]> granicus.if.org Git - php/commitdiff
Fixed executor without global register variales (gcc warnings or clang errors)
authorDmitry Stogov <dmitry@zend.com>
Mon, 27 Jun 2016 07:36:41 +0000 (10:36 +0300)
committerDmitry Stogov <dmitry@zend.com>
Mon, 27 Jun 2016 07:36:41 +0000 (10:36 +0300)
Zend/zend_execute.c
Zend/zend_vm_execute.h
Zend/zend_vm_execute.skl
Zend/zend_vm_gen.php

index 670dcd24427e5d99ace9824268cc0c302799d14c..4a69cabded126d4908b32d1f5e4bd63568c5e1b2 100644 (file)
@@ -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)
  * ==================
index e68f8e4bedc9dc5e5373118313d2662f6fd0570c..f0ef140f78d897fd4c1af1d780adf06aa01f2305 100644 (file)
@@ -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;
index ebc6474ae5090a61f97148cf0fa362c214cc0c72..345d7bde7b26e07a901844b3963f2a6bfae01714 100644 (file)
@@ -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%}
index 6086237c39c0151c8b96f0031a6b072e793a2359..eb5bfe9106872a19d44116a86df27131606e6a1f 100644 (file)
@@ -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" .