Re: com php-src: Don't create live-range across NOPs and some other instructions: Zend/zend_compile.c

From: Date: Wed, 09 Dec 2015 10:39:44 +0000
Subject: Re: com php-src: Don't create live-range across NOPs and some other instructions: Zend/zend_compile.c
References: 1 2  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-90176@lists.php.net to get a copy of this message
Hi Derick, They are for automatic temporary variables clean-up in case of exception thrown in the middle of "live-range" Thanks. Dmitry. On Wed, Dec 9, 2015 at 1:01 PM, Derick Rethans <derick@php.net> wrote: > On Wed, 9 Dec 2015, Dmitry Stogov wrote: > > > Commit: 5ee7b7d01ae3588e3e026592eb61159e778cdde4 > > Author: Dmitry Stogov <dmitry@zend.com> Wed, 9 Dec 2015 > 05:15:58 +0300 > > Parents: 2cc2396f840eadf9b9a9947ca7969b8ab0205291 > > Branches: master > > > > Link: > > http://git.php.net/?p=php-src.git;a=commitdiff;h=5ee7b7d01ae3588e3e026592eb61159e778cdde4 > > > > Log: > > Don't create live-range across NOPs and some other instructions > > Could you explain what a "live range" is, and what it is for? > > cheers, > Derick > > > > > > Changed paths: > > M Zend/zend_compile.c > > > > > > Diff: > > diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c > > index d304a6b..dd9c5a4 100644 > > --- a/Zend/zend_compile.c > > +++ b/Zend/zend_compile.c > > @@ -1945,14 +1945,25 @@ static void zend_find_live_range(zend_op > *opline, zend_uchar type, uint32_t var) > > > > static zend_always_inline int zend_is_def_range(zend_op *opline, > zend_uchar type, uint32_t var) /* {{{ */ > > { > > - if (opline->result_type == type && opline->result.var == var) { > > - return opline->opcode != ZEND_ADD_ARRAY_ELEMENT && > > - opline->opcode != ZEND_ROPE_ADD; > > - } else if (opline->opcode == ZEND_OP_DATA) { > > - return (opline-1)->result_type == type && > > - (opline-1)->result.var == var; > > + while (1) { > > + if (opline->result_type == type && opline->result.var == > var) { > > + return opline->opcode != ZEND_ADD_ARRAY_ELEMENT && > > + opline->opcode != ZEND_ROPE_ADD; > > + } else if (opline->opcode == ZEND_OP_DATA) { > > + return (opline-1)->result_type == type && > > + (opline-1)->result.var == var; > > + } else if (opline->opcode == ZEND_END_SILENCE || > > + opline->opcode == ZEND_NOP || > > + opline->opcode == ZEND_EXT_NOP || > > + opline->opcode == ZEND_EXT_STMT || > > + opline->opcode == ZEND_EXT_FCALL_BEGIN || > > + opline->opcode == ZEND_EXT_FCALL_END || > > + opline->opcode == ZEND_TICKS) { > > + opline--; > > + } else { > > + return 0; > > + } > > } > > - return 0; > > } > > /* }}} */ > > > > > > -- > > PHP CVS Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- > http://derickrethans.nl | > http://xdebug.org > Like Xdebug? Consider a donation: http://xdebug.org/donate.php > twitter: @derickr and @xdebug > Posted with an email client that doesn't mangle email: alpine >

« previous php.cvs (#90176) next »