]> granicus.if.org Git - php/commitdiff
- Improve overall engine performance
authorAndi Gutmans <andi@php.net>
Tue, 22 Oct 2002 19:31:53 +0000 (19:31 +0000)
committerAndi Gutmans <andi@php.net>
Tue, 22 Oct 2002 19:31:53 +0000 (19:31 +0000)
Zend/zend_compile.h
Zend/zend_execute.c
Zend/zend_globals.h

index 50fb1a78bb82caeb6d55a1abe08bb078d57546eb..b919cd23b38cccc32c526bfdf66762b59c90b897 100644 (file)
@@ -32,7 +32,7 @@
 #define DEBUG_ZEND 0
 
 #define FREE_PNODE(znode)      zval_dtor(&znode->u.constant);
-#define FREE_OP(Ts, op, should_free) if (should_free) zval_dtor(&Ts[(op)->u.var].tmp_var);
+#define FREE_OP(Ts, op, should_free) if (should_free) zval_dtor(should_free);
 
 #define SET_UNUSED(op)  (op).op_type = IS_UNUSED
 
index 9a969b5a078ad2d99ff4addf1a840bcdc8803ffb..a55d21e561792bc70d2c1b1134785df23aca15ae 100644 (file)
@@ -68,7 +68,7 @@ static void zend_extension_fcall_end_handler(zend_extension *extension, zend_op_
 
 #define RETURN_VALUE_USED(opline) (!((opline)->result.u.EA.type & EXT_TYPE_UNUSED))
 
-static inline zval *_get_zval_ptr(znode *node, temp_variable *Ts, int *should_free TSRMLS_DC)
+static inline zval *_get_zval_ptr(znode *node, temp_variable *Ts, zval **should_free TSRMLS_DC)
 {
        switch(node->op_type) {
                case IS_CONST:
@@ -76,8 +76,7 @@ static inline zval *_get_zval_ptr(znode *node, temp_variable *Ts, int *should_fr
                        return &node->u.constant;
                        break;
                case IS_TMP_VAR:
-                       *should_free = 1;
-                       return &Ts[node->u.var].tmp_var;
+                       return *should_free = &Ts[node->u.var].tmp_var;
                        break;
                case IS_VAR:
                        if (Ts[node->u.var].var.ptr) {
@@ -85,7 +84,7 @@ static inline zval *_get_zval_ptr(znode *node, temp_variable *Ts, int *should_fr
                                *should_free = 0;
                                return Ts[node->u.var].var.ptr;
                        } else {
-                               *should_free = 1;
+                               *should_free = &Ts[node->u.var].tmp_var;
 
                                switch (Ts[node->u.var].EA.type) {
                                        case IS_STRING_OFFSET: {
@@ -114,10 +113,6 @@ static inline zval *_get_zval_ptr(znode *node, temp_variable *Ts, int *should_fr
                                }
                        }
                        break;
-               case IS_UNUSED:
-                       *should_free = 0;
-                       return NULL;
-                       break;
                EMPTY_SWITCH_DEFAULT_CASE()
        }
        return NULL;
@@ -278,7 +273,7 @@ static inline zval **get_obj_zval_ptr_ptr(znode *op, temp_variable *Ts, int type
        return get_zval_ptr_ptr(op, Ts, type);
 }
 
-static inline zval *get_obj_zval_ptr(znode *op, temp_variable *Ts, int *freeop, int type TSRMLS_DC)
+static inline zval *get_obj_zval_ptr(znode *op, temp_variable *Ts, zval **freeop, int type TSRMLS_DC)
 {
        if(op->op_type == IS_UNUSED) {
                if(EG(This)) {
@@ -663,7 +658,7 @@ static inline HashTable *zend_get_target_symbol_table(zend_op *opline, temp_vari
 
 static void zend_fetch_var_address(zend_op *opline, temp_variable *Ts, int type TSRMLS_DC)
 {
-       int free_op1;
+       zval *free_op1;
        zval *varname = get_zval_ptr(&opline->op1, Ts, &free_op1, BP_VAR_R);
        zval **retval;
        zval tmp_varname;
@@ -910,7 +905,7 @@ static void zend_fetch_dimension_address(znode *result, znode *op1, znode *op2,
 
 static void zend_fetch_dimension_address_from_tmp_var(znode *result, znode *op1, znode *op2, temp_variable *Ts TSRMLS_DC)
 {
-       int free_op1;
+       zval *free_op1;
        zval *container = get_zval_ptr(op1, Ts, &free_op1, BP_VAR_R);
 
        if (container->type != IS_ARRAY) {
index 9ca3aa24e506e38311a428d0fe9c167eacd18491..8e1fc29a3a410102932cf9528c4001f49d7c65a2 100644 (file)
@@ -186,7 +186,7 @@ struct _zend_executor_globals {
        HashTable persistent_list;
 
        zend_ptr_stack argument_stack;
-       int free_op1, free_op2;
+       zval *free_op1, *free_op2;
        int (*unary_op)(zval *result, zval *op1);
        int (*binary_op)(zval *result, zval *op1, zval *op2 TSRMLS_DC);