cvs: ZendEngine2 / zend_compile.h zend_execute.c zend_globals.h
| From: | Andi Gutmans | Date: | Tue, 22 Oct 2002 19:31:54 +0000 |
| Subject: | cvs: ZendEngine2 / zend_compile.h zend_execute.c zend_globals.h | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-528@lists.php.net to get a copy of this message | ||
andi Tue Oct 22 15:31:54 2002 EDT
Modified files:
/ZendEngine2 zend_compile.h zend_execute.c zend_globals.h
Log:
- Improve overall engine performance
Index: ZendEngine2/zend_compile.h
diff -u ZendEngine2/zend_compile.h:1.186 ZendEngine2/zend_compile.h:1.187
--- ZendEngine2/zend_compile.h:1.186 Sat Oct 19 16:57:15 2002
+++ ZendEngine2/zend_compile.h Tue Oct 22 15:31:53 2002
@@ -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: ZendEngine2/zend_execute.c
diff -u ZendEngine2/zend_execute.c:1.380 ZendEngine2/zend_execute.c:1.381
--- ZendEngine2/zend_execute.c:1.380 Tue Oct 22 13:00:59 2002
+++ ZendEngine2/zend_execute.c Tue Oct 22 15:31:53 2002
@@ -68,7 +68,7 @@
#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 @@
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 @@
*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 @@
}
}
break;
- case IS_UNUSED:
- *should_free = 0;
- return NULL;
- break;
EMPTY_SWITCH_DEFAULT_CASE()
}
return NULL;
@@ -278,7 +273,7 @@
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 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_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: ZendEngine2/zend_globals.h
diff -u ZendEngine2/zend_globals.h:1.109 ZendEngine2/zend_globals.h:1.110
--- ZendEngine2/zend_globals.h:1.109 Mon Oct 14 19:41:31 2002
+++ ZendEngine2/zend_globals.h Tue Oct 22 15:31:53 2002
@@ -186,7 +186,7 @@
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);