summaryrefslogtreecommitdiff
path: root/Zend/zend_execute.c
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-10-03 20:30:49 +0200
committerAnatol Belski <ab@php.net>2014-10-03 20:30:49 +0200
commitee4ae7fbc3ba6de5f51f95a621e14a18dd55c95d (patch)
treed774f5b506e70bc8a70ef22988e2d374bf0756b8 /Zend/zend_execute.c
parent45e23645a42ba939fb1cca9cc099f977af2a4722 (diff)
parent1ff094deb481234c0aa2fb5b0ee144b7aba924ff (diff)
downloadphp-git-ee4ae7fbc3ba6de5f51f95a621e14a18dd55c95d.tar.gz
Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: remove the remains of dsp files handling fix EX usage remove misprint parentheses remove misprint parentheses Replaced EG(This) and EX(object) with EX(This). Internal functions now recieves zend_execute_data as the first argument. And this one... It should be in extern c Remove useless condition NEWS entry for previous commit NEWS entry for previous commit add IPv6 support to php-fpm Micro optimization for the most frequency case Add hash to EXTENSIONS file Remove extensions which are long gone we also have xz release tarballs since 5.5 Fix ZTS build improved file size computation in stat() Fixed incorrect compilation 5.5.19 now
Diffstat (limited to 'Zend/zend_execute.c')
-rw-r--r--Zend/zend_execute.c53
1 files changed, 23 insertions, 30 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 0c15e06b6c..e019191a5e 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -123,9 +123,6 @@ static const zend_internal_function zend_pass_function = {
#define DECODE_CTOR(ce) \
((zend_class_entry*)(((zend_uintptr_t)(ce)) & ~(CTOR_CALL_BIT|CTOR_USED_BIT)))
-#undef EX
-#define EX(element) execute_data->element
-
ZEND_API zval* zend_get_compiled_variable_value(const zend_execute_data *execute_data, uint32_t var)
{
return EX_VAR(var);
@@ -426,22 +423,22 @@ static inline zval *_get_zval_ptr_ptr(int op_type, const znode_op *node, const z
}
}
-static zend_always_inline zval *_get_obj_zval_ptr_unused(TSRMLS_D)
+static zend_always_inline zval *_get_obj_zval_ptr_unused(zend_execute_data *execute_data TSRMLS_DC)
{
- if (EXPECTED(Z_OBJ(EG(This)) != NULL)) {
- return &EG(This);
+ if (EXPECTED(Z_OBJ(EX(This)) != NULL)) {
+ return &EX(This);
} else {
zend_error_noreturn(E_ERROR, "Using $this when not in object context");
return NULL;
}
}
-static inline zval *_get_obj_zval_ptr(int op_type, znode_op *op, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC)
+static inline zval *_get_obj_zval_ptr(int op_type, znode_op *op, zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC)
{
if (op_type == IS_UNUSED) {
- if (EXPECTED(Z_OBJ(EG(This)) != NULL)) {
+ if (EXPECTED(Z_OBJ(EX(This)) != NULL)) {
should_free->var = NULL;
- return &EG(This);
+ return &EX(This);
} else {
zend_error_noreturn(E_ERROR, "Using $this when not in object context");
}
@@ -449,12 +446,12 @@ static inline zval *_get_obj_zval_ptr(int op_type, znode_op *op, const zend_exec
return get_zval_ptr(op_type, op, execute_data, should_free, type);
}
-static inline zval *_get_obj_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)
+static inline zval *_get_obj_zval_ptr_ptr(int op_type, const znode_op *node, zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC)
{
if (op_type == IS_UNUSED) {
- if (EXPECTED(Z_OBJ(EG(This)) != NULL)) {
+ if (EXPECTED(Z_OBJ(EX(This)) != NULL)) {
should_free->var = NULL;
- return &EG(This);
+ return &EX(This);
} else {
zend_error_noreturn(E_ERROR, "Using $this when not in object context");
}
@@ -1217,14 +1214,13 @@ static zend_always_inline void zend_fetch_dimension_address_read(zval *result, z
} else {
retval = Z_OBJ_HT_P(container)->read_dimension(container, dim, type, result TSRMLS_CC);
- if (result) {
- if (retval) {
- if (result != retval) {
- ZVAL_COPY(result, retval);
- }
- } else {
- ZVAL_NULL(result);
+ ZEND_ASSERT(result != NULL);
+ if (retval) {
+ if (result != retval) {
+ ZVAL_COPY(result, retval);
}
+ } else {
+ ZVAL_NULL(result);
}
}
} else {
@@ -1368,7 +1364,7 @@ ZEND_API opcode_handler_t *zend_opcode_handlers;
ZEND_API void execute_internal(zend_execute_data *execute_data, zval *return_value TSRMLS_DC)
{
- execute_data->func->internal_function.handler(execute_data->num_args, return_value TSRMLS_CC);
+ execute_data->func->internal_function.handler(execute_data, return_value TSRMLS_CC);
}
void zend_clean_and_cache_symbol_table(zend_array *symbol_table TSRMLS_DC) /* {{{ */
@@ -1428,7 +1424,6 @@ static zend_always_inline void i_init_func_execute_data(zend_execute_data *execu
{
uint32_t first_extra_arg, num_args;
ZEND_ASSERT(EX(func) == (zend_function*)op_array);
- ZEND_ASSERT(EX(object) == Z_OBJ(EG(This)));
EX(opline) = op_array->opcodes;
EX(call) = NULL;
@@ -1480,9 +1475,9 @@ static zend_always_inline void i_init_func_execute_data(zend_execute_data *execu
} while (var != end);
}
- if (op_array->this_var != -1 && EX(object)) {
- ZVAL_OBJ(EX_VAR(op_array->this_var), EX(object));
- GC_REFCOUNT(EX(object))++;
+ if (op_array->this_var != -1 && Z_OBJ(EX(This))) {
+ ZVAL_OBJ(EX_VAR(op_array->this_var), Z_OBJ(EX(This)));
+ GC_REFCOUNT(Z_OBJ(EX(This)))++;
}
if (!op_array->run_time_cache && op_array->last_cache_slot) {
@@ -1497,7 +1492,6 @@ static zend_always_inline void i_init_func_execute_data(zend_execute_data *execu
static zend_always_inline void i_init_code_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value, vm_frame_kind frame_kind TSRMLS_DC) /* {{{ */
{
ZEND_ASSERT(EX(func) == (zend_function*)op_array);
- ZEND_ASSERT(EX(object) == Z_OBJ(EG(This)));
EX(opline) = op_array->opcodes;
EX(call) = NULL;
@@ -1521,7 +1515,6 @@ static zend_always_inline void i_init_code_execute_data(zend_execute_data *execu
static zend_always_inline void i_init_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value, vm_frame_kind frame_kind TSRMLS_DC) /* {{{ */
{
ZEND_ASSERT(EX(func) == (zend_function*)op_array);
- ZEND_ASSERT(EX(object) == Z_OBJ(EG(This)));
EX(opline) = op_array->opcodes;
EX(call) = NULL;
@@ -1578,9 +1571,9 @@ static zend_always_inline void i_init_execute_data(zend_execute_data *execute_da
} while (var != end);
}
- if (op_array->this_var != -1 && EX(object)) {
- ZVAL_OBJ(EX_VAR(op_array->this_var), EX(object));
- GC_REFCOUNT(EX(object))++;
+ if (op_array->this_var != -1 && Z_OBJ(EX(This))) {
+ ZVAL_OBJ(EX_VAR(op_array->this_var), Z_OBJ(EX(This)));
+ GC_REFCOUNT(Z_OBJ(EX(This)))++;
}
}
@@ -1623,7 +1616,7 @@ ZEND_API zend_execute_data *zend_create_generator_execute_data(zend_execute_data
num_args,
call->flags,
call->called_scope,
- call->object,
+ Z_OBJ(call->This),
NULL TSRMLS_CC);
EX(num_args) = num_args;