PerlOnTheWay has asked for the wisdom of the Perl Monks concerning the following question:
As we know perl's executor does a simple job:
int Perl_runops_standard(pTHX) { dVAR; register OP *op = PL_op; while ((PL_op = op = op->op_ppaddr(aTHX))) { } TAINT_NOT; return 0; }
So that means each opcode is chained,it will return the next opcode when return.
PP(pp_cond_expr) { dVAR; dSP; PERL_ASYNC_CHECK(); if (SvTRUEx(POPs)) RETURNOP(cLOGOP->op_other); else RETURNOP(cLOGOP->op_next); }
The above matches what I assume.
But I still see many of them not matching:
PP(pp_unstack) { dVAR; PERL_ASYNC_CHECK(); TAINT_NOT; /* Each statement is presumed innocent */ PL_stack_sp = PL_stack_base + cxstack[cxstack_ix].blk_oldsp; FREETMPS; if (!(PL_op->op_flags & OPf_SPECIAL)) { I32 oldsave = PL_scopestack[PL_scopestack_ix - 1]; LEAVE_SCOPE(oldsave); } return NORMAL; }
The above doesn't return cLOGOP->op_next,how can the executor still chain them together?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: About the opcodes of Perl
by Anonymous Monk on Sep 02, 2011 at 09:24 UTC | |
by PerlOnTheWay (Monk) on Sep 02, 2011 at 09:39 UTC | |
by ikegami (Patriarch) on Sep 02, 2011 at 09:59 UTC | |
by Anonymous Monk on Sep 02, 2011 at 09:50 UTC | |
|
Re: About the opcodes of Perl
by locked_user sundialsvc4 (Abbot) on Sep 02, 2011 at 14:38 UTC |