com php-src: Optimize class lookup: Zend/zend_compile.c

From: Date: Tue, 03 Feb 2015 14:39:05 +0000
Subject: com php-src: Optimize class lookup: Zend/zend_compile.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-84591@lists.php.net to get a copy of this message
Commit: 67207166827b2c91e82e0cacab568f62c70ceef0 Author: Dmitry Stogov <dmitry@zend.com> Tue, 3 Feb 2015 17:39:05 +0300 Parents: 22d8393bfa2a677e569b87046fee075d4b4885ee Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=67207166827b2c91e82e0cacab568f62c70ceef0 Log: Optimize class lookup Changed paths: M Zend/zend_compile.c Diff: diff --git a/Zend/zend_compile..c b/Zend/zend_compile.c index 4720b4f..cffed9c 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -1029,7 +1029,7 @@ void zend_do_early_binding(void) /* {{{ */ zend_class_entry *ce; parent_name = CT_CONSTANT(fetch_class_opline->op2); - if (((ce = zend_lookup_class(Z_STR_P(parent_name))) == NULL) || + if (((ce = zend_lookup_class_ex(Z_STR_P(parent_name), parent_name + 1, 0)) == NULL) || ((CG(compiler_options) & ZEND_COMPILE_IGNORE_INTERNAL_CLASSES) && (ce->type == ZEND_INTERNAL_CLASS))) { if (CG(compiler_options) & ZEND_COMPILE_DELAYED_BINDING) { @@ -1083,7 +1083,8 @@ ZEND_API void zend_do_delayed_early_binding(const zend_op_array *op_array) /* {{ CG(in_compilation) = 1; while (opline_num != (uint32_t)-1) { - if ((ce = zend_lookup_class(Z_STR_P(RT_CONSTANT(op_array, op_array->opcodes[opline_num-1].op2)))) != NULL) { + zval *parent_name = RT_CONSTANT(op_array, op_array->opcodes[opline_num-1].op2); + if ((ce = zend_lookup_class_ex(Z_STR_P(parent_name), parent_name + 1, 0)) != NULL) { do_bind_inherited_class(op_array, &op_array->opcodes[opline_num], EG(class_table), ce, 0); } opline_num = op_array->opcodes[opline_num].result.opline_num;

« previous php.cvs (#84591) next »