summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.h
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2015-11-17 07:15:35 +0300
committerDmitry Stogov <dmitry@zend.com>2015-11-17 07:15:35 +0300
commit843c1657358e7dab48fb8fa66574b48eb870989b (patch)
tree54c517fc59624ab5bfde989f1ab4f232706a4d4d /Zend/zend_compile.h
parente4173bd15c0860a2d9f6a6b0c4844e939b98d523 (diff)
downloadphp-git-843c1657358e7dab48fb8fa66574b48eb870989b.tar.gz
Don't undo/redo "pass two" for jump targets in opcache optimizer.
Diffstat (limited to 'Zend/zend_compile.h')
-rw-r--r--Zend/zend_compile.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index ff74ec26e5..ce7dc3aefc 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -530,6 +530,9 @@ struct _zend_execute_data {
#define EX_VAR_TO_NUM(n) (ZEND_CALL_VAR(NULL, n) - ZEND_CALL_VAR_NUM(NULL, 0))
+#define ZEND_OPLINE_TO_OFFSET(opline, target) \
+ ((char*)(target) - (char*)(opline))
+
#define ZEND_OPLINE_NUM_TO_OFFSET(op_array, opline, opline_num) \
((char*)&(op_array)->opcodes[opline_num] - (char*)(opline))
@@ -545,6 +548,10 @@ struct _zend_execute_data {
# define OP_JMP_ADDR(opline, node) \
(node).jmp_addr
+# define ZEND_SET_OP_JMP_ADDR(opline, node, val) do { \
+ (node).jmp_addr = (val); \
+ } while (0)
+
/* convert jump target from compile-time to run-time */
# define ZEND_PASS_TWO_UPDATE_JMP_TARGET(op_array, opline, node) do { \
(node).jmp_addr = (op_array)->opcodes + (node).opline_num; \
@@ -561,6 +568,10 @@ struct _zend_execute_data {
# define OP_JMP_ADDR(opline, node) \
ZEND_OFFSET_TO_OPLINE(opline, (node).jmp_offset)
+# define ZEND_SET_OP_JMP_ADDR(opline, node, val) do { \
+ (node).jmp_offset = ZEND_OPLINE_TO_OFFSET(opline, val); \
+ } while (0)
+
/* convert jump target from compile-time to run-time */
# define ZEND_PASS_TWO_UPDATE_JMP_TARGET(op_array, opline, node) do { \
(node).jmp_offset = ZEND_OPLINE_NUM_TO_OFFSET(op_array, opline, (node).opline_num); \