diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-08-31 09:05:50 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-08-31 09:05:50 +0000 |
commit | 78c72037c327e2cd8ede6cf098324435a670ca67 (patch) | |
tree | a16b884a1b38e00a54fe96eb7fe890408d6abb13 /op.c | |
parent | 2e0df0e80ba5355d269a0006da239be95c70765d (diff) | |
download | perl-78c72037c327e2cd8ede6cf098324435a670ca67.tar.gz |
Change the generation of {} and [] from 3 ops to 1, and avoid 1 mortal
on the tempstack, by augmenting pp_anonlist and pp_anonhash to accept
OPf_SPECIAL to mean "return a reference to the aggregate" on the stack
rather than the aggregate itself.
p4raw-id: //depot/perl@28771
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -2258,6 +2258,8 @@ Perl_gen_constant_list(pTHX_ register OP *o) pp_pushmark(); CALLRUNOPS(aTHX); PL_op = curop; + assert (!(curop->op_flags & OPf_SPECIAL)); + assert(curop->op_type == OP_RANGE); pp_anonlist(); PL_tmps_floor = oldtmps_floor; @@ -5681,15 +5683,13 @@ Perl_newFORM(pTHX_ I32 floor, OP *o, OP *block) OP * Perl_newANONLIST(pTHX_ OP *o) { - return newUNOP(OP_REFGEN, 0, - mod(list(convert(OP_ANONLIST, 0, o)), OP_REFGEN)); + return convert(OP_ANONLIST, OPf_SPECIAL, o); } OP * Perl_newANONHASH(pTHX_ OP *o) { - return newUNOP(OP_REFGEN, 0, - mod(list(convert(OP_ANONHASH, 0, o)), OP_REFGEN)); + return convert(OP_ANONHASH, OPf_SPECIAL, o); } OP * |