]> granicus.if.org Git - php/commit
Remove uses of VARs in extended_value
authorNikita Popov <nikic@php.net>
Sun, 20 Dec 2015 12:42:26 +0000 (13:42 +0100)
committerNikita Popov <nikic@php.net>
Mon, 21 Dec 2015 13:44:42 +0000 (14:44 +0100)
commit88eae43ff94ed3ba7eb663a896d65cece0113808
tree8fc5de5446f37c5d8c3fbb224e8649fb1c4f831d
parent1fe8a1dec9aae41ee2f8216179b33a59bccbd3eb
Remove uses of VARs in extended_value

The DECLARE_(ANON_)INHERITED_CLASS(_DELAYED) opcodes were
referencing the parent ce VAR through extended_value. This is
hacky and we can't track the def-use chain in SSA.

To avoid this, the layout of declaration opcodes is changed
as follows: op1 points to the lcname and rtd_key literals, in
that order. (For anon/lambda declarations only one of lcname or
rtd_key is present.) This frees up op2, which is now used to
reference the parent ce VAR in inheriting declarations. The
jmp offset for anon class declarations is moved frop op2 to
extended_value.

The changes were applied both to class and function declarations
to keep everything symmetric.
16 files changed:
Zend/zend_compile.c
Zend/zend_opcode.c
Zend/zend_vm_def.h
Zend/zend_vm_execute.h
Zend/zend_vm_gen.php
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/nop_removal.c
ext/opcache/Optimizer/optimize_temp_vars_5.c
ext/opcache/Optimizer/zend_cfg.c
ext/opcache/Optimizer/zend_dump.c
ext/opcache/Optimizer/zend_optimizer.c
ext/opcache/zend_file_cache.c
ext/opcache/zend_persist.c