]> granicus.if.org Git - php/commit
Speed up fetching of class entries for self:: parent:: and static::
authorDmitry Stogov <dmitry@zend.com>
Tue, 27 Oct 2015 12:47:58 +0000 (15:47 +0300)
committerDmitry Stogov <dmitry@zend.com>
Wed, 28 Oct 2015 18:26:52 +0000 (21:26 +0300)
commiteb7be5379d9b6e20f4d086bd688103fe75f46977
tree93db96418746ca1c4d6e15e0b455174ecddfad9c
parentff0ec065623a7563cc9a99586a9cb2f351f3cbfa
Speed up fetching of class entries for self:: parent:: and static::

This is generalized solution for Bob's idea of speed up self::method() calls without ZEND_FETCH_CLASS.

At first, it adds few new opcodes to separate class related behaviour:
FETCH_STATIC_PROP_R
FETCH_STATIC_PROP_W
FETCH_STATIC_PROP_RW
FETCH_STATIC_PROP_FUNC_ARG
FETCH_STATIC_PROP_UNSET
FETCH_STATIC_PROP_IS
UNSET_STATIC_PROP
ISSET_ISEMPTY_STATIC_PROP
FETCH_CLASS_CONSTANT

At seconds, it enables IS_UNUSED operand to fetch (self, parent or static without separate FETCH_CLASS) for new opcodes and the following ones:
INIT_STATIC_METHOD_CALL
NEW
END_INSTANCEOF

Finaly, opcache optimizer had to be fixed to support new opcodes.
Zend/zend_compile.c
Zend/zend_vm_def.h
Zend/zend_vm_execute.h
Zend/zend_vm_opcodes.c
Zend/zend_vm_opcodes.h
ext/opcache/Optimizer/block_pass.c
ext/opcache/Optimizer/compact_literals.c
ext/opcache/Optimizer/optimize_func_calls.c
ext/opcache/Optimizer/pass1_5.c
ext/opcache/Optimizer/zend_optimizer.c