Guest User

ts_cvs.diff

a guest
Dec 3rd, 2012
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 55.59 KB | None | 0 0
  1. diff --git a/NEWS b/NEWS
  2. index 350729c..1c57996 100644
  3. --- a/NEWS
  4. +++ b/NEWS
  5. @@ -3,6 +3,7 @@ PHP                                                                        NEWS
  6.  ?? ??? 201?, PHP 5.5.0
  7.  
  8.  - General improvements:
  9. +  . Optimized access to temporary VM variables. 5% less memory reads. (Dmitry)
  10.    . The VM stacks for passing function arguments and syntaticaly nested calls
  11.      were merged into a single stack. The stack size needed for op_array
  12.      execution is calculated at compile time and preallocated at once. As result
  13. diff --git a/UPGRADING b/UPGRADING
  14. index f8cb6fa..170c6de 100755
  15. --- a/UPGRADING
  16. +++ b/UPGRADING
  17. @@ -48,6 +48,17 @@ PHP 5.5 UPGRADE NOTES
  18.    corresponding stack space is preallocated together with execute_data.
  19.    ZEND_SEND* and ZEND_DO_FCALL* don't need to check for stack overflow
  20.    anymore.
  21. +- Removed execute_data->Ts field. The VM temporary variables always allocated
  22. +  immediately before execute_data structure. Now they are accessed by offset
  23. +  from the execute_data base pointer (instead of execute_data->Ts). Compiler
  24. +  stores new offsets in op_array->opcodes[*].op?.num. You can use macros
  25. +  EX_TMP_VAR() and EX_TMP_VAR_NUM() to access temp_variable by offset or
  26. +  number. You can convert number to offset using EX_TMP_VAR_NUM(0, num) or
  27. +  offset to number (EX_TMP_VAR(0,offset)-EX_TMP_VAR_NUM(0,0)).
  28. +- Removed execute_data->CVs field. The VM compiled variables always allocated
  29. +  immediately after execute_data structure. Now they are accessed by offset
  30. +  from the execute_data base pointer (instead of execute_data->CVs). You can
  31. +  use macros EX_CV_NUM() to access compiled variables by number.
  32.  
  33.  ========================================
  34.  2. New Features
  35. diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
  36. index e768996..109949a 100644
  37. --- a/Zend/zend_compile.c
  38. +++ b/Zend/zend_compile.c
  39. @@ -287,7 +287,7 @@ ZEND_API zend_bool zend_is_compiling(TSRMLS_D) /* {{{ */
  40.  
  41.  static zend_uint get_temporary_variable(zend_op_array *op_array) /* {{{ */
  42.  {
  43. -   return (op_array->T)++ * ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable));
  44. +   return EX_TMP_VAR_NUM(0, (op_array->T)++);
  45.  }
  46.  /* }}} */
  47.  
  48. diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
  49. index def6341..e06c270 100644
  50. --- a/Zend/zend_compile.h
  51. +++ b/Zend/zend_compile.h
  52. @@ -387,8 +387,6 @@ struct _zend_execute_data {
  53.     zend_function_state function_state;
  54.     zend_op_array *op_array;
  55.     zval *object;
  56. -   union _temp_variable *Ts;
  57. -   zval ***CVs;
  58.     HashTable *symbol_table;
  59.     struct _zend_execute_data *prev_execute_data;
  60.     zval *old_error_reporting;
  61. @@ -404,6 +402,11 @@ struct _zend_execute_data {
  62.  
  63.  #define EX(element) execute_data.element
  64.  
  65. +#define EX_TMP_VAR(ex, n)     ((temp_variable*)(((char*)(ex)) + (n)))
  66. +#define EX_TMP_VAR_NUM(ex, n)  (EX_TMP_VAR(ex, 0) - (1 + (n)))
  67. +
  68. +#define EX_CV_NUM(ex, n)       (((zval***)(((char*)(ex))+ZEND_MM_ALIGNED_SIZE(sizeof(zend_execute_data))))+(n))
  69. +
  70.  
  71.  #define IS_CONST   (1<<0)
  72.  #define IS_TMP_VAR (1<<1)
  73. diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
  74. index 5f04ba7..e5198eb 100644
  75. --- a/Zend/zend_execute.c
  76. +++ b/Zend/zend_execute.c
  77. @@ -50,10 +50,10 @@
  78.  
  79.  typedef int (*incdec_t)(zval *);
  80.  
  81. -#define get_zval_ptr(op_type, node, Ts, should_free, type) _get_zval_ptr(op_type, node, Ts, should_free, type TSRMLS_CC)
  82. -#define get_zval_ptr_ptr(op_type, node, Ts, should_free, type) _get_zval_ptr_ptr(op_type, node, Ts, should_free, type TSRMLS_CC)
  83. -#define get_obj_zval_ptr(op_type, node, Ts, should_free, type) _get_obj_zval_ptr(op_type, node, Ts, should_free, type TSRMLS_CC)
  84. -#define get_obj_zval_ptr_ptr(op_type, node, Ts, should_free, type) _get_obj_zval_ptr_ptr(op_type, node, Ts, should_free, type TSRMLS_CC)
  85. +#define get_zval_ptr(op_type, node, ex, should_free, type) _get_zval_ptr(op_type, node, ex, should_free, type TSRMLS_CC)
  86. +#define get_zval_ptr_ptr(op_type, node, ex, should_free, type) _get_zval_ptr_ptr(op_type, node, ex, should_free, type TSRMLS_CC)
  87. +#define get_obj_zval_ptr(op_type, node, ex, should_free, type) _get_obj_zval_ptr(op_type, node, ex, should_free, type TSRMLS_CC)
  88. +#define get_obj_zval_ptr_ptr(op_type, node, ex, should_free, type) _get_obj_zval_ptr_ptr(op_type, node, ex, should_free, type TSRMLS_CC)
  89.  
  90.  /* Prototypes */
  91.  static void zend_extension_statement_handler(const zend_extension *extension, zend_op_array *op_array TSRMLS_DC);
  92. @@ -62,8 +62,8 @@ static void zend_extension_fcall_end_handler(const zend_extension *extension, ze
  93.  
  94.  #define RETURN_VALUE_USED(opline) (!((opline)->result_type & EXT_TYPE_UNUSED))
  95.  
  96. -#define T(offset) (*(temp_variable *)((char *) Ts + offset))
  97. -#define CV(var)   CVs[var]
  98. +#define EX_T(offset) (*EX_TMP_VAR(execute_data, offset))
  99. +#define EX_CV(var)   (*EX_CV_NUM(execute_data, var))
  100.  
  101.  #define TEMP_VAR_STACK_LIMIT 2000
  102.  
  103. @@ -154,7 +154,6 @@ static zend_always_inline void zend_pzval_unlock_free_func(zval *z TSRMLS_DC)
  104.  
  105.  /* End of zend_execute_locks.h */
  106.  
  107. -#define CV_OF(i)     (EG(current_execute_data)->CVs[i])
  108.  #define CV_DEF_OF(i) (EG(active_op_array)->vars[i])
  109.  
  110.  #define CTOR_CALL_BIT    0x1
  111. @@ -168,19 +167,19 @@ static zend_always_inline void zend_pzval_unlock_free_func(zval *z TSRMLS_DC)
  112.  #define DECODE_CTOR(ce) \
  113.     ((zend_class_entry*)(((zend_uintptr_t)(ce)) & ~(CTOR_CALL_BIT|CTOR_USED_BIT)))
  114.  
  115. -ZEND_API zval** zend_get_compiled_variable_value(const zend_execute_data *execute_data_ptr, zend_uint var)
  116. +ZEND_API zval** zend_get_compiled_variable_value(const zend_execute_data *execute_data, zend_uint var)
  117.  {
  118. -   return execute_data_ptr->CVs[var];
  119. +   return EX_CV(var);
  120.  }
  121.  
  122. -static zend_always_inline zval *_get_zval_ptr_tmp(zend_uint var, const temp_variable *Ts, zend_free_op *should_free TSRMLS_DC)
  123. +static zend_always_inline zval *_get_zval_ptr_tmp(zend_uint var, const zend_execute_data *execute_data, zend_free_op *should_free TSRMLS_DC)
  124.  {
  125. -   return should_free->var = &T(var).tmp_var;
  126. +   return should_free->var = &EX_T(var).tmp_var;
  127.  }
  128.  
  129. -static zend_always_inline zval *_get_zval_ptr_var(zend_uint var, const temp_variable *Ts, zend_free_op *should_free TSRMLS_DC)
  130. +static zend_always_inline zval *_get_zval_ptr_var(zend_uint var, const zend_execute_data *execute_data, zend_free_op *should_free TSRMLS_DC)
  131.  {
  132. -   zval *ptr = T(var).var.ptr;
  133. +   zval *ptr = EX_T(var).var.ptr;
  134.  
  135.     PZVAL_UNLOCK(ptr, should_free);
  136.     return ptr;
  137. @@ -206,7 +205,7 @@ static zend_never_inline zval **_get_zval_cv_lookup(zval ***ptr, zend_uint var,
  138.             case BP_VAR_W:
  139.                 Z_ADDREF(EG(uninitialized_zval));
  140.                 if (!EG(active_symbol_table)) {
  141. -                   *ptr = (zval**)EG(current_execute_data)->CVs + (EG(active_op_array)->last_var + var);
  142. +                   *ptr = (zval**)EX_CV_NUM(EG(current_execute_data), EG(active_op_array)->last_var + var);
  143.                     **ptr = &EG(uninitialized_zval);
  144.                 } else {
  145.                     zend_hash_quick_update(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, &EG(uninitialized_zval_ptr), sizeof(zval *), (void **)ptr);
  146. @@ -258,7 +257,7 @@ static zend_never_inline zval **_get_zval_cv_lookup_BP_VAR_RW(zval ***ptr, zend_
  147.  
  148.     if (!EG(active_symbol_table)) {
  149.         Z_ADDREF(EG(uninitialized_zval));
  150. -       *ptr = (zval**)EG(current_execute_data)->CVs + (EG(active_op_array)->last_var + var);
  151. +       *ptr = (zval**)EX_CV_NUM(EG(current_execute_data), EG(active_op_array)->last_var + var);
  152.         **ptr = &EG(uninitialized_zval);
  153.         zend_error(E_NOTICE, "Undefined variable: %s", cv->name);
  154.     } else if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void **)ptr)==FAILURE) {
  155. @@ -275,7 +274,7 @@ static zend_never_inline zval **_get_zval_cv_lookup_BP_VAR_W(zval ***ptr, zend_u
  156.  
  157.     if (!EG(active_symbol_table)) {
  158.         Z_ADDREF(EG(uninitialized_zval));
  159. -       *ptr = (zval**)EG(current_execute_data)->CVs + (EG(active_op_array)->last_var + var);
  160. +       *ptr = (zval**)EX_CV_NUM(EG(current_execute_data), EG(active_op_array)->last_var + var);
  161.         **ptr = &EG(uninitialized_zval);
  162.     } else if (zend_hash_quick_find(EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value, (void **)ptr)==FAILURE) {
  163.         Z_ADDREF(EG(uninitialized_zval));
  164. @@ -286,7 +285,7 @@ static zend_never_inline zval **_get_zval_cv_lookup_BP_VAR_W(zval ***ptr, zend_u
  165.  
  166.  static zend_always_inline zval *_get_zval_ptr_cv(zend_uint var, int type TSRMLS_DC)
  167.  {
  168. -   zval ***ptr = &CV_OF(var);
  169. +   zval ***ptr = EX_CV_NUM(EG(current_execute_data), var);
  170.  
  171.     if (UNEXPECTED(*ptr == NULL)) {
  172.         return *_get_zval_cv_lookup(ptr, var, type TSRMLS_CC);
  173. @@ -294,9 +293,9 @@ static zend_always_inline zval *_get_zval_ptr_cv(zend_uint var, int type TSRMLS_
  174.     return **ptr;
  175.  }
  176.  
  177. -static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_R(zval ***CVs, zend_uint var TSRMLS_DC)
  178. +static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_R(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC)
  179.  {
  180. -   zval ***ptr = &CV(var);
  181. +   zval ***ptr = EX_CV_NUM(execute_data, var);
  182.  
  183.     if (UNEXPECTED(*ptr == NULL)) {
  184.         return *_get_zval_cv_lookup_BP_VAR_R(ptr, var TSRMLS_CC);
  185. @@ -304,9 +303,9 @@ static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_R(zval ***CVs, zend_uint
  186.     return **ptr;
  187.  }
  188.  
  189. -static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_UNSET(zval ***CVs, zend_uint var TSRMLS_DC)
  190. +static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_UNSET(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC)
  191.  {
  192. -   zval ***ptr = &CV(var);
  193. +   zval ***ptr = EX_CV_NUM(execute_data, var);
  194.  
  195.     if (UNEXPECTED(*ptr == NULL)) {
  196.         return *_get_zval_cv_lookup_BP_VAR_UNSET(ptr, var TSRMLS_CC);
  197. @@ -314,9 +313,9 @@ static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_UNSET(zval ***CVs, zend_
  198.     return **ptr;
  199.  }
  200.  
  201. -static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_IS(zval ***CVs, zend_uint var TSRMLS_DC)
  202. +static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_IS(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC)
  203.  {
  204. -   zval ***ptr = &CV(var);
  205. +   zval ***ptr = EX_CV_NUM(execute_data, var);
  206.  
  207.     if (UNEXPECTED(*ptr == NULL)) {
  208.         return *_get_zval_cv_lookup_BP_VAR_IS(ptr, var TSRMLS_CC);
  209. @@ -324,9 +323,9 @@ static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_IS(zval ***CVs, zend_uin
  210.     return **ptr;
  211.  }
  212.  
  213. -static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_RW(zval ***CVs, zend_uint var TSRMLS_DC)
  214. +static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_RW(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC)
  215.  {
  216. -   zval ***ptr = &CV(var);
  217. +   zval ***ptr = EX_CV_NUM(execute_data, var);
  218.  
  219.     if (UNEXPECTED(*ptr == NULL)) {
  220.         return *_get_zval_cv_lookup_BP_VAR_RW(ptr, var TSRMLS_CC);
  221. @@ -334,9 +333,9 @@ static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_RW(zval ***CVs, zend_uin
  222.     return **ptr;
  223.  }
  224.  
  225. -static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_W(zval ***CVs, zend_uint var TSRMLS_DC)
  226. +static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_W(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC)
  227.  {
  228. -   zval ***ptr = &CV(var);
  229. +   zval ***ptr = EX_CV_NUM(execute_data, var);
  230.  
  231.     if (UNEXPECTED(*ptr == NULL)) {
  232.         return *_get_zval_cv_lookup_BP_VAR_W(ptr, var TSRMLS_CC);
  233. @@ -344,7 +343,7 @@ static zend_always_inline zval *_get_zval_ptr_cv_BP_VAR_W(zval ***CVs, zend_uint
  234.     return **ptr;
  235.  }
  236.  
  237. -static inline zval *_get_zval_ptr(int op_type, const znode_op *node, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC)
  238. +static inline zval *_get_zval_ptr(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC)
  239.  {
  240.  /* should_free->is_var = 0; */
  241.     switch (op_type) {
  242. @@ -353,11 +352,11 @@ static inline zval *_get_zval_ptr(int op_type, const znode_op *node, const temp_
  243.             return node->zv;
  244.             break;
  245.         case IS_TMP_VAR:
  246. -           should_free->var = TMP_FREE(&T(node->var).tmp_var);
  247. -           return &T(node->var).tmp_var;
  248. +           should_free->var = TMP_FREE(&EX_T(node->var).tmp_var);
  249. +           return &EX_T(node->var).tmp_var;
  250.             break;
  251.         case IS_VAR:
  252. -           return _get_zval_ptr_var(node->var, Ts, should_free TSRMLS_CC);
  253. +           return _get_zval_ptr_var(node->var, execute_data, should_free TSRMLS_CC);
  254.             break;
  255.         case IS_UNUSED:
  256.             should_free->var = 0;
  257. @@ -372,22 +371,22 @@ static inline zval *_get_zval_ptr(int op_type, const znode_op *node, const temp_
  258.     return NULL;
  259.  }
  260.  
  261. -static zend_always_inline zval **_get_zval_ptr_ptr_var(zend_uint var, const temp_variable *Ts, zend_free_op *should_free TSRMLS_DC)
  262. +static zend_always_inline zval **_get_zval_ptr_ptr_var(zend_uint var, const zend_execute_data *execute_data, zend_free_op *should_free TSRMLS_DC)
  263.  {
  264. -   zval** ptr_ptr = T(var).var.ptr_ptr;
  265. +   zval** ptr_ptr = EX_T(var).var.ptr_ptr;
  266.  
  267.     if (EXPECTED(ptr_ptr != NULL)) {
  268.         PZVAL_UNLOCK(*ptr_ptr, should_free);
  269.     } else {
  270.         /* string offset */
  271. -       PZVAL_UNLOCK(T(var).str_offset.str, should_free);
  272. +       PZVAL_UNLOCK(EX_T(var).str_offset.str, should_free);
  273.     }
  274.     return ptr_ptr;
  275.  }
  276.  
  277.  static zend_always_inline zval **_get_zval_ptr_ptr_cv(zend_uint var, int type TSRMLS_DC)
  278.  {
  279. -   zval ***ptr = &CV_OF(var);
  280. +   zval ***ptr = EX_CV_NUM(EG(current_execute_data), var);
  281.  
  282.     if (UNEXPECTED(*ptr == NULL)) {
  283.         return _get_zval_cv_lookup(ptr, var, type TSRMLS_CC);
  284. @@ -395,9 +394,9 @@ static zend_always_inline zval **_get_zval_ptr_ptr_cv(zend_uint var, int type TS
  285.     return *ptr;
  286.  }
  287.  
  288. -static zend_always_inline zval **_get_zval_ptr_ptr_cv_BP_VAR_R(zval ***CVs, zend_uint var TSRMLS_DC)
  289. +static zend_always_inline zval **_get_zval_ptr_ptr_cv_BP_VAR_R(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC)
  290.  {
  291. -   zval ***ptr = &CV(var);
  292. +   zval ***ptr = EX_CV_NUM(execute_data, var);
  293.  
  294.     if (UNEXPECTED(*ptr == NULL)) {
  295.         return _get_zval_cv_lookup_BP_VAR_R(ptr, var TSRMLS_CC);
  296. @@ -405,9 +404,9 @@ static zend_always_inline zval **_get_zval_ptr_ptr_cv_BP_VAR_R(zval ***CVs, zend
  297.     return *ptr;
  298.  }
  299.  
  300. -static zend_always_inline zval **_get_zval_ptr_ptr_cv_BP_VAR_UNSET(zval ***CVs, zend_uint var TSRMLS_DC)
  301. +static zend_always_inline zval **_get_zval_ptr_ptr_cv_BP_VAR_UNSET(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC)
  302.  {
  303. -   zval ***ptr = &CV(var);
  304. +   zval ***ptr = EX_CV_NUM(execute_data, var);
  305.  
  306.     if (UNEXPECTED(*ptr == NULL)) {
  307.         return _get_zval_cv_lookup_BP_VAR_UNSET(ptr, var TSRMLS_CC);
  308. @@ -415,9 +414,9 @@ static zend_always_inline zval **_get_zval_ptr_ptr_cv_BP_VAR_UNSET(zval ***CVs,
  309.     return *ptr;
  310.  }
  311.  
  312. -static zend_always_inline zval **_get_zval_ptr_ptr_cv_BP_VAR_IS(zval ***CVs, zend_uint var TSRMLS_DC)
  313. +static zend_always_inline zval **_get_zval_ptr_ptr_cv_BP_VAR_IS(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC)
  314.  {
  315. -   zval ***ptr = &CV(var);
  316. +   zval ***ptr = EX_CV_NUM(execute_data, var);
  317.  
  318.     if (UNEXPECTED(*ptr == NULL)) {
  319.         return _get_zval_cv_lookup_BP_VAR_IS(ptr, var TSRMLS_CC);
  320. @@ -425,9 +424,9 @@ static zend_always_inline zval **_get_zval_ptr_ptr_cv_BP_VAR_IS(zval ***CVs, zen
  321.     return *ptr;
  322.  }
  323.  
  324. -static zend_always_inline zval **_get_zval_ptr_ptr_cv_BP_VAR_RW(zval ***CVs, zend_uint var TSRMLS_DC)
  325. +static zend_always_inline zval **_get_zval_ptr_ptr_cv_BP_VAR_RW(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC)
  326.  {
  327. -   zval ***ptr = &CV(var);
  328. +   zval ***ptr = EX_CV_NUM(execute_data, var);
  329.  
  330.     if (UNEXPECTED(*ptr == NULL)) {
  331.         return _get_zval_cv_lookup_BP_VAR_RW(ptr, var TSRMLS_CC);
  332. @@ -435,9 +434,9 @@ static zend_always_inline zval **_get_zval_ptr_ptr_cv_BP_VAR_RW(zval ***CVs, zen
  333.     return *ptr;
  334.  }
  335.  
  336. -static zend_always_inline zval **_get_zval_ptr_ptr_cv_BP_VAR_W(zval ***CVs, zend_uint var TSRMLS_DC)
  337. +static zend_always_inline zval **_get_zval_ptr_ptr_cv_BP_VAR_W(const zend_execute_data *execute_data, zend_uint var TSRMLS_DC)
  338.  {
  339. -   zval ***ptr = &CV(var);
  340. +   zval ***ptr = EX_CV_NUM(execute_data, var);
  341.  
  342.     if (UNEXPECTED(*ptr == NULL)) {
  343.         return _get_zval_cv_lookup_BP_VAR_W(ptr, var TSRMLS_CC);
  344. @@ -445,13 +444,13 @@ static zend_always_inline zval **_get_zval_ptr_ptr_cv_BP_VAR_W(zval ***CVs, zend
  345.     return *ptr;
  346.  }
  347.  
  348. -static inline zval **_get_zval_ptr_ptr(int op_type, const znode_op *node, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC)
  349. +static inline zval **_get_zval_ptr_ptr(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC)
  350.  {
  351.     if (op_type == IS_CV) {
  352.         should_free->var = 0;
  353.         return _get_zval_ptr_ptr_cv(node->var, type TSRMLS_CC);
  354.     } else if (op_type == IS_VAR) {
  355. -       return _get_zval_ptr_ptr_var(node->var, Ts, should_free TSRMLS_CC);
  356. +       return _get_zval_ptr_ptr_var(node->var, execute_data, should_free TSRMLS_CC);
  357.     } else {
  358.         should_free->var = 0;
  359.         return NULL;
  360. @@ -468,7 +467,7 @@ static zend_always_inline zval *_get_obj_zval_ptr_unused(TSRMLS_D)
  361.     }
  362.  }
  363.  
  364. -static inline zval **_get_obj_zval_ptr_ptr(int op_type, const znode_op *op, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC)
  365. +static inline zval **_get_obj_zval_ptr_ptr(int op_type, const znode_op *op, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC)
  366.  {
  367.     if (op_type == IS_UNUSED) {
  368.         if (EXPECTED(EG(This) != NULL)) {
  369. @@ -480,7 +479,7 @@ static inline zval **_get_obj_zval_ptr_ptr(int op_type, const znode_op *op, cons
  370.             zend_error_noreturn(E_ERROR, "Using $this when not in object context");
  371.         }
  372.     }
  373. -   return get_zval_ptr_ptr(op_type, op, Ts, should_free, type);
  374. +   return get_zval_ptr_ptr(op_type, op, execute_data, should_free, type);
  375.  }
  376.  
  377.  static zend_always_inline zval **_get_obj_zval_ptr_ptr_unused(TSRMLS_D)
  378. @@ -493,7 +492,7 @@ static zend_always_inline zval **_get_obj_zval_ptr_ptr_unused(TSRMLS_D)
  379.     }
  380.  }
  381.  
  382. -static inline zval *_get_obj_zval_ptr(int op_type, znode_op *op, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC)
  383. +static inline zval *_get_obj_zval_ptr(int op_type, znode_op *op, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC)
  384.  {
  385.     if (op_type == IS_UNUSED) {
  386.         if (EXPECTED(EG(This) != NULL)) {
  387. @@ -503,7 +502,7 @@ static inline zval *_get_obj_zval_ptr(int op_type, znode_op *op, const temp_vari
  388.             zend_error_noreturn(E_ERROR, "Using $this when not in object context");
  389.         }
  390.     }
  391. -   return get_zval_ptr(op_type, op, Ts, should_free, type);
  392. +   return get_zval_ptr(op_type, op, execute_data, should_free, type);
  393.  }
  394.  
  395.  static void zend_assign_to_variable_reference(zval **variable_ptr_ptr, zval **value_ptr_ptr TSRMLS_DC)
  396. @@ -654,11 +653,11 @@ static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zva
  397.     return 1;
  398.  }
  399.  
  400. -static inline void zend_assign_to_object(zval **retval, zval **object_ptr, zval *property_name, int value_type, znode_op *value_op, const temp_variable *Ts, int opcode, const zend_literal *key TSRMLS_DC)
  401. +static inline void zend_assign_to_object(zval **retval, zval **object_ptr, zval *property_name, int value_type, znode_op *value_op, const zend_execute_data *execute_data, int opcode, const zend_literal *key TSRMLS_DC)
  402.  {
  403.     zval *object = *object_ptr;
  404.     zend_free_op free_value;
  405. -   zval *value = get_zval_ptr(value_type, value_op, Ts, &free_value, BP_VAR_R);
  406. +   zval *value = get_zval_ptr(value_type, value_op, execute_data, &free_value, BP_VAR_R);
  407.  
  408.     if (Z_TYPE_P(object) != IS_OBJECT) {
  409.         if (object == &EG(error_zval)) {
  410. @@ -1410,7 +1409,7 @@ static void zend_fetch_property_address(temp_variable *result, zval **container_
  411.     }
  412.  }
  413.  
  414. -static inline zend_brk_cont_element* zend_brk_cont(int nest_levels, int array_offset, const zend_op_array *op_array, const temp_variable *Ts TSRMLS_DC)
  415. +static inline zend_brk_cont_element* zend_brk_cont(int nest_levels, int array_offset, const zend_op_array *op_array, const zend_execute_data *execute_data TSRMLS_DC)
  416.  {
  417.     int original_nest_levels = nest_levels;
  418.     zend_brk_cont_element *jmp_to;
  419. @@ -1426,12 +1425,12 @@ static inline zend_brk_cont_element* zend_brk_cont(int nest_levels, int array_of
  420.             switch (brk_opline->opcode) {
  421.                 case ZEND_SWITCH_FREE:
  422.                     if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) {
  423. -                       zval_ptr_dtor(&T(brk_opline->op1.var).var.ptr);
  424. +                       zval_ptr_dtor(&EX_T(brk_opline->op1.var).var.ptr);
  425.                     }
  426.                     break;
  427.                 case ZEND_FREE:
  428.                     if (!(brk_opline->extended_value & EXT_TYPE_FREE_ON_RETURN)) {
  429. -                       zendi_zval_dtor(T(brk_opline->op1.var).tmp_var);
  430. +                       zendi_zval_dtor(EX_T(brk_opline->op1.var).tmp_var);
  431.                     }
  432.                     break;
  433.             }
  434. @@ -1482,7 +1481,7 @@ ZEND_API void execute_internal(zend_execute_data *execute_data_ptr, zend_fcall_i
  435.                 *fci->retval_ptr_ptr, fci->retval_ptr_ptr, fci->object_ptr, 1 TSRMLS_CC);
  436.  
  437.     } else {
  438. -       zval **return_value_ptr = &(*(temp_variable *)((char *) execute_data_ptr->Ts + execute_data_ptr->opline->result.var)).var.ptr;
  439. +       zval **return_value_ptr = &EX_TMP_VAR(execute_data_ptr, execute_data_ptr->opline->result.var)->var.ptr;
  440.         ((zend_internal_function *) execute_data_ptr->function_state.function)->handler(execute_data_ptr->opline->extended_value, *return_value_ptr,
  441.                     (execute_data_ptr->function_state.function->common.fn_flags & ZEND_ACC_RETURN_REFERENCE)?return_value_ptr:NULL,
  442.                     execute_data_ptr->object, return_value_used TSRMLS_CC);
  443. @@ -1537,12 +1536,12 @@ ZEND_API user_opcode_handler_t zend_get_user_opcode_handler(zend_uchar opcode)
  444.     return zend_user_opcode_handlers[opcode];
  445.  }
  446.  
  447. -ZEND_API zval *zend_get_zval_ptr(int op_type, const znode_op *node, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC) {
  448. -   return get_zval_ptr(op_type, node, Ts, should_free, type);
  449. +ZEND_API zval *zend_get_zval_ptr(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC) {
  450. +   return get_zval_ptr(op_type, node, execute_data, should_free, type);
  451.  }
  452.  
  453. -ZEND_API zval **zend_get_zval_ptr_ptr(int op_type, const znode_op *node, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC) {
  454. -   return get_zval_ptr_ptr(op_type, node, Ts, should_free, type);
  455. +ZEND_API zval **zend_get_zval_ptr_ptr(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC) {
  456. +   return get_zval_ptr_ptr(op_type, node, execute_data, should_free, type);
  457.  }
  458.  
  459.  void zend_clean_and_cache_symbol_table(HashTable *symbol_table TSRMLS_DC) /* {{{ */
  460. @@ -1559,12 +1558,12 @@ void zend_clean_and_cache_symbol_table(HashTable *symbol_table TSRMLS_DC) /* {{{
  461.  }
  462.  /* }}} */
  463.  
  464. -void zend_free_compiled_variables(zval ***CVs, int num) /* {{{ */
  465. +void zend_free_compiled_variables(zend_execute_data *execute_data) /* {{{ */
  466.  {
  467.     int i;
  468. -   for (i = 0; i < num; ++i) {
  469. -       if (CVs[i]) {
  470. -           zval_ptr_dtor(CVs[i]);
  471. +   for (i = 0; i < EX(op_array)->last_var; ++i) {
  472. +       if (EX_CV(i)) {
  473. +           zval_ptr_dtor(EX_CV(i));
  474.         }
  475.     }
  476.  }
  477. diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h
  478. index fdd9f56..963decd 100644
  479. --- a/Zend/zend_execute.h
  480. +++ b/Zend/zend_execute.h
  481. @@ -394,13 +394,13 @@ typedef struct _zend_free_op {
  482.  /* int   is_var; */
  483.  } zend_free_op;
  484.  
  485. -ZEND_API zval *zend_get_zval_ptr(int op_type, const znode_op *node, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC);
  486. -ZEND_API zval **zend_get_zval_ptr_ptr(int op_type, const znode_op *node, const temp_variable *Ts, zend_free_op *should_free, int type TSRMLS_DC);
  487. +ZEND_API zval *zend_get_zval_ptr(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC);
  488. +ZEND_API zval **zend_get_zval_ptr_ptr(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC);
  489.  
  490.  ZEND_API int zend_do_fcall(ZEND_OPCODE_HANDLER_ARGS);
  491.  
  492.  void zend_clean_and_cache_symbol_table(HashTable *symbol_table TSRMLS_DC);
  493. -void zend_free_compiled_variables(zval ***CVs, int num);
  494. +void zend_free_compiled_variables(zend_execute_data *execute_data);
  495.  
  496.  #define CACHED_PTR(num) \
  497.     EG(active_op_array)->run_time_cache[(num)]
  498. diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
  499. index 3df0ca2..4a635b2 100644
  500. --- a/Zend/zend_execute_API.c
  501. +++ b/Zend/zend_execute_API.c
  502. @@ -1689,7 +1689,7 @@ ZEND_API void zend_reset_all_cv(HashTable *symbol_table TSRMLS_DC) /* {{{ */
  503.     for (ex = EG(current_execute_data); ex; ex = ex->prev_execute_data) {
  504.         if (ex->op_array && ex->symbol_table == symbol_table) {
  505.             for (i = 0; i < ex->op_array->last_var; i++) {
  506. -               ex->CVs[i] = NULL;
  507. +               *EX_CV_NUM(ex, i) = NULL;
  508.             }
  509.         }
  510.     }
  511. @@ -1708,7 +1708,7 @@ ZEND_API void zend_delete_variable(zend_execute_data *ex, HashTable *ht, const c
  512.                     if (ex->op_array->vars[i].hash_value == hash_value &&
  513.                         ex->op_array->vars[i].name_len == name_len &&
  514.                         !memcmp(ex->op_array->vars[i].name, name, name_len)) {
  515. -                       ex->CVs[i] = NULL;
  516. +                       *EX_CV_NUM(ex, i) = NULL;
  517.                         break;
  518.                     }
  519.                 }
  520. @@ -1732,7 +1732,7 @@ ZEND_API int zend_delete_global_variable_ex(const char *name, int name_len, ulon
  521.                         ex->op_array->vars[i].name_len == name_len &&
  522.                         !memcmp(ex->op_array->vars[i].name, name, name_len)
  523.                     ) {
  524. -                       ex->CVs[i] = NULL;
  525. +                       *EX_CV_NUM(ex, i) = NULL;
  526.                         break;
  527.                     }
  528.                 }
  529. @@ -1779,20 +1779,20 @@ ZEND_API void zend_rebuild_symbol_table(TSRMLS_D) /* {{{ */
  530.             ex->symbol_table = EG(active_symbol_table);
  531.  
  532.             if (ex->op_array->this_var != -1 &&
  533. -               !ex->CVs[ex->op_array->this_var] &&
  534. +               !*EX_CV_NUM(ex, ex->op_array->this_var) &&
  535.                 EG(This)) {
  536. -               ex->CVs[ex->op_array->this_var] = (zval**)ex->CVs + ex->op_array->last_var + ex->op_array->this_var;
  537. -               *ex->CVs[ex->op_array->this_var] = EG(This);
  538. +               *EX_CV_NUM(ex, ex->op_array->this_var) = (zval**)EX_CV_NUM(ex, ex->op_array->last_var + ex->op_array->this_var);
  539. +               **EX_CV_NUM(ex, ex->op_array->this_var) = EG(This);
  540.             }
  541.             for (i = 0; i < ex->op_array->last_var; i++) {
  542. -               if (ex->CVs[i]) {
  543. +               if (*EX_CV_NUM(ex, i)) {
  544.                     zend_hash_quick_update(EG(active_symbol_table),
  545.                         ex->op_array->vars[i].name,
  546.                         ex->op_array->vars[i].name_len + 1,
  547.                         ex->op_array->vars[i].hash_value,
  548. -                       (void**)ex->CVs[i],
  549. +                       (void**)*EX_CV_NUM(ex, i),
  550.                         sizeof(zval*),
  551. -                       (void**)&ex->CVs[i]);
  552. +                       (void**)EX_CV_NUM(ex, i));
  553.                 }
  554.             }
  555.         }
  556. diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c
  557. index 4450374..dc7ae14 100644
  558. --- a/Zend/zend_generators.c
  559. +++ b/Zend/zend_generators.c
  560. @@ -35,7 +35,7 @@ void zend_generator_close(zend_generator *generator, zend_bool finished_executio
  561.         void **stack_frame;
  562.  
  563.         if (!execute_data->symbol_table) {
  564. -           zend_free_compiled_variables(execute_data->CVs, op_array->last_var);
  565. +           zend_free_compiled_variables(execute_data);
  566.         } else {
  567.             zend_clean_and_cache_symbol_table(execute_data->symbol_table TSRMLS_CC);
  568.         }
  569. @@ -66,13 +66,13 @@ void zend_generator_close(zend_generator *generator, zend_bool finished_executio
  570.                     switch (brk_opline->opcode) {
  571.                         case ZEND_SWITCH_FREE:
  572.                             {
  573. -                               temp_variable *var = (temp_variable *) ((char *) execute_data->Ts + brk_opline->op1.var);
  574. +                               temp_variable *var = EX_TMP_VAR(execute_data, brk_opline->op1.var);
  575.                                 zval_ptr_dtor(&var->var.ptr);
  576.                             }
  577.                             break;
  578.                         case ZEND_FREE:
  579.                             {
  580. -                               temp_variable *var = (temp_variable *) ((char *) execute_data->Ts + brk_opline->op1.var);
  581. +                               temp_variable *var = EX_TMP_VAR(execute_data, brk_opline->op1.var);
  582.                                 zval_dtor(&var->tmp_var);
  583.                             }
  584.                             break;
  585. @@ -198,10 +198,10 @@ static void zend_generator_clone_storage(zend_generator *orig, zend_generator **
  586.  
  587.             /* Copy compiled variables */
  588.             for (i = 0; i < op_array->last_var; i++) {
  589. -               if (execute_data->CVs[i]) {
  590. -                   clone->execute_data->CVs[i] = (zval **) clone->execute_data->CVs + op_array->last_var + i;
  591. -                   *clone->execute_data->CVs[i] = (zval *) execute_data->CVs[op_array->last_var + i];
  592. -                   Z_ADDREF_PP(clone->execute_data->CVs[i]);
  593. +               if (*EX_CV_NUM(execute_data, i)) {
  594. +                   *EX_CV_NUM(clone->execute_data, i) = (zval **) EX_CV_NUM(clone->execute_data, op_array->last_var + i);
  595. +                   **EX_CV_NUM(clone->execute_data, i) = *(zval **) EX_CV_NUM(execute_data, op_array->last_var + i);
  596. +                   Z_ADDREF_PP(*EX_CV_NUM(clone->execute_data, i));
  597.                 }
  598.             }
  599.         } else {
  600. @@ -214,8 +214,8 @@ static void zend_generator_clone_storage(zend_generator *orig, zend_generator **
  601.             {
  602.                 int i;
  603.                 for (i = 0; i < op_array->last_var; i++) {
  604. -                   if (zend_hash_quick_find(clone->execute_data->symbol_table, op_array->vars[i].name, op_array->vars[i].name_len + 1, op_array->vars[i].hash_value, (void **) &clone->execute_data->CVs[i]) == FAILURE) {
  605. -                       clone->execute_data->CVs[i] = NULL;
  606. +                   if (zend_hash_quick_find(clone->execute_data->symbol_table, op_array->vars[i].name, op_array->vars[i].name_len + 1, op_array->vars[i].hash_value, (void **) EX_CV_NUM(clone->execute_data, i)) == FAILURE) {
  607. +                       *EX_CV_NUM(clone->execute_data, i) = NULL;
  608.                     }
  609.                 }
  610.             }
  611. @@ -228,7 +228,7 @@ static void zend_generator_clone_storage(zend_generator *orig, zend_generator **
  612.         } else {
  613.             clone->execute_data->call = NULL;
  614.         }
  615. -       memcpy(clone->execute_data->call_slots, execute_data->call_slots, sizeof(call_slot) * op_array->nested_calls);
  616. +       memcpy(clone->execute_data->call_slots, execute_data->call_slots, ZEND_MM_ALIGNED_SIZE(sizeof(call_slot)) * op_array->nested_calls);
  617.         if (clone->execute_data->call >= clone->execute_data->call_slots) {
  618.             call_slot *call = clone->execute_data->call;
  619.    
  620. @@ -241,14 +241,14 @@ static void zend_generator_clone_storage(zend_generator *orig, zend_generator **
  621.         }
  622.  
  623.         /* Copy the temporary variables */
  624. -       memcpy(clone->execute_data->Ts, execute_data->Ts, sizeof(temp_variable) * op_array->T);
  625. +       memcpy(EX_TMP_VAR_NUM(clone->execute_data, op_array->T-1), EX_TMP_VAR_NUM(execute_data, op_array->T-1), ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * op_array->T);
  626.  
  627.         /* Copy arguments passed on stack */
  628.         stack_frame = zend_vm_stack_frame_base(clone->execute_data);
  629.         orig_stack_frame = zend_vm_stack_frame_base(execute_data);
  630.         clone->stack->top = stack_frame + (orig->stack->top - orig_stack_frame);
  631.         if (clone->stack->top != stack_frame) {
  632. -           memcpy(stack_frame, orig_stack_frame, sizeof(zval*) * (orig->stack->top - orig_stack_frame));
  633. +           memcpy(stack_frame, orig_stack_frame, ZEND_MM_ALIGNED_SIZE(sizeof(zval*)) * (orig->stack->top - orig_stack_frame));
  634.             while (clone->stack->top != stack_frame) {
  635.                 Z_ADDREF_PP((zval**)stack_frame);
  636.                 stack_frame++;
  637. @@ -271,7 +271,7 @@ static void zend_generator_clone_storage(zend_generator *orig, zend_generator **
  638.                     zend_op *brk_opline = op_array->opcodes + brk_cont->brk;
  639.  
  640.                     if (brk_opline->opcode == ZEND_SWITCH_FREE) {
  641. -                       temp_variable *var = (temp_variable *) ((char *) execute_data->Ts + brk_opline->op1.var);
  642. +                       temp_variable *var = EX_TMP_VAR(execute_data, brk_opline->op1.var);
  643.  
  644.                         Z_ADDREF_P(var->var.ptr);
  645.                     }
  646. @@ -283,10 +283,8 @@ static void zend_generator_clone_storage(zend_generator *orig, zend_generator **
  647.          * offset as the original generator, but in our temporary variable
  648.          * memory segment. */
  649.         if (orig->send_target) {
  650. -           size_t offset = (char *) orig->send_target - (char *) execute_data->Ts;
  651. -           clone->send_target = (temp_variable *) (
  652. -               (char *) clone->execute_data->Ts + offset
  653. -           );
  654. +           size_t offset = (char *) orig->send_target - (char *)execute_data;
  655. +           clone->send_target = EX_TMP_VAR(clone->execute_data, offset);
  656.             Z_ADDREF_P(clone->send_target->var.ptr);
  657.         }
  658.  
  659. diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
  660. index 966827d..c309ca0 100644
  661. --- a/Zend/zend_vm_def.h
  662. +++ b/Zend/zend_vm_def.h
  663. @@ -334,7 +334,7 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMP|VAR
  664.     zval **object_ptr = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_RW);
  665.     zval *object;
  666.     zval *property = GET_OP2_ZVAL_PTR(BP_VAR_R);
  667. -   zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
  668. +   zval *value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
  669.     int have_get_ptr = 0;
  670.  
  671.     if (OP1_TYPE == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
  672. @@ -465,8 +465,8 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_helper, VAR|UNUSED|CV, CONST|TMP|VAR|UNU
  673.                     zval *dim = GET_OP2_ZVAL_PTR(BP_VAR_R);
  674.  
  675.                     zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), container, dim, OP2_TYPE, BP_VAR_RW TSRMLS_CC);
  676. -                   value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
  677. -                   var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC);
  678. +                   value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
  679. +                   var_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
  680.                 }
  681.             }
  682.             break;
  683. @@ -1636,7 +1636,7 @@ ZEND_VM_HANDLER(136, ZEND_ASSIGN_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
  684.     if (OP1_TYPE == IS_VAR && UNEXPECTED(object_ptr == NULL)) {
  685.         zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
  686.     }
  687. -   zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_OBJ, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
  688. +   zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
  689.     if (IS_OP2_TMP_FREE()) {
  690.         zval_ptr_dtor(&property_name);
  691.     } else {
  692. @@ -1668,7 +1668,7 @@ ZEND_VM_HANDLER(147, ZEND_ASSIGN_DIM, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
  693.         if (IS_OP2_TMP_FREE()) {
  694.             MAKE_REAL_ZVAL_PTR(property_name);
  695.         }
  696. -       zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), ZEND_ASSIGN_DIM, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
  697. +       zend_assign_to_object(RETURN_VALUE_USED(opline)?&EX_T(opline->result.var).var.ptr:NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
  698.         if (IS_OP2_TMP_FREE()) {
  699.             zval_ptr_dtor(&property_name);
  700.         } else {
  701. @@ -1683,8 +1683,8 @@ ZEND_VM_HANDLER(147, ZEND_ASSIGN_DIM, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
  702.         zend_fetch_dimension_address(&EX_T((opline+1)->op2.var), object_ptr, dim, OP2_TYPE, BP_VAR_W TSRMLS_CC);
  703.         FREE_OP2();
  704.  
  705. -       value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, EX_Ts(), &free_op_data1, BP_VAR_R);
  706. -       variable_ptr_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, EX_Ts(), &free_op_data2 TSRMLS_CC);
  707. +       value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
  708. +       variable_ptr_ptr = _get_zval_ptr_ptr_var((opline+1)->op2.var, execute_data, &free_op_data2 TSRMLS_CC);
  709.         if (UNEXPECTED(variable_ptr_ptr == NULL)) {
  710.             if (zend_assign_to_string_offset(&EX_T((opline+1)->op2.var), value, (opline+1)->op1_type TSRMLS_CC)) {
  711.                 if (RETURN_VALUE_USED(opline)) {
  712. @@ -1866,7 +1866,7 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
  713.     EG(current_execute_data) = EX(prev_execute_data);
  714.     EG(opline_ptr) = NULL;
  715.     if (!EG(active_symbol_table)) {
  716. -       zend_free_compiled_variables(EX_CVs(), op_array->last_var);
  717. +       zend_free_compiled_variables(execute_data);
  718.     }
  719.  
  720.     if ((op_array->fn_flags & ZEND_ACC_CLOSURE) && op_array->prototype) {
  721. @@ -1875,7 +1875,7 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
  722.  
  723.     nested = EX(nested);
  724.  
  725. -   zend_vm_stack_free(execute_data TSRMLS_CC);
  726. +   zend_vm_stack_free((char*)execute_data - (ZEND_MM_ALIGNED_SIZE(sizeof(temp_variable)) * op_array->T) TSRMLS_CC);
  727.  
  728.     if (nested) {
  729.         execute_data = EG(current_execute_data);
  730. @@ -2029,7 +2029,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
  731.             /* saves one function call if zend_execute_internal is not used */
  732.             fbc->internal_function.handler(opline->extended_value, ret->var.ptr, (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) ? &ret->var.ptr : NULL, EX(object), RETURN_VALUE_USED(opline) TSRMLS_CC);
  733.         } else {
  734. -           zend_execute_internal(EXECUTE_DATA, NULL, RETURN_VALUE_USED(opline) TSRMLS_CC);
  735. +           zend_execute_internal(execute_data, NULL, RETURN_VALUE_USED(opline) TSRMLS_CC);
  736.         }
  737.  
  738.         if (!RETURN_VALUE_USED(opline)) {
  739. @@ -3043,7 +3043,7 @@ ZEND_VM_HANDLER(107, ZEND_CATCH, CONST, CV)
  740.         if (EX_CV(opline->op2.var)) {
  741.             zval_ptr_dtor(EX_CV(opline->op2.var));
  742.         }
  743. -       EX_CV(opline->op2.var) = (zval**)EX_CVs() + (EX(op_array)->last_var + opline->op2.var);
  744. +       EX_CV(opline->op2.var) = (zval**)EX_CV_NUM(execute_data, EX(op_array)->last_var + opline->op2.var);
  745.         *EX_CV(opline->op2.var) = EG(exception);
  746.     } else {
  747.         zend_compiled_variable *cv = &CV_DEF_OF(opline->op2.var);
  748. @@ -3245,7 +3245,7 @@ ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY)
  749.         zval **var_ptr;
  750.  
  751.         zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, *param, opline->extended_value TSRMLS_CC);
  752. -       var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->result.var TSRMLS_CC);
  753. +       var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
  754.         Z_DELREF_PP(var_ptr);
  755.         *var_ptr = *param;
  756.         Z_ADDREF_PP(var_ptr);
  757. @@ -3281,7 +3281,7 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST)
  758.     }
  759.  
  760.     zend_verify_arg_type((zend_function *) EG(active_op_array), arg_num, assignment_value, opline->extended_value TSRMLS_CC);
  761. -   var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(EX_CVs(), opline->result.var TSRMLS_CC);
  762. +   var_ptr = _get_zval_ptr_ptr_cv_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
  763.     Z_DELREF_PP(var_ptr);
  764.     *var_ptr = assignment_value;
  765.  
  766. @@ -3311,7 +3311,7 @@ ZEND_VM_HANDLER(50, ZEND_BRK, ANY, CONST)
  767.  
  768.     SAVE_OPLINE();
  769.     el = zend_brk_cont(Z_LVAL_P(opline->op2.zv), opline->op1.opline_num,
  770. -                      EX(op_array), EX_Ts() TSRMLS_CC);
  771. +                      EX(op_array), execute_data TSRMLS_CC);
  772.     FREE_OP2();
  773.     ZEND_VM_JMP(EX(op_array)->opcodes + el->brk);
  774.  }
  775. @@ -3323,7 +3323,7 @@ ZEND_VM_HANDLER(51, ZEND_CONT, ANY, CONST)
  776.  
  777.     SAVE_OPLINE();
  778.     el = zend_brk_cont(Z_LVAL_P(opline->op2.zv), opline->op1.opline_num,
  779. -                      EX(op_array), EX_Ts() TSRMLS_CC);
  780. +                      EX(op_array), execute_data TSRMLS_CC);
  781.     FREE_OP2();
  782.     ZEND_VM_JMP(EX(op_array)->opcodes + el->cont);
  783.  }
  784. @@ -3336,7 +3336,7 @@ ZEND_VM_HANDLER(100, ZEND_GOTO, ANY, CONST)
  785.  
  786.     SAVE_OPLINE();
  787.     el = zend_brk_cont(Z_LVAL_P(opline->op2.zv), opline->extended_value,
  788. -                      EX(op_array), EX_Ts() TSRMLS_CC);
  789. +                      EX(op_array), execute_data TSRMLS_CC);
  790.  
  791.     brk_opline = EX(op_array)->opcodes + el->brk;
  792.  
  793. @@ -3953,7 +3953,7 @@ ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMP|VAR|CV, UNUSED|CONST|VAR)
  794.         ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
  795.  
  796.         target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
  797. -       zend_delete_variable(EXECUTE_DATA, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
  798. +       zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
  799.     }
  800.  
  801.     if (OP1_TYPE != IS_CONST && varname == &tmp) {
  802. @@ -5035,7 +5035,7 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
  803.  
  804.     /* Figure out where the next stack frame (which maybe contains pushed
  805.      * arguments that have to be dtor'ed) starts */
  806. -   stack_frame = zend_vm_stack_frame_base(EXECUTE_DATA);
  807. +   stack_frame = zend_vm_stack_frame_base(execute_data);
  808.  
  809.     /* If the exception was thrown during a function call there might be
  810.      * arguments pushed to the stack that have to be dtor'ed. */
  811. diff --git a/Zend/zend_vm_execute.skl b/Zend/zend_vm_execute.skl
  812. index 85d3dfb..63f8349 100644
  813. --- a/Zend/zend_vm_execute.skl
  814. +++ b/Zend/zend_vm_execute.skl
  815. @@ -15,24 +15,24 @@
  816.   *                             +========================================+    |
  817.   *                                                                           |
  818.   *                             +========================================+    |
  819. + *                             | TMP_VAR[op_arrat->T-1]                 |    |
  820. + *                             | ...                                    |    |
  821. + *     EX_TMP_VAR_NUM(0) ----> | TMP_VAR[0]                             |    |
  822. + *                             +----------------------------------------+    |
  823.   * EG(current_execute_data) -> | zend_execute_data                      |    |
  824.   *                             |     EX(prev_execute_data)              |----+
  825.   *                             +----------------------------------------+
  826. - *           EX(Ts) ---------> | EX(Ts)[0]                              |
  827. - *                             | ...                                    |
  828. - *                             | EX(Tx)[op_arrat->T]                    |
  829. - *                             +----------------------------------------+
  830. - *           EX(CVs) --------> | EX(CVs)[0]                             |--+
  831. + *     EX_CV_NUM(0) ---------> | CV[0]                                  |--+
  832.   *                             | ...                                    |  |
  833. - *                             | EX(CVs)[op_array->last_var]            |  |
  834. + *                             | CV[op_array->last_var-1]               |  |
  835.   *                             +----------------------------------------+  |
  836.   *                             | Optional slot for CV[0] zval*          |<-+
  837.   *                             | ...                                    |
  838. - *                             | ...  for CV [op_array->last_var] zval* |
  839. + *                             | ...for CV [op_array->last_var-1] zval* |
  840.   *                             +----------------------------------------+
  841. - *           EX(call_slots) -> | EX(call_slots)[0]                      |
  842. + *           EX(call_slots) -> | CALL_SLOT[0]                           |
  843.   *                             | ...                                    |
  844. - *                             | EX(call_slots)[op_array->nested_calls] |
  845. + *                             | CALL_SLOT[op_array->nested_calls-1]    |
  846.   *                             +----------------------------------------+
  847.   * zend_vm_stack_frame_base -> | ARGUMENTS STACK [0]                    |
  848.   *                             | ...                                    |
  849. @@ -82,7 +82,7 @@ zend_execute_data *zend_create_execute_data_from_op_array(zend_op_array *op_arra
  850.  
  851.         EG(argument_stack) = zend_vm_stack_new_page((total_size + (sizeof(void*) - 1)) / sizeof(void*));
  852.         EG(argument_stack)->prev = NULL;
  853. -       execute_data = (zend_execute_data*)((char*)ZEND_VM_STACK_ELEMETS(EG(argument_stack)) + args_size + execute_data_size);
  854. +       execute_data = (zend_execute_data*)((char*)ZEND_VM_STACK_ELEMETS(EG(argument_stack)) + args_size + execute_data_size + Ts_size);
  855.  
  856.         /* copy prev_execute_data */
  857.         EX(prev_execute_data) = (zend_execute_data*)((char*)ZEND_VM_STACK_ELEMETS(EG(argument_stack)) + args_size);
  858. @@ -104,15 +104,13 @@ zend_execute_data *zend_create_execute_data_from_op_array(zend_op_array *op_arra
  859.         }
  860.     } else {
  861.         execute_data = zend_vm_stack_alloc(total_size TSRMLS_CC);
  862. +       execute_data = (zend_execute_data*)((char*)execute_data + Ts_size);
  863.         EX(prev_execute_data) = EG(current_execute_data);
  864.     }
  865.  
  866. -   EX(Ts) = (temp_variable *) ((char *) execute_data + execute_data_size);
  867. -
  868. -   EX(CVs) = (zval ***) ((char *) EX(Ts) + Ts_size);
  869. -   memset(EX(CVs), 0, sizeof(zval **) * op_array->last_var);
  870. +   memset(EX_CV_NUM(execute_data, 0), 0, sizeof(zval **) * op_array->last_var);
  871.  
  872. -   EX(call_slots) = (call_slot*)((char *) EX(CVs) + CVs_size);
  873. +   EX(call_slots) = (call_slot*)((char *)execute_data + execute_data_size + CVs_size);
  874.  
  875.  
  876.     EX(op_array) = op_array;
  877. @@ -134,10 +132,10 @@ zend_execute_data *zend_create_execute_data_from_op_array(zend_op_array *op_arra
  878.     if (op_array->this_var != -1 && EG(This)) {
  879.         Z_ADDREF_P(EG(This)); /* For $this pointer */
  880.         if (!EG(active_symbol_table)) {
  881. -           EX(CVs)[op_array->this_var] = (zval **) EX(CVs) + op_array->last_var + op_array->this_var;
  882. -           *EX(CVs)[op_array->this_var] = EG(This);
  883. +           EX_CV(op_array->this_var) = (zval **) EX_CV_NUM(execute_data, op_array->last_var + op_array->this_var);
  884. +           *EX_CV(op_array->this_var) = EG(This);
  885.         } else {
  886. -           if (zend_hash_add(EG(active_symbol_table), "this", sizeof("this"), &EG(This), sizeof(zval *), (void **) &EX(CVs)[op_array->this_var])==FAILURE) {
  887. +           if (zend_hash_add(EG(active_symbol_table), "this", sizeof("this"), &EG(This), sizeof(zval *), (void **) EX_CV_NUM(execute_data, op_array->this_var))==FAILURE) {
  888.                 Z_DELREF_P(EG(This));
  889.             }
  890.         }
  891. diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php
  892. index bd5f2de..6c9dcaf 100644
  893. --- a/Zend/zend_vm_gen.php
  894. +++ b/Zend/zend_vm_gen.php
  895. @@ -118,75 +118,75 @@ $op2_free = array(
  896.  );
  897.  
  898.  $op1_get_zval_ptr = array(
  899. -   "ANY"    => "get_zval_ptr(opline->op1_type, &opline->op1, EX_Ts(), &free_op1, \)",
  900. -   "TMP"    => "_get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC)",
  901. -   "VAR"    => "_get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC)",
  902. +   "ANY"    => "get_zval_ptr(opline->op1_type, &opline->op1, execute_data, &free_op1, \)",
  903. +   "TMP"    => "_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)",
  904. +   "VAR"    => "_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)",
  905.     "CONST"  => "opline->op1.zv",
  906.     "UNUSED" => "NULL",
  907. -   "CV"     => "_get_zval_ptr_cv_\(EX_CVs(), opline->op1.var TSRMLS_CC)",
  908. +   "CV"     => "_get_zval_ptr_cv_\(execute_data, opline->op1.var TSRMLS_CC)",
  909.  );
  910.  
  911.  $op2_get_zval_ptr = array(
  912. -   "ANY"    => "get_zval_ptr(opline->op2_type, &opline->op2, EX_Ts(), &free_op2, \)",
  913. -   "TMP"    => "_get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC)",
  914. -   "VAR"    => "_get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC)",
  915. +   "ANY"    => "get_zval_ptr(opline->op2_type, &opline->op2, execute_data, &free_op2, \)",
  916. +   "TMP"    => "_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)",
  917. +   "VAR"    => "_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)",
  918.     "CONST"  => "opline->op2.zv",
  919.     "UNUSED" => "NULL",
  920. -   "CV"     => "_get_zval_ptr_cv_\(EX_CVs(), opline->op2.var TSRMLS_CC)",
  921. +   "CV"     => "_get_zval_ptr_cv_\(execute_data, opline->op2.var TSRMLS_CC)",
  922.  );
  923.  
  924.  $op1_get_zval_ptr_ptr = array(
  925. -   "ANY"    => "get_zval_ptr_ptr(opline->op1_type, &opline->op1, EX_Ts(), &free_op1, \)",
  926. +   "ANY"    => "get_zval_ptr_ptr(opline->op1_type, &opline->op1, execute_data, &free_op1, \)",
  927.     "TMP"    => "NULL",
  928. -   "VAR"    => "_get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC)",
  929. +   "VAR"    => "_get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)",
  930.     "CONST"  => "NULL",
  931.     "UNUSED" => "NULL",
  932. -   "CV"     => "_get_zval_ptr_ptr_cv_\(EX_CVs(), opline->op1.var TSRMLS_CC)",
  933. +   "CV"     => "_get_zval_ptr_ptr_cv_\(execute_data, opline->op1.var TSRMLS_CC)",
  934.  );
  935.  
  936.  $op2_get_zval_ptr_ptr = array(
  937. -   "ANY"    => "get_zval_ptr_ptr(opline->op2_type, &opline->op2, EX_Ts(), &free_op2, \)",
  938. +   "ANY"    => "get_zval_ptr_ptr(opline->op2_type, &opline->op2, execute_data, &free_op2, \)",
  939.     "TMP"    => "NULL",
  940. -   "VAR"    => "_get_zval_ptr_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC)",
  941. +   "VAR"    => "_get_zval_ptr_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)",
  942.     "CONST"  => "NULL",
  943.     "UNUSED" => "NULL",
  944. -   "CV"     => "_get_zval_ptr_ptr_cv_\(EX_CVs(), opline->op2.var TSRMLS_CC)",
  945. +   "CV"     => "_get_zval_ptr_ptr_cv_\(execute_data, opline->op2.var TSRMLS_CC)",
  946.  );
  947.  
  948.  $op1_get_obj_zval_ptr = array(
  949. -   "ANY"    => "get_obj_zval_ptr(opline->op1_type, &opline->op1, EX_Ts(), &free_op1, \)",
  950. -   "TMP"    => "_get_zval_ptr_tmp(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC)",
  951. -   "VAR"    => "_get_zval_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC)",
  952. +   "ANY"    => "get_obj_zval_ptr(opline->op1_type, &opline->op1, execute_data, &free_op1, \)",
  953. +   "TMP"    => "_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)",
  954. +   "VAR"    => "_get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)",
  955.     "CONST"  => "opline->op1.zv",
  956.     "UNUSED" => "_get_obj_zval_ptr_unused(TSRMLS_C)",
  957. -   "CV"     => "_get_zval_ptr_cv_\(EX_CVs(), opline->op1.var TSRMLS_CC)",
  958. +   "CV"     => "_get_zval_ptr_cv_\(execute_data, opline->op1.var TSRMLS_CC)",
  959.  );
  960.  
  961.  $op2_get_obj_zval_ptr = array(
  962. -   "ANY"    => "get_obj_zval_ptr(opline->op2_type, &opline->op2, EX_Ts(), &free_op2, \)",
  963. -   "TMP"    => "_get_zval_ptr_tmp(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC)",
  964. -   "VAR"    => "_get_zval_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC)",
  965. +   "ANY"    => "get_obj_zval_ptr(opline->op2_type, &opline->op2, execute_data, &free_op2, \)",
  966. +   "TMP"    => "_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)",
  967. +   "VAR"    => "_get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)",
  968.     "CONST"  => "opline->op2.zv",
  969.     "UNUSED" => "_get_obj_zval_ptr_unused(TSRMLS_C)",
  970. -   "CV"     => "_get_zval_ptr_cv_\(EX_CVs(), opline->op2.var TSRMLS_CC)",
  971. +   "CV"     => "_get_zval_ptr_cv_\(execute_data, opline->op2.var TSRMLS_CC)",
  972.  );
  973.  
  974.  $op1_get_obj_zval_ptr_ptr = array(
  975. -   "ANY"    => "get_obj_zval_ptr_ptr(opline->op1_type, &opline->op1, EX_Ts(), &free_op1, \)",
  976. +   "ANY"    => "get_obj_zval_ptr_ptr(opline->op1_type, &opline->op1, execute_data, &free_op1, \)",
  977.     "TMP"    => "NULL",
  978. -   "VAR"    => "_get_zval_ptr_ptr_var(opline->op1.var, EX_Ts(), &free_op1 TSRMLS_CC)",
  979. +   "VAR"    => "_get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)",
  980.     "CONST"  => "NULL",
  981.     "UNUSED" => "_get_obj_zval_ptr_ptr_unused(TSRMLS_C)",
  982. -   "CV"     => "_get_zval_ptr_ptr_cv_\(EX_CVs(), opline->op1.var TSRMLS_CC)",
  983. +   "CV"     => "_get_zval_ptr_ptr_cv_\(execute_data, opline->op1.var TSRMLS_CC)",
  984.  );
  985.  
  986.  $op2_get_obj_zval_ptr_ptr = array(
  987. -   "ANY"    => "get_obj_zval_ptr_ptr(opline->op2_type, &opline->op2, EX_Ts(), &free_op2, \)",
  988. +   "ANY"    => "get_obj_zval_ptr_ptr(opline->op2_type, &opline->op2, execute_data, &free_op2, \)",
  989.     "TMP"    => "NULL",
  990. -   "VAR"    => "_get_zval_ptr_ptr_var(opline->op2.var, EX_Ts(), &free_op2 TSRMLS_CC)",
  991. +   "VAR"    => "_get_zval_ptr_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)",
  992.     "CONST"  => "NULL",
  993.     "UNUSED" => "_get_obj_zval_ptr_ptr_unused(TSRMLS_C)",
  994. -   "CV"     => "_get_zval_ptr_ptr_cv_\(EX_CVs(), opline->op2.var TSRMLS_CC)",
  995. +   "CV"     => "_get_zval_ptr_ptr_cv_\(execute_data, opline->op2.var TSRMLS_CC)",
  996.  );
  997.  
  998.  $op1_is_tmp_free = array(
  999. @@ -841,14 +841,6 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name,
  1000.                             out($f,"#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL execute_data TSRMLS_CC\n");
  1001.                             out($f,"#undef EX\n");
  1002.                             out($f,"#define EX(element) execute_data->element\n\n");
  1003. -                           out($f,"#undef EX_CV\n");
  1004. -                           out($f,"#define EX_CV(var) EX(CVs)[var]\n");
  1005. -                           out($f,"#undef EX_CVs\n");
  1006. -                           out($f,"#define EX_CVs() EX(CVs)\n");
  1007. -                           out($f,"#undef EX_T\n");
  1008. -                           out($f,"#define EX_T(offset) (*(temp_variable *)((char *) EX(Ts) + offset))\n");
  1009. -                           out($f,"#undef EX_Ts\n");
  1010. -                           out($f,"#define EX_Ts() EX(Ts)\n\n");
  1011.                             break;
  1012.                         case ZEND_VM_KIND_SWITCH:
  1013.                             out($f,"\n");
  1014. @@ -868,7 +860,7 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name,
  1015.                             out($f,"#define CHECK_EXCEPTION() LOAD_OPLINE()\n");
  1016.                             out($f,"#define HANDLE_EXCEPTION() LOAD_OPLINE(); ZEND_VM_CONTINUE()\n");
  1017.                             out($f,"#define HANDLE_EXCEPTION_LEAVE() LOAD_OPLINE(); ZEND_VM_LEAVE()\n");
  1018. -                           out($f,"#define LOAD_REGS()                do {Ts = EX(Ts); CVs = EX(CVs);} while (0)\n");
  1019. +                           out($f,"#define LOAD_REGS()\n");
  1020.                             out($f,"#define ZEND_VM_CONTINUE() goto zend_vm_continue\n");
  1021.                             out($f,"#define ZEND_VM_RETURN()   EG(in_execution) = original_in_execution; return\n");
  1022.                             out($f,"#define ZEND_VM_ENTER()    execute_data = zend_create_execute_data_from_op_array(EG(active_op_array), 1 TSRMLS_CC); LOAD_REGS(); LOAD_OPLINE(); ZEND_VM_CONTINUE()\n");
  1023. @@ -877,14 +869,6 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name,
  1024.                             out($f,"#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL execute_data TSRMLS_CC\n");
  1025.                             out($f,"#undef EX\n");
  1026.                             out($f,"#define EX(element) execute_data->element\n\n");
  1027. -                           out($f,"#undef EX_CV\n");
  1028. -                           out($f,"#define EX_CV(var) CVs[var]\n");
  1029. -                           out($f,"#undef EX_CVs\n");
  1030. -                           out($f,"#define EX_CVs() CVs\n");
  1031. -                           out($f,"#undef EX_T\n");
  1032. -                           out($f,"#define EX_T(offset) T(offset)\n");
  1033. -                           out($f,"#undef EX_Ts\n");
  1034. -                           out($f,"#define EX_Ts() Ts\n\n");
  1035.                             break;
  1036.                         case ZEND_VM_KIND_GOTO:
  1037.                             out($f,"\n");
  1038. @@ -904,7 +888,7 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name,
  1039.                             out($f,"#define CHECK_EXCEPTION() if (UNEXPECTED(EG(exception) != NULL)) goto ZEND_HANDLE_EXCEPTION_SPEC_HANDLER\n");
  1040.                             out($f,"#define HANDLE_EXCEPTION() goto ZEND_HANDLE_EXCEPTION_SPEC_HANDLER\n");
  1041.                             out($f,"#define HANDLE_EXCEPTION_LEAVE() goto ZEND_HANDLE_EXCEPTION_SPEC_HANDLER\n");
  1042. -                           out($f,"#define LOAD_REGS()                do {Ts = EX(Ts); CVs = EX(CVs);} while (0)\n");
  1043. +                           out($f,"#define LOAD_REGS()\n");
  1044.                             out($f,"#define ZEND_VM_CONTINUE() goto *(void**)(OPLINE->handler)\n");
  1045.                             out($f,"#define ZEND_VM_RETURN()   EG(in_execution) = original_in_execution; return\n");
  1046.                             out($f,"#define ZEND_VM_ENTER()    execute_data = zend_create_execute_data_from_op_array(EG(active_op_array), 1 TSRMLS_CC); LOAD_REGS(); LOAD_OPLINE(); ZEND_VM_CONTINUE()\n");
  1047. @@ -913,14 +897,6 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name,
  1048.                             out($f,"#define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL execute_data TSRMLS_CC\n");
  1049.                             out($f,"#undef EX\n");
  1050.                             out($f,"#define EX(element) execute_data->element\n\n");
  1051. -                           out($f,"#undef EX_CV\n");
  1052. -                           out($f,"#define EX_CV(var) CVs[var]\n");
  1053. -                           out($f,"#undef EX_CVs\n");
  1054. -                           out($f,"#define EX_CVs() CVs\n");
  1055. -                           out($f,"#undef EX_T\n");
  1056. -                           out($f,"#define EX_T(offset) T(offset)\n\n");
  1057. -                           out($f,"#undef EX_Ts\n");
  1058. -                           out($f,"#define EX_Ts() Ts\n\n");
  1059.                             break;
  1060.                     }
  1061.                     break;
  1062. @@ -929,8 +905,6 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name,
  1063.                     break;
  1064.                 case "HELPER_VARS":
  1065.                     if ($kind != ZEND_VM_KIND_CALL) {
  1066. -                       out($f,$m[1]."temp_variable *Ts;\n");
  1067. -                       out($f,$m[1]."zval ***CVs;\n");
  1068.                         if ($kind == ZEND_VM_KIND_SWITCH) {
  1069.                             out($f,$m[1]."opcode_handler_t dispatch_handler;\n");
  1070.                         }
  1071. @@ -1243,12 +1217,6 @@ function gen_vm($def, $skel) {
  1072.         out($f,"\n/* Old executor */\n\n");
  1073.         out($f,"#undef EX\n");
  1074.         out($f,"#define EX(element) execute_data.element\n\n");
  1075. -       out($f,"#undef EX_CV\n");
  1076. -       out($f,"#define EX_CV(var) EX(CVs)[var]\n");
  1077. -       out($f,"#undef EX_CVs\n");
  1078. -       out($f,"#define EX_CVs() EX(CVs)\n");
  1079. -       out($f,"#undef EX_T\n");
  1080. -       out($f,"#define EX_T(offset) (*(temp_variable *)((char *) EX(Ts) + offset))\n\n");
  1081.         out($f,"#undef ZEND_VM_CONTINUE\n\n");
  1082.         out($f,"#undef ZEND_VM_RETURN\n\n");
  1083.         out($f,"#undef ZEND_VM_ENTER\n\n");
  1084. @@ -1323,12 +1291,6 @@ function gen_vm($def, $skel) {
  1085.         out($f,"#define HANDLE_EXCEPTION_LEAVE() LOAD_OPLINE(); ZEND_VM_LEAVE()\n");
  1086.         out($f,"#undef EX\n");
  1087.         out($f,"#define EX(element) execute_data->element\n\n");
  1088. -       out($f,"#undef EX_CV\n");
  1089. -       out($f,"#define EX_CV(var) EX(CVs)[var]\n");
  1090. -       out($f,"#undef EX_CVs\n");
  1091. -       out($f,"#define EX_CVs() EX(CVs)\n");
  1092. -       out($f,"#undef EX_T\n");
  1093. -       out($f,"#define EX_T(offset) (*(temp_variable *)((char *) EX(Ts) + offset))\n\n");
  1094.         out($f,"#undef ZEND_VM_CONTINUE\n");
  1095.         out($f,"#undef ZEND_VM_RETURN\n");
  1096.         out($f,"#undef ZEND_VM_ENTER\n");
Advertisement
Add Comment
Please, Sign In to add comment