com php-src: Fixed executor without global register variales (gcc warnings or clang errors): Zend/zend_execute.c Zend/zend_vm_ex ecute.h
Zend/zend_vm_execute.skl Zend/zend_vm_g en.php
| From: | Dmitry Stogov | Date: | Mon, 27 Jun 2016 07:36:41 +0000 |
| Subject: | com php-src: Fixed executor without global register variales (gcc warnings or clang errors): Zend/zend_execute.c Zend/zend_vm_ex ecute.h Zend/zend_vm_execute.skl Zend/zend_vm_g en.php |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-92654@lists.php.net to get a copy of this message | ||
Commit: 044e2718fec8d74f8430e7bdf3a41cc29085fed6
Author: Dmitry Stogov <dmitry@zend.com> Mon, 27 Jun 2016 10:36:41 +0300
Parents: e53982320ba43cbc18fa2bd2fc5f0c0771cb1889
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=044e2718fec8d74f8430e7bdf3a41cc29085fed6
Log:
Fixed executor without global register variales (gcc warnings or clang errors)
Changed paths:
M Zend/zend_execute.c
M Zend/zend_vm_execute.h
M Zend/zend_vm_execute.skl
M Zend/zend_vm_gen.php
Diff:
diff --git a/Zend/zend_execute..c b/Zend/zend_execute.c
index 670dcd2..4a69cab 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -2075,6 +2075,12 @@ void zend_free_compiled_variables(zend_execute_data *execute_data) /* {{{ */
} \
} while (0)
+#define ZEND_VM_LOOP_INTERRUPT_CHECK() do { \
+ if (UNEXPECTED(EG(vm_interrupt))) { \
+ ZEND_VM_LOOP_INTERRUPT(); \
+ } \
+ } while (0)
+
/*
* Stack Frame Layout (the whole stack frame is allocated at once)
* ==================
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index e68f8e4..f0ef140 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -398,6 +398,7 @@ typedef ZEND_OPCODE_HANDLER_RET (ZEND_FASTCALL *opcode_handler_t) (ZEND_OPCODE_H
# define ZEND_VM_LEAVE() return 2
#endif
#define ZEND_VM_INTERRUPT()
ZEND_VM_TAIL_CALL(zend_interrupt_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
+#define ZEND_VM_LOOP_INTERRUPT() zend_interrupt_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
#define ZEND_VM_DISPATCH(opcode, opline)
ZEND_VM_TAIL_CALL(((opcode_handler_t)zend_vm_get_opcode_handler(opcode,
opline))(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_interrupt_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS);
@@ -418,7 +419,7 @@ ZEND_API void execute_ex(zend_execute_data *ex)
LOAD_OPLINE();
- ZEND_VM_INTERRUPT_CHECK();
+ ZEND_VM_LOOP_INTERRUPT_CHECK();
while (1) {
#if !defined(ZEND_VM_FP_GLOBAL_REG) || !defined(ZEND_VM_IP_GLOBAL_REG)
@@ -439,7 +440,7 @@ ZEND_API void execute_ex(zend_execute_data *ex)
#else
if (EXPECTED(ret > 0)) {
execute_data = EG(current_execute_data);
- ZEND_VM_INTERRUPT_CHECK();
+ ZEND_VM_LOOP_INTERRUPT_CHECK();
} else {
# ifdef ZEND_VM_IP_GLOBAL_REG
opline = orig_opline;
diff --git a/Zend/zend_vm_execute.skl b/Zend/zend_vm_execute.skl
index ebc6474..345d7bd 100644
--- a/Zend/zend_vm_execute.skl
+++ b/Zend/zend_vm_execute.skl
@@ -9,7 +9,7 @@ ZEND_API void {%EXECUTOR_NAME%}_ex(zend_execute_data *ex)
{%INTERNAL_LABELS%}
LOAD_OPLINE();
- ZEND_VM_INTERRUPT_CHECK();
+ ZEND_VM_LOOP_INTERRUPT_CHECK();
while (1) {
{%ZEND_VM_CONTINUE_LABEL%}
diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php
index 6086237..eb5bfe9 100644
--- a/Zend/zend_vm_gen.php
+++ b/Zend/zend_vm_gen.php
@@ -1620,6 +1620,7 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name,
$initializer_name)
out($f,"# define ZEND_VM_LEAVE() return 2\n");
out($f,"#endif\n");
out($f,"#define ZEND_VM_INTERRUPT()
ZEND_VM_TAIL_CALL(zend_interrupt_helper".($spec?"_SPEC":"")."(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));\n");
+ out($f,"#define ZEND_VM_LOOP_INTERRUPT()
zend_interrupt_helper".($spec?"_SPEC":"")."(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);\n");
out($f,"#define ZEND_VM_DISPATCH(opcode, opline)
ZEND_VM_TAIL_CALL(((opcode_handler_t)zend_vm_get_opcode_handler(opcode,
opline))(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));\n");
out($f,"\n");
out($f,"static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL
zend_interrupt_helper".($spec?"_SPEC":"")."(ZEND_OPCODE_HANDLER_ARGS);");
@@ -1652,6 +1653,7 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name,
$initializer_name)
out($f,"#define ZEND_VM_ENTER() execute_data = EG(current_execute_data);
LOAD_OPLINE(); ZEND_VM_INTERRUPT_CHECK(); ZEND_VM_CONTINUE()\n");
out($f,"#define ZEND_VM_LEAVE() ZEND_VM_CONTINUE()\n");
out($f,"#define ZEND_VM_INTERRUPT() goto
zend_interrupt_helper".($spec?"_SPEC":"").";\n");
+ out($f,"#define ZEND_VM_LOOP_INTERRUPT() goto
zend_interrupt_helper".($spec?"_SPEC":"").";\n");
out($f,"#define ZEND_VM_DISPATCH(opcode, opline) dispatch_handler =
zend_vm_get_opcode_handler(opcode, opline); goto zend_vm_dispatch;\n");
out($f,"\n");
break;
@@ -1687,6 +1689,7 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name,
$initializer_name)
out($f,"#define ZEND_VM_ENTER() execute_data = EG(current_execute_data);
LOAD_OPLINE(); ZEND_VM_INTERRUPT_CHECK(); ZEND_VM_CONTINUE()\n");
out($f,"#define ZEND_VM_LEAVE() ZEND_VM_CONTINUE()\n");
out($f,"#define ZEND_VM_INTERRUPT() goto
zend_interrupt_helper".($spec?"_SPEC":"").";\n");
+ out($f,"#define ZEND_VM_LOOP_INTERRUPT() goto
zend_interrupt_helper".($spec?"_SPEC":"").";\n");
out($f,"#define ZEND_VM_DISPATCH(opcode, opline) goto
*(void**)(zend_vm_get_opcode_handler(opcode, opline));\n");
out($f,"\n");
break;
@@ -1787,7 +1790,7 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name,
$initializer_name)
"#else\n" .
$m[1]."if (EXPECTED(ret > 0)) {\n" .
$m[1]."\texecute_data = EG(current_execute_data);\n".
- $m[1]."\tZEND_VM_INTERRUPT_CHECK();\n".
+ $m[1]."\tZEND_VM_LOOP_INTERRUPT_CHECK();\n".
$m[1]."} else {\n" .
"# ifdef ZEND_VM_IP_GLOBAL_REG\n" .
$m[1]."\topline = orig_opline;\n" .