From aafefcb90183e1d6ef62d9e1ccc1fae7fcdf9c8e Mon Sep 17 00:00:00 2001 From: Richard Leach Date: Sat, 6 Aug 2022 21:55:28 +0000 Subject: OP_AELEMFASTLEX_STORE - combined sassign/aelemfast_lex This commit introduces a new OP to replace simple cases of OP_SASSIGN and OP_AELEMFAST_LEX. (Similar concept to GH #19943) For example, `my @ary; $ary[0] = "boo"` is currently implemented as: 7 <2> sassign vKS/2 ->8 5 <$> const[PV "boo"] s ->6 - <1> ex-aelem sKRM*/2 ->7 6 <0> aelemfast_lex[@ary:1,2] sRM ->7 - <0> ex-const s ->- But now will be turned into: 6 <1> aelemfastlex_store[@ary:1,2] vKS ->7 5 <$> const(PV "boo") s ->6 - <1> ex-aelem sKRM*/2 ->6 - <0> ex-aelemfast_lex sRM ->6 - <0> ex-const s ->- This is intended to be a transparent performance optimization. It should be applicable for RHS optrees of varying complexity. --- pp_proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'pp_proto.h') diff --git a/pp_proto.h b/pp_proto.h index c89828a56b..759545152a 100644 --- a/pp_proto.h +++ b/pp_proto.h @@ -12,6 +12,7 @@ PERL_CALLCONV OP *Perl_pp_add(pTHX) __attribute__visibility__("hidden"); PERL_CALLCONV OP *Perl_pp_aeach(pTHX) __attribute__visibility__("hidden"); PERL_CALLCONV OP *Perl_pp_aelem(pTHX) __attribute__visibility__("hidden"); PERL_CALLCONV OP *Perl_pp_aelemfast(pTHX) __attribute__visibility__("hidden"); +PERL_CALLCONV OP *Perl_pp_aelemfastlex_store(pTHX) __attribute__visibility__("hidden"); PERL_CALLCONV OP *Perl_pp_akeys(pTHX) __attribute__visibility__("hidden"); PERL_CALLCONV OP *Perl_pp_alarm(pTHX) __attribute__visibility__("hidden"); PERL_CALLCONV OP *Perl_pp_and(pTHX) __attribute__visibility__("hidden"); -- cgit v1.2.1