diff options
| author | Sascha Schumann <sas@php.net> | 2000-06-13 17:58:33 +0000 |
|---|---|---|
| committer | Sascha Schumann <sas@php.net> | 2000-06-13 17:58:33 +0000 |
| commit | df74f1dfabafb515bdf8ffee5f989761c0d6604d (patch) | |
| tree | 208700924af318225292a4982e9fc0ac2dda7c19 /Zend/zend_execute_API.c | |
| parent | 307a234879aad2f47e00e158f9a424b9531c5879 (diff) | |
| download | php-git-df74f1dfabafb515bdf8ffee5f989761c0d6604d.tar.gz | |
Add optional support for C0x inline semantics.
These are enabled by specifying `--enable-c0x-inline' on the command
line. We might add an autoconf check for this particular feature
later.
Diffstat (limited to 'Zend/zend_execute_API.c')
| -rw-r--r-- | Zend/zend_execute_API.c | 128 |
1 files changed, 0 insertions, 128 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index a8f5b58304..512e85d04d 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -237,16 +237,6 @@ ZEND_API zend_bool zend_is_executing() } -ZEND_API inline void safe_free_zval_ptr(zval *p) -{ - ELS_FETCH(); - - if (p!=EG(uninitialized_zval_ptr)) { - FREE_ZVAL(p); - } -} - - ZEND_API void _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC) { #if DEBUG_ZEND>=2 @@ -262,44 +252,6 @@ ZEND_API void _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC) } -ZEND_API inline int i_zend_is_true(zval *op) -{ - int result; - - switch (op->type) { - case IS_NULL: - result = 0; - break; - case IS_LONG: - case IS_BOOL: - case IS_RESOURCE: - result = (op->value.lval?1:0); - break; - case IS_DOUBLE: - result = (op->value.dval ? 1 : 0); - break; - case IS_STRING: - if (op->value.str.len == 0 - || (op->value.str.len==1 && op->value.str.val[0]=='0')) { - result = 0; - } else { - result = 1; - } - break; - case IS_ARRAY: - result = (zend_hash_num_elements(op->value.ht)?1:0); - break; - case IS_OBJECT: - result = (zend_hash_num_elements(op->value.obj.properties)?1:0); - break; - default: - result = 0; - break; - } - return result; -} - - ZEND_API int zend_is_true(zval *op) { return i_zend_is_true(op); @@ -550,57 +502,6 @@ ZEND_API int zend_eval_string(char *str, zval *retval_ptr CLS_DC ELS_DC) } -ZEND_API inline void zend_assign_to_variable_reference(znode *result, zval **variable_ptr_ptr, zval **value_ptr_ptr, temp_variable *Ts ELS_DC) -{ - zval *variable_ptr = *variable_ptr_ptr; - zval *value_ptr; - - - if (!value_ptr_ptr) { - zend_error(E_ERROR, "Cannot create references to string offsets nor overloaded objects"); - return; - } - - value_ptr = *value_ptr_ptr; - if (variable_ptr == EG(error_zval_ptr) || value_ptr==EG(error_zval_ptr)) { - variable_ptr_ptr = &EG(uninitialized_zval_ptr); -/* } else if (variable_ptr==&EG(uninitialized_zval) || variable_ptr!=value_ptr) { */ - } else if (variable_ptr_ptr != value_ptr_ptr) { - variable_ptr->refcount--; - if (variable_ptr->refcount==0) { - zendi_zval_dtor(*variable_ptr); - FREE_ZVAL(variable_ptr); - } - - if (!PZVAL_IS_REF(value_ptr)) { - /* break it away */ - value_ptr->refcount--; - if (value_ptr->refcount>0) { - ALLOC_ZVAL(*value_ptr_ptr); - **value_ptr_ptr = *value_ptr; - value_ptr = *value_ptr_ptr; - zendi_zval_copy_ctor(*value_ptr); - } - value_ptr->refcount = 1; - value_ptr->is_ref = 1; - } - - *variable_ptr_ptr = value_ptr; - value_ptr->refcount++; - } else { - if (variable_ptr->refcount>1) { /* we need to break away */ - SEPARATE_ZVAL(variable_ptr_ptr); - } - (*variable_ptr_ptr)->is_ref = 1; - } - - if (result && (result->op_type != IS_UNUSED)) { - Ts[result->u.var].var.ptr_ptr = variable_ptr_ptr; - SELECTIVE_PZVAL_LOCK(*variable_ptr_ptr, result); - AI_USE_PTR(Ts[result->u.var].var); - } -} - #if SUPPORT_INTERACTIVE void execute_new_code(CLS_D) @@ -622,32 +523,3 @@ void execute_new_code(CLS_D) #endif -/* these are a dedicated, optimized, function, and shouldn't be used for any purpose - * other than by Zend's executor - */ -ZEND_API inline void zend_ptr_stack_clear_multiple(ELS_D) -{ - void **p = EG(argument_stack).top_element-2; - int delete_count = (ulong) *p; - - EG(argument_stack).top -= (delete_count+2); - while (--delete_count>=0) { - zval_ptr_dtor((zval **) --p); - } - EG(argument_stack).top_element = p; -} - - - -ZEND_API int zend_ptr_stack_get_arg(int requested_arg, void **data ELS_DC) -{ - void **p = EG(argument_stack).top_element-2; - int arg_count = (ulong) *p; - - if (requested_arg>arg_count) { - return FAILURE; - } - *data = (p-arg_count+requested_arg-1); - return SUCCESS; -} - |
