@@ -1652,12 +1652,6 @@ function read_order_file($fn) {
1652
1652
function gen_executor_code ($ f , $ spec , $ kind , $ prolog , &$ switch_labels = array ()) {
1653
1653
global $ list , $ opcodes , $ helpers , $ op_types_ex , $ gen_order ;
1654
1654
1655
- if ($ kind == ZEND_VM_KIND_HYBRID && file_exists (__DIR__ . "/zend_vm_order.txt " )) {
1656
- $ gen_order = read_order_file (__DIR__ . "/zend_vm_order.txt " );
1657
- } else {
1658
- $ gen_order = null ;
1659
- }
1660
-
1661
1655
if ($ spec ) {
1662
1656
// Produce specialized executor
1663
1657
$ op1t = $ op_types_ex ;
@@ -1770,7 +1764,13 @@ function skip_blanks($f, $prolog, $epilog) {
1770
1764
1771
1765
// Generates executor from skeleton file and definition (specialized or unspecialized)
1772
1766
function gen_executor ($ f , $ skl , $ spec , $ kind , $ executor_name , $ initializer_name ) {
1773
- global $ params , $ skeleton_file , $ line_no ;
1767
+ global $ params , $ skeleton_file , $ line_no , $ gen_order ;
1768
+
1769
+ if ($ kind == ZEND_VM_KIND_HYBRID && file_exists (__DIR__ . "/zend_vm_order.txt " )) {
1770
+ $ gen_order = read_order_file (__DIR__ . "/zend_vm_order.txt " );
1771
+ } else {
1772
+ $ gen_order = null ;
1773
+ }
1774
1774
1775
1775
$ switch_labels = array ();
1776
1776
$ lineno = 0 ;
@@ -1811,7 +1811,11 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name)
1811
1811
out ($ f ,"#endif \n\n" );
1812
1812
}
1813
1813
out ($ f ,"#ifndef VM_TRACE \n" );
1814
- out ($ f ,"# define VM_TRACE(op) \n" );
1814
+ if (is_array ($ gen_order )) {
1815
+ out ($ f ,"# define VM_TRACE(op) ZEND_VM_GUARD(op); \n" );
1816
+ } else {
1817
+ out ($ f ,"# define VM_TRACE(op) \n" );
1818
+ }
1815
1819
out ($ f ,"#endif \n" );
1816
1820
out ($ f ,"#ifndef VM_TRACE_START \n" );
1817
1821
out ($ f ,"# define VM_TRACE_START() \n" );
0 commit comments