develooper Front page | perl.perl5.porters | Postings from February 2013

OP_PADSV_NOLV

Thread Next
From:
Steffen Mueller
Date:
February 27, 2013 07:01
Subject:
OP_PADSV_NOLV
Message ID:
512DAF22.3090503@cpan.org
Would it be feasible to split OP_PADSV in two, such that:


PP(pp_padsv)
{
     dVAR; dSP;
     EXTEND(SP, 1);
     {
	OP * const op = PL_op;
	/* access PL_curpad once */
	SV ** const padentry = &(PAD_SVl(op->op_targ));
	{
	    dTARG;
	    TARG = *padentry;
	    PUSHs(TARG);
	    PUTBACK; /* no pop/push after this, TOPs ok */
	}
	if (op->op_flags & OPf_MOD) {
	    if (op->op_private & OPpLVAL_INTRO)
		if (!(op->op_private & OPpPAD_STATE))
		    save_clearsv(padentry);
	    if (op->op_private & OPpDEREF) {
		/* TOPs is equivalent to TARG here.  Using TOPs (SP) rather
		   than TARG reduces the scope of TARG, so it does not
		   span the call to save_clearsv, resulting in smaller
		   machine code. */
		TOPs = vivify_ref(TOPs, op->op_private & OPpDEREF);
	    }
	}
	return op->op_next;
     }
}


becomes in most cases just:


PP(pp_padsv)
{
     dVAR; dSP;
     EXTEND(SP, 1);
     {
	OP * const op = PL_op;
	/* access PL_curpad once */
	SV ** const padentry = &(PAD_SVl(op->op_targ));
	{
	    dTARG;
	    TARG = *padentry;
	    PUSHs(TARG);
	    PUTBACK; /* no pop/push after this, TOPs ok */
	}
}


--Steffen

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About