diff options
author | Dmitry Stogov <dmitry@zend.com> | 2015-10-06 23:48:08 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2015-10-06 23:48:08 +0300 |
commit | 3c0348056a085395b045bf9dc65d26c7da503488 (patch) | |
tree | 6f47ae4ceff3dc0cbaad689a5a35da2e9b0817f5 /Zend/zend_vm_def.h | |
parent | 5a49ac77aabd742462f213f74c695b96f717794a (diff) | |
download | php-git-3c0348056a085395b045bf9dc65d26c7da503488.tar.gz |
Revert "Speed up self::method() calls (no ZEND_FETCH_CLASS)"
This reverts commit 8c33bdb976e957ea67ebffd424e0a133a79c6ebe.
Diffstat (limited to 'Zend/zend_vm_def.h')
-rw-r--r-- | Zend/zend_vm_def.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 7d9153f27b..a4b082b7b5 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -3024,7 +3024,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMPVAR|UNUSE /* no function found. try a static method in class */ ce = CACHED_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1))); if (UNEXPECTED(ce == NULL)) { - ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION); + ce = zend_fetch_class_by_name(Z_STR_P(EX_CONSTANT(opline->op1)), EX_CONSTANT(opline->op1) + 1, ZEND_FETCH_CLASS_DEFAULT | ZEND_FETCH_CLASS_EXCEPTION); if (UNEXPECTED(ce == NULL)) { if (UNEXPECTED(EG(exception) != NULL)) { HANDLE_EXCEPTION(); @@ -3127,11 +3127,16 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMPVAR|UNUSE } } - if (opline->extended_value & ZEND_FETCH_CLASS_FORWARD) { - call = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION, fbc, opline->extended_value & ~ZEND_FETCH_CLASS_FORWARD, EX(called_scope), object); - } else { - call = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION, fbc, opline->extended_value, ce, object); + if (OP1_TYPE != IS_CONST) { + /* previous opcode is ZEND_FETCH_CLASS */ + if (((opline-1)->extended_value & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_PARENT || + ((opline-1)->extended_value & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_SELF) { + ce = EX(called_scope); + } } + + call = zend_vm_stack_push_call_frame(ZEND_CALL_NESTED_FUNCTION, + fbc, opline->extended_value, ce, object); call->prev_execute_data = EX(call); EX(call) = call; |