com php-src: Remove now unnecessary code in begin_method_ca ll: Zend/zend_compile.c
| From: | Nikita Popov | Date: | Sat, 31 May 2014 14:08:38 +0000 |
| Subject: | com php-src: Remove now unnecessary code in begin_method_ca ll: Zend/zend_compile.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-81073@lists.php.net to get a copy of this message | ||
Commit: 8a65c3b2343a7a53f2bfac73db7693e81c59a65c
Author: Nikita Popov <nikic@php.net> Sat, 31 May 2014 16:08:38 +0200
Parents: fcf42d817df81c887056ebcab8c6d16f4e987316
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8a65c3b2343a7a53f2bfac73db7693e81c59a65c
Log:
Remove now unnecessary code in begin_method_call
Changed paths:
M Zend/zend_compile.c
Diff:
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index e8182a6..02698fc 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -1961,35 +1961,22 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC) /* {{{ */
zend_error_noreturn(E_COMPILE_ERROR, "Cannot call __clone() method on objects - use
'clone $obj' instead");
}
- if (last_op->opcode == ZEND_FETCH_OBJ_R) {
- if (last_op->op2_type == IS_CONST) {
- zval name;
- name = CONSTANT(last_op->op2.constant);
- if (Z_TYPE(name) != IS_STRING) {
- zend_error_noreturn(E_COMPILE_ERROR, "Method name must be a string");
- }
- Z_STR(name) = STR_COPY(Z_STR(name));
- FREE_POLYMORPHIC_CACHE_SLOT(last_op->op2.constant);
- last_op->op2.constant =
- zend_add_func_name_literal(CG(active_op_array), &name TSRMLS_CC);
- GET_POLYMORPHIC_CACHE_SLOT(last_op->op2.constant);
- }
- last_op->opcode = ZEND_INIT_METHOD_CALL;
- last_op->result_type = IS_UNUSED;
- last_op->result.num = CG(context).nested_calls;
- Z_LVAL(left_bracket->u.constant) = ZEND_INIT_FCALL_BY_NAME;
- } else {
- zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
- opline->opcode = ZEND_INIT_FCALL_BY_NAME;
- opline->result.num = CG(context).nested_calls;
- SET_UNUSED(opline->op1);
- if (left_bracket->op_type == IS_CONST) {
- opline->op2_type = IS_CONST;
- opline->op2.constant = zend_add_func_name_literal(CG(active_op_array),
&left_bracket->u.constant TSRMLS_CC);
- GET_CACHE_SLOT(opline->op2.constant);
- } else {
- SET_NODE(opline->op2, left_bracket);
+ /* Convert ZEND_FETCH_OBJ_R to ZEND_INIT_METHOD_CALL */
+ last_op->opcode = ZEND_INIT_METHOD_CALL;
+ last_op->result_type = IS_UNUSED;
+ last_op->result.num = CG(context).nested_calls;
+ Z_LVAL(left_bracket->u.constant) = ZEND_INIT_FCALL_BY_NAME;
+ if (last_op->op2_type == IS_CONST) {
+ zval name;
+ name = CONSTANT(last_op->op2.constant);
+ if (Z_TYPE(name) != IS_STRING) {
+ zend_error_noreturn(E_COMPILE_ERROR, "Method name must be a string");
}
+ Z_STR(name) = STR_COPY(Z_STR(name));
+ FREE_POLYMORPHIC_CACHE_SLOT(last_op->op2.constant);
+ last_op->op2.constant =
+ zend_add_func_name_literal(CG(active_op_array), &name TSRMLS_CC);
+ GET_POLYMORPHIC_CACHE_SLOT(last_op->op2.constant);
}
zend_push_function_call_entry(NULL TSRMLS_CC);