cvs: ZendEngine2 / zend_compile.c
| From: | Dmitry Stogov | Date: | Tue, 21 Jun 2005 12:05:16 +0000 |
| Subject: | cvs: ZendEngine2 / zend_compile.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-3837@lists.php.net to get a copy of this message | ||
dmitry Tue Jun 21 08:05:16 2005 EDT
Modified files:
/ZendEngine2 zend_compile.c
Log:
Remove unnecessary ZEND_FETCH_CLASS together with ZEND_DECLARE_INHERITED_CLASS in case of early
binding
http://cvs.php.net/diff.php/ZendEngine2/zend_compile.c?r1=1.638&r2=1.639&ty=u
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.638 ZendEngine2/zend_compile.c:1.639
--- ZendEngine2/zend_compile.c:1.638 Thu Jun 16 10:52:45 2005
+++ ZendEngine2/zend_compile.c Tue Jun 21 08:05:15 2005
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_compile.c,v 1.638 2005/06/16 14:52:45 dmitry Exp $ */
+/* $Id: zend_compile.c,v 1.639 2005/06/21 12:05:15 dmitry Exp $ */
#include <zend_language_parser.h>
#include "zend.h"
@@ -2298,6 +2298,19 @@
if (do_bind_inherited_class(opline, CG(class_table), *pce, 1 TSRMLS_CC) == NULL) {
return;
}
+ /* clear unnecessary ZEND_FETCH_CLASS opcode */
+ if (opline > CG(active_op_array)->opcodes &&
+ (opline-1)->opcode == ZEND_FETCH_CLASS) {
+ zend_op *fetch_class_opline = opline-1;
+
+ zval_dtor(&fetch_class_opline->op2.u.constant);
+ fetch_class_opline->opcode = ZEND_NOP;
+ memset(&fetch_class_opline->op1, 0, sizeof(znode));
+ memset(&fetch_class_opline->op2, 0, sizeof(znode));
+ SET_UNUSED(fetch_class_opline->op1);
+ SET_UNUSED(fetch_class_opline->op2);
+ SET_UNUSED(fetch_class_opline->result);
+ }
} else {
/* We currently don't early-bind classes that implement interfaces */
return;