@@ -167,6 +167,9 @@ static zend_always_inline void zend_pzval_unlock_free_func(zval *z TSRMLS_DC)
167
167
#define DECODE_CTOR (ce ) \
168
168
((zend_class_entry*)(((zend_uintptr_t)(ce)) & ~(CTOR_CALL_BIT|CTOR_USED_BIT)))
169
169
170
+ #undef EX
171
+ #define EX (element ) execute_data->element
172
+
170
173
ZEND_API zval * * zend_get_compiled_variable_value (const zend_execute_data * execute_data , zend_uint var )
171
174
{
172
175
return EX_CV (var );
@@ -1488,62 +1491,6 @@ ZEND_API void execute_internal(zend_execute_data *execute_data_ptr, zend_fcall_i
1488
1491
}
1489
1492
}
1490
1493
1491
- #define ZEND_VM_NEXT_OPCODE () \
1492
- CHECK_SYMBOL_TABLES() \
1493
- ZEND_VM_INC_OPCODE(); \
1494
- ZEND_VM_CONTINUE()
1495
-
1496
- #define ZEND_VM_SET_OPCODE (new_op ) \
1497
- CHECK_SYMBOL_TABLES() \
1498
- OPLINE = new_op
1499
-
1500
- #define ZEND_VM_JMP (new_op ) \
1501
- if (EXPECTED(!EG(exception))) { \
1502
- ZEND_VM_SET_OPCODE(new_op); \
1503
- } else { \
1504
- LOAD_OPLINE(); \
1505
- } \
1506
- ZEND_VM_CONTINUE()
1507
-
1508
- #define ZEND_VM_INC_OPCODE () \
1509
- OPLINE++
1510
-
1511
- #ifdef __GNUC__
1512
- # define ZEND_VM_GUARD (name ) __asm__("#" #name)
1513
- #else
1514
- # define ZEND_VM_GUARD (name )
1515
- #endif
1516
-
1517
- #include "zend_vm_execute.h"
1518
-
1519
- ZEND_API int zend_set_user_opcode_handler (zend_uchar opcode , user_opcode_handler_t handler )
1520
- {
1521
- if (opcode != ZEND_USER_OPCODE ) {
1522
- if (handler == NULL ) {
1523
- /* restore the original handler */
1524
- zend_user_opcodes [opcode ] = opcode ;
1525
- } else {
1526
- zend_user_opcodes [opcode ] = ZEND_USER_OPCODE ;
1527
- }
1528
- zend_user_opcode_handlers [opcode ] = handler ;
1529
- return SUCCESS ;
1530
- }
1531
- return FAILURE ;
1532
- }
1533
-
1534
- ZEND_API user_opcode_handler_t zend_get_user_opcode_handler (zend_uchar opcode )
1535
- {
1536
- return zend_user_opcode_handlers [opcode ];
1537
- }
1538
-
1539
- 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 ) {
1540
- return get_zval_ptr (op_type , node , execute_data , should_free , type );
1541
- }
1542
-
1543
- 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 ) {
1544
- return get_zval_ptr_ptr (op_type , node , execute_data , should_free , type );
1545
- }
1546
-
1547
1494
void zend_clean_and_cache_symbol_table (HashTable * symbol_table TSRMLS_DC ) /* {{{ */
1548
1495
{
1549
1496
if (EG (symtable_cache_ptr ) >= EG (symtable_cache_limit )) {
@@ -1558,14 +1505,22 @@ void zend_clean_and_cache_symbol_table(HashTable *symbol_table TSRMLS_DC) /* {{{
1558
1505
}
1559
1506
/* }}} */
1560
1507
1561
- void zend_free_compiled_variables (zend_execute_data * execute_data ) /* {{{ */
1508
+ static zend_always_inline void i_free_compiled_variables (zend_execute_data * execute_data ) /* {{{ */
1562
1509
{
1563
- int i ;
1564
- for (i = 0 ; i < EX (op_array )-> last_var ; ++ i ) {
1565
- if (EX_CV (i )) {
1566
- zval_ptr_dtor (EX_CV (i ));
1510
+ zval * * * cv = EX_CV_NUM (execute_data , 0 );
1511
+ zval * * * end = cv + EX (op_array )-> last_var ;
1512
+ while (cv != end ) {
1513
+ if (* cv ) {
1514
+ zval_ptr_dtor (* cv );
1567
1515
}
1568
- }
1516
+ cv ++ ;
1517
+ }
1518
+ }
1519
+ /* }}} */
1520
+
1521
+ void zend_free_compiled_variables (zend_execute_data * execute_data ) /* {{{ */
1522
+ {
1523
+ i_free_compiled_variables (execute_data );
1569
1524
}
1570
1525
/* }}} */
1571
1526
@@ -1611,7 +1566,7 @@ void zend_free_compiled_variables(zend_execute_data *execute_data) /* {{{ */
1611
1566
* +----------------------------------------+
1612
1567
*/
1613
1568
1614
- zend_execute_data * zend_create_execute_data_from_op_array (zend_op_array * op_array , zend_bool nested TSRMLS_DC ) /* {{{ */
1569
+ static zend_always_inline zend_execute_data * i_create_execute_data_from_op_array (zend_op_array * op_array , zend_bool nested TSRMLS_DC ) /* {{{ */
1615
1570
{
1616
1571
zend_execute_data * execute_data ;
1617
1572
@@ -1720,6 +1675,68 @@ zend_execute_data *zend_create_execute_data_from_op_array(zend_op_array *op_arra
1720
1675
}
1721
1676
/* }}} */
1722
1677
1678
+ zend_execute_data * zend_create_execute_data_from_op_array (zend_op_array * op_array , zend_bool nested TSRMLS_DC ) /* {{{ */
1679
+ {
1680
+ return i_create_execute_data_from_op_array (op_array , nested TSRMLS_CC );
1681
+ }
1682
+ /* }}} */
1683
+
1684
+ #define ZEND_VM_NEXT_OPCODE () \
1685
+ CHECK_SYMBOL_TABLES() \
1686
+ ZEND_VM_INC_OPCODE(); \
1687
+ ZEND_VM_CONTINUE()
1688
+
1689
+ #define ZEND_VM_SET_OPCODE (new_op ) \
1690
+ CHECK_SYMBOL_TABLES() \
1691
+ OPLINE = new_op
1692
+
1693
+ #define ZEND_VM_JMP (new_op ) \
1694
+ if (EXPECTED(!EG(exception))) { \
1695
+ ZEND_VM_SET_OPCODE(new_op); \
1696
+ } else { \
1697
+ LOAD_OPLINE(); \
1698
+ } \
1699
+ ZEND_VM_CONTINUE()
1700
+
1701
+ #define ZEND_VM_INC_OPCODE () \
1702
+ OPLINE++
1703
+
1704
+ #ifdef __GNUC__
1705
+ # define ZEND_VM_GUARD (name ) __asm__("#" #name)
1706
+ #else
1707
+ # define ZEND_VM_GUARD (name )
1708
+ #endif
1709
+
1710
+ #include "zend_vm_execute.h"
1711
+
1712
+ ZEND_API int zend_set_user_opcode_handler (zend_uchar opcode , user_opcode_handler_t handler )
1713
+ {
1714
+ if (opcode != ZEND_USER_OPCODE ) {
1715
+ if (handler == NULL ) {
1716
+ /* restore the original handler */
1717
+ zend_user_opcodes [opcode ] = opcode ;
1718
+ } else {
1719
+ zend_user_opcodes [opcode ] = ZEND_USER_OPCODE ;
1720
+ }
1721
+ zend_user_opcode_handlers [opcode ] = handler ;
1722
+ return SUCCESS ;
1723
+ }
1724
+ return FAILURE ;
1725
+ }
1726
+
1727
+ ZEND_API user_opcode_handler_t zend_get_user_opcode_handler (zend_uchar opcode )
1728
+ {
1729
+ return zend_user_opcode_handlers [opcode ];
1730
+ }
1731
+
1732
+ 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 ) {
1733
+ return get_zval_ptr (op_type , node , execute_data , should_free , type );
1734
+ }
1735
+
1736
+ 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 ) {
1737
+ return get_zval_ptr_ptr (op_type , node , execute_data , should_free , type );
1738
+ }
1739
+
1723
1740
/*
1724
1741
* Local variables:
1725
1742
* tab-width: 4
0 commit comments