diff options
author | Daniel Dragan <bulk88@hotmail.com> | 2014-05-27 17:14:20 -0400 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2014-06-04 10:50:40 +1000 |
commit | b3cf48215cfee8e6a067db4592c0d9e4a4759613 (patch) | |
tree | 0080b25e9fa592b2d2d94c4be0ca46f610022828 /pp_sys.c | |
parent | 736c79db2485068b77cfe34cb6c0aa3e4dd65187 (diff) | |
download | perl-b3cf48215cfee8e6a067db4592c0d9e4a4759613.tar.gz |
refactor pp_tied
remove some redundant code regarding stack handling
-removed:
-4/-8 pop on SP
+4/+8 push on SP
PUTBACK
function's machine code size dropped from 0xC5 to 0xBD bytes on VC2003
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -1005,21 +1005,23 @@ PP(pp_tied) dVAR; dSP; const MAGIC *mg; - SV *sv = POPs; + dTOPss; const char how = (SvTYPE(sv) == SVt_PVHV || SvTYPE(sv) == SVt_PVAV) ? PERL_MAGIC_tied : PERL_MAGIC_tiedscalar; if (isGV_with_GP(sv) && !SvFAKE(sv) && !(sv = MUTABLE_SV(GvIOp(sv)))) - RETPUSHUNDEF; + goto ret_undef; if (SvTYPE(sv) == SVt_PVLV && LvTYPE(sv) == 'y' && - !(sv = defelem_target(sv, NULL))) RETPUSHUNDEF; + !(sv = defelem_target(sv, NULL))) goto ret_undef; if ((mg = SvTIED_mg(sv, how))) { - PUSHs(SvTIED_obj(sv, mg)); - RETURN; + SETs(SvTIED_obj(sv, mg)); + return NORMAL; /* PUTBACK not needed, pp_tied never moves SP */ } - RETPUSHUNDEF; + ret_undef: + SETs(&PL_sv_undef); + return NORMAL; } PP(pp_dbmopen) |