- Improve overall engine performance

This commit is contained in:
Andi Gutmans 2002-10-22 19:31:53 +00:00
parent e94b9ea9ee
commit d12679a64d
3 changed files with 8 additions and 13 deletions

View 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

View 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) {

View 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);