diff --git a/Library/Backends/ZendEngine2/Backend.php b/Library/Backends/ZendEngine2/Backend.php index 230bae3173..7193eb1432 100644 --- a/Library/Backends/ZendEngine2/Backend.php +++ b/Library/Backends/ZendEngine2/Backend.php @@ -185,6 +185,11 @@ public function getTypeDefinition($type) $code = 'zend_class_entry'; break; + case 'zephir_method_globals': + $pointer = '*'; + $code = 'zephir_method_globals'; + break; + case 'zephir_ce_guard': $code = 'zend_bool'; break; diff --git a/Library/ClassMethod.php b/Library/ClassMethod.php index 3b6efd1e4c..d3c9bdeca0 100644 --- a/Library/ClassMethod.php +++ b/Library/ClassMethod.php @@ -2042,7 +2042,7 @@ public function compile(CompilationContext $compilationContext) if ($symbolTable->getMustGrownStack()) { $code .= "\t".'zephir_fetch_params(1, '.$numberRequiredParams.', '.$numberOptionalParams.', '.implode(', ', $params).');'.PHP_EOL; } else { - $code .= "\t".'zephir_fetch_params(0, '.$numberRequiredParams.', '.$numberOptionalParams.', '.implode(', ', $params).');'.PHP_EOL; + $code .= "\t".'zephir_fetch_params_without_memory_grow('.$numberRequiredParams.', '.$numberOptionalParams.', '.implode(', ', $params).');'.PHP_EOL; } } else { foreach ($params as $param) { @@ -2089,6 +2089,14 @@ public function compile(CompilationContext $compilationContext) */ if ($symbolTable->getMustGrownStack()) { $compilationContext->headersManager->add('kernel/memory'); + if (!$compilationContext->symbolTable->hasVariable('ZEPHIR_METHOD_GLOBALS_PTR')) { + $methodGlobals = new Variable('zephir_method_globals', 'ZEPHIR_METHOD_GLOBALS_PTR', $compilationContext->branchManager->getCurrentBranch()); + $methodGlobals->setMustInitNull(true); + $methodGlobals->increaseUses(); + $methodGlobals->setReusable(false); + $methodGlobals->setReadOnly(true); + $compilationContext->symbolTable->addRawVariable($methodGlobals); + } $codePrinter->preOutput("\t".'ZEPHIR_MM_GROW();'); } diff --git a/Library/Expression/Constants.php b/Library/Expression/Constants.php index 8c8bb2ee13..02da991fdf 100644 --- a/Library/Expression/Constants.php +++ b/Library/Expression/Constants.php @@ -221,7 +221,11 @@ public function compile(array $expression, CompilationContext $compilationContex throw new CompilerException('Cannot use variable: '.$symbolVariable->getType().' to assign property value', $expression); } - $compilationContext->codePrinter->output('ZEPHIR_GET_CONSTANT('.$compilationContext->backend->getVariableCode($symbolVariable).', "'.$expression['value'].'");'); + if ($compilationContext->symbolTable->getMustGrownStack()) { + $compilationContext->codePrinter->output('ZEPHIR_MM_GET_CONSTANT('.$compilationContext->backend->getVariableCode($symbolVariable).', "'.$expression['value'].'");'); + } else { + $compilationContext->codePrinter->output('ZEPHIR_GET_CONSTANT('.$compilationContext->backend->getVariableCode($symbolVariable).', "'.$expression['value'].'");'); + } return new CompiledExpression('variable', $symbolVariable->getName(), $expression); } diff --git a/Library/Optimizers/FunctionCall/CreateSymbolTableOptimizer.php b/Library/Optimizers/FunctionCall/CreateSymbolTableOptimizer.php index 2160d502ef..e8639f47d6 100644 --- a/Library/Optimizers/FunctionCall/CreateSymbolTableOptimizer.php +++ b/Library/Optimizers/FunctionCall/CreateSymbolTableOptimizer.php @@ -57,9 +57,9 @@ public function optimize(array $expression, Call $call, CompilationContext $cont $symbolVariable->initVariant($context); } - $context->headersManager->add('kernel/memory'); + $context->symbolTable->mustGrownStack(true); - $context->codePrinter->output('zephir_create_symbol_table(TSRMLS_C);'); + $context->codePrinter->output('ZEPHIR_CREATE_SYMBOL_TABLE();'); $context->codePrinter->output(''); return new CompiledExpression('null', null, $expression); diff --git a/ext/kernel/exception.c b/ext/kernel/exception.c index 035c8e50af..13b77e6142 100644 --- a/ext/kernel/exception.c +++ b/ext/kernel/exception.c @@ -40,6 +40,7 @@ void zephir_throw_exception_debug(zval *object, const char *file, zend_uint line) { zend_class_entry *default_exception_ce; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; int ZEPHIR_LAST_CALL_STATUS = 0; zval curline; zval object_copy; @@ -86,7 +87,7 @@ void zephir_throw_exception_string_debug(zend_class_entry *ce, const char *messa ZVAL_STRINGL(&msg, message, message_len); - ZEPHIR_CALL_METHOD(NULL, &object, "__construct", NULL, 0, &msg); + ZEPHIR_CALL_METHOD_WITHOUT_OBSERVE(NULL, &object, "__construct", NULL, 0, &msg); if (line > 0) { default_exception_ce = zend_exception_get_default(); @@ -113,7 +114,7 @@ void zephir_throw_exception_string(zend_class_entry *ce, const char *message, ze ZVAL_STRINGL(&msg, message, message_len); - ZEPHIR_CALL_METHOD(NULL, &object, "__construct", NULL, 0, &msg); + ZEPHIR_CALL_METHOD_WITHOUT_OBSERVE(NULL, &object, "__construct", NULL, 0, &msg); if (ZEPHIR_LAST_CALL_STATUS != FAILURE) { zend_throw_exception_object(&object); @@ -141,7 +142,7 @@ void zephir_throw_exception_format(zend_class_entry *ce, const char *format, ... ZVAL_STRINGL(&msg, buffer, len); efree(buffer); - ZEPHIR_CALL_METHOD(NULL, &object, "__construct", NULL, 0, &msg); + ZEPHIR_CALL_METHOD_WITHOUT_OBSERVE(NULL, &object, "__construct", NULL, 0, &msg); if (ZEPHIR_LAST_CALL_STATUS != FAILURE) { zend_throw_exception_object(&object); diff --git a/ext/kernel/globals.h b/ext/kernel/globals.h index 60980b3c3f..c65845458f 100644 --- a/ext/kernel/globals.h +++ b/ext/kernel/globals.h @@ -23,32 +23,8 @@ #include -#define ZEPHIR_MAX_MEMORY_STACK 48 #define ZEPHIR_MAX_CACHE_SLOTS 512 -/** Memory frame */ -typedef struct _zephir_memory_entry { - size_t pointer; - size_t capacity; - zval **addresses; - size_t hash_pointer; - size_t hash_capacity; - zval **hash_addresses; - struct _zephir_memory_entry *prev; - struct _zephir_memory_entry *next; -#ifndef ZEPHIR_RELEASE - int permanent; - const char *func; -#endif -} zephir_memory_entry; - -/** Virtual Symbol Table */ -typedef struct _zephir_symbol_table { - struct _zephir_memory_entry *scope; - zend_array *symbol_table; - struct _zephir_symbol_table *prev; -} zephir_symbol_table; - typedef struct _zephir_function_cache { zend_class_entry *ce; zend_function *func; diff --git a/ext/kernel/main.h b/ext/kernel/main.h index a76681e9d8..b15b0e4d79 100644 --- a/ext/kernel/main.h +++ b/ext/kernel/main.h @@ -266,6 +266,11 @@ int zephir_fetch_parameters(int num_args, int required_args, int optional_args, } \ } +#define zephir_fetch_params_without_memory_grow(required_params, optional_params, ...) \ + if (zephir_fetch_parameters(ZEND_NUM_ARGS(), required_params, optional_params, __VA_ARGS__) == FAILURE) { \ + RETURN_NULL(); \ + } + #define ZEPHIR_CREATE_OBJECT(obj, class_type) \ { \ zend_object *object = zend_objects_new(class_type); \ @@ -277,7 +282,7 @@ int zephir_fetch_parameters(int num_args, int required_args, int optional_args, #define ZEPHIR_MAKE_REF(obj) ZVAL_NEW_REF(obj, obj); #define ZEPHIR_UNREF(obj) ZVAL_UNREF(obj); -#define ZEPHIR_GET_CONSTANT(return_value, const_name) do { \ +#define ZEPHIR_MM_GET_CONSTANT(return_value, const_name) do { \ zval *_constant_ptr = zend_get_constant_str(SL(const_name)); \ if (_constant_ptr == NULL) { \ ZEPHIR_MM_RESTORE(); \ @@ -286,6 +291,14 @@ int zephir_fetch_parameters(int num_args, int required_args, int optional_args, ZVAL_COPY(return_value, _constant_ptr); \ } while(0) +#define ZEPHIR_GET_CONSTANT(return_value, const_name) do { \ + zval *_constant_ptr = zend_get_constant_str(SL(const_name)); \ + if (_constant_ptr == NULL) { \ + return; \ + } \ + ZVAL_COPY(return_value, _constant_ptr); \ +} while(0) + #define ZEPHIR_GET_IMKEY(var, it) it->funcs->get_current_key(it, &var); /* Declare class constants */ diff --git a/ext/kernel/memory.c b/ext/kernel/memory.c index 1cb64ad6ed..3254b4d124 100644 --- a/ext/kernel/memory.c +++ b/ext/kernel/memory.c @@ -45,8 +45,7 @@ * Not all methods must grow/restore the zephir_memory_entry. */ -static zend_always_inline zend_execute_data* -find_symbol_table(zend_execute_data* ex) +static zend_always_inline zend_execute_data* find_symbol_table(zend_execute_data* ex) { while (ex && (!ex->func || !ZEND_USER_CODE(ex->func->common.type))) { ex = ex->prev_execute_data; @@ -55,46 +54,36 @@ find_symbol_table(zend_execute_data* ex) return ex; } -static zephir_memory_entry* zephir_memory_grow_stack_common(zend_zephir_globals_def *g) +/** + * Adds a memory frame in the current executed method + */ +void ZEPHIR_FASTCALL zephir_memory_grow_stack(zephir_method_globals *g, const char *func) { - assert(g->start_memory != NULL); - if (!g->active_memory) { - g->active_memory = g->start_memory; -#ifndef ZEPHIR_RELEASE - assert(g->active_memory->permanent == 1); -#endif - } - else if (!g->active_memory->next) { -#ifndef PHP_WIN32 - assert(g->active_memory >= g->end_memory - 1 || g->active_memory < g->start_memory); -#endif - zephir_memory_entry *entry = (zephir_memory_entry *) ecalloc(1, sizeof(zephir_memory_entry)); -#ifndef ZEPHIR_RELEASE - entry->permanent = 0; - entry->func = NULL; -#endif - entry->prev = g->active_memory; - entry->prev->next = entry; - g->active_memory = entry; - } - else { -#ifndef ZEPHIR_RELEASE - assert(g->active_memory->permanent == 1); -#endif - assert(g->active_memory < g->end_memory && g->active_memory >= g->start_memory); - g->active_memory = g->active_memory->next; + zephir_memory_entry *entry; + if (g->active_memory == NULL) { + zephir_memory_entry *active_memory; + size_t i; + + active_memory = (zephir_memory_entry *) pecalloc(1, sizeof(zephir_memory_entry), 1); + + active_memory->addresses = pecalloc(24, sizeof(zval*), 1); + active_memory->capacity = 24; + active_memory->hash_addresses = pecalloc(8, sizeof(zval*), 1); + active_memory->hash_capacity = 8; + + g->active_memory = active_memory; } + assert(g->active_memory != NULL); assert(g->active_memory->pointer == 0); assert(g->active_memory->hash_pointer == 0); - return g->active_memory; +#ifndef ZEPHIR_RELEASE + g->active_memory->func = func; +#endif } -/** - * Restore a memory stack applying GC to all observed variables - */ -static void zephir_memory_restore_stack_common(zend_zephir_globals_def *g) +void zephir_memory_restore_stack(zephir_method_globals *g, const char *func) { size_t i; zephir_memory_entry *prev, *active_memory; @@ -104,6 +93,24 @@ static void zephir_memory_restore_stack_common(zend_zephir_globals_def *g) int show_backtrace = 0; #endif +#ifndef ZEPHIR_RELEASE + if (UNEXPECTED(g->active_memory == NULL)) { + fprintf(stderr, "WARNING: calling zephir_memory_restore_stack() without an active memory frame!\n"); + fprintf(stderr, "The frame was created by %s\n", g->active_memory->func); + fprintf(stderr, "Calling function: %s\n", func); + zephir_print_backtrace(); + return; + } + + if (UNEXPECTED(g->active_memory->func != func)) { + fprintf(stderr, "Trying to free someone else's memory frame!\n"); + fprintf(stderr, "The frame was created by %s\n", g->active_memory->func); + fprintf(stderr, "Calling function: %s\n", func); + zephir_print_backtrace(); + return; + } +#endif + active_memory = g->active_memory; assert(active_memory != NULL); @@ -186,156 +193,29 @@ static void zephir_memory_restore_stack_common(zend_zephir_globals_def *g) active_memory->func = NULL; #endif - prev = active_memory->prev; - - if (active_memory >= g->end_memory || active_memory < g->start_memory) { -#ifndef ZEPHIR_RELEASE - assert(g->active_memory->permanent == 0); -#endif - assert(prev != NULL); - - if (active_memory->hash_addresses != NULL) { - efree(active_memory->hash_addresses); - } - - if (active_memory->addresses != NULL) { - efree(active_memory->addresses); - } - - efree(g->active_memory); - g->active_memory = prev; - prev->next = NULL; - } else { -#ifndef ZEPHIR_RELEASE - assert(g->active_memory->permanent == 1); -#endif - active_memory->pointer = 0; - active_memory->hash_pointer = 0; - g->active_memory = prev; - } - -#ifndef ZEPHIR_RELEASE - if (g->active_memory) { - zephir_memory_entry *f = g->active_memory; - if (f >= g->start_memory && f < g->end_memory - 1) { - assert(f->permanent == 1); - assert(f->next != NULL); - - if (f > g->start_memory) { - assert(f->prev != NULL); - } - } + if (active_memory->hash_addresses != NULL) { + pefree(active_memory->hash_addresses, 1); } - if (show_backtrace == 1) { - zephir_print_backtrace(); + if (active_memory->addresses != NULL) { + pefree(active_memory->addresses, 1); } -#endif -} + pefree(g->active_memory, 1); + g->active_memory = NULL; #ifndef ZEPHIR_RELEASE -/** - * Finishes the current memory stack by releasing allocated memory - */ -int ZEPHIR_FASTCALL zephir_memory_restore_stack(const char *func) -{ - zend_zephir_globals_def *zephir_globals_ptr = ZEPHIR_VGLOBAL; - - if (UNEXPECTED(zephir_globals_ptr->active_memory == NULL)) { - fprintf(stderr, "WARNING: calling zephir_memory_restore_stack() without an active memory frame!\n"); - zephir_print_backtrace(); - return FAILURE; - } - - if (UNEXPECTED(zephir_globals_ptr->active_memory->func != func)) { - fprintf(stderr, "Trying to free someone else's memory frame!\n"); - fprintf(stderr, "The frame was created by %s\n", zephir_globals_ptr->active_memory->func); - fprintf(stderr, "Calling function: %s\n", func); + if (show_backtrace == 1) { zephir_print_backtrace(); - return FAILURE; } - - zephir_memory_restore_stack_common(zephir_globals_ptr); - return SUCCESS; -} - -/** - * Adds a memory frame in the current executed method - */ -void ZEPHIR_FASTCALL zephir_memory_grow_stack(const char *func) -{ - zephir_memory_entry *entry; - zend_zephir_globals_def *g = ZEPHIR_VGLOBAL; - if (g->start_memory == NULL) { - zephir_initialize_memory(g); - } - entry = zephir_memory_grow_stack_common(g); - entry->func = func; -} - -#else - -/** - * Adds a memory frame in the current executed method - */ -void ZEPHIR_FASTCALL zephir_memory_grow_stack() -{ - zend_zephir_globals_def *g = ZEPHIR_VGLOBAL; - if (g->start_memory == NULL) { - zephir_initialize_memory(g); - } - zephir_memory_grow_stack_common(g); -} - -/** - * Finishes the current memory stack by releasing allocated memory - */ -int ZEPHIR_FASTCALL zephir_memory_restore_stack() -{ - zephir_memory_restore_stack_common(ZEPHIR_VGLOBAL); - return SUCCESS; -} - #endif +} /** * Pre-allocates memory for further use in execution */ void zephir_initialize_memory(zend_zephir_globals_def *zephir_globals_ptr) { - zephir_memory_entry *start; - size_t i; - - start = (zephir_memory_entry *) pecalloc(ZEPHIR_NUM_PREALLOCATED_FRAMES, sizeof(zephir_memory_entry), 1); -/* pecalloc() will take care of these members for every frame - start->pointer = 0; - start->hash_pointer = 0; - start->prev = NULL; - start->next = NULL; -*/ - for (i = 0; i < ZEPHIR_NUM_PREALLOCATED_FRAMES; ++i) { - start[i].addresses = pecalloc(24, sizeof(zval*), 1); - start[i].capacity = 24; - start[i].hash_addresses = pecalloc(8, sizeof(zval*), 1); - start[i].hash_capacity = 8; - -#ifndef ZEPHIR_RELEASE - start[i].permanent = 1; -#endif - } - - start[0].next = &start[1]; - start[ZEPHIR_NUM_PREALLOCATED_FRAMES - 1].prev = &start[ZEPHIR_NUM_PREALLOCATED_FRAMES - 2]; - - for (i = 1; i < ZEPHIR_NUM_PREALLOCATED_FRAMES - 1; ++i) { - start[i].next = &start[i + 1]; - start[i].prev = &start[i - 1]; - } - - zephir_globals_ptr->start_memory = start; - zephir_globals_ptr->end_memory = start + ZEPHIR_NUM_PREALLOCATED_FRAMES; - zephir_globals_ptr->fcache = pemalloc(sizeof(HashTable), 1); zend_hash_init(zephir_globals_ptr->fcache, 128, NULL, NULL, 1); // zephir_fcall_cache_dtor @@ -355,40 +235,6 @@ void zephir_deinitialize_memory() return; } - if (zephir_globals_ptr->start_memory != NULL) { - zephir_clean_restore_stack(); - } - -// { -// size_t i; -// for (i=0; iscache[i]; -// if (e) { -// free(e); -// } -// } -// zephir_fcall_cache_entry *cache_entry_temp = NULL; -// ZEND_HASH_FOREACH_PTR(zephir_globals_ptr->fcache, cache_entry_temp) { -// free(cache_entry_temp); -// } ZEND_HASH_FOREACH_END(); -// } - -#if 0 - zend_hash_apply_with_arguments(zephir_globals_ptr->fcache, zephir_cleanup_fcache, 0); -#endif - -#ifndef ZEPHIR_RELEASE - assert(zephir_globals_ptr->start_memory != NULL); -#endif - - for (i = 0; i < ZEPHIR_NUM_PREALLOCATED_FRAMES; ++i) { - pefree(zephir_globals_ptr->start_memory[i].hash_addresses, 1); - pefree(zephir_globals_ptr->start_memory[i].addresses, 1); - } - - pefree(zephir_globals_ptr->start_memory, 1); - zephir_globals_ptr->start_memory = NULL; - zend_hash_destroy(zephir_globals_ptr->fcache); pefree(zephir_globals_ptr->fcache, 1); zephir_globals_ptr->fcache = NULL; @@ -399,10 +245,9 @@ void zephir_deinitialize_memory() /** * Creates a virtual symbol tables dynamically */ -void zephir_create_symbol_table() +void zephir_create_symbol_table(zephir_method_globals *gptr) { zephir_symbol_table *entry; - zend_zephir_globals_def *gptr = ZEPHIR_VGLOBAL; zend_array *symbol_table; #ifndef ZEPHIR_RELEASE @@ -513,25 +358,7 @@ int zephir_cleanup_fcache(void *pDest, int num_args, va_list args, zend_hash_key return ZEND_HASH_APPLY_KEEP; } -ZEPHIR_ATTR_NONNULL static void zephir_reallocate_memory(const zend_zephir_globals_def *g) -{ - zephir_memory_entry *frame = g->active_memory; - int persistent = (frame >= g->start_memory && frame < g->end_memory); - void *buf = perealloc(frame->addresses, sizeof(zval *) * (frame->capacity + 16), persistent); - if (EXPECTED(buf != NULL)) { - frame->capacity += 16; - frame->addresses = buf; - } - else { - zend_error(E_CORE_ERROR, "Memory allocation failed"); - } - -#ifndef ZEPHIR_RELEASE - assert(frame->permanent == persistent); -#endif -} - -ZEPHIR_ATTR_NONNULL1(2) static inline void zephir_do_memory_observe(zval *var, const zend_zephir_globals_def *g) +void zephir_do_memory_observe(zval *var, const zephir_method_globals *g) { zephir_memory_entry *frame = g->active_memory; #ifndef ZEPHIR_RELEASE @@ -543,7 +370,14 @@ ZEPHIR_ATTR_NONNULL1(2) static inline void zephir_do_memory_observe(zval *var, c #endif if (UNEXPECTED(frame->pointer == frame->capacity)) { - zephir_reallocate_memory(g); + void *buf = perealloc(frame->addresses, sizeof(zval *) * (frame->capacity + 16), 1); + if (EXPECTED(buf != NULL)) { + frame->capacity += 16; + frame->addresses = buf; + } else { + zend_error(E_CORE_ERROR, "Memory allocation failed"); + return; + } } #ifndef ZEPHIR_RELEASE @@ -562,104 +396,3 @@ ZEPHIR_ATTR_NONNULL1(2) static inline void zephir_do_memory_observe(zval *var, c frame->addresses[frame->pointer] = var; ++frame->pointer; } - -/** - * Observes a memory pointer to release its memory at the end of the request - */ -void ZEPHIR_FASTCALL zephir_memory_observe(zval *var) -{ - zend_zephir_globals_def *g = ZEPHIR_VGLOBAL; - zephir_do_memory_observe(var, g); -} - -/** - * Observes a variable and allocates memory for it - */ -void ZEPHIR_FASTCALL zephir_memory_alloc(zval *var) -{ - zend_zephir_globals_def *g = ZEPHIR_VGLOBAL; - zephir_do_memory_observe(var, g); - ZVAL_NULL(var); -} - -/** - * Cleans the zephir memory stack recursively - */ -int ZEPHIR_FASTCALL zephir_clean_restore_stack() { - - zend_zephir_globals_def *zephir_globals_ptr = ZEPHIR_VGLOBAL; - - while (zephir_globals_ptr->active_memory != NULL) { - zephir_memory_restore_stack_common(zephir_globals_ptr); - } - - return SUCCESS; -} - -/* Debugging */ -#ifndef ZEPHIR_RELEASE - -/** - * Dumps a memory frame for debug purposes - */ -void zephir_dump_memory_frame(zephir_memory_entry *active_memory) -{ - size_t i; - - assert(active_memory != NULL); - - fprintf(stderr, "Dump of the memory frame %p (%s)\n", active_memory, active_memory->func); - - if (active_memory->hash_pointer) { - for (i = 0; i < active_memory->hash_pointer; ++i) { - assert(active_memory->hash_addresses[i] != NULL); - fprintf(stderr, "Hash ptr %lu (%p), type=%u, refcnted=%d, refcnt=%u\n", (ulong)i, active_memory->hash_addresses[i], Z_TYPE_P(active_memory->hash_addresses[i]), - Z_REFCOUNTED_P(active_memory->hash_addresses[i]), - Z_REFCOUNTED_P(active_memory->hash_addresses[i]) ? Z_REFCOUNT_P(active_memory->hash_addresses[i]) : 0 - ); - } - } - - for (i = 0; i < active_memory->pointer; ++i) { - if (EXPECTED(active_memory->addresses[i] != NULL)) { - zval *var = active_memory->addresses[i]; - fprintf(stderr, "Obs var %lu (%p), type=%u, refcnted=%d, refcnt=%u; ", (ulong)i, var, Z_TYPE_P(var), Z_REFCOUNTED_P(var), Z_REFCOUNTED_P(var) ? Z_REFCOUNT_P(var) : 0); - switch (Z_TYPE_P(var)) { - case IS_NULL: fprintf(stderr, "value=NULL\n"); break; -#ifdef ZEPHIR_ENABLE_64BITS - case IS_LONG: fprintf(stderr, "value=%lld\n", (long long int)Z_LVAL_P(var)); break; -#else - case IS_LONG: fprintf(stderr, "value=%ld\n", Z_LVAL_P(var)); break; -#endif - case IS_DOUBLE: fprintf(stderr, "value=%E\n", Z_DVAL_P(var)); break; - case IS_TRUE: fprintf(stderr, "value=(bool)true\n"); break; - case IS_FALSE: fprintf(stderr, "value=(bool)false\n"); break; - case IS_ARRAY: fprintf(stderr, "value=array(%p), %d elements\n", Z_ARRVAL_P(var), zend_hash_num_elements(Z_ARRVAL_P(var))); break; - case IS_OBJECT: fprintf(stderr, "value=object(%u), %s\n", Z_OBJ_HANDLE_P(var), ZSTR_VAL(Z_OBJCE_P(var)->name)); break; - case IS_STRING: fprintf(stderr, "value=%s (%zu)\n", Z_STRVAL_P(var), Z_STRLEN_P(var)); break; -#ifdef ZEPHIR_ENABLE_64BITS - case IS_RESOURCE: fprintf(stderr, "value=(resource)%lld\n", (long long int)Z_LVAL_P(var)); break; -#else - case IS_RESOURCE: fprintf(stderr, "value=(resource)%ld\n", Z_LVAL_P(var)); break; -#endif - default: fprintf(stderr, "\n"); break; - } - } - } - - fprintf(stderr, "End of the dump of the memory frame %p\n", active_memory); -} - -void zephir_dump_current_frame() -{ - zend_zephir_globals_def *zephir_globals_ptr = ZEPHIR_VGLOBAL; - - if (UNEXPECTED(zephir_globals_ptr->active_memory == NULL)) { - fprintf(stderr, "WARNING: calling %s() without an active memory frame!\n", __func__); - zephir_print_backtrace(); - return; - } - - zephir_dump_memory_frame(zephir_globals_ptr->active_memory); -} -#endif diff --git a/ext/kernel/memory.h b/ext/kernel/memory.h index d50802ee62..d530d183c3 100644 --- a/ext/kernel/memory.h +++ b/ext/kernel/memory.h @@ -32,42 +32,70 @@ #define ZEPHIR_NUM_PREALLOCATED_FRAMES 25 -void zephir_initialize_memory(zend_zephir_globals_def *zephir_globals_ptr); -int zephir_cleanup_fcache(void *pDest, int num_args, va_list args, zend_hash_key *hash_key); -void zephir_deinitialize_memory(); - -/* Memory Frames */ +/** Memory frame */ +typedef struct _zephir_memory_entry { + size_t pointer; + size_t capacity; + zval **addresses; + size_t hash_pointer; + size_t hash_capacity; + zval **hash_addresses; #ifndef ZEPHIR_RELEASE -void ZEPHIR_FASTCALL zephir_memory_grow_stack(const char *func); -int ZEPHIR_FASTCALL zephir_memory_restore_stack(const char *func); + int permanent; + const char *func; +#endif +} zephir_memory_entry; -#define ZEPHIR_MM_GROW() zephir_memory_grow_stack(NULL) -#define ZEPHIR_MM_RESTORE() zephir_memory_restore_stack(NULL) +/** Virtual Symbol Table */ +typedef struct _zephir_symbol_table { + struct _zephir_memory_entry *scope; + zend_array *symbol_table; + struct _zephir_symbol_table *prev; +} zephir_symbol_table; -#else -void ZEPHIR_FASTCALL zephir_memory_grow_stack(); -int ZEPHIR_FASTCALL zephir_memory_restore_stack(); +typedef struct _zephir_method_globals { + /* Memory */ + zephir_memory_entry *active_memory; /**< The current memory frame */ -#define ZEPHIR_MM_GROW() zephir_memory_grow_stack() -#define ZEPHIR_MM_RESTORE() zephir_memory_restore_stack() + /* Virtual Symbol Tables */ + zephir_symbol_table *active_symbol_table; +} zephir_method_globals; -#endif +/* Memory Frames */ +void ZEPHIR_FASTCALL zephir_memory_grow_stack(zephir_method_globals *g, const char *func); +void ZEPHIR_FASTCALL zephir_memory_restore_stack(zephir_method_globals *g, const char *func); + +#define ZEPHIR_MM_GROW() \ + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 1); \ + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); + +#define ZEPHIR_MM_RESTORE() \ + zephir_memory_restore_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); \ + pefree(ZEPHIR_METHOD_GLOBALS_PTR, 1); \ + ZEPHIR_METHOD_GLOBALS_PTR = NULL; + +void zephir_initialize_memory(zend_zephir_globals_def *zephir_globals_ptr); +int zephir_cleanup_fcache(void *pDest, int num_args, va_list args, zend_hash_key *hash_key); +void zephir_deinitialize_memory(); #define zephir_dtor(x) zval_dtor(x) #define zephir_ptr_dtor(x) zval_ptr_dtor(x) -void ZEPHIR_FASTCALL zephir_memory_observe(zval *var); -void ZEPHIR_FASTCALL zephir_memory_alloc(zval *var); - -int ZEPHIR_FASTCALL zephir_clean_restore_stack(); +void zephir_do_memory_observe(zval *var, const zephir_method_globals *g); +#define zephir_memory_observe(var) zephir_do_memory_observe(var, ZEPHIR_METHOD_GLOBALS_PTR); #define zephir_safe_zval_ptr_dtor(pzval) -void zephir_create_symbol_table(); +void zephir_create_symbol_table(zephir_method_globals *g); + +#define ZEPHIR_CREATE_SYMBOL_TABLE() zephir_create_symbol_table(ZEPHIR_METHOD_GLOBALS_PTR); + int zephir_set_symbol(zval *key_name, zval *value); int zephir_set_symbol_str(char *key_name, unsigned int key_length, zval *value); -#define ZEPHIR_INIT_VAR(z) zephir_memory_alloc(z); +#define ZEPHIR_INIT_VAR(z) \ + zephir_memory_observe(z); \ + ZVAL_NULL(z); #define ZEPHIR_SINIT_VAR(z) ZVAL_NULL(&z); diff --git a/ext/php_test.h b/ext/php_test.h index 133b5bd79d..1ff1d0fb7c 100644 --- a/ext/php_test.h +++ b/ext/php_test.h @@ -38,14 +38,6 @@ ZEND_BEGIN_MODULE_GLOBALS(test) int initialized; - /* Memory */ - zephir_memory_entry *start_memory; /**< The first preallocated frame */ - zephir_memory_entry *end_memory; /**< The last preallocate frame */ - zephir_memory_entry *active_memory; /**< The current memory frame */ - - /* Virtual Symbol Tables */ - zephir_symbol_table *active_symbol_table; - /** Function cache */ HashTable *fcache; diff --git a/ext/test.c b/ext/test.c index 269245a683..862bc262fd 100644 --- a/ext/test.c +++ b/ext/test.c @@ -436,12 +436,6 @@ static void php_zephir_init_globals(zend_test_globals *test_globals TSRMLS_DC) { test_globals->initialized = 0; - /* Memory options */ - test_globals->active_memory = NULL; - - /* Virtual Symbol Tables */ - test_globals->active_symbol_table = NULL; - /* Cache Enabled */ test_globals->cache_enabled = 1; diff --git a/ext/test/0__closure.zep.c b/ext/test/0__closure.zep.c index 825f537a5b..850a02219c 100644 --- a/ext/test/0__closure.zep.c +++ b/ext/test/0__closure.zep.c @@ -32,7 +32,7 @@ PHP_METHOD(test_0__closure, __invoke) { ZVAL_UNDEF(&x_sub); - zephir_fetch_params(0, 1, 0, &x); + zephir_fetch_params_without_memory_grow(1, 0, &x); diff --git a/ext/test/10__closure.zep.c b/ext/test/10__closure.zep.c index 2976ea6dee..337f5eb6c4 100644 --- a/ext/test/10__closure.zep.c +++ b/ext/test/10__closure.zep.c @@ -32,7 +32,7 @@ PHP_METHOD(test_10__closure, __invoke) { ZVAL_UNDEF(&x_sub); - zephir_fetch_params(0, 1, 0, &x); + zephir_fetch_params_without_memory_grow(1, 0, &x); diff --git a/ext/test/12__closure.zep.c b/ext/test/12__closure.zep.c index bd1a35c6b7..025a06ce11 100644 --- a/ext/test/12__closure.zep.c +++ b/ext/test/12__closure.zep.c @@ -27,6 +27,7 @@ ZEPHIR_INIT_CLASS(test_12__closure) { PHP_METHOD(test_12__closure, __invoke) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *this_ptr = getThis(); diff --git a/ext/test/3__closure.zep.c b/ext/test/3__closure.zep.c index 1f3f13ebce..5c0b2b441c 100644 --- a/ext/test/3__closure.zep.c +++ b/ext/test/3__closure.zep.c @@ -31,7 +31,7 @@ PHP_METHOD(test_3__closure, __invoke) { ZVAL_UNDEF(¶m1_sub); - zephir_fetch_params(0, 1, 0, ¶m1); + zephir_fetch_params_without_memory_grow(1, 0, ¶m1); diff --git a/ext/test/4__closure.zep.c b/ext/test/4__closure.zep.c index ed19a1277b..8f61a31a00 100644 --- a/ext/test/4__closure.zep.c +++ b/ext/test/4__closure.zep.c @@ -31,7 +31,7 @@ PHP_METHOD(test_4__closure, __invoke) { ZVAL_UNDEF(¶m1_sub); - zephir_fetch_params(0, 1, 0, ¶m1); + zephir_fetch_params_without_memory_grow(1, 0, ¶m1); diff --git a/ext/test/5__closure.zep.c b/ext/test/5__closure.zep.c index 3f04a6744c..a1a8436c7d 100644 --- a/ext/test/5__closure.zep.c +++ b/ext/test/5__closure.zep.c @@ -31,7 +31,7 @@ PHP_METHOD(test_5__closure, __invoke) { ZVAL_UNDEF(¶m1_sub); - zephir_fetch_params(0, 1, 0, ¶m1); + zephir_fetch_params_without_memory_grow(1, 0, ¶m1); diff --git a/ext/test/6__closure.zep.c b/ext/test/6__closure.zep.c index 4370bfa940..eacf0bf961 100644 --- a/ext/test/6__closure.zep.c +++ b/ext/test/6__closure.zep.c @@ -32,7 +32,7 @@ PHP_METHOD(test_6__closure, __invoke) { ZVAL_UNDEF(&x_sub); - zephir_fetch_params(0, 1, 0, &x); + zephir_fetch_params_without_memory_grow(1, 0, &x); diff --git a/ext/test/7__closure.zep.c b/ext/test/7__closure.zep.c index 912ddcf5f8..bd952c9641 100644 --- a/ext/test/7__closure.zep.c +++ b/ext/test/7__closure.zep.c @@ -32,7 +32,7 @@ PHP_METHOD(test_7__closure, __invoke) { ZVAL_UNDEF(&x_sub); - zephir_fetch_params(0, 1, 0, &x); + zephir_fetch_params_without_memory_grow(1, 0, &x); diff --git a/ext/test/arithmetic.zep.c b/ext/test/arithmetic.zep.c index 706036bd66..2dbf5be615 100644 --- a/ext/test/arithmetic.zep.c +++ b/ext/test/arithmetic.zep.c @@ -126,6 +126,7 @@ PHP_METHOD(Test_Arithmetic, boolSumExpression) { zval _0, _1; zend_bool a = 0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -197,6 +198,7 @@ PHP_METHOD(Test_Arithmetic, doubleSum2Simple) { PHP_METHOD(Test_Arithmetic, doubleSumExpression) { zval _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -216,6 +218,7 @@ PHP_METHOD(Test_Arithmetic, doubleSumVarExpression) { zval _0, _1; double a = 0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -344,6 +347,7 @@ PHP_METHOD(Test_Arithmetic, intVarImplicitCastSum) { zend_long c = 0; zval a, b, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -367,6 +371,7 @@ PHP_METHOD(Test_Arithmetic, intVarImplicitCast2Sum) { zend_long b = 0, c = 0; zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -420,6 +425,7 @@ PHP_METHOD(Test_Arithmetic, complex3Sum) { PHP_METHOD(Test_Arithmetic, complex4Sum) { zval c; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&c); @@ -1046,6 +1052,7 @@ PHP_METHOD(Test_Arithmetic, addSum22) { zend_long b = 0, _0; zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -1077,6 +1084,7 @@ PHP_METHOD(Test_Arithmetic, addSum23) { PHP_METHOD(Test_Arithmetic, addSum24) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *a, a_sub, _0; zval *this_ptr = getThis(); @@ -1379,6 +1387,7 @@ PHP_METHOD(Test_Arithmetic, intVarImplicitCastSub) { zend_long c = 0; zval a, b, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -1402,6 +1411,7 @@ PHP_METHOD(Test_Arithmetic, intVarImplicitCast2Sub) { zend_long b = 0, c = 0; zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -1455,6 +1465,7 @@ PHP_METHOD(Test_Arithmetic, complex3Sub) { PHP_METHOD(Test_Arithmetic, complex4Sub) { zval c; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&c); @@ -2081,6 +2092,7 @@ PHP_METHOD(Test_Arithmetic, sub22) { zend_long b = 0, _0; zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -2112,6 +2124,7 @@ PHP_METHOD(Test_Arithmetic, sub23) { PHP_METHOD(Test_Arithmetic, sub24) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *a, a_sub, _0; zval *this_ptr = getThis(); @@ -2147,6 +2160,7 @@ PHP_METHOD(Test_Arithmetic, mul1) { PHP_METHOD(Test_Arithmetic, mul2) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *a, a_sub, _0; zval *this_ptr = getThis(); @@ -2213,7 +2227,7 @@ PHP_METHOD(Test_Arithmetic, less3) { ZVAL_UNDEF(&a_sub); - zephir_fetch_params(0, 1, 0, &a); + zephir_fetch_params_without_memory_grow(1, 0, &a); @@ -2228,7 +2242,7 @@ PHP_METHOD(Test_Arithmetic, less4) { ZVAL_UNDEF(&a_sub); - zephir_fetch_params(0, 1, 0, &a); + zephir_fetch_params_without_memory_grow(1, 0, &a); @@ -2269,7 +2283,7 @@ PHP_METHOD(Test_Arithmetic, greater3) { ZVAL_UNDEF(&a_sub); - zephir_fetch_params(0, 1, 0, &a); + zephir_fetch_params_without_memory_grow(1, 0, &a); @@ -2284,7 +2298,7 @@ PHP_METHOD(Test_Arithmetic, greater4) { ZVAL_UNDEF(&a_sub); - zephir_fetch_params(0, 1, 0, &a); + zephir_fetch_params_without_memory_grow(1, 0, &a); @@ -2327,7 +2341,7 @@ PHP_METHOD(Test_Arithmetic, letStatementBoolMinus) { ZVAL_UNDEF(&b_sub); - zephir_fetch_params(0, 1, 0, &b); + zephir_fetch_params_without_memory_grow(1, 0, &b); @@ -2339,6 +2353,7 @@ PHP_METHOD(Test_Arithmetic, letStatementBoolMinus) { PHP_METHOD(Test_Arithmetic, letStatementVarMinus) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *b, b_sub, a; zval *this_ptr = getThis(); diff --git a/ext/test/arrayaccessobj.zep.c b/ext/test/arrayaccessobj.zep.c index d4fdc30b3f..df44a91c9e 100644 --- a/ext/test/arrayaccessobj.zep.c +++ b/ext/test/arrayaccessobj.zep.c @@ -31,6 +31,7 @@ ZEPHIR_INIT_CLASS(Test_ArrayAccessObj) { PHP_METHOD(Test_ArrayAccessObj, __construct) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -55,7 +56,7 @@ PHP_METHOD(Test_ArrayAccessObj, offsetSet) { ZVAL_UNDEF(&offset_sub); ZVAL_UNDEF(&value_sub); - zephir_fetch_params(0, 2, 0, &offset, &value); + zephir_fetch_params_without_memory_grow(2, 0, &offset, &value); @@ -75,7 +76,7 @@ PHP_METHOD(Test_ArrayAccessObj, offsetExists) { ZVAL_UNDEF(&offset_sub); ZVAL_UNDEF(&_0); - zephir_fetch_params(0, 1, 0, &offset); + zephir_fetch_params_without_memory_grow(1, 0, &offset); @@ -92,7 +93,7 @@ PHP_METHOD(Test_ArrayAccessObj, offsetUnset) { ZVAL_UNDEF(&offset_sub); ZVAL_UNDEF(&_0); - zephir_fetch_params(0, 1, 0, &offset); + zephir_fetch_params_without_memory_grow(1, 0, &offset); @@ -103,6 +104,7 @@ PHP_METHOD(Test_ArrayAccessObj, offsetUnset) { PHP_METHOD(Test_ArrayAccessObj, offsetGet) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *offset, offset_sub, _0, _1, _2; zval *this_ptr = getThis(); diff --git a/ext/test/arrayaccesstest.zep.c b/ext/test/arrayaccesstest.zep.c index e0460fc77c..916b267c5d 100644 --- a/ext/test/arrayaccesstest.zep.c +++ b/ext/test/arrayaccesstest.zep.c @@ -29,6 +29,7 @@ ZEPHIR_INIT_CLASS(Test_ArrayAccessTest) { PHP_METHOD(Test_ArrayAccessTest, exits) { zval arr; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -47,6 +48,7 @@ PHP_METHOD(Test_ArrayAccessTest, exits) { PHP_METHOD(Test_ArrayAccessTest, get) { zval arr, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); diff --git a/ext/test/arrayiterator.zep.c b/ext/test/arrayiterator.zep.c index a06abf465c..d47cabd07e 100644 --- a/ext/test/arrayiterator.zep.c +++ b/ext/test/arrayiterator.zep.c @@ -34,6 +34,7 @@ PHP_METHOD(Test_ArrayIterator, __construct) { zval _1, _2; zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -78,6 +79,7 @@ PHP_METHOD(Test_ArrayIterator, rewind) { PHP_METHOD(Test_ArrayIterator, current) { zval _0, _1, _2; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); diff --git a/ext/test/arrayiteratortest.zep.c b/ext/test/arrayiteratortest.zep.c index 4c3a036658..4f7678ef87 100644 --- a/ext/test/arrayiteratortest.zep.c +++ b/ext/test/arrayiteratortest.zep.c @@ -31,6 +31,7 @@ PHP_METHOD(Test_ArrayIteratorTest, test) { zend_string *_3; zend_ulong _2; zval arr, k, v, *_0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); diff --git a/ext/test/arraysearch.zep.c b/ext/test/arraysearch.zep.c index cc0e846f05..1f1114a16b 100644 --- a/ext/test/arraysearch.zep.c +++ b/ext/test/arraysearch.zep.c @@ -30,6 +30,7 @@ ZEPHIR_INIT_CLASS(Test_ArraySearch) { /** @issue https://github.com/phalcon/zephir/issues/1609 */ PHP_METHOD(Test_ArraySearch, simpleSearch) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zend_bool strict; zval haystack; @@ -63,6 +64,7 @@ PHP_METHOD(Test_ArraySearch, searchUsingArrayInsideZephir) { zval _0, pos; zval itoA64; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); diff --git a/ext/test/assign.zep.c b/ext/test/assign.zep.c index 08d2299a1c..677ef60373 100644 --- a/ext/test/assign.zep.c +++ b/ext/test/assign.zep.c @@ -284,6 +284,7 @@ PHP_METHOD(Test_Assign, testAssign19) { PHP_METHOD(Test_Assign, testAssign20) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -518,6 +519,7 @@ PHP_METHOD(Test_Assign, testAssign37) { zval _1, _4; zval v, arr, _0, _2, _3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&v); @@ -570,6 +572,7 @@ PHP_METHOD(Test_Assign, testAssign37) { PHP_METHOD(Test_Assign, testAssign38) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *index, index_sub, arr, _0; zval *this_ptr = getThis(); @@ -594,6 +597,7 @@ PHP_METHOD(Test_Assign, testAssign38) { PHP_METHOD(Test_Assign, testAssign39) { zval a, b, c; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -619,6 +623,7 @@ PHP_METHOD(Test_Assign, testAssign39) { PHP_METHOD(Test_Assign, testAssign40) { zval a, b; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -649,7 +654,7 @@ PHP_METHOD(Test_Assign, testAssign41) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &num_param); + zephir_fetch_params_without_memory_grow(1, 0, &num_param); num = zephir_get_intval(num_param); @@ -670,7 +675,7 @@ PHP_METHOD(Test_Assign, testAssign42) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &num_param); + zephir_fetch_params_without_memory_grow(1, 0, &num_param); num = zephir_get_intval(num_param); @@ -688,7 +693,7 @@ PHP_METHOD(Test_Assign, testAssign43) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &num_param); + zephir_fetch_params_without_memory_grow(1, 0, &num_param); num = zephir_get_intval(num_param); @@ -706,7 +711,7 @@ PHP_METHOD(Test_Assign, testAssign44) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &num_param); + zephir_fetch_params_without_memory_grow(1, 0, &num_param); num = zephir_get_intval(num_param); @@ -719,6 +724,7 @@ PHP_METHOD(Test_Assign, testAssign44) { PHP_METHOD(Test_Assign, testPropertyAssign1) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, __$true, __$false, _0, _1; zval *this_ptr = getThis(); @@ -768,6 +774,7 @@ PHP_METHOD(Test_Assign, testPropertyAssign2) { zend_bool d; double b; zend_long a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$true, __$false, c, _0; zval *this_ptr = getThis(); @@ -826,6 +833,7 @@ PHP_METHOD(Test_Assign, testPropertyIncr1) { PHP_METHOD(Test_Assign, testPropertyAddAssign1) { zval _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -848,6 +856,7 @@ PHP_METHOD(Test_Assign, testPropertyAddAssign1) { PHP_METHOD(Test_Assign, testPropertyAddAssign2) { zval _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -906,6 +915,7 @@ PHP_METHOD(Test_Assign, testPropertyDecr) { PHP_METHOD(Test_Assign, testPropertySubAssign1) { zval _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -928,6 +938,7 @@ PHP_METHOD(Test_Assign, testPropertySubAssign1) { PHP_METHOD(Test_Assign, testPropertySubAssign2) { zval _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -950,6 +961,7 @@ PHP_METHOD(Test_Assign, testPropertySubAssign2) { PHP_METHOD(Test_Assign, testPropertyMulAssign1) { zval _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -972,6 +984,7 @@ PHP_METHOD(Test_Assign, testPropertyMulAssign1) { PHP_METHOD(Test_Assign, testPropertyMulAssign2) { zval _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -994,6 +1007,7 @@ PHP_METHOD(Test_Assign, testPropertyMulAssign2) { PHP_METHOD(Test_Assign, testPropertyAssignStringConcat) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -1012,6 +1026,7 @@ PHP_METHOD(Test_Assign, testPropertyAssignStringConcat) { PHP_METHOD(Test_Assign, testPropertyArray1) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, __$true, __$false, _0, _1, _2; zval *this_ptr = getThis(); @@ -1065,6 +1080,7 @@ PHP_METHOD(Test_Assign, testPropertyArray2) { zval c, _0, _1; double b; zend_long a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&c); @@ -1105,6 +1121,7 @@ PHP_METHOD(Test_Assign, testPropertyArray2) { PHP_METHOD(Test_Assign, testPropertyArray3) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, __$false, __$true, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11; zval *this_ptr = getThis(); @@ -1164,6 +1181,7 @@ PHP_METHOD(Test_Assign, testPropertyArray3) { PHP_METHOD(Test_Assign, testPropertyArray4) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *index, index_sub, __$null, __$false, __$true, _0, _1, _2, _3, _4; zval *this_ptr = getThis(); @@ -1206,6 +1224,7 @@ PHP_METHOD(Test_Assign, testPropertyArray4) { PHP_METHOD(Test_Assign, testPropertyArray5) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *index_param = NULL, __$null, __$false, __$true, _0, _1, _2, _3, _4; zval index; zval *this_ptr = getThis(); @@ -1250,6 +1269,7 @@ PHP_METHOD(Test_Assign, testPropertyArray5) { PHP_METHOD(Test_Assign, testPropertyArray6) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, __$false, __$true, _0, _1; zval *this_ptr = getThis(); @@ -1288,6 +1308,7 @@ PHP_METHOD(Test_Assign, testPropertyArray6) { PHP_METHOD(Test_Assign, testPropertyArray7) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, __$false, __$true, _0, _1; zval *this_ptr = getThis(); @@ -1326,6 +1347,7 @@ PHP_METHOD(Test_Assign, testPropertyArray7) { PHP_METHOD(Test_Assign, testPropertyArray8) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *index, index_sub, __$null, __$false, __$true, _0, _1; zval *this_ptr = getThis(); @@ -1368,6 +1390,7 @@ PHP_METHOD(Test_Assign, testPropertyArray8) { PHP_METHOD(Test_Assign, testPropertyArray9) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *index_param = NULL, __$null, __$false, __$true, _0, _1; zend_long index; zval *this_ptr = getThis(); @@ -1411,6 +1434,7 @@ PHP_METHOD(Test_Assign, testPropertyArray9) { PHP_METHOD(Test_Assign, testPropertyArray10) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *index_param = NULL, __$null, __$false, __$true, _0, _1; zval index; zval *this_ptr = getThis(); @@ -1455,6 +1479,7 @@ PHP_METHOD(Test_Assign, testPropertyArray10) { PHP_METHOD(Test_Assign, testPropertyArray11) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *index, index_sub, __$null, __$false, __$true, _0, _1, _2, _3, _4; zval *this_ptr = getThis(); @@ -1497,6 +1522,7 @@ PHP_METHOD(Test_Assign, testPropertyArray11) { PHP_METHOD(Test_Assign, testPropertyArray12) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *index, index_sub, __$null, __$false, __$true, temp1, temp2, temp3, _0, _1, _2, _3, _4, _5, _6; zval *this_ptr = getThis(); @@ -1552,6 +1578,7 @@ PHP_METHOD(Test_Assign, testPropertyArray12) { PHP_METHOD(Test_Assign, testPropertyArray13) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *index, index_sub, __$null, __$false, __$true, temp1, temp2, temp3, _0, _1, _2, _3, _4, _5, _6; zval *this_ptr = getThis(); @@ -1609,6 +1636,7 @@ PHP_METHOD(Test_Assign, testPropertyArray14) { zval _0, _1, _3; zval v, _2, _4, _5, _6; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&v); @@ -1662,6 +1690,7 @@ PHP_METHOD(Test_Assign, testPropertyArray14) { PHP_METHOD(Test_Assign, testStaticPropertyAssign1) { zval _2; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, __$false, __$true, _0, _1, _3; zval *this_ptr = getThis(); @@ -1719,6 +1748,7 @@ PHP_METHOD(Test_Assign, testStaticPropertyAssign2) { zval c, _0; double b; zend_long a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&c); @@ -1756,6 +1786,7 @@ PHP_METHOD(Test_Assign, testStaticPropertyAssign2) { PHP_METHOD(Test_Assign, testStaticPropertyArray1) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, __$false, __$true, _0, _1, _2; zval *this_ptr = getThis(); @@ -1796,6 +1827,7 @@ PHP_METHOD(Test_Assign, testStaticPropertyArray1) { PHP_METHOD(Test_Assign, testStaticPropertyArray2) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, __$false, __$true, _0, _1, _2; zval *this_ptr = getThis(); @@ -1836,6 +1868,7 @@ PHP_METHOD(Test_Assign, testStaticPropertyArray2) { PHP_METHOD(Test_Assign, testStaticPropertyArray3) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *index, index_sub, __$null, __$false, __$true, _0, _1, _2; zval *this_ptr = getThis(); @@ -1880,6 +1913,7 @@ PHP_METHOD(Test_Assign, testStaticPropertyArray3) { PHP_METHOD(Test_Assign, testStaticPropertyArrayAppend) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$false, _0, _1, _2; zval *this_ptr = getThis(); @@ -1913,6 +1947,7 @@ PHP_METHOD(Test_Assign, testStaticPropertyArrayAppend) { PHP_METHOD(Test_Assign, testStaticPropertyArrayMutli1) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, __$false, __$true, _0, _1, _2; zval *this_ptr = getThis(); @@ -1953,6 +1988,7 @@ PHP_METHOD(Test_Assign, testStaticPropertyArrayMutli1) { PHP_METHOD(Test_Assign, testStaticPropertyArrayMutli2) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, __$false, __$true, _0, _1, _2; zval *this_ptr = getThis(); @@ -1993,6 +2029,7 @@ PHP_METHOD(Test_Assign, testStaticPropertyArrayMutli2) { PHP_METHOD(Test_Assign, testStaticPropertyArrayMutli3) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *index, index_sub, __$null, __$false, __$true, _0, _1, _2; zval *this_ptr = getThis(); @@ -2039,6 +2076,7 @@ PHP_METHOD(Test_Assign, testStaticPropertyArrayMulti4) { zval _0, _1, _3; zval v, _2, _4; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&v); @@ -2086,6 +2124,7 @@ PHP_METHOD(Test_Assign, testStaticPropertyArrayMulti4) { PHP_METHOD(Test_Assign, testStaticPropertyArrayAppend1) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, __$false, __$true, _0, _1, _2; zval *this_ptr = getThis(); @@ -2126,6 +2165,7 @@ PHP_METHOD(Test_Assign, testStaticPropertyArrayAppend1) { PHP_METHOD(Test_Assign, testArrayVarAssign1) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *index, index_sub, *value, value_sub, a; zval *this_ptr = getThis(); @@ -2147,6 +2187,7 @@ PHP_METHOD(Test_Assign, testArrayVarAssign1) { PHP_METHOD(Test_Assign, testArrayVarAssign2) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *index, index_sub, *value, value_sub, _POST; zval *this_ptr = getThis(); @@ -2168,6 +2209,7 @@ PHP_METHOD(Test_Assign, testArrayVarAssign2) { PHP_METHOD(Test_Assign, testArrayProperty) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *index, index_sub, *value, value_sub, _POST; zval *this_ptr = getThis(); @@ -2200,7 +2242,7 @@ PHP_METHOD(Test_Assign, testGlobalVarAssign) { ZVAL_UNDEF(&_POST); zephir_get_global(&_POST, SL("_POST")); - zephir_fetch_params(0, 2, 0, &index, &value); + zephir_fetch_params_without_memory_grow(2, 0, &index, &value); @@ -2214,6 +2256,7 @@ PHP_METHOD(Test_Assign, testGlobalVarAssign) { PHP_METHOD(Test_Assign, testConstantKeyAssign) { zval elements; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&elements); @@ -2236,6 +2279,7 @@ PHP_METHOD(Test_Assign, testConstantKeyAssign) { PHP_METHOD(Test_Assign, testArrayBoolExpressionAssign) { zval str, _0, _1, _2, _3, _4; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&str); @@ -2271,6 +2315,7 @@ PHP_METHOD(Test_Assign, testArrayBoolExpressionAssign) { */ PHP_METHOD(Test_Assign, testAssignSuperGlobals) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval _GET, v, _0, _1, _2, _3; zval *this_ptr = getThis(); diff --git a/ext/test/bench/foo.zep.c b/ext/test/bench/foo.zep.c index 66261f392e..7c5a99c6ad 100644 --- a/ext/test/bench/foo.zep.c +++ b/ext/test/bench/foo.zep.c @@ -36,6 +36,7 @@ PHP_METHOD(Test_Bench_Foo, emptyForInRange) { zend_long _1; zend_bool _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *n, n_sub, i, _2; zval *this_ptr = getThis(); @@ -73,6 +74,7 @@ PHP_METHOD(Test_Bench_Foo, readStatic) { zend_long _1; zend_bool _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *n, n_sub, x, i, _2; zval *this_ptr = getThis(); @@ -113,6 +115,7 @@ PHP_METHOD(Test_Bench_Foo, writeStatic) { zend_long _1; zend_bool _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *n, n_sub, i, _2, _3$$3; zval *this_ptr = getThis(); @@ -154,6 +157,7 @@ PHP_METHOD(Test_Bench_Foo, issetStatic) { zend_long _1; zend_bool x = 0, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *n, n_sub, i, _2; zval *this_ptr = getThis(); @@ -192,6 +196,7 @@ PHP_METHOD(Test_Bench_Foo, emptyStatic) { zend_long _1; zend_bool x = 0, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *n, n_sub, i, _2, _3$$3; zval *this_ptr = getThis(); @@ -233,6 +238,7 @@ PHP_METHOD(Test_Bench_Foo, readProp) { zend_long _1; zend_bool _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *n, n_sub, x, i, _2; zval *this_ptr = getThis(); @@ -272,6 +278,7 @@ PHP_METHOD(Test_Bench_Foo, writeProp) { zend_long _1; zend_bool _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *n, n_sub, i, _2, _3$$3; zval *this_ptr = getThis(); @@ -313,6 +320,7 @@ PHP_METHOD(Test_Bench_Foo, assignAddProp) { zend_long _1; zend_bool _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *n, n_sub, i, _2, _3$$3, _4$$3; zval *this_ptr = getThis(); @@ -373,6 +381,7 @@ PHP_METHOD(Test_Bench_Foo, postIncProp) { zend_long _1; zend_bool _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *n, n_sub, i, _2; zval *this_ptr = getThis(); @@ -411,6 +420,7 @@ PHP_METHOD(Test_Bench_Foo, postDecProp) { zend_long _1; zend_bool _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *n, n_sub, i, _2; zval *this_ptr = getThis(); @@ -449,6 +459,7 @@ PHP_METHOD(Test_Bench_Foo, issetProp) { zend_long _1; zend_bool x = 0, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *n, n_sub, i, _2; zval *this_ptr = getThis(); @@ -487,6 +498,7 @@ PHP_METHOD(Test_Bench_Foo, emptyProp) { zend_long _1; zend_bool x = 0, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *n, n_sub, i, _2, _3$$3; zval *this_ptr = getThis(); @@ -535,6 +547,7 @@ PHP_METHOD(Test_Bench_Foo, g) { PHP_METHOD(Test_Bench_Foo, call) { zend_bool _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zephir_fcall_cache_entry *_3 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, _1; zval *n, n_sub, i, _2; @@ -592,6 +605,7 @@ PHP_METHOD(Test_Bench_Foo, staticMethod1) { PHP_METHOD(Test_Bench_Foo, scall) { zend_bool _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, _1; zephir_fcall_cache_entry *_3 = NULL; zval *n, n_sub, i, _2; @@ -632,6 +646,7 @@ PHP_METHOD(Test_Bench_Foo, scall) { PHP_METHOD(Test_Bench_Foo, scallWithReturnTrue) { zend_bool _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, _1; zephir_fcall_cache_entry *_3 = NULL; zval *n, n_sub, i, _2; @@ -673,6 +688,7 @@ PHP_METHOD(Test_Bench_Foo, readConst) { zend_long _1; zend_bool _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *n, n_sub, i, x, _2; zval *this_ptr = getThis(); diff --git a/ext/test/bitwise.zep.c b/ext/test/bitwise.zep.c index 22b438f9e4..d096e74559 100644 --- a/ext/test/bitwise.zep.c +++ b/ext/test/bitwise.zep.c @@ -284,6 +284,7 @@ PHP_METHOD(Test_Bitwise, intVarImplicitCastAnd) { zend_long c = 0; zval a, b, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -307,6 +308,7 @@ PHP_METHOD(Test_Bitwise, intVarImplicitCast2And) { zend_long b = 0, c = 0; zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -360,6 +362,7 @@ PHP_METHOD(Test_Bitwise, complex3And) { PHP_METHOD(Test_Bitwise, complex4And) { zval c; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&c); @@ -933,6 +936,7 @@ PHP_METHOD(Test_Bitwise, intVarImplicitCastOr) { zend_long c = 0; zval a, b, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -956,6 +960,7 @@ PHP_METHOD(Test_Bitwise, intVarImplicitCast2Or) { zend_long b = 0, c = 0; zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -1009,6 +1014,7 @@ PHP_METHOD(Test_Bitwise, complex3Or) { PHP_METHOD(Test_Bitwise, complex4Or) { zval c; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&c); @@ -1400,7 +1406,7 @@ PHP_METHOD(Test_Bitwise, testBitwiseNot) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &a_param); + zephir_fetch_params_without_memory_grow(1, 0, &a_param); a = zephir_get_intval(a_param); @@ -1416,7 +1422,7 @@ PHP_METHOD(Test_Bitwise, testBitwiseAndNot) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 2, 0, &a_param, &b_param); + zephir_fetch_params_without_memory_grow(2, 0, &a_param, &b_param); a = zephir_get_intval(a_param); b = zephir_get_intval(b_param); @@ -1433,7 +1439,7 @@ PHP_METHOD(Test_Bitwise, getInt) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &num_param); + zephir_fetch_params_without_memory_grow(1, 0, &num_param); num = zephir_get_intval(num_param); @@ -1448,6 +1454,7 @@ PHP_METHOD(Test_Bitwise, getInt) { PHP_METHOD(Test_Bitwise, testbitwiseXor) { zval i, _0, j; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); diff --git a/ext/test/branchprediction.zep.c b/ext/test/branchprediction.zep.c index ca629836f7..4c0bc85b93 100644 --- a/ext/test/branchprediction.zep.c +++ b/ext/test/branchprediction.zep.c @@ -48,7 +48,7 @@ PHP_METHOD(Test_BranchPrediction, testLikely2) { ZVAL_UNDEF(&a_sub); - zephir_fetch_params(0, 1, 0, &a); + zephir_fetch_params_without_memory_grow(1, 0, &a); @@ -80,7 +80,7 @@ PHP_METHOD(Test_BranchPrediction, testUnlikely2) { ZVAL_UNDEF(&a_sub); - zephir_fetch_params(0, 1, 0, &a); + zephir_fetch_params_without_memory_grow(1, 0, &a); diff --git a/ext/test/builtin/arraymethods.zep.c b/ext/test/builtin/arraymethods.zep.c index 186c3fb3aa..5d34e7e082 100644 --- a/ext/test/builtin/arraymethods.zep.c +++ b/ext/test/builtin/arraymethods.zep.c @@ -31,6 +31,7 @@ PHP_METHOD(Test_BuiltIn_ArrayMethods, getJoin1) { zval _1; zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -59,6 +60,7 @@ PHP_METHOD(Test_BuiltIn_ArrayMethods, getReversed1) { zval _1, _2; zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -89,6 +91,7 @@ PHP_METHOD(Test_BuiltIn_ArrayMethods, getMap1) { zval _1, _2; zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); diff --git a/ext/test/builtin/charmethods.zep.c b/ext/test/builtin/charmethods.zep.c index 29d50df111..8b52646755 100644 --- a/ext/test/builtin/charmethods.zep.c +++ b/ext/test/builtin/charmethods.zep.c @@ -29,6 +29,7 @@ ZEPHIR_INIT_CLASS(Test_BuiltIn_CharMethods) { PHP_METHOD(Test_BuiltIn_CharMethods, getHex) { zval _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -48,6 +49,7 @@ PHP_METHOD(Test_BuiltIn_CharMethods, getHexForString) { long _0; char ch = 0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *str_param = NULL, o, _1$$3, _2$$3, _3$$3; zval str; zval *this_ptr = getThis(); diff --git a/ext/test/builtin/intmethods.zep.c b/ext/test/builtin/intmethods.zep.c index 5170f00192..d69dcf65a7 100644 --- a/ext/test/builtin/intmethods.zep.c +++ b/ext/test/builtin/intmethods.zep.c @@ -29,6 +29,7 @@ ZEPHIR_INIT_CLASS(Test_BuiltIn_IntMethods) { PHP_METHOD(Test_BuiltIn_IntMethods, getAbs) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *num_param = NULL, _0, _1; zend_long num, ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -52,6 +53,7 @@ PHP_METHOD(Test_BuiltIn_IntMethods, getAbs) { PHP_METHOD(Test_BuiltIn_IntMethods, getAbs1) { zval _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -69,6 +71,7 @@ PHP_METHOD(Test_BuiltIn_IntMethods, getAbs1) { PHP_METHOD(Test_BuiltIn_IntMethods, getBinary) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *num_param = NULL, _0, _1; zend_long num, ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -91,6 +94,7 @@ PHP_METHOD(Test_BuiltIn_IntMethods, getBinary) { PHP_METHOD(Test_BuiltIn_IntMethods, getHex) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *num_param = NULL, _0, _1; zend_long num, ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -113,6 +117,7 @@ PHP_METHOD(Test_BuiltIn_IntMethods, getHex) { PHP_METHOD(Test_BuiltIn_IntMethods, getOctal) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *num_param = NULL, _0, _1; zend_long num, ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -135,6 +140,7 @@ PHP_METHOD(Test_BuiltIn_IntMethods, getOctal) { PHP_METHOD(Test_BuiltIn_IntMethods, getPow) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *num_param = NULL, *exp_param = NULL, _0, _1, _2; zend_long num, exp; zval *this_ptr = getThis(); @@ -166,7 +172,7 @@ PHP_METHOD(Test_BuiltIn_IntMethods, getSqrt) { ZVAL_UNDEF(&_0); - zephir_fetch_params(0, 1, 0, &num_param); + zephir_fetch_params_without_memory_grow(1, 0, &num_param); num = zephir_get_intval(num_param); @@ -178,6 +184,7 @@ PHP_METHOD(Test_BuiltIn_IntMethods, getSqrt) { PHP_METHOD(Test_BuiltIn_IntMethods, getExp) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *num_param = NULL, _0, _1; zend_long num, ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -206,7 +213,7 @@ PHP_METHOD(Test_BuiltIn_IntMethods, getSin) { ZVAL_UNDEF(&_0); - zephir_fetch_params(0, 1, 0, &num_param); + zephir_fetch_params_without_memory_grow(1, 0, &num_param); num = zephir_get_intval(num_param); @@ -224,7 +231,7 @@ PHP_METHOD(Test_BuiltIn_IntMethods, getCos) { ZVAL_UNDEF(&_0); - zephir_fetch_params(0, 1, 0, &num_param); + zephir_fetch_params_without_memory_grow(1, 0, &num_param); num = zephir_get_intval(num_param); @@ -242,7 +249,7 @@ PHP_METHOD(Test_BuiltIn_IntMethods, getTan) { ZVAL_UNDEF(&_0); - zephir_fetch_params(0, 1, 0, &num_param); + zephir_fetch_params_without_memory_grow(1, 0, &num_param); num = zephir_get_intval(num_param); @@ -254,6 +261,7 @@ PHP_METHOD(Test_BuiltIn_IntMethods, getTan) { PHP_METHOD(Test_BuiltIn_IntMethods, getAsin) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *num_param = NULL, _0, _1; zend_long num, ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -276,6 +284,7 @@ PHP_METHOD(Test_BuiltIn_IntMethods, getAsin) { PHP_METHOD(Test_BuiltIn_IntMethods, getAcos) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *num_param = NULL, _0, _1; zend_long num, ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -298,6 +307,7 @@ PHP_METHOD(Test_BuiltIn_IntMethods, getAcos) { PHP_METHOD(Test_BuiltIn_IntMethods, getAtan) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *num_param = NULL, _0, _1; zend_long num, ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -320,6 +330,7 @@ PHP_METHOD(Test_BuiltIn_IntMethods, getAtan) { PHP_METHOD(Test_BuiltIn_IntMethods, getLog) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *num_param = NULL, *base_param = NULL, _0$$3, _1$$3, _2, _3, _4; zend_long num, base, ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); diff --git a/ext/test/builtin/stringmethods.zep.c b/ext/test/builtin/stringmethods.zep.c index 0ae1ef3c0d..f26258c6e6 100644 --- a/ext/test/builtin/stringmethods.zep.c +++ b/ext/test/builtin/stringmethods.zep.c @@ -30,6 +30,7 @@ ZEPHIR_INIT_CLASS(Test_BuiltIn_StringMethods) { PHP_METHOD(Test_BuiltIn_StringMethods, camelize) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *str_param = NULL, *delimiter = NULL, delimiter_sub, __$null, _0; zval str; zval *this_ptr = getThis(); @@ -57,6 +58,7 @@ PHP_METHOD(Test_BuiltIn_StringMethods, camelize) { PHP_METHOD(Test_BuiltIn_StringMethods, uncamelize) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *str_param = NULL, *delimiter = NULL, delimiter_sub, __$null, _0; zval str; zval *this_ptr = getThis(); @@ -85,6 +87,7 @@ PHP_METHOD(Test_BuiltIn_StringMethods, uncamelize) { PHP_METHOD(Test_BuiltIn_StringMethods, getLength1) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -100,6 +103,7 @@ PHP_METHOD(Test_BuiltIn_StringMethods, getLength1) { PHP_METHOD(Test_BuiltIn_StringMethods, getLength2) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -115,6 +119,7 @@ PHP_METHOD(Test_BuiltIn_StringMethods, getLength2) { PHP_METHOD(Test_BuiltIn_StringMethods, getLength3) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -129,6 +134,7 @@ PHP_METHOD(Test_BuiltIn_StringMethods, getLength3) { PHP_METHOD(Test_BuiltIn_StringMethods, getLength4) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *a_param = NULL; zval a; zval *this_ptr = getThis(); @@ -147,6 +153,7 @@ PHP_METHOD(Test_BuiltIn_StringMethods, getLength4) { PHP_METHOD(Test_BuiltIn_StringMethods, getLength5) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *a_param = NULL; zval a, _0; zval *this_ptr = getThis(); @@ -168,6 +175,7 @@ PHP_METHOD(Test_BuiltIn_StringMethods, getLength5) { PHP_METHOD(Test_BuiltIn_StringMethods, getIndex) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *str_param = NULL, *needle_param = NULL, _0; zval str, needle; zval *this_ptr = getThis(); @@ -191,6 +199,7 @@ PHP_METHOD(Test_BuiltIn_StringMethods, getIndex) { PHP_METHOD(Test_BuiltIn_StringMethods, getIndexWithPosition) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long position; zval *str_param = NULL, *needle_param = NULL, *position_param = NULL, _0, _1; zval str, needle; @@ -219,6 +228,7 @@ PHP_METHOD(Test_BuiltIn_StringMethods, getIndexWithPosition) { PHP_METHOD(Test_BuiltIn_StringMethods, getTrimmed) { zval _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -236,6 +246,7 @@ PHP_METHOD(Test_BuiltIn_StringMethods, getTrimmed) { PHP_METHOD(Test_BuiltIn_StringMethods, getTrimmed1) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *str_param = NULL, _0; zval str; zval *this_ptr = getThis(); @@ -257,6 +268,7 @@ PHP_METHOD(Test_BuiltIn_StringMethods, getTrimmed1) { PHP_METHOD(Test_BuiltIn_StringMethods, getLeftTrimmed) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *str_param = NULL, _0; zval str; zval *this_ptr = getThis(); @@ -278,6 +290,7 @@ PHP_METHOD(Test_BuiltIn_StringMethods, getLeftTrimmed) { PHP_METHOD(Test_BuiltIn_StringMethods, getRightTrimmed) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *str_param = NULL, _0; zval str; zval *this_ptr = getThis(); @@ -299,6 +312,7 @@ PHP_METHOD(Test_BuiltIn_StringMethods, getRightTrimmed) { PHP_METHOD(Test_BuiltIn_StringMethods, getLower) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *str_param = NULL, _0; zval str; zval *this_ptr = getThis(); @@ -320,6 +334,7 @@ PHP_METHOD(Test_BuiltIn_StringMethods, getLower) { PHP_METHOD(Test_BuiltIn_StringMethods, getUpper) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *str_param = NULL, _0; zval str; zval *this_ptr = getThis(); @@ -341,6 +356,7 @@ PHP_METHOD(Test_BuiltIn_StringMethods, getUpper) { PHP_METHOD(Test_BuiltIn_StringMethods, getLowerFirst) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *str_param = NULL, _0; zval str; @@ -363,6 +379,7 @@ PHP_METHOD(Test_BuiltIn_StringMethods, getLowerFirst) { PHP_METHOD(Test_BuiltIn_StringMethods, getUpperFirst) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *str_param = NULL, _0; zval str; zval *this_ptr = getThis(); @@ -384,6 +401,7 @@ PHP_METHOD(Test_BuiltIn_StringMethods, getUpperFirst) { PHP_METHOD(Test_BuiltIn_StringMethods, getFormatted) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *str_param = NULL, _0, _1; zval str; @@ -409,6 +427,7 @@ PHP_METHOD(Test_BuiltIn_StringMethods, getFormatted) { PHP_METHOD(Test_BuiltIn_StringMethods, getMd5) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *str_param = NULL, _0; zval str; zval *this_ptr = getThis(); @@ -430,6 +449,7 @@ PHP_METHOD(Test_BuiltIn_StringMethods, getMd5) { PHP_METHOD(Test_BuiltIn_StringMethods, getSha1) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *str_param = NULL, _0; zval str; @@ -452,6 +472,7 @@ PHP_METHOD(Test_BuiltIn_StringMethods, getSha1) { PHP_METHOD(Test_BuiltIn_StringMethods, getNl2br) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *str_param = NULL, _0; zval str; @@ -474,6 +495,7 @@ PHP_METHOD(Test_BuiltIn_StringMethods, getNl2br) { PHP_METHOD(Test_BuiltIn_StringMethods, getParsedCsv) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *str_param = NULL, _0; zval str; @@ -496,6 +518,7 @@ PHP_METHOD(Test_BuiltIn_StringMethods, getParsedCsv) { PHP_METHOD(Test_BuiltIn_StringMethods, getParsedJson) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_bool assoc; zval *str_param = NULL, *assoc_param = NULL, _0, _1; zval str; @@ -525,6 +548,7 @@ PHP_METHOD(Test_BuiltIn_StringMethods, getParsedJson) { PHP_METHOD(Test_BuiltIn_StringMethods, getRepeatted) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long count, ZEPHIR_LAST_CALL_STATUS; zval *str_param = NULL, *count_param = NULL, _0, _1; zval str; @@ -550,6 +574,7 @@ PHP_METHOD(Test_BuiltIn_StringMethods, getRepeatted) { PHP_METHOD(Test_BuiltIn_StringMethods, getShuffled) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *str_param = NULL, _0; zval str; @@ -572,6 +597,7 @@ PHP_METHOD(Test_BuiltIn_StringMethods, getShuffled) { PHP_METHOD(Test_BuiltIn_StringMethods, getSplited) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *str_param = NULL, *del_param = NULL, _0; zval str, del; @@ -596,6 +622,7 @@ PHP_METHOD(Test_BuiltIn_StringMethods, getSplited) { PHP_METHOD(Test_BuiltIn_StringMethods, getCompare) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *left_param = NULL, *right_param = NULL, _0; zval left, right; @@ -620,6 +647,7 @@ PHP_METHOD(Test_BuiltIn_StringMethods, getCompare) { PHP_METHOD(Test_BuiltIn_StringMethods, getCompareLocale) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *left_param = NULL, *right_param = NULL, _0; zval left, right; @@ -644,6 +672,7 @@ PHP_METHOD(Test_BuiltIn_StringMethods, getCompareLocale) { PHP_METHOD(Test_BuiltIn_StringMethods, getReversed) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *str_param = NULL, _0; zval str; @@ -666,6 +695,7 @@ PHP_METHOD(Test_BuiltIn_StringMethods, getReversed) { PHP_METHOD(Test_BuiltIn_StringMethods, getHtmlSpecialChars) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *str_param = NULL, _0; zval str; diff --git a/ext/test/cast.zep.c b/ext/test/cast.zep.c index 20ae609531..872334d18e 100644 --- a/ext/test/cast.zep.c +++ b/ext/test/cast.zep.c @@ -96,6 +96,7 @@ PHP_METHOD(Test_Cast, testIntCastFromVariableBooleanFalse) { PHP_METHOD(Test_Cast, testIntCastFromVariableNull) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -111,6 +112,7 @@ PHP_METHOD(Test_Cast, testIntCastFromVariableNull) { PHP_METHOD(Test_Cast, testIntCastFromStringValue) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -127,6 +129,7 @@ PHP_METHOD(Test_Cast, testIntCastFromStringValue) { PHP_METHOD(Test_Cast, testIntCastFromVariableString) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -141,6 +144,7 @@ PHP_METHOD(Test_Cast, testIntCastFromVariableString) { PHP_METHOD(Test_Cast, testIntCastFromParameterString) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *a_param = NULL; zval a; zval *this_ptr = getThis(); @@ -169,6 +173,7 @@ PHP_METHOD(Test_Cast, testIntCastFromNull) { PHP_METHOD(Test_Cast, testIntCastFromVariableEmptyArray) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -184,6 +189,7 @@ PHP_METHOD(Test_Cast, testIntCastFromVariableEmptyArray) { PHP_METHOD(Test_Cast, testIntCastFromEmptyArray) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -199,6 +205,7 @@ PHP_METHOD(Test_Cast, testIntCastFromEmptyArray) { PHP_METHOD(Test_Cast, testIntCastFromVariableArray) { zval a, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -228,6 +235,7 @@ PHP_METHOD(Test_Cast, testIntCastFromArray) { zval _1; zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -260,6 +268,7 @@ PHP_METHOD(Test_Cast, testIntCastFromArray) { PHP_METHOD(Test_Cast, testIntCastFromStdClass) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -279,6 +288,7 @@ PHP_METHOD(Test_Cast, testIntCastFromStdClass) { PHP_METHOD(Test_Cast, testIntCastFromVariableStdClass) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -358,6 +368,7 @@ PHP_METHOD(Test_Cast, testFloatCastFromVariableBooleanFalse) { PHP_METHOD(Test_Cast, testFloatCastFromVariableNull) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -382,6 +393,7 @@ PHP_METHOD(Test_Cast, testFloatCastFromNull) { PHP_METHOD(Test_Cast, testFloatCastFromVariableEmptyArray) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -397,6 +409,7 @@ PHP_METHOD(Test_Cast, testFloatCastFromVariableEmptyArray) { PHP_METHOD(Test_Cast, testFloatCastFromEmptyArray) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -412,6 +425,7 @@ PHP_METHOD(Test_Cast, testFloatCastFromEmptyArray) { PHP_METHOD(Test_Cast, testFloatCastFromVariableArray) { zval a, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -441,6 +455,7 @@ PHP_METHOD(Test_Cast, testFloatCastFromArray) { zval _1; zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -473,6 +488,7 @@ PHP_METHOD(Test_Cast, testFloatCastFromArray) { PHP_METHOD(Test_Cast, testFloatCastFromStdClass) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -492,6 +508,7 @@ PHP_METHOD(Test_Cast, testFloatCastFromStdClass) { PHP_METHOD(Test_Cast, testFloatCastFromVariableStdClass) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -535,6 +552,7 @@ PHP_METHOD(Test_Cast, testBooleanCastFromIntFalse) { PHP_METHOD(Test_Cast, testBooleanCastFromObject) { zval simpleObject; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&simpleObject); @@ -550,6 +568,7 @@ PHP_METHOD(Test_Cast, testBooleanCastFromObject) { PHP_METHOD(Test_Cast, testBooleanCastFromEmptyArray) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -565,6 +584,7 @@ PHP_METHOD(Test_Cast, testBooleanCastFromEmptyArray) { PHP_METHOD(Test_Cast, testBooleanCastFromArray) { zval a, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -593,6 +613,7 @@ PHP_METHOD(Test_Cast, testBooleanCastFromArray) { PHP_METHOD(Test_Cast, testBooleanCastFromNull) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -609,6 +630,7 @@ PHP_METHOD(Test_Cast, testBooleanCastFromNull) { PHP_METHOD(Test_Cast, testObjectCastFromInt) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -625,6 +647,7 @@ PHP_METHOD(Test_Cast, testObjectCastFromInt) { PHP_METHOD(Test_Cast, testObjectCastFromFloat) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -641,6 +664,7 @@ PHP_METHOD(Test_Cast, testObjectCastFromFloat) { PHP_METHOD(Test_Cast, testObjectCastFromFalse) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -657,6 +681,7 @@ PHP_METHOD(Test_Cast, testObjectCastFromFalse) { PHP_METHOD(Test_Cast, testObjectCastFromTrue) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -673,6 +698,7 @@ PHP_METHOD(Test_Cast, testObjectCastFromTrue) { PHP_METHOD(Test_Cast, testObjectCastFromNull) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -689,6 +715,7 @@ PHP_METHOD(Test_Cast, testObjectCastFromNull) { PHP_METHOD(Test_Cast, testObjectCastFromEmptyArray) { zval _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -708,6 +735,7 @@ PHP_METHOD(Test_Cast, testObjectCastFromArray) { zval _1, _2; zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -739,6 +767,7 @@ PHP_METHOD(Test_Cast, testObjectCastFromArray) { PHP_METHOD(Test_Cast, testObjectCastFromEmptyString) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -755,6 +784,7 @@ PHP_METHOD(Test_Cast, testObjectCastFromEmptyString) { PHP_METHOD(Test_Cast, testObjectCastFromString) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -771,6 +801,7 @@ PHP_METHOD(Test_Cast, testObjectCastFromString) { PHP_METHOD(Test_Cast, testCastStdinToInteger) { zval handle; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&handle); @@ -778,7 +809,7 @@ PHP_METHOD(Test_Cast, testCastStdinToInteger) { ZEPHIR_MM_GROW(); ZEPHIR_INIT_VAR(&handle); - ZEPHIR_GET_CONSTANT(&handle, "STDIN"); + ZEPHIR_MM_GET_CONSTANT(&handle, "STDIN"); RETURN_MM_LONG(zephir_get_intval(&handle)); } @@ -786,6 +817,7 @@ PHP_METHOD(Test_Cast, testCastStdinToInteger) { PHP_METHOD(Test_Cast, testCastStdoutToInteger) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -793,7 +825,7 @@ PHP_METHOD(Test_Cast, testCastStdoutToInteger) { ZEPHIR_MM_GROW(); ZEPHIR_INIT_VAR(&_0); - ZEPHIR_GET_CONSTANT(&_0, "STDOUT"); + ZEPHIR_MM_GET_CONSTANT(&_0, "STDOUT"); RETURN_MM_LONG(zephir_get_intval(&_0)); } @@ -806,7 +838,7 @@ PHP_METHOD(Test_Cast, testCastFileResourceToInteger) { ZVAL_UNDEF(&fileName_sub); - zephir_fetch_params(0, 1, 0, &fileName); + zephir_fetch_params_without_memory_grow(1, 0, &fileName); diff --git a/ext/test/chars.zep.c b/ext/test/chars.zep.c index 2b7bf9ebe1..f68ad41651 100644 --- a/ext/test/chars.zep.c +++ b/ext/test/chars.zep.c @@ -48,7 +48,7 @@ PHP_METHOD(Test_Chars, sumChars2) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &ch_param); + zephir_fetch_params_without_memory_grow(1, 0, &ch_param); ch = zephir_get_charval(ch_param); @@ -78,7 +78,7 @@ PHP_METHOD(Test_Chars, diffChars2) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &ch_param); + zephir_fetch_params_without_memory_grow(1, 0, &ch_param); ch = zephir_get_charval(ch_param); diff --git a/ext/test/closures.zep.c b/ext/test/closures.zep.c index d3f416582f..77234e4cd9 100644 --- a/ext/test/closures.zep.c +++ b/ext/test/closures.zep.c @@ -116,6 +116,7 @@ PHP_METHOD(Test_Closures, testUseCommand) { PHP_METHOD(Test_Closures, issue1860) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *abc_param = NULL; zval abc; zval *this_ptr = getThis(); diff --git a/ext/test/compare.zep.c b/ext/test/compare.zep.c index baf0f4e5d8..e4753362d1 100644 --- a/ext/test/compare.zep.c +++ b/ext/test/compare.zep.c @@ -36,7 +36,7 @@ PHP_METHOD(Test_Compare, isLessInt) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 2, 0, &a_param, &b_param); + zephir_fetch_params_without_memory_grow(2, 0, &a_param, &b_param); a = zephir_get_intval(a_param); b = zephir_get_intval(b_param); @@ -53,7 +53,7 @@ PHP_METHOD(Test_Compare, isGreaterEqual) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 2, 0, &a_param, &b_param); + zephir_fetch_params_without_memory_grow(2, 0, &a_param, &b_param); a = zephir_get_intval(a_param); b = zephir_get_intval(b_param); @@ -70,7 +70,7 @@ PHP_METHOD(Test_Compare, isLessDouble) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 2, 0, &a_param, &b_param); + zephir_fetch_params_without_memory_grow(2, 0, &a_param, &b_param); a = zephir_get_doubleval(a_param); b = zephir_get_doubleval(b_param); @@ -87,7 +87,7 @@ PHP_METHOD(Test_Compare, isLessThenPi) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &a_param); + zephir_fetch_params_without_memory_grow(1, 0, &a_param); a = zephir_get_doubleval(a_param); @@ -103,7 +103,7 @@ PHP_METHOD(Test_Compare, isMoreThenPi) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &a_param); + zephir_fetch_params_without_memory_grow(1, 0, &a_param); a = zephir_get_doubleval(a_param); @@ -117,6 +117,7 @@ PHP_METHOD(Test_Compare, isMoreThenPi) { */ PHP_METHOD(Test_Compare, testVarWithStringEquals) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *str_param = NULL; zval str; zval *this_ptr = getThis(); @@ -166,7 +167,7 @@ PHP_METHOD(Test_Compare, testVarEqualsNull) { ZVAL_UNDEF(&a_sub); - zephir_fetch_params(0, 1, 0, &a); + zephir_fetch_params_without_memory_grow(1, 0, &a); @@ -184,7 +185,7 @@ PHP_METHOD(Test_Compare, testNullEqualsVar) { ZVAL_UNDEF(&a_sub); - zephir_fetch_params(0, 1, 0, &a); + zephir_fetch_params_without_memory_grow(1, 0, &a); diff --git a/ext/test/concat.zep.c b/ext/test/concat.zep.c index 9b8411f7ab..3d50a55ec8 100644 --- a/ext/test/concat.zep.c +++ b/ext/test/concat.zep.c @@ -43,6 +43,7 @@ PHP_METHOD(Test_Concat, getTestProperty) { PHP_METHOD(Test_Concat, testConcatBySelfProperty) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *title_param = NULL, _0; zval title; zval *this_ptr = getThis(); @@ -68,6 +69,7 @@ PHP_METHOD(Test_Concat, testConcatBySelfProperty) { PHP_METHOD(Test_Concat, testConcat1) { zval url, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&url); @@ -88,6 +90,7 @@ PHP_METHOD(Test_Concat, testConcat2) { zval _1; zval url, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&url); @@ -117,6 +120,7 @@ PHP_METHOD(Test_Concat, testConcat2) { PHP_METHOD(Test_Concat, testConcat3) { zval a, b; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); diff --git a/ext/test/constants.zep.c b/ext/test/constants.zep.c index 22a8bfc6db..dfefce2133 100644 --- a/ext/test/constants.zep.c +++ b/ext/test/constants.zep.c @@ -267,6 +267,7 @@ PHP_METHOD(Test_Constants, testDirConstant) { PHP_METHOD(Test_Constants, testPHPVersionEnvConstantInExpValue) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -274,7 +275,7 @@ PHP_METHOD(Test_Constants, testPHPVersionEnvConstantInExpValue) { ZEPHIR_MM_GROW(); ZEPHIR_INIT_VAR(&a); - ZEPHIR_GET_CONSTANT(&a, "PHP_VERSION"); + ZEPHIR_MM_GET_CONSTANT(&a, "PHP_VERSION"); RETURN_CCTOR(&a); } @@ -287,6 +288,7 @@ PHP_METHOD(Test_Constants, testPHPVersionEnvConstantInExpValue) { PHP_METHOD(Test_Constants, testStringDelimiterConstantDoubleQuoted) { zval delimiter; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&delimiter); @@ -302,6 +304,7 @@ PHP_METHOD(Test_Constants, testStringDelimiterConstantDoubleQuoted) { PHP_METHOD(Test_Constants, testStringConstantWithVars) { zval property; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&property); diff --git a/ext/test/declaretest.zep.c b/ext/test/declaretest.zep.c index ff36b5a497..bdd4da4be8 100644 --- a/ext/test/declaretest.zep.c +++ b/ext/test/declaretest.zep.c @@ -31,6 +31,7 @@ ZEPHIR_INIT_CLASS(Test_DeclareTest) { PHP_METHOD(Test_DeclareTest, testStringDeclare1) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -46,6 +47,7 @@ PHP_METHOD(Test_DeclareTest, testStringDeclare1) { PHP_METHOD(Test_DeclareTest, testStringDeclare2) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -217,6 +219,7 @@ PHP_METHOD(Test_DeclareTest, testDeclare13) { PHP_METHOD(Test_DeclareTest, testDeclare14) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -232,6 +235,7 @@ PHP_METHOD(Test_DeclareTest, testDeclare14) { PHP_METHOD(Test_DeclareTest, testDeclare15) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -247,6 +251,7 @@ PHP_METHOD(Test_DeclareTest, testDeclare15) { PHP_METHOD(Test_DeclareTest, testDeclareMcallExpression) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); diff --git a/ext/test/emptytest.zep.c b/ext/test/emptytest.zep.c index f8a68ada03..f92dca673b 100644 --- a/ext/test/emptytest.zep.c +++ b/ext/test/emptytest.zep.c @@ -35,6 +35,7 @@ ZEPHIR_INIT_CLASS(Test_EmptyTest) { PHP_METHOD(Test_EmptyTest, testDynamicVarArrayEmpty) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -50,6 +51,7 @@ PHP_METHOD(Test_EmptyTest, testDynamicVarArrayEmpty) { PHP_METHOD(Test_EmptyTest, testDynamicVarArrayNotEmpty) { zval a, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -78,6 +80,7 @@ PHP_METHOD(Test_EmptyTest, testDynamicVarArrayNotEmpty) { PHP_METHOD(Test_EmptyTest, testEmptyString) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -93,6 +96,7 @@ PHP_METHOD(Test_EmptyTest, testEmptyString) { PHP_METHOD(Test_EmptyTest, testNotEmptyString) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -107,6 +111,7 @@ PHP_METHOD(Test_EmptyTest, testNotEmptyString) { PHP_METHOD(Test_EmptyTest, testString) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *a_param = NULL; zval a; zval *this_ptr = getThis(); diff --git a/ext/test/evaltest.zep.c b/ext/test/evaltest.zep.c index 2ca301d001..faf92c4e13 100644 --- a/ext/test/evaltest.zep.c +++ b/ext/test/evaltest.zep.c @@ -28,6 +28,7 @@ ZEPHIR_INIT_CLASS(Test_EvalTest) { PHP_METHOD(Test_EvalTest, evalCode) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *code_param = NULL; zval code; zval *this_ptr = getThis(); diff --git a/ext/test/exception.zep.c b/ext/test/exception.zep.c index cb337dec5a..96639db429 100644 --- a/ext/test/exception.zep.c +++ b/ext/test/exception.zep.c @@ -35,6 +35,7 @@ ZEPHIR_INIT_CLASS(Test_Exception) { */ PHP_METHOD(Test_Exception, testRuntimePropertyFetch) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *message_param = NULL; zval message; zval *this_ptr = getThis(); diff --git a/ext/test/exceptions.zep.c b/ext/test/exceptions.zep.c index 8fa56bdb66..be1bd3cdd7 100644 --- a/ext/test/exceptions.zep.c +++ b/ext/test/exceptions.zep.c @@ -55,6 +55,7 @@ PHP_METHOD(Test_Exceptions, testExceptionStringEscape) { PHP_METHOD(Test_Exceptions, testException2) { zval msg, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -78,6 +79,7 @@ PHP_METHOD(Test_Exceptions, testException2) { PHP_METHOD(Test_Exceptions, testException3) { zval ex, msg; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -101,6 +103,7 @@ PHP_METHOD(Test_Exceptions, testException3) { PHP_METHOD(Test_Exceptions, getException) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -120,6 +123,7 @@ PHP_METHOD(Test_Exceptions, getException) { PHP_METHOD(Test_Exceptions, testException4) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -138,6 +142,7 @@ PHP_METHOD(Test_Exceptions, testException4) { PHP_METHOD(Test_Exceptions, testException5) { zval exception, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -160,6 +165,7 @@ PHP_METHOD(Test_Exceptions, testException5) { PHP_METHOD(Test_Exceptions, testExceptionLiteral) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *type_param = NULL; zval type; zval *this_ptr = getThis(); @@ -197,6 +203,7 @@ PHP_METHOD(Test_Exceptions, testExceptionLiteral) { PHP_METHOD(Test_Exceptions, testExceptionSprintf) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *name_param = NULL, _0, _1; zval name; @@ -224,6 +231,7 @@ PHP_METHOD(Test_Exceptions, testExceptionSprintf) { PHP_METHOD(Test_Exceptions, testExceptionConcat) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *framework_param = NULL, *language_param = NULL; zval framework, language, _0; zval *this_ptr = getThis(); @@ -250,6 +258,7 @@ PHP_METHOD(Test_Exceptions, testExceptionConcat) { PHP_METHOD(Test_Exceptions, testExceptionRethrow) { zval e, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -285,6 +294,7 @@ PHP_METHOD(Test_Exceptions, testExceptionRethrow) { PHP_METHOD(Test_Exceptions, testMultiException) { zend_bool _1$$4, _3$$7, _5$$10, _7$$13; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *returnValue, returnValue_sub, *exception, exception_sub, e, f, iexc, exc, _0, _2$$4, _4$$7, _6$$10, _8$$13; zval *this_ptr = getThis(); @@ -399,6 +409,7 @@ PHP_METHOD(Test_Exceptions, testMultiException) { PHP_METHOD(Test_Exceptions, issue1325) { zval e, status, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); diff --git a/ext/test/exists.zep.c b/ext/test/exists.zep.c index 489140f3cb..1137a3b099 100644 --- a/ext/test/exists.zep.c +++ b/ext/test/exists.zep.c @@ -35,7 +35,7 @@ PHP_METHOD(Test_Exists, testClassExists) { ZVAL_UNDEF(&className_sub); ZVAL_UNDEF(&_0); - zephir_fetch_params(0, 1, 1, &className, &autoload_param); + zephir_fetch_params_without_memory_grow(1, 1, &className, &autoload_param); if (!autoload_param) { autoload = 1; @@ -58,7 +58,7 @@ PHP_METHOD(Test_Exists, testInterfaceExists) { ZVAL_UNDEF(&interfaceName_sub); ZVAL_UNDEF(&_0); - zephir_fetch_params(0, 1, 1, &interfaceName, &autoload_param); + zephir_fetch_params_without_memory_grow(1, 1, &interfaceName, &autoload_param); if (!autoload_param) { autoload = 1; @@ -80,7 +80,7 @@ PHP_METHOD(Test_Exists, testMethodExists) { ZVAL_UNDEF(&obj_sub); ZVAL_UNDEF(&methodName_sub); - zephir_fetch_params(0, 2, 0, &obj, &methodName); + zephir_fetch_params_without_memory_grow(2, 0, &obj, &methodName); @@ -95,7 +95,7 @@ PHP_METHOD(Test_Exists, testFileExists) { ZVAL_UNDEF(&fileName_sub); - zephir_fetch_params(0, 1, 0, &fileName); + zephir_fetch_params_without_memory_grow(1, 0, &fileName); diff --git a/ext/test/exitdie.zep.c b/ext/test/exitdie.zep.c index 4cbc4b572b..2f70d6fd6a 100644 --- a/ext/test/exitdie.zep.c +++ b/ext/test/exitdie.zep.c @@ -34,7 +34,7 @@ PHP_METHOD(Test_ExitDie, testExit) { ZVAL_UNDEF(¶m_sub); ZVAL_NULL(&__$null); - zephir_fetch_params(0, 0, 1, ¶m); + zephir_fetch_params_without_memory_grow(0, 1, ¶m); if (!param) { param = ¶m_sub; @@ -57,7 +57,7 @@ PHP_METHOD(Test_ExitDie, testDie) { ZVAL_UNDEF(¶m_sub); ZVAL_NULL(&__$null); - zephir_fetch_params(0, 0, 1, ¶m); + zephir_fetch_params_without_memory_grow(0, 1, ¶m); if (!param) { param = ¶m_sub; diff --git a/ext/test/factorial.zep.c b/ext/test/factorial.zep.c index 8c34da97f5..37c96bee60 100644 --- a/ext/test/factorial.zep.c +++ b/ext/test/factorial.zep.c @@ -35,7 +35,7 @@ PHP_METHOD(Test_Factorial, intIterativeFactorial) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &n_param); + zephir_fetch_params_without_memory_grow(1, 0, &n_param); n = zephir_get_intval(n_param); @@ -65,6 +65,7 @@ PHP_METHOD(Test_Factorial, intIterativeFactorial) { PHP_METHOD(Test_Factorial, intRecursiveFactorial) { zend_bool _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *num_param = NULL, _0, _2, _3; zend_long num, ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); diff --git a/ext/test/fannkuch.zep.c b/ext/test/fannkuch.zep.c index de8e6a0adb..d96a88925b 100644 --- a/ext/test/fannkuch.zep.c +++ b/ext/test/fannkuch.zep.c @@ -36,6 +36,7 @@ ZEPHIR_INIT_CLASS(Test_Fannkuch) { PHP_METHOD(Test_Fannkuch, process) { zend_bool _0, _5$$4, _11$$8; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *n_param = NULL, perm, perm0, perm1, count, temp, _3$$3, _4$$6, _9$$4, _8$$7, _10$$8, _14$$9, _15$$14, _16$$15, _17$$13, _18$$13, _19$$13; zend_long n, maxFlipsCount, permCount, checksum, i = 0, j = 0, flipsCount = 0, k = 0, r = 0, k2 = 0, _1, _2, _6$$4, _7$$4, _12$$8, _13$$8; zval *this_ptr = getThis(); diff --git a/ext/test/fasta.zep.c b/ext/test/fasta.zep.c index cee4a5ce33..1f5d70413d 100644 --- a/ext/test/fasta.zep.c +++ b/ext/test/fasta.zep.c @@ -33,6 +33,7 @@ ZEPHIR_INIT_CLASS(Test_Fasta) { PHP_METHOD(Test_Fasta, fastaRepeat) { zval _2, _5; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, seqi, i = 0; zval seq; zval *n, n_sub, *seq_param = NULL, len, j, k, l, block, str, lines, _0, _1, _3, _4, _9, _10, _6$$3, _7$$3, _8$$3, _11$$6, _12$$7, _13$$7, _14$$7, _15$$7; @@ -154,6 +155,7 @@ PHP_METHOD(Test_Fasta, fastRandom) { PHP_METHOD(Test_Fasta, main) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *n, n_sub, alu, iub, homoSap, _1; zval *this_ptr = getThis(); diff --git a/ext/test/fcall.zep.c b/ext/test/fcall.zep.c index e88ee0186f..2f3b272db5 100644 --- a/ext/test/fcall.zep.c +++ b/ext/test/fcall.zep.c @@ -42,6 +42,7 @@ ZEPHIR_INIT_CLASS(Test_Fcall) { PHP_METHOD(Test_Fcall, testCall1) { zval _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -78,6 +79,7 @@ PHP_METHOD(Test_Fcall, testCall2) { PHP_METHOD(Test_Fcall, testCall3) { zval handle, handle2, buffer, _0, _1, _3$$4; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_2 = NULL, *_4 = NULL; zval *this_ptr = getThis(); @@ -123,6 +125,7 @@ PHP_METHOD(Test_Fcall, testCall3) { PHP_METHOD(Test_Fcall, testCall4) { zval handle, handle2, buffer, _0, _1, _3$$4; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_2 = NULL, *_4 = NULL; zval *this_ptr = getThis(); @@ -167,6 +170,7 @@ PHP_METHOD(Test_Fcall, testCall4) { PHP_METHOD(Test_Fcall, testCall5) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *a, a_sub, *b, b_sub; zval *this_ptr = getThis(); @@ -187,6 +191,7 @@ PHP_METHOD(Test_Fcall, testCall5) { PHP_METHOD(Test_Fcall, testCall6) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -201,6 +206,7 @@ PHP_METHOD(Test_Fcall, testCall6) { PHP_METHOD(Test_Fcall, testCall7) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -215,6 +221,7 @@ PHP_METHOD(Test_Fcall, testCall7) { PHP_METHOD(Test_Fcall, zvalFcallWith1Parameter) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *callback, callback_sub, *param1 = NULL, param1_sub, __$null; zval *this_ptr = getThis(); @@ -240,6 +247,7 @@ PHP_METHOD(Test_Fcall, zvalFcallWith1Parameter) { PHP_METHOD(Test_Fcall, testCall8) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *a, a_sub, *b, b_sub, x; zval *this_ptr = getThis(); @@ -262,6 +270,7 @@ PHP_METHOD(Test_Fcall, testCall8) { PHP_METHOD(Test_Fcall, testCall1FromVar) { zval funcName, _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -294,6 +303,7 @@ PHP_METHOD(Test_Fcall, testStrtokFalse) { PHP_METHOD(Test_Fcall, testStrtokVarBySlash) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *value, value_sub, _0; zval *this_ptr = getThis(); @@ -322,7 +332,7 @@ PHP_METHOD(Test_Fcall, testFunctionGetArgs) { ZVAL_UNDEF(¶m1_sub); ZVAL_UNDEF(¶m2_sub); - zephir_fetch_params(0, 2, 0, ¶m1, ¶m2); + zephir_fetch_params_without_memory_grow(2, 0, ¶m1, ¶m2); @@ -353,6 +363,7 @@ PHP_METHOD(Test_Fcall, testStaticFunctionGetArgsAllExtra) { PHP_METHOD(Test_Fcall, testFunctionGetArg) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *param1, param1_sub, *param2, param2_sub, _0, _1, _2; zval *this_ptr = getThis(); @@ -383,6 +394,7 @@ PHP_METHOD(Test_Fcall, testFunctionGetArg) { PHP_METHOD(Test_Fcall, testFunctionGetArgAllExtra) { zval _0, _1, _2; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -407,6 +419,7 @@ PHP_METHOD(Test_Fcall, testFunctionGetArgAllExtra) { PHP_METHOD(Test_Fcall, testStaticFunctionGetArgAllExtra) { zval _0, _1, _2; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -431,6 +444,7 @@ PHP_METHOD(Test_Fcall, testStaticFunctionGetArgAllExtra) { PHP_METHOD(Test_Fcall, testArrayFill) { zval v1, v2, _0, _1, _2; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_3 = NULL; zval *this_ptr = getThis(); @@ -463,6 +477,7 @@ PHP_METHOD(Test_Fcall, testArrayFill) { } PHP_FUNCTION(g_test_zephir_global_method_test) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *str, str_sub, _0; ZVAL_UNDEF(&str_sub); @@ -489,7 +504,7 @@ PHP_FUNCTION(g_test_zephir_global_method_with_type_casting) { zval *variable, variable_sub; ZVAL_UNDEF(&variable_sub); - zephir_fetch_params(0, 1, 0, &variable); + zephir_fetch_params_without_memory_grow(1, 0, &variable); @@ -499,6 +514,7 @@ PHP_FUNCTION(g_test_zephir_global_method_with_type_casting) { } PHP_FUNCTION(f_Test_zephir_namespaced_method_test) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *str, str_sub, _0, _1; ZVAL_UNDEF(&str_sub); @@ -527,7 +543,7 @@ PHP_FUNCTION(f_Test_test_call_relative_object_hint) { zval *a, a_sub; ZVAL_UNDEF(&a_sub); - zephir_fetch_params(0, 1, 0, &a); + zephir_fetch_params_without_memory_grow(1, 0, &a); @@ -539,7 +555,7 @@ PHP_FUNCTION(f_Test_zephir_namespaced_method_with_type_casting) { zval *variable, variable_sub; ZVAL_UNDEF(&variable_sub); - zephir_fetch_params(0, 1, 0, &variable); + zephir_fetch_params_without_memory_grow(1, 0, &variable); @@ -552,7 +568,7 @@ PHP_FUNCTION(f_Test_test_call_object_hint) { zval *a, a_sub; ZVAL_UNDEF(&a_sub); - zephir_fetch_params(0, 1, 0, &a); + zephir_fetch_params_without_memory_grow(1, 0, &a); diff --git a/ext/test/fetchtest.zep.c b/ext/test/fetchtest.zep.c index 2ef58688f5..751d51e369 100644 --- a/ext/test/fetchtest.zep.c +++ b/ext/test/fetchtest.zep.c @@ -38,7 +38,7 @@ PHP_METHOD(Test_FetchTest, setValues) { ZVAL_UNDEF(&values_sub); - zephir_fetch_params(0, 1, 0, &values); + zephir_fetch_params_without_memory_grow(1, 0, &values); @@ -65,7 +65,7 @@ PHP_METHOD(Test_FetchTest, testFetchArray1) { ZVAL_UNDEF(&b_sub); ZVAL_UNDEF(&c); - zephir_fetch_params(0, 2, 0, &a, &b); + zephir_fetch_params_without_memory_grow(2, 0, &a, &b); @@ -75,6 +75,7 @@ PHP_METHOD(Test_FetchTest, testFetchArray1) { PHP_METHOD(Test_FetchTest, testFetchArray2) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *a = NULL, a_sub, *b, b_sub; zval *this_ptr = getThis(); @@ -101,7 +102,7 @@ PHP_METHOD(Test_FetchTest, testFetchArray3) { ZVAL_UNDEF(&a_sub); ZVAL_UNDEF(&c); - zephir_fetch_params(0, 2, 0, &a, &b_param); + zephir_fetch_params_without_memory_grow(2, 0, &a, &b_param); b = zephir_get_intval(b_param); @@ -112,6 +113,7 @@ PHP_METHOD(Test_FetchTest, testFetchArray3) { PHP_METHOD(Test_FetchTest, testFetchArray4) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long b; zval *a = NULL, a_sub, *b_param = NULL; zval *this_ptr = getThis(); @@ -132,6 +134,7 @@ PHP_METHOD(Test_FetchTest, testFetchArray4) { PHP_METHOD(Test_FetchTest, testFetchArray5) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval b; zval *a, a_sub, *b_param = NULL, c; zval *this_ptr = getThis(); @@ -152,6 +155,7 @@ PHP_METHOD(Test_FetchTest, testFetchArray5) { PHP_METHOD(Test_FetchTest, testFetchArray6) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval b; zval *a = NULL, a_sub, *b_param = NULL; zval *this_ptr = getThis(); @@ -173,6 +177,7 @@ PHP_METHOD(Test_FetchTest, testFetchArray6) { PHP_METHOD(Test_FetchTest, testFetchObject1) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *a, a_sub, *b, b_sub, c; zval *this_ptr = getThis(); @@ -192,6 +197,7 @@ PHP_METHOD(Test_FetchTest, testFetchObject1) { PHP_METHOD(Test_FetchTest, testFetchObject2) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *a = NULL, a_sub, *b, b_sub; zval *this_ptr = getThis(); @@ -219,7 +225,7 @@ PHP_METHOD(Test_FetchTest, testFetchPost) { ZVAL_UNDEF(&c); zephir_get_global(&_POST, SL("_POST")); - zephir_fetch_params(0, 1, 0, &b); + zephir_fetch_params_without_memory_grow(1, 0, &b); @@ -232,6 +238,7 @@ PHP_METHOD(Test_FetchTest, testFetchPost) { PHP_METHOD(Test_FetchTest, hasValue) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *name_param = NULL, _POST, _0$$4; zval name; zval *this_ptr = getThis(); @@ -261,6 +268,7 @@ PHP_METHOD(Test_FetchTest, hasValue) { PHP_METHOD(Test_FetchTest, getValue) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *name_param = NULL, _POST, value, _0$$3; zval name; zval *this_ptr = getThis(); diff --git a/ext/test/fibonnaci.zep.c b/ext/test/fibonnaci.zep.c index e37f1932ee..8e5ce671de 100644 --- a/ext/test/fibonnaci.zep.c +++ b/ext/test/fibonnaci.zep.c @@ -77,6 +77,7 @@ PHP_METHOD(Test_Fibonnaci, fibArray) { zend_long i = 0, n = 0, k = 0, j = 0; zval fib, a, b, c, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&fib); @@ -118,6 +119,7 @@ PHP_METHOD(Test_Fibonnaci, fibArray2) { zend_long i = 0, n = 0; zval fib, _0, _1$$3, _2$$3, _3$$3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&fib); @@ -155,6 +157,7 @@ PHP_METHOD(Test_Fibonnaci, fibArray2) { PHP_METHOD(Test_Fibonnaci, fibonacciRecursive) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zephir_fcall_cache_entry *_2 = NULL; zval *n_param = NULL, _0$$6, _1$$6, _3$$6; zend_long n, ZEPHIR_LAST_CALL_STATUS; @@ -191,6 +194,7 @@ PHP_METHOD(Test_Fibonnaci, fibonacciRecursive) { PHP_METHOD(Test_Fibonnaci, fibonacciFinalRecursive) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zephir_fcall_cache_entry *_2 = NULL; zval *n_param = NULL, _0$$6, _1$$6, _3$$6; zend_long n, ZEPHIR_LAST_CALL_STATUS; diff --git a/ext/test/flow.zep.c b/ext/test/flow.zep.c index 6e08d72c4c..2220dd00c8 100644 --- a/ext/test/flow.zep.c +++ b/ext/test/flow.zep.c @@ -290,7 +290,7 @@ PHP_METHOD(Test_Flow, testIf16) { ZVAL_UNDEF(&a_sub); - zephir_fetch_params(0, 1, 0, &a); + zephir_fetch_params_without_memory_grow(1, 0, &a); @@ -308,7 +308,7 @@ PHP_METHOD(Test_Flow, testIf17) { ZVAL_UNDEF(&b_sub); - zephir_fetch_params(0, 1, 0, &b); + zephir_fetch_params_without_memory_grow(1, 0, &b); @@ -594,6 +594,7 @@ PHP_METHOD(Test_Flow, testWhile10) { double c = 0; zend_long b = 0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *a, a_sub; zval *this_ptr = getThis(); @@ -629,6 +630,7 @@ PHP_METHOD(Test_Flow, testWhile11) { double c = 0; zend_long b = 0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *a, a_sub, *d, d_sub; zval *this_ptr = getThis(); @@ -665,6 +667,7 @@ PHP_METHOD(Test_Flow, testWhile12) { zval _0; zval b; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&b); @@ -691,6 +694,7 @@ PHP_METHOD(Test_Flow, testWhile13) { zval _0; zend_long a; zval b; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&b); @@ -725,6 +729,7 @@ PHP_METHOD(Test_Flow, testDoWhile1) { PHP_METHOD(Test_Flow, testWhileNextTest) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_1 = NULL, *_3 = NULL; zval *variable, variable_sub, returnValue, _0, _2$$3; @@ -760,6 +765,7 @@ PHP_METHOD(Test_Flow, testWhileNextTest) { PHP_METHOD(Test_Flow, testWhileDoNextTest) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_1 = NULL, *_3 = NULL; zval *variable, variable_sub, returnValue, _2, _0$$3; @@ -793,6 +799,7 @@ PHP_METHOD(Test_Flow, testWhileDoNextTest) { PHP_METHOD(Test_Flow, testFor1) { zval v, b, _0, *_1, _2; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, c = 0; zval *this_ptr = getThis(); @@ -853,6 +860,7 @@ PHP_METHOD(Test_Flow, testFor2) { zend_ulong _3; double c = 0; zval v, k, b, _0, *_1, _2; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -920,6 +928,7 @@ PHP_METHOD(Test_Flow, testFor2) { PHP_METHOD(Test_Flow, testFor3) { zval v, b, c, _0, *_1, _2; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -981,6 +990,7 @@ PHP_METHOD(Test_Flow, testFor4) { zend_long _1, _2; zend_bool _0; zval a, b; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -1047,6 +1057,7 @@ PHP_METHOD(Test_Flow, testFor6) { zend_long _1, _2; zend_bool _0; zval a, b; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -1177,6 +1188,7 @@ PHP_METHOD(Test_Flow, testFor10) { zend_bool _0; zend_long c = 0, d = 0, _1, _2; zval a, b; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -1215,6 +1227,7 @@ PHP_METHOD(Test_Flow, testFor11) { zend_bool _0; zval b; char a = 0, _1, _2; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&b); @@ -1249,6 +1262,7 @@ PHP_METHOD(Test_Flow, testFor12) { zend_bool _0; zval b; char a = 0, _1, _2; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&b); @@ -1283,6 +1297,7 @@ PHP_METHOD(Test_Flow, testFor13) { zend_bool _0; zval b; char a = 0, _1, _2; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&b); @@ -1317,6 +1332,7 @@ PHP_METHOD(Test_Flow, testFor14) { zend_bool _0; zval b; char a = 0, _1, _2; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&b); @@ -1354,7 +1370,7 @@ PHP_METHOD(Test_Flow, testFor15) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 2, 0, &c_param, &d_param); + zephir_fetch_params_without_memory_grow(2, 0, &c_param, &d_param); c = zephir_get_intval(c_param); d = zephir_get_intval(d_param); @@ -1388,6 +1404,7 @@ PHP_METHOD(Test_Flow, testFor16) { zend_bool _1; long _0; zval a, b, c; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -1430,6 +1447,7 @@ PHP_METHOD(Test_Flow, testFor17) { zend_bool _1; long _0; zval a, b, c; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -1472,6 +1490,7 @@ PHP_METHOD(Test_Flow, testFor18) { long _0; zval c, _4$$3; zend_long a = 0, b = 0, _2, _3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&c); @@ -1512,6 +1531,7 @@ PHP_METHOD(Test_Flow, testFor19) { zend_long _1, _2; zend_bool _0; zval a, b; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -1548,6 +1568,7 @@ PHP_METHOD(Test_Flow, testFor20) { zend_long _1, _2; zend_bool _0; zval a, b; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -1584,6 +1605,7 @@ PHP_METHOD(Test_Flow, testFor21) { zend_long _1, _2; zend_bool _0; zval a, b; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -1620,6 +1642,7 @@ PHP_METHOD(Test_Flow, testFor22) { zend_long _1, _2; zend_bool _0; zval a, b; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -1657,6 +1680,7 @@ PHP_METHOD(Test_Flow, testFor23) { zend_bool _0; zval b; zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -1694,6 +1718,7 @@ PHP_METHOD(Test_Flow, testFor24) { zval _0; zval b; zval a, _1, *_2, _3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -1756,6 +1781,7 @@ PHP_METHOD(Test_Flow, testFor30) { zend_long v = 0; zval b; zval a, _1$$3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -1784,6 +1810,7 @@ PHP_METHOD(Test_Flow, testFor31) { zend_long k = 0, v = 0; zval b; zval a, _1$$3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -1810,6 +1837,7 @@ PHP_METHOD(Test_Flow, testFor31) { PHP_METHOD(Test_Flow, testFor32) { long sum; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *e, e_sub, v, *_0, _1; zval *this_ptr = getThis(); @@ -1856,6 +1884,7 @@ PHP_METHOD(Test_Flow, testFor32) { PHP_METHOD(Test_Flow, testFor33) { zend_object_iterator *_0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *e, e_sub, v, result; zval *this_ptr = getThis(); @@ -1886,6 +1915,7 @@ PHP_METHOD(Test_Flow, testFor33) { PHP_METHOD(Test_Flow, testFor34) { zend_object_iterator *_0$$3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *e = NULL, e_sub, __$null, v, result; zval *this_ptr = getThis(); @@ -1928,7 +1958,7 @@ PHP_METHOD(Test_Flow, testFor35Aux) { ZVAL_UNDEF(&hello_sub); - zephir_fetch_params(0, 1, 0, &hello); + zephir_fetch_params_without_memory_grow(1, 0, &hello); @@ -1940,6 +1970,7 @@ PHP_METHOD(Test_Flow, testFor35) { zend_bool _0; zval i, _3$$3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zephir_fcall_cache_entry *_4 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, _1, _2; zval *this_ptr = getThis(); @@ -1981,7 +2012,7 @@ PHP_METHOD(Test_Flow, testFor36Aux) { ZVAL_UNDEF(&hello_sub); - zephir_fetch_params(0, 1, 0, &hello); + zephir_fetch_params_without_memory_grow(1, 0, &hello); @@ -1995,6 +2026,7 @@ PHP_METHOD(Test_Flow, testFor36) { zend_bool _0; zval i, _3$$3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zephir_fcall_cache_entry *_4 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, _1, _2; zval *this_ptr = getThis(); @@ -2065,6 +2097,7 @@ PHP_METHOD(Test_Flow, testFor38) { long _0; zval v; zend_long i, _2, _3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&v); @@ -2124,6 +2157,7 @@ PHP_METHOD(Test_Flow, testFor40) { zend_long _1, _2; zend_bool _0; zval a, b, _3$$3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -2165,6 +2199,7 @@ PHP_METHOD(Test_Flow, testUnrechable1) { zend_bool c; double b; zend_long a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&d); @@ -2203,6 +2238,7 @@ PHP_METHOD(Test_Flow, testUnrechable2) { zend_bool c; double b; zend_long a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&d); diff --git a/ext/test/flow/switchflow.zep.c b/ext/test/flow/switchflow.zep.c index 33a6c1016c..e819a6754c 100644 --- a/ext/test/flow/switchflow.zep.c +++ b/ext/test/flow/switchflow.zep.c @@ -235,7 +235,7 @@ PHP_METHOD(Test_Flow_SwitchFlow, testSwitch12) { ZVAL_UNDEF(&var1_sub); ZVAL_UNDEF(&var2_sub); - zephir_fetch_params(0, 2, 0, &var1, &var2); + zephir_fetch_params_without_memory_grow(2, 0, &var1, &var2); @@ -270,7 +270,7 @@ PHP_METHOD(Test_Flow_SwitchFlow, testSwitch13) { ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); - zephir_fetch_params(0, 1, 0, &a_param); + zephir_fetch_params_without_memory_grow(1, 0, &a_param); a = zephir_get_intval(a_param); diff --git a/ext/test/fortytwo.zep.c b/ext/test/fortytwo.zep.c index bc143a2921..b384667525 100644 --- a/ext/test/fortytwo.zep.c +++ b/ext/test/fortytwo.zep.c @@ -36,6 +36,7 @@ PHP_METHOD(Test_FortyTwo, proof) { zend_bool _4$$3, _8$$6; zval _0; zval box, side, _1, *_2, _3, _7$$4, _11$$7; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, i = 0, j = 0, _5$$3, _6$$3, _9$$6, _10$$6; zval *this_ptr = getThis(); diff --git a/ext/test/functional.zep.c b/ext/test/functional.zep.c index 34a41f1f7e..0fb0dc2ee4 100644 --- a/ext/test/functional.zep.c +++ b/ext/test/functional.zep.c @@ -28,6 +28,7 @@ ZEPHIR_INIT_CLASS(Test_Functional) { PHP_METHOD(Test_Functional, map1) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *a_param = NULL, _0, _1; zval a; @@ -54,6 +55,7 @@ PHP_METHOD(Test_Functional, map1) { PHP_METHOD(Test_Functional, map2) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *a_param = NULL, *b, b_sub, _0; zval a; diff --git a/ext/test/functionexists.zep.c b/ext/test/functionexists.zep.c index c4a764bf9e..43670eb7d9 100644 --- a/ext/test/functionexists.zep.c +++ b/ext/test/functionexists.zep.c @@ -29,6 +29,7 @@ ZEPHIR_INIT_CLASS(Test_FunctionExists) { PHP_METHOD(Test_FunctionExists, testWithPassedName) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *func_param = NULL; zval func; zval *this_ptr = getThis(); @@ -49,6 +50,7 @@ PHP_METHOD(Test_FunctionExists, testBuiltInFunctions) { zval result, functions; zval func, _0, *_1, _2, _3$$3, _4$$4; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); diff --git a/ext/test/geometry.zep.c b/ext/test/geometry.zep.c index 0871992ebe..11f191b2cf 100644 --- a/ext/test/geometry.zep.c +++ b/ext/test/geometry.zep.c @@ -30,6 +30,7 @@ ZEPHIR_INIT_CLASS(Test_Geometry) { PHP_METHOD(Test_Geometry, run) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zephir_fcall_cache_entry *_0 = NULL; zend_long count, ZEPHIR_LAST_CALL_STATUS, i; zval *list_param = NULL, *count_param = NULL, _1$$3, _2$$3, _3$$3, _4$$3, _5$$3, _6$$3, _7$$3, _8$$3; @@ -76,6 +77,7 @@ PHP_METHOD(Test_Geometry, run) { PHP_METHOD(Test_Geometry, runOptimize) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zephir_fcall_cache_entry *_0 = NULL; zend_long count, ZEPHIR_LAST_CALL_STATUS, i; zval *list_param = NULL, *count_param = NULL, item, _1$$3, _2$$3, _3$$3, _4$$3; @@ -123,7 +125,7 @@ PHP_METHOD(Test_Geometry, distanceStatic) { ZVAL_UNDEF(&_0); - zephir_fetch_params(0, 4, 0, &x1_param, &y1_param, &x2_param, &y2_param); + zephir_fetch_params_without_memory_grow(4, 0, &x1_param, &y1_param, &x2_param, &y2_param); x1 = zephir_get_doubleval(x1_param); y1 = zephir_get_doubleval(y1_param); diff --git a/ext/test/globals.zep.c b/ext/test/globals.zep.c index dd093213fb..c6e9510c26 100644 --- a/ext/test/globals.zep.c +++ b/ext/test/globals.zep.c @@ -31,7 +31,7 @@ PHP_METHOD(Test_Globals, setBoolValueUsingDotNotation) { ZVAL_UNDEF(&value_sub); - zephir_fetch_params(0, 1, 0, &value); + zephir_fetch_params_without_memory_grow(1, 0, &value); @@ -46,7 +46,7 @@ PHP_METHOD(Test_Globals, setIntValueUsingDotNotation) { ZVAL_UNDEF(&value_sub); - zephir_fetch_params(0, 1, 0, &value); + zephir_fetch_params_without_memory_grow(1, 0, &value); @@ -61,7 +61,7 @@ PHP_METHOD(Test_Globals, setCharValue) { ZVAL_UNDEF(&value_sub); - zephir_fetch_params(0, 1, 0, &value); + zephir_fetch_params_without_memory_grow(1, 0, &value); @@ -76,7 +76,7 @@ PHP_METHOD(Test_Globals, setBoolValue) { ZVAL_UNDEF(&value_sub); - zephir_fetch_params(0, 1, 0, &value); + zephir_fetch_params_without_memory_grow(1, 0, &value); @@ -91,7 +91,7 @@ PHP_METHOD(Test_Globals, setDefaultGlobalsOrmCacheLevel) { ZVAL_UNDEF(&value_sub); - zephir_fetch_params(0, 1, 0, &value); + zephir_fetch_params_without_memory_grow(1, 0, &value); diff --git a/ext/test/globals/env.zep.c b/ext/test/globals/env.zep.c index b07604ca63..23ee73b00c 100644 --- a/ext/test/globals/env.zep.c +++ b/ext/test/globals/env.zep.c @@ -28,6 +28,7 @@ ZEPHIR_INIT_CLASS(Test_Globals_Env) { PHP_METHOD(Test_Globals_Env, read) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *name_param = NULL, _ENV, _0; zval name; zval *this_ptr = getThis(); diff --git a/ext/test/globals/post.zep.c b/ext/test/globals/post.zep.c index faff702500..798782e60a 100644 --- a/ext/test/globals/post.zep.c +++ b/ext/test/globals/post.zep.c @@ -33,6 +33,7 @@ ZEPHIR_INIT_CLASS(Test_Globals_Post) { */ PHP_METHOD(Test_Globals_Post, hasValue) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *name_param = NULL, _POST; zval name; zval *this_ptr = getThis(); diff --git a/ext/test/globals/session/base.zep.c b/ext/test/globals/session/base.zep.c index 53fee25fd1..644310c0cc 100644 --- a/ext/test/globals/session/base.zep.c +++ b/ext/test/globals/session/base.zep.c @@ -29,6 +29,7 @@ ZEPHIR_INIT_CLASS(Test_Globals_Session_Base) { PHP_METHOD(Test_Globals_Session_Base, set) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *index_param = NULL, *value, value_sub, _SESSION; zval index; zval *this_ptr = getThis(); @@ -52,6 +53,7 @@ PHP_METHOD(Test_Globals_Session_Base, set) { PHP_METHOD(Test_Globals_Session_Base, remove) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *index_param = NULL, _SESSION; zval index; zval *this_ptr = getThis(); @@ -73,6 +75,7 @@ PHP_METHOD(Test_Globals_Session_Base, remove) { PHP_METHOD(Test_Globals_Session_Base, __set) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *index_param = NULL, *value, value_sub; zval index; @@ -95,6 +98,7 @@ PHP_METHOD(Test_Globals_Session_Base, __set) { PHP_METHOD(Test_Globals_Session_Base, __unset) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *index_param = NULL; zval index; @@ -118,6 +122,7 @@ PHP_METHOD(Test_Globals_Session_Base, removeSessionData) { zend_string *_4; zend_ulong _3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval _SESSION, key, _0, *_1, _2; zval *this_ptr = getThis(); diff --git a/ext/test/globals/session/child.zep.c b/ext/test/globals/session/child.zep.c index 741c5c691c..da78134737 100644 --- a/ext/test/globals/session/child.zep.c +++ b/ext/test/globals/session/child.zep.c @@ -27,6 +27,7 @@ ZEPHIR_INIT_CLASS(Test_Globals_Session_Child) { PHP_METHOD(Test_Globals_Session_Child, destroy) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); diff --git a/ext/test/instance.zep.c b/ext/test/instance.zep.c index 21b399d665..350aa1a587 100644 --- a/ext/test/instance.zep.c +++ b/ext/test/instance.zep.c @@ -47,7 +47,7 @@ PHP_METHOD(Test_Instance, __construct) { ZVAL_UNDEF(&a10_sub); ZVAL_UNDEF(&a11_sub); - zephir_fetch_params(0, 11, 0, &a1, &a2, &a3, &a4, &a5, &a6, &a7, &a8, &a9, &a10, &a11); + zephir_fetch_params_without_memory_grow(11, 0, &a1, &a2, &a3, &a4, &a5, &a6, &a7, &a8, &a9, &a10, &a11); @@ -57,6 +57,7 @@ PHP_METHOD(Test_Instance, __construct) { PHP_METHOD(Test_Instance, testIssue1339) { zval parameters, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -152,6 +153,7 @@ PHP_METHOD(Test_Instance, testIssue1339) { PHP_METHOD(Test_Instance, testInstanceCreate) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *className_param = NULL; zval className; diff --git a/ext/test/instanceoff.zep.c b/ext/test/instanceoff.zep.c index 557e5158c5..94dc4aae70 100644 --- a/ext/test/instanceoff.zep.c +++ b/ext/test/instanceoff.zep.c @@ -32,6 +32,7 @@ ZEPHIR_INIT_CLASS(Test_Instanceoff) { PHP_METHOD(Test_Instanceoff, testInstanceOf1) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -47,6 +48,7 @@ PHP_METHOD(Test_Instanceoff, testInstanceOf1) { PHP_METHOD(Test_Instanceoff, testInstanceOf2) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -67,6 +69,7 @@ PHP_METHOD(Test_Instanceoff, testInstanceOf2) { PHP_METHOD(Test_Instanceoff, testInstanceOf3) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -86,7 +89,7 @@ PHP_METHOD(Test_Instanceoff, testInstanceOf4) { ZVAL_UNDEF(&a_sub); - zephir_fetch_params(0, 1, 0, &a); + zephir_fetch_params_without_memory_grow(1, 0, &a); @@ -104,7 +107,7 @@ PHP_METHOD(Test_Instanceoff, testInstanceOf5) { ZVAL_UNDEF(&a_sub); - zephir_fetch_params(0, 1, 0, &a); + zephir_fetch_params_without_memory_grow(1, 0, &a); @@ -118,6 +121,7 @@ PHP_METHOD(Test_Instanceoff, testInstanceOf5) { PHP_METHOD(Test_Instanceoff, testInstanceOf6) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -142,7 +146,7 @@ PHP_METHOD(Test_Instanceoff, testInstanceOf7) { ZVAL_UNDEF(&test_sub); - zephir_fetch_params(0, 1, 0, &test); + zephir_fetch_params_without_memory_grow(1, 0, &test); @@ -152,6 +156,7 @@ PHP_METHOD(Test_Instanceoff, testInstanceOf7) { PHP_METHOD(Test_Instanceoff, testInstanceOf8) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *test_param = NULL, a; zval test; @@ -178,6 +183,7 @@ PHP_METHOD(Test_Instanceoff, testInstanceOf8) { PHP_METHOD(Test_Instanceoff, testInstanceOf9) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval test; zval *a, a_sub, *test_param = NULL; zval *this_ptr = getThis(); diff --git a/ext/test/internalclasses.zep.c b/ext/test/internalclasses.zep.c index 1dfa7315fa..a074bf7434 100644 --- a/ext/test/internalclasses.zep.c +++ b/ext/test/internalclasses.zep.c @@ -28,6 +28,7 @@ ZEPHIR_INIT_CLASS(Test_InternalClasses) { PHP_METHOD(Test_InternalClasses, testStaticCall) { zend_class_entry *_0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); diff --git a/ext/test/invoke.zep.c b/ext/test/invoke.zep.c index 0d1b648592..1a79859d32 100644 --- a/ext/test/invoke.zep.c +++ b/ext/test/invoke.zep.c @@ -30,6 +30,7 @@ ZEPHIR_INIT_CLASS(Test_Invoke) { PHP_METHOD(Test_Invoke, __construct) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -61,6 +62,7 @@ PHP_METHOD(Test_Invoke, __invoke) { PHP_METHOD(Test_Invoke, test) { zval func; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); diff --git a/ext/test/issettest.zep.c b/ext/test/issettest.zep.c index 1e5d53cfde..56e0bb8d40 100644 --- a/ext/test/issettest.zep.c +++ b/ext/test/issettest.zep.c @@ -40,7 +40,7 @@ PHP_METHOD(Test_IssetTest, testIssetArray1) { ZVAL_UNDEF(&a_sub); ZVAL_UNDEF(&b_sub); - zephir_fetch_params(0, 2, 0, &a, &b); + zephir_fetch_params_without_memory_grow(2, 0, &a, &b); @@ -56,7 +56,7 @@ PHP_METHOD(Test_IssetTest, testIssetArray2) { ZVAL_UNDEF(&a_sub); - zephir_fetch_params(0, 2, 0, &a, &b_param); + zephir_fetch_params_without_memory_grow(2, 0, &a, &b_param); b = zephir_get_intval(b_param); @@ -67,6 +67,7 @@ PHP_METHOD(Test_IssetTest, testIssetArray2) { PHP_METHOD(Test_IssetTest, testIssetArray3) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval b; zval *a, a_sub, *b_param = NULL; zval *this_ptr = getThis(); @@ -91,7 +92,7 @@ PHP_METHOD(Test_IssetTest, testIssetArray4) { ZVAL_UNDEF(&a_sub); - zephir_fetch_params(0, 1, 0, &a); + zephir_fetch_params_without_memory_grow(1, 0, &a); @@ -106,7 +107,7 @@ PHP_METHOD(Test_IssetTest, testIssetArray5) { ZVAL_UNDEF(&a_sub); - zephir_fetch_params(0, 1, 0, &a); + zephir_fetch_params_without_memory_grow(1, 0, &a); @@ -121,7 +122,7 @@ PHP_METHOD(Test_IssetTest, testIssetProperty1) { ZVAL_UNDEF(&a_sub); - zephir_fetch_params(0, 1, 0, &a); + zephir_fetch_params_without_memory_grow(1, 0, &a); @@ -137,7 +138,7 @@ PHP_METHOD(Test_IssetTest, testIssetProperty2) { ZVAL_UNDEF(&a_sub); ZVAL_UNDEF(&b_sub); - zephir_fetch_params(0, 2, 0, &a, &b); + zephir_fetch_params_without_memory_grow(2, 0, &a, &b); @@ -152,7 +153,7 @@ PHP_METHOD(Test_IssetTest, testIssetProperty3) { ZVAL_UNDEF(&a_sub); - zephir_fetch_params(0, 1, 0, &a); + zephir_fetch_params_without_memory_grow(1, 0, &a); @@ -163,6 +164,7 @@ PHP_METHOD(Test_IssetTest, testIssetProperty3) { PHP_METHOD(Test_IssetTest, testIssetDynamicProperty1) { zval g; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&g); @@ -180,6 +182,7 @@ PHP_METHOD(Test_IssetTest, testIssetDynamicProperty1) { PHP_METHOD(Test_IssetTest, testIssetDynamicProperty2) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *inp, inp_sub, g; zval *this_ptr = getThis(); @@ -204,6 +207,7 @@ zend_object *zephir_init_properties_Test_IssetTest(zend_class_entry *class_type zval _1$$3; zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1$$3); diff --git a/ext/test/issue1521.zep.c b/ext/test/issue1521.zep.c index 59a78ca5a3..d584b3c4de 100644 --- a/ext/test/issue1521.zep.c +++ b/ext/test/issue1521.zep.c @@ -30,6 +30,7 @@ ZEPHIR_INIT_CLASS(Test_Issue1521) { PHP_METHOD(Test_Issue1521, test) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); diff --git a/ext/test/issues.zep.c b/ext/test/issues.zep.c index 3343d54240..e263d3da0a 100644 --- a/ext/test/issues.zep.c +++ b/ext/test/issues.zep.c @@ -34,7 +34,7 @@ PHP_METHOD(Test_Issues, setAdapter) { ZVAL_UNDEF(&adapter_sub); - zephir_fetch_params(0, 1, 0, &adapter); + zephir_fetch_params_without_memory_grow(1, 0, &adapter); @@ -44,6 +44,7 @@ PHP_METHOD(Test_Issues, setAdapter) { PHP_METHOD(Test_Issues, someMethod) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *methodName, methodName_sub, _0; zval *this_ptr = getThis(); diff --git a/ext/test/json.zep.c b/ext/test/json.zep.c index cc0b1e817a..25b402e8fc 100644 --- a/ext/test/json.zep.c +++ b/ext/test/json.zep.c @@ -30,6 +30,7 @@ ZEPHIR_INIT_CLASS(Test_Json) { PHP_METHOD(Test_Json, testEncodeObject) { zval obj; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&obj); @@ -49,6 +50,7 @@ PHP_METHOD(Test_Json, testEncodeObject) { PHP_METHOD(Test_Json, testEncodeArray) { zval arr, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&arr); @@ -75,6 +77,7 @@ PHP_METHOD(Test_Json, testEncodeArray) { PHP_METHOD(Test_Json, testEncodeOptions) { zval arr, _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&arr); @@ -106,6 +109,7 @@ PHP_METHOD(Test_Json, testEncodeOptions) { PHP_METHOD(Test_Json, testDecodeObject) { zval obj; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&obj); @@ -121,6 +125,7 @@ PHP_METHOD(Test_Json, testDecodeObject) { PHP_METHOD(Test_Json, testDecodeObject2) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$true, obj; zval *this_ptr = getThis(); @@ -139,6 +144,7 @@ PHP_METHOD(Test_Json, testDecodeObject2) { PHP_METHOD(Test_Json, testDecodeArray) { zval arr; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&arr); diff --git a/ext/test/logical.zep.c b/ext/test/logical.zep.c index 13dc04dcd0..d91a309ba9 100644 --- a/ext/test/logical.zep.c +++ b/ext/test/logical.zep.c @@ -108,7 +108,7 @@ PHP_METHOD(Test_Logical, testAnd9) { ZVAL_UNDEF(&a_sub); ZVAL_UNDEF(&_1$$3); - zephir_fetch_params(0, 2, 0, &a, &b_param); + zephir_fetch_params_without_memory_grow(2, 0, &a, &b_param); b = zephir_get_intval(b_param); @@ -191,7 +191,7 @@ PHP_METHOD(Test_Logical, testMixed2) { ZVAL_UNDEF(&minLength_sub); ZVAL_UNDEF(&_2); - zephir_fetch_params(0, 2, 0, &match, &minLength); + zephir_fetch_params_without_memory_grow(2, 0, &match, &minLength); @@ -247,7 +247,7 @@ PHP_METHOD(Test_Logical, testMixed4) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 2, 0, &a_param, &b_param); + zephir_fetch_params_without_memory_grow(2, 0, &a_param, &b_param); a = zephir_get_boolval(a_param); b = zephir_get_boolval(b_param); diff --git a/ext/test/mcall.zep.c b/ext/test/mcall.zep.c index 42ac656542..38bad9a1de 100644 --- a/ext/test/mcall.zep.c +++ b/ext/test/mcall.zep.c @@ -67,7 +67,7 @@ PHP_METHOD(Test_Mcall, testMethod4) { ZVAL_UNDEF(&a_sub); ZVAL_UNDEF(&b_sub); - zephir_fetch_params(0, 2, 0, &a, &b); + zephir_fetch_params_without_memory_grow(2, 0, &a, &b); @@ -84,7 +84,7 @@ PHP_METHOD(Test_Mcall, testMethod5) { ZVAL_UNDEF(&a_sub); ZVAL_UNDEF(&b_sub); - zephir_fetch_params(0, 2, 0, &a, &b); + zephir_fetch_params_without_memory_grow(2, 0, &a, &b); @@ -101,7 +101,7 @@ PHP_METHOD(Test_Mcall, testMethod6) { ZVAL_UNDEF(&a_sub); ZVAL_UNDEF(&b_sub); - zephir_fetch_params(0, 2, 0, &a, &b); + zephir_fetch_params_without_memory_grow(2, 0, &a, &b); @@ -122,6 +122,7 @@ PHP_METHOD(Test_Mcall, testMethod7) { PHP_METHOD(Test_Mcall, testCall1) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -136,6 +137,7 @@ PHP_METHOD(Test_Mcall, testCall1) { PHP_METHOD(Test_Mcall, testCall2) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -150,6 +152,7 @@ PHP_METHOD(Test_Mcall, testCall2) { PHP_METHOD(Test_Mcall, testCall3) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -164,6 +167,7 @@ PHP_METHOD(Test_Mcall, testCall3) { PHP_METHOD(Test_Mcall, testCall4) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *a, a_sub, *b, b_sub; zval *this_ptr = getThis(); @@ -184,6 +188,7 @@ PHP_METHOD(Test_Mcall, testCall4) { PHP_METHOD(Test_Mcall, testCall5) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *a, a_sub, *b, b_sub; zval *this_ptr = getThis(); @@ -204,6 +209,7 @@ PHP_METHOD(Test_Mcall, testCall5) { PHP_METHOD(Test_Mcall, testCall6) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *a, a_sub, *b, b_sub; zval *this_ptr = getThis(); @@ -224,6 +230,7 @@ PHP_METHOD(Test_Mcall, testCall6) { PHP_METHOD(Test_Mcall, testCall7) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zephir_fcall_cache_entry *_1 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *a, a_sub, *b, b_sub, _0, _2; @@ -250,6 +257,7 @@ PHP_METHOD(Test_Mcall, testCall7) { PHP_METHOD(Test_Mcall, testCall8) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zephir_fcall_cache_entry *_1 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *a, a_sub, *b, b_sub, _0, _2; @@ -276,6 +284,7 @@ PHP_METHOD(Test_Mcall, testCall8) { PHP_METHOD(Test_Mcall, testCall9) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *a, a_sub, *b, b_sub, _0, _1; zval *this_ptr = getThis(); @@ -301,6 +310,7 @@ PHP_METHOD(Test_Mcall, testCall9) { PHP_METHOD(Test_Mcall, testCall10) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -315,6 +325,7 @@ PHP_METHOD(Test_Mcall, testCall10) { PHP_METHOD(Test_Mcall, testCall11) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -329,6 +340,7 @@ PHP_METHOD(Test_Mcall, testCall11) { PHP_METHOD(Test_Mcall, testCall12) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -343,6 +355,7 @@ PHP_METHOD(Test_Mcall, testCall12) { PHP_METHOD(Test_Mcall, testCall13) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *a, a_sub, *b, b_sub; zval *this_ptr = getThis(); @@ -363,6 +376,7 @@ PHP_METHOD(Test_Mcall, testCall13) { PHP_METHOD(Test_Mcall, testCall14) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *a, a_sub, *b, b_sub; zval *this_ptr = getThis(); @@ -383,6 +397,7 @@ PHP_METHOD(Test_Mcall, testCall14) { PHP_METHOD(Test_Mcall, testCall15) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *a, a_sub, *b, b_sub; zval *this_ptr = getThis(); @@ -403,6 +418,7 @@ PHP_METHOD(Test_Mcall, testCall15) { PHP_METHOD(Test_Mcall, testCall16) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *c, c_sub, *d, d_sub; zval *this_ptr = getThis(); @@ -423,6 +439,7 @@ PHP_METHOD(Test_Mcall, testCall16) { PHP_METHOD(Test_Mcall, testCall17) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *c, c_sub, *d, d_sub; zval *this_ptr = getThis(); @@ -443,6 +460,7 @@ PHP_METHOD(Test_Mcall, testCall17) { PHP_METHOD(Test_Mcall, testCall18) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -462,7 +480,7 @@ PHP_METHOD(Test_Mcall, testMethod19) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 2, 0, &a_param, &b_param); + zephir_fetch_params_without_memory_grow(2, 0, &a_param, &b_param); a = zephir_get_intval(a_param); b = zephir_get_intval(b_param); @@ -475,6 +493,7 @@ PHP_METHOD(Test_Mcall, testMethod19) { PHP_METHOD(Test_Mcall, testCall20) { zend_bool _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zephir_fcall_cache_entry *_4 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, _1; zval *k_param = NULL, *p, p_sub, _3$$3; @@ -521,7 +540,7 @@ PHP_METHOD(Test_Mcall, testMethod21) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 2, 0, &a_param, &b_param); + zephir_fetch_params_without_memory_grow(2, 0, &a_param, &b_param); a = zephir_get_intval(a_param); b = zephir_get_intval(b_param); @@ -534,6 +553,7 @@ PHP_METHOD(Test_Mcall, testMethod21) { PHP_METHOD(Test_Mcall, testCall22) { zend_bool _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zephir_fcall_cache_entry *_4 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, _1; zval *k_param = NULL, *p, p_sub, _3$$3; @@ -575,6 +595,7 @@ PHP_METHOD(Test_Mcall, testCall22) { PHP_METHOD(Test_Mcall, optionalRequereString) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *param_param = NULL; zval param; zval *this_ptr = getThis(); @@ -602,6 +623,7 @@ PHP_METHOD(Test_Mcall, optionalRequereString) { PHP_METHOD(Test_Mcall, optionalParameterString) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *param_param = NULL; zval param; zval *this_ptr = getThis(); @@ -625,6 +647,7 @@ PHP_METHOD(Test_Mcall, optionalParameterString) { PHP_METHOD(Test_Mcall, optionalParameterStringNull) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *param_param = NULL; zval param; zval *this_ptr = getThis(); @@ -653,7 +676,7 @@ PHP_METHOD(Test_Mcall, optionalParameterInt) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 0, 1, ¶m_param); + zephir_fetch_params_without_memory_grow(0, 1, ¶m_param); if (!param_param) { param = 2; @@ -674,7 +697,7 @@ PHP_METHOD(Test_Mcall, optionalParameterVar) { ZVAL_UNDEF(¶m_sub); ZVAL_NULL(&__$null); - zephir_fetch_params(0, 0, 1, ¶m); + zephir_fetch_params_without_memory_grow(0, 1, ¶m); if (!param) { param = ¶m_sub; @@ -694,7 +717,7 @@ PHP_METHOD(Test_Mcall, optionalParameterBoolTrue) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 0, 1, ¶m_param); + zephir_fetch_params_without_memory_grow(0, 1, ¶m_param); if (!param_param) { param = 1; @@ -714,7 +737,7 @@ PHP_METHOD(Test_Mcall, optionalParameterBoolFalse) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 0, 1, ¶m_param); + zephir_fetch_params_without_memory_grow(0, 1, ¶m_param); if (!param_param) { param = 0; @@ -734,7 +757,7 @@ PHP_METHOD(Test_Mcall, optionalParameterBoolean) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 0, 1, &start_param); + zephir_fetch_params_without_memory_grow(0, 1, &start_param); if (!start_param) { start = 1; @@ -758,7 +781,7 @@ PHP_METHOD(Test_Mcall, optionalParameterBooleanNull) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 0, 1, &value_param); + zephir_fetch_params_without_memory_grow(0, 1, &value_param); if (!value_param) { value = 0; @@ -780,6 +803,7 @@ PHP_METHOD(Test_Mcall, optionalParameterBooleanNull) { */ PHP_METHOD(Test_Mcall, arrayParamWithDefaultEmptyArray) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *driverOptions_param = NULL; zval driverOptions; zval *this_ptr = getThis(); @@ -803,6 +827,7 @@ PHP_METHOD(Test_Mcall, arrayParamWithDefaultEmptyArray) { PHP_METHOD(Test_Mcall, arrayParamWithDefaultNullValue) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *driverOptions_param = NULL; zval driverOptions; zval *this_ptr = getThis(); @@ -826,6 +851,7 @@ PHP_METHOD(Test_Mcall, arrayParamWithDefaultNullValue) { PHP_METHOD(Test_Mcall, arrayParam) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *driverOptions_param = NULL; zval driverOptions; zval *this_ptr = getThis(); @@ -849,7 +875,7 @@ PHP_METHOD(Test_Mcall, objectParamCastStdClass) { ZVAL_UNDEF(¶m_sub); - zephir_fetch_params(0, 1, 0, ¶m); + zephir_fetch_params_without_memory_grow(1, 0, ¶m); @@ -865,7 +891,7 @@ PHP_METHOD(Test_Mcall, objectParamCastOoParam) { ZVAL_UNDEF(¶m_sub); - zephir_fetch_params(0, 1, 0, ¶m); + zephir_fetch_params_without_memory_grow(1, 0, ¶m); @@ -886,6 +912,7 @@ PHP_METHOD(Test_Mcall, bb) { PHP_METHOD(Test_Mcall, testCallablePass) { zval a, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -913,6 +940,7 @@ PHP_METHOD(Test_Mcall, testCallableArrayThisMethodPass) { zval _0; zval a, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -943,6 +971,7 @@ PHP_METHOD(Test_Mcall, testCallableArrayThisMethodPass) { PHP_METHOD(Test_Mcall, aa) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); diff --git a/ext/test/mcall/caller.zep.c b/ext/test/mcall/caller.zep.c index acdeac93bb..98e4185dcc 100644 --- a/ext/test/mcall/caller.zep.c +++ b/ext/test/mcall/caller.zep.c @@ -27,6 +27,7 @@ ZEPHIR_INIT_CLASS(Test_Mcall_Caller) { PHP_METHOD(Test_Mcall_Caller, start) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *f, f_sub; zval *this_ptr = getThis(); diff --git a/ext/test/mcallchained.zep.c b/ext/test/mcallchained.zep.c index af04da695b..da23c67ea4 100644 --- a/ext/test/mcallchained.zep.c +++ b/ext/test/mcallchained.zep.c @@ -60,6 +60,7 @@ PHP_METHOD(Test_McallChained, testMethod3) { PHP_METHOD(Test_McallChained, testChained1) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -78,6 +79,7 @@ PHP_METHOD(Test_McallChained, testChained1) { PHP_METHOD(Test_McallChained, testChained2) { zval _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -99,6 +101,7 @@ PHP_METHOD(Test_McallChained, testChained2) { PHP_METHOD(Test_McallChained, testChained3) { zval _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -120,6 +123,7 @@ PHP_METHOD(Test_McallChained, testChained3) { PHP_METHOD(Test_McallChained, testChained4) { zval _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); diff --git a/ext/test/mcalldynamic.zep.c b/ext/test/mcalldynamic.zep.c index aa3050e6a8..bd906fdbfd 100644 --- a/ext/test/mcalldynamic.zep.c +++ b/ext/test/mcalldynamic.zep.c @@ -42,6 +42,7 @@ PHP_METHOD(Test_McallDynamic, testMethod1) { PHP_METHOD(Test_McallDynamic, testMagicCall1) { zval _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -61,6 +62,7 @@ PHP_METHOD(Test_McallDynamic, testMagicCall1) { PHP_METHOD(Test_McallDynamic, __call) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *method, method_sub, *arguments, arguments_sub, realMethod; zval *this_ptr = getThis(); @@ -88,6 +90,7 @@ PHP_METHOD(Test_McallDynamic, __call) { PHP_METHOD(Test_McallDynamic, testCallAnonymousFunctionWithContext) { zval result, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *this_ptr = getThis(); diff --git a/ext/test/mcallinternal.zep.c b/ext/test/mcallinternal.zep.c index 5eb6f9fcf6..8c5057f368 100644 --- a/ext/test/mcallinternal.zep.c +++ b/ext/test/mcallinternal.zep.c @@ -33,6 +33,7 @@ ZEPHIR_INIT_CLASS(Test_McallInternal) { void zep_Test_McallInternal_a(int ht, zval *return_value, zval *this_ptr, int return_value_used) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; ZVAL_UNDEF(&_0); ZEPHIR_MM_GROW(); @@ -80,6 +81,7 @@ void zep_Test_McallInternal_c(int ht, zval *return_value, zval *this_ptr, int re PHP_METHOD(Test_McallInternal, e) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -96,6 +98,7 @@ PHP_METHOD(Test_McallInternal, d) { zval _3$$3; zend_bool _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, a, i = 0, _1, _2; zval *this_ptr = getThis(); @@ -131,6 +134,7 @@ PHP_METHOD(Test_McallInternal, f) { zval _3$$3; zend_bool _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zephir_fcall_cache_entry *_4 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, a, i = 0, _1, _2; zval *this_ptr = getThis(); @@ -168,6 +172,7 @@ PHP_METHOD(Test_McallInternal, g) { zval _3$$3, _4$$3, _5$$3; zend_bool _0; long i = 0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, a, _1, _2; zval *this_ptr = getThis(); @@ -227,6 +232,7 @@ PHP_METHOD(Test_McallInternal, callFibonacci) { zend_bool _0; long i; double p; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, _1, _2; zval *this_ptr = getThis(); diff --git a/ext/test/methodabstract.zep.c b/ext/test/methodabstract.zep.c index 8fe0e627d1..105de28e6e 100644 --- a/ext/test/methodabstract.zep.c +++ b/ext/test/methodabstract.zep.c @@ -28,6 +28,7 @@ ZEPHIR_INIT_CLASS(Test_MethodAbstract) { PHP_METHOD(Test_MethodAbstract, testInterfaceMetho) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); diff --git a/ext/test/methodargs.zep.c b/ext/test/methodargs.zep.c index 7b21d14ba1..330e38919d 100644 --- a/ext/test/methodargs.zep.c +++ b/ext/test/methodargs.zep.c @@ -44,7 +44,7 @@ PHP_METHOD(Test_MethodArgs, setCallable) { ZVAL_UNDEF(&a_sub); - zephir_fetch_params(0, 1, 0, &a); + zephir_fetch_params_without_memory_grow(1, 0, &a); @@ -59,7 +59,7 @@ PHP_METHOD(Test_MethodArgs, setObject) { ZVAL_UNDEF(&a_sub); - zephir_fetch_params(0, 1, 0, &a); + zephir_fetch_params_without_memory_grow(1, 0, &a); @@ -74,7 +74,7 @@ PHP_METHOD(Test_MethodArgs, setCallableStrict) { ZVAL_UNDEF(&a_sub); - zephir_fetch_params(0, 1, 0, &a); + zephir_fetch_params_without_memory_grow(1, 0, &a); if (UNEXPECTED(zephir_is_callable(a TSRMLS_CC) != 1)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'a' must be of the type callable") TSRMLS_CC); @@ -93,7 +93,7 @@ PHP_METHOD(Test_MethodArgs, setObjectStrict) { ZVAL_UNDEF(&a_sub); - zephir_fetch_params(0, 1, 0, &a); + zephir_fetch_params_without_memory_grow(1, 0, &a); if (UNEXPECTED(Z_TYPE_P(a) != IS_OBJECT)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'a' must be of the type object") TSRMLS_CC); @@ -112,7 +112,7 @@ PHP_METHOD(Test_MethodArgs, setResourceStrict) { ZVAL_UNDEF(&a_sub); - zephir_fetch_params(0, 1, 0, &a); + zephir_fetch_params_without_memory_grow(1, 0, &a); if (UNEXPECTED(Z_TYPE_P(a) != IS_RESOURCE)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'a' must be of the type resource") TSRMLS_CC); @@ -129,6 +129,7 @@ PHP_METHOD(Test_MethodArgs, setResourceStrict) { */ PHP_METHOD(Test_MethodArgs, methodOptionalValueWithDefaultStaticConstantAccess) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *method = NULL, method_sub; zval *this_ptr = getThis(); @@ -155,6 +156,7 @@ PHP_METHOD(Test_MethodArgs, methodOptionalValueWithDefaultStaticConstantAccess) */ PHP_METHOD(Test_MethodArgs, methodOptionalStringValueWithDefaultStaticConstantAccess) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *parameter_param = NULL; zval parameter; zval *this_ptr = getThis(); @@ -187,7 +189,7 @@ PHP_METHOD(Test_MethodArgs, methodOptionalDoubleValueWithDefaultStaticConstantAc zval *this_ptr = getThis(); - zephir_fetch_params(0, 0, 1, ¶meter_param); + zephir_fetch_params_without_memory_grow(0, 1, ¶meter_param); if (!parameter_param) { parameter = 1.32; @@ -211,7 +213,7 @@ PHP_METHOD(Test_MethodArgs, methodOptionalBoolValueWithDefaultStaticConstantAcce zval *this_ptr = getThis(); - zephir_fetch_params(0, 0, 1, ¶meter_param); + zephir_fetch_params_without_memory_grow(0, 1, ¶meter_param); if (!parameter_param) { parameter = 1; @@ -235,7 +237,7 @@ PHP_METHOD(Test_MethodArgs, methodOptionalIntValueWithDefaultStaticConstantAcces zval *this_ptr = getThis(); - zephir_fetch_params(0, 0, 1, ¶meter_param); + zephir_fetch_params_without_memory_grow(0, 1, ¶meter_param); if (!parameter_param) { parameter = 12345; diff --git a/ext/test/nativearray.zep.c b/ext/test/nativearray.zep.c index 62997c0c68..a7c93739e3 100644 --- a/ext/test/nativearray.zep.c +++ b/ext/test/nativearray.zep.c @@ -34,6 +34,7 @@ ZEPHIR_INIT_CLASS(Test_NativeArray) { PHP_METHOD(Test_NativeArray, testArray1) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -49,6 +50,7 @@ PHP_METHOD(Test_NativeArray, testArray1) { PHP_METHOD(Test_NativeArray, testArray2) { zval a, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -74,6 +76,7 @@ PHP_METHOD(Test_NativeArray, testArray2) { PHP_METHOD(Test_NativeArray, testArray3) { zval a, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -98,6 +101,7 @@ PHP_METHOD(Test_NativeArray, testArray3) { PHP_METHOD(Test_NativeArray, testArray4) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$false, __$true, a; zval *this_ptr = getThis(); @@ -118,6 +122,7 @@ PHP_METHOD(Test_NativeArray, testArray4) { PHP_METHOD(Test_NativeArray, testArray5) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, a; zval *this_ptr = getThis(); @@ -138,6 +143,7 @@ PHP_METHOD(Test_NativeArray, testArray5) { PHP_METHOD(Test_NativeArray, testArray6) { zval a, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -164,6 +170,7 @@ PHP_METHOD(Test_NativeArray, testArray7) { zend_long a = 0, b = 0, c = 0; zval d, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&d); @@ -193,6 +200,7 @@ PHP_METHOD(Test_NativeArray, testArray8) { double a = 0, b = 0, c = 0; zval d, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&d); @@ -222,6 +230,7 @@ PHP_METHOD(Test_NativeArray, testArray9) { zend_bool a = 0, b = 0, c = 0; zval d, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&d); @@ -251,6 +260,7 @@ PHP_METHOD(Test_NativeArray, testArray10) { zval a, b, c; zval d; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&d); @@ -278,6 +288,7 @@ PHP_METHOD(Test_NativeArray, testArray10) { PHP_METHOD(Test_NativeArray, testArray11) { zval a, b, c, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -320,6 +331,7 @@ PHP_METHOD(Test_NativeArray, testArray11) { PHP_METHOD(Test_NativeArray, testArray12) { zval a, b, c, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -353,6 +365,7 @@ PHP_METHOD(Test_NativeArray, testArray12) { PHP_METHOD(Test_NativeArray, testArray13) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -371,6 +384,7 @@ PHP_METHOD(Test_NativeArray, testArray13) { PHP_METHOD(Test_NativeArray, testArray14) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -388,6 +402,7 @@ PHP_METHOD(Test_NativeArray, testArray14) { PHP_METHOD(Test_NativeArray, testArray15) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$true, __$false, a; zval *this_ptr = getThis(); @@ -409,6 +424,7 @@ PHP_METHOD(Test_NativeArray, testArray15) { PHP_METHOD(Test_NativeArray, testArray16) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -426,6 +442,7 @@ PHP_METHOD(Test_NativeArray, testArray16) { PHP_METHOD(Test_NativeArray, testArray17) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, a; zval *this_ptr = getThis(); @@ -446,6 +463,7 @@ PHP_METHOD(Test_NativeArray, testArray17) { PHP_METHOD(Test_NativeArray, testArray18) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -463,6 +481,7 @@ PHP_METHOD(Test_NativeArray, testArray18) { PHP_METHOD(Test_NativeArray, testArray19) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$true, __$false, a; zval *this_ptr = getThis(); @@ -484,6 +503,7 @@ PHP_METHOD(Test_NativeArray, testArray19) { PHP_METHOD(Test_NativeArray, testArray20) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -501,6 +521,7 @@ PHP_METHOD(Test_NativeArray, testArray20) { PHP_METHOD(Test_NativeArray, testArray21) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, a; zval *this_ptr = getThis(); @@ -521,6 +542,7 @@ PHP_METHOD(Test_NativeArray, testArray21) { PHP_METHOD(Test_NativeArray, testArray22) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -540,6 +562,7 @@ PHP_METHOD(Test_NativeArray, testArray23) { zend_long b = 0; zval a, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -567,6 +590,7 @@ PHP_METHOD(Test_NativeArray, testArray24) { double b = 0; zval a, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -594,6 +618,7 @@ PHP_METHOD(Test_NativeArray, testArray25) { zend_bool b = 0; zval a, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -620,6 +645,7 @@ PHP_METHOD(Test_NativeArray, testArray25) { PHP_METHOD(Test_NativeArray, testArray26) { zval a, b; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -642,6 +668,7 @@ PHP_METHOD(Test_NativeArray, testArray27) { zval b; zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -664,6 +691,7 @@ PHP_METHOD(Test_NativeArray, testArray28) { zval b; zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -686,6 +714,7 @@ PHP_METHOD(Test_NativeArray, testArray29) { long b = 0; zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -704,6 +733,7 @@ PHP_METHOD(Test_NativeArray, testArray30) { zval b; zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -723,6 +753,7 @@ PHP_METHOD(Test_NativeArray, testArray30) { PHP_METHOD(Test_NativeArray, testArrayAccess1) { zval a, b, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -750,6 +781,7 @@ PHP_METHOD(Test_NativeArray, testArrayAccess1) { PHP_METHOD(Test_NativeArray, testArrayAccess2) { zval a, b; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -771,6 +803,7 @@ PHP_METHOD(Test_NativeArray, testArrayAccess3) { long c = 0; zval a, b, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -800,6 +833,7 @@ PHP_METHOD(Test_NativeArray, testArrayAccess4) { zval c; zval a, b; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -823,6 +857,7 @@ PHP_METHOD(Test_NativeArray, testArrayAccess4) { PHP_METHOD(Test_NativeArray, testArrayAccess5) { zval a, b, c; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -846,6 +881,7 @@ PHP_METHOD(Test_NativeArray, testArrayAccess5) { PHP_METHOD(Test_NativeArray, testArrayAccess6) { zval a, b, _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -872,6 +908,7 @@ PHP_METHOD(Test_NativeArray, testArrayMultipleAccess1) { zval _0; zval a, b, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -898,6 +935,7 @@ PHP_METHOD(Test_NativeArray, testArrayMultipleAccess2) { zval _0; zval a, b, _1, _2; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -929,6 +967,7 @@ PHP_METHOD(Test_NativeArray, testArrayMultipleAccess3) { zval _0, _1; zval a, b, _2, _3, _4; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -966,6 +1005,7 @@ PHP_METHOD(Test_NativeArray, testArrayMultipleAccess4) { zval _0, _1; zval a, b, _2, _3, _4; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -1003,6 +1043,7 @@ PHP_METHOD(Test_NativeArray, testArrayMultipleAccess5) { zval _0, _1; zval a, b, _2, _3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -1034,6 +1075,7 @@ PHP_METHOD(Test_NativeArray, testArrayMultipleAccess5) { PHP_METHOD(Test_NativeArray, testArrayUpdate1) { zval a, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -1063,6 +1105,7 @@ PHP_METHOD(Test_NativeArray, testArrayUpdate2) { zend_long b = 0; zval a, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -1093,6 +1136,7 @@ PHP_METHOD(Test_NativeArray, testArrayUpdate3) { zend_long b = 0; zval a, _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -1127,6 +1171,7 @@ PHP_METHOD(Test_NativeArray, testArrayUpdate3) { PHP_METHOD(Test_NativeArray, testArrayUpdate4) { zval a, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -1150,6 +1195,7 @@ PHP_METHOD(Test_NativeArray, testArrayUpdate5) { zval _1, _2, _3; zval a, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -1214,6 +1260,7 @@ PHP_METHOD(Test_NativeArray, testArrayUpdate5) { PHP_METHOD(Test_NativeArray, testArrayAppend1) { zval _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, a, _0; zval *this_ptr = getThis(); @@ -1262,6 +1309,7 @@ PHP_METHOD(Test_NativeArray, testArrayAppend2) { zend_bool d; zval b; zval a, c, g, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -1310,6 +1358,7 @@ PHP_METHOD(Test_NativeArray, testArrayAppend2) { PHP_METHOD(Test_NativeArray, testMultipleArrayUpdate1) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, a; zval *this_ptr = getThis(); @@ -1327,6 +1376,7 @@ PHP_METHOD(Test_NativeArray, testMultipleArrayUpdate1) { PHP_METHOD(Test_NativeArray, testMultipleArrayUpdate2) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, a; zval *this_ptr = getThis(); @@ -1344,6 +1394,7 @@ PHP_METHOD(Test_NativeArray, testMultipleArrayUpdate2) { PHP_METHOD(Test_NativeArray, testMultipleArrayUpdate3) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, a; zval *this_ptr = getThis(); @@ -1361,6 +1412,7 @@ PHP_METHOD(Test_NativeArray, testMultipleArrayUpdate3) { PHP_METHOD(Test_NativeArray, testMultipleArrayUpdate4) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, a; zval *this_ptr = getThis(); @@ -1378,6 +1430,7 @@ PHP_METHOD(Test_NativeArray, testMultipleArrayUpdate4) { PHP_METHOD(Test_NativeArray, testMultipleArrayUpdate5) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, a; zval *this_ptr = getThis(); @@ -1395,6 +1448,7 @@ PHP_METHOD(Test_NativeArray, testMultipleArrayUpdate5) { PHP_METHOD(Test_NativeArray, testMultipleArrayUpdate6) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, a; zval *this_ptr = getThis(); @@ -1412,6 +1466,7 @@ PHP_METHOD(Test_NativeArray, testMultipleArrayUpdate6) { PHP_METHOD(Test_NativeArray, testMultipleArrayUpdate7) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$true, __$false, a; zval *this_ptr = getThis(); @@ -1431,6 +1486,7 @@ PHP_METHOD(Test_NativeArray, testMultipleArrayUpdate7) { PHP_METHOD(Test_NativeArray, testMultipleArrayUpdate8) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, __$true, __$false, a; zval *this_ptr = getThis(); @@ -1452,6 +1508,7 @@ PHP_METHOD(Test_NativeArray, testMultipleArrayUpdate8) { PHP_METHOD(Test_NativeArray, testMultipleArrayUpdate9) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, __$true, __$false, a; zval *this_ptr = getThis(); @@ -1473,6 +1530,7 @@ PHP_METHOD(Test_NativeArray, testMultipleArrayUpdate9) { PHP_METHOD(Test_NativeArray, testMultipleArrayUpdate10) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, __$true, __$false, a; zval *this_ptr = getThis(); @@ -1494,6 +1552,7 @@ PHP_METHOD(Test_NativeArray, testMultipleArrayUpdate10) { PHP_METHOD(Test_NativeArray, testMultipleArrayUpdate11) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, a, b, c; zval *this_ptr = getThis(); @@ -1517,6 +1576,7 @@ PHP_METHOD(Test_NativeArray, testMultipleArrayUpdate11) { PHP_METHOD(Test_NativeArray, testMultipleArrayUpdate12) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, a, b, c, d; zval *this_ptr = getThis(); @@ -1544,6 +1604,7 @@ PHP_METHOD(Test_NativeArray, testMultipleArrayUpdate12) { PHP_METHOD(Test_NativeArray, testMultipleArrayUpdate13) { zval b, c, d, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, __$false, a; zval *this_ptr = getThis(); @@ -1584,6 +1645,7 @@ PHP_METHOD(Test_NativeArray, testMultipleArrayUpdate13) { PHP_METHOD(Test_NativeArray, testMultipleArrayAppend1) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, a, b; zval *this_ptr = getThis(); @@ -1606,6 +1668,7 @@ PHP_METHOD(Test_NativeArray, testMultipleArrayAppend2) { zval x; zend_long b; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, a; zval *this_ptr = getThis(); @@ -1628,6 +1691,7 @@ PHP_METHOD(Test_NativeArray, testMultipleArrayAppend2) { PHP_METHOD(Test_NativeArray, testMultipleArrayAppend3) { zval _2; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$null, __$false, a, b, _0, _1, _3; zval *this_ptr = getThis(); @@ -1677,7 +1741,7 @@ PHP_METHOD(Test_NativeArray, testArrayKeys) { ZVAL_UNDEF(¶m_sub); - zephir_fetch_params(0, 1, 0, ¶m); + zephir_fetch_params_without_memory_grow(1, 0, ¶m); @@ -1688,6 +1752,7 @@ PHP_METHOD(Test_NativeArray, testArrayKeys) { PHP_METHOD(Test_NativeArray, testImplodeArray) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *param, param_sub, _0; zval *this_ptr = getThis(); @@ -1712,6 +1777,7 @@ PHP_METHOD(Test_NativeArray, testImplodeArray) { PHP_METHOD(Test_NativeArray, issue110) { zval byteUnits, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&byteUnits); @@ -1739,6 +1805,7 @@ PHP_METHOD(Test_NativeArray, issue110) { PHP_METHOD(Test_NativeArray, issue264) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *tokens_param = NULL; zval tokens; zval *this_ptr = getThis(); @@ -1757,6 +1824,7 @@ PHP_METHOD(Test_NativeArray, issue264) { PHP_METHOD(Test_NativeArray, issue743a) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *current743a_param = NULL, _0; zval current743a; zval *this_ptr = getThis(); @@ -1779,6 +1847,7 @@ PHP_METHOD(Test_NativeArray, issue743a) { PHP_METHOD(Test_NativeArray, issue743b) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *current_param = NULL, _0; zval current; zval *this_ptr = getThis(); @@ -1801,6 +1870,7 @@ PHP_METHOD(Test_NativeArray, issue743b) { PHP_METHOD(Test_NativeArray, issue743c) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *current_param = NULL, key, _0; zval current; zval *this_ptr = getThis(); @@ -1831,6 +1901,7 @@ PHP_METHOD(Test_NativeArray, issue709) { zend_bool works, _0, _7$$3; zval c, arr, _3$$3, _4$$3, _5$$3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, _1, _2; zephir_fcall_cache_entry *_6 = NULL; zval *this_ptr = getThis(); @@ -1886,6 +1957,7 @@ PHP_METHOD(Test_NativeArray, issue709) { PHP_METHOD(Test_NativeArray, Issue1140) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *prefix_param = NULL, *baseDir_param = NULL, _0, _2, _3, _1$$3; zval prefix, baseDir; @@ -1924,6 +1996,7 @@ PHP_METHOD(Test_NativeArray, Issue1140) { PHP_METHOD(Test_NativeArray, Issue1159) { zval myvar, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&myvar); @@ -1944,6 +2017,7 @@ PHP_METHOD(Test_NativeArray, Issue1159) { zend_object *zephir_init_properties_Test_NativeArray(zend_class_entry *class_type TSRMLS_DC) { zval _0, _1$$3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1$$3); diff --git a/ext/test/oo.zep.c b/ext/test/oo.zep.c index 2c6ae4b554..2a1af0b765 100644 --- a/ext/test/oo.zep.c +++ b/ext/test/oo.zep.c @@ -33,6 +33,7 @@ ZEPHIR_INIT_CLASS(Test_Oo) { PHP_METHOD(Test_Oo, testInstance1) { zval o; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&o); @@ -48,6 +49,7 @@ PHP_METHOD(Test_Oo, testInstance1) { PHP_METHOD(Test_Oo, testInstance2) { zval o; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -66,6 +68,7 @@ PHP_METHOD(Test_Oo, testInstance2) { PHP_METHOD(Test_Oo, testInstance3) { zval o; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -86,6 +89,7 @@ PHP_METHOD(Test_Oo, testInstance3) { PHP_METHOD(Test_Oo, testInstance4) { zval o, a, b; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -110,6 +114,7 @@ PHP_METHOD(Test_Oo, testInstance4) { PHP_METHOD(Test_Oo, testInstance5) { zval o, _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -134,6 +139,7 @@ PHP_METHOD(Test_Oo, testInstance5) { PHP_METHOD(Test_Oo, testInstance6) { zval o, _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -156,6 +162,7 @@ PHP_METHOD(Test_Oo, testInstance6) { PHP_METHOD(Test_Oo, testInstance7) { zval o, _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -178,6 +185,7 @@ PHP_METHOD(Test_Oo, testInstance7) { PHP_METHOD(Test_Oo, testInstance8) { zval o, _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -200,6 +208,7 @@ PHP_METHOD(Test_Oo, testInstance8) { PHP_METHOD(Test_Oo, testInstance9) { zval o; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *this_ptr = getThis(); @@ -217,6 +226,7 @@ PHP_METHOD(Test_Oo, testInstance9) { PHP_METHOD(Test_Oo, testInstance10) { zval o; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *this_ptr = getThis(); @@ -234,6 +244,7 @@ PHP_METHOD(Test_Oo, testInstance10) { PHP_METHOD(Test_Oo, testInstance11) { zval o, _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -256,6 +267,7 @@ PHP_METHOD(Test_Oo, testInstance11) { PHP_METHOD(Test_Oo, testInstance12) { zval o; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *this_ptr = getThis(); @@ -275,6 +287,7 @@ PHP_METHOD(Test_Oo, createInstancesInLoop) { zend_class_entry *_5$$3, *_9$$4; zval result, _0; zval className, instance, fqcn, _1, *_2, _3, _4$$3, _6$$3, _7$$3, _8$$4, _10$$4, _11$$4; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); diff --git a/ext/test/oo/concretestatic.zep.c b/ext/test/oo/concretestatic.zep.c index 0aff7c2341..276f0d8f13 100644 --- a/ext/test/oo/concretestatic.zep.c +++ b/ext/test/oo/concretestatic.zep.c @@ -36,6 +36,7 @@ PHP_METHOD(Test_Oo_ConcreteStatic, parentFunction) { PHP_METHOD(Test_Oo_ConcreteStatic, childFunction) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); diff --git a/ext/test/oo/deprecatedmethods.zep.c b/ext/test/oo/deprecatedmethods.zep.c index b578f4f9d2..afcaee6fa7 100644 --- a/ext/test/oo/deprecatedmethods.zep.c +++ b/ext/test/oo/deprecatedmethods.zep.c @@ -36,6 +36,7 @@ PHP_METHOD(Test_Oo_DeprecatedMethods, publicDeprecated) { PHP_METHOD(Test_Oo_DeprecatedMethods, normalMethod) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); diff --git a/ext/test/oo/dynamicprop.zep.c b/ext/test/oo/dynamicprop.zep.c index b8806d9ee3..756e3ec5f2 100644 --- a/ext/test/oo/dynamicprop.zep.c +++ b/ext/test/oo/dynamicprop.zep.c @@ -34,6 +34,7 @@ ZEPHIR_INIT_CLASS(Test_Oo_DynamicProp) { PHP_METHOD(Test_Oo_DynamicProp, setPropertyInt) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *property_param = NULL, _0; zval property; zval *this_ptr = getThis(); @@ -65,6 +66,7 @@ PHP_METHOD(Test_Oo_DynamicProp, setPropertyInt) { PHP_METHOD(Test_Oo_DynamicProp, setPropertyBoolTrue) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *property_param = NULL, __$true; zval property; zval *this_ptr = getThis(); @@ -94,6 +96,7 @@ PHP_METHOD(Test_Oo_DynamicProp, setPropertyBoolTrue) { PHP_METHOD(Test_Oo_DynamicProp, setPropertyBoolFalse) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *property_param = NULL, __$false; zval property; zval *this_ptr = getThis(); @@ -123,6 +126,7 @@ PHP_METHOD(Test_Oo_DynamicProp, setPropertyBoolFalse) { PHP_METHOD(Test_Oo_DynamicProp, setPropertyString) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *property_param = NULL, _0; zval property; zval *this_ptr = getThis(); @@ -155,6 +159,7 @@ PHP_METHOD(Test_Oo_DynamicProp, setPropertyString) { PHP_METHOD(Test_Oo_DynamicProp, setPropertyChar) { char a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *property_param = NULL, _0; zval property; zval *this_ptr = getThis(); @@ -188,6 +193,7 @@ PHP_METHOD(Test_Oo_DynamicProp, setPropertyChar) { PHP_METHOD(Test_Oo_DynamicProp, setPropertyUChar) { unsigned char a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *property_param = NULL, _0; zval property; zval *this_ptr = getThis(); @@ -220,6 +226,7 @@ PHP_METHOD(Test_Oo_DynamicProp, setPropertyUChar) { PHP_METHOD(Test_Oo_DynamicProp, setPropertyNull) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *property_param = NULL, __$null; zval property; zval *this_ptr = getThis(); @@ -250,6 +257,7 @@ PHP_METHOD(Test_Oo_DynamicProp, setPropertyNull) { PHP_METHOD(Test_Oo_DynamicProp, setPropertyVariableInt) { zend_long a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *property_param = NULL, _0; zval property; zval *this_ptr = getThis(); @@ -282,6 +290,7 @@ PHP_METHOD(Test_Oo_DynamicProp, setPropertyVariableInt) { PHP_METHOD(Test_Oo_DynamicProp, setPropertyVariableString) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *property_param = NULL, a; zval property; zval *this_ptr = getThis(); @@ -314,6 +323,7 @@ PHP_METHOD(Test_Oo_DynamicProp, setPropertyVariableString) { PHP_METHOD(Test_Oo_DynamicProp, setPropertyVariableBoolTrue) { zend_bool a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *property_param = NULL, _0; zval property; zval *this_ptr = getThis(); @@ -347,6 +357,7 @@ PHP_METHOD(Test_Oo_DynamicProp, setPropertyVariableBoolTrue) { PHP_METHOD(Test_Oo_DynamicProp, setPropertyVariableBoolFalse) { zend_bool a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *property_param = NULL, _0; zval property; zval *this_ptr = getThis(); @@ -380,6 +391,7 @@ PHP_METHOD(Test_Oo_DynamicProp, setPropertyVariableBoolFalse) { PHP_METHOD(Test_Oo_DynamicProp, setExistingStringProperty) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -395,6 +407,7 @@ PHP_METHOD(Test_Oo_DynamicProp, setExistingStringProperty) { PHP_METHOD(Test_Oo_DynamicProp, setExistingStringPropertyString) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *value_param = NULL; zval value; zval *this_ptr = getThis(); @@ -424,6 +437,7 @@ PHP_METHOD(Test_Oo_DynamicProp, setExistingStringPropertyString) { PHP_METHOD(Test_Oo_DynamicProp, setNonExistingStringProperty) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); diff --git a/ext/test/oo/extendpdoclass.zep.c b/ext/test/oo/extendpdoclass.zep.c index eb95473314..001aefd260 100644 --- a/ext/test/oo/extendpdoclass.zep.c +++ b/ext/test/oo/extendpdoclass.zep.c @@ -31,6 +31,7 @@ ZEPHIR_INIT_CLASS(Test_Oo_ExtendPdoClass) { PHP_METHOD(Test_Oo_ExtendPdoClass, __construct) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *dsn_param = NULL, *username_param = NULL, *password_param = NULL, *attrs = NULL, attrs_sub, _1; zval dsn, username, password; diff --git a/ext/test/oo/ooconstructparams.zep.c b/ext/test/oo/ooconstructparams.zep.c index 7d7d847db0..536e880d1b 100644 --- a/ext/test/oo/ooconstructparams.zep.c +++ b/ext/test/oo/ooconstructparams.zep.c @@ -39,7 +39,7 @@ PHP_METHOD(Test_Oo_OoConstructParams, __construct) { ZVAL_UNDEF(&a_sub); ZVAL_UNDEF(&b_sub); - zephir_fetch_params(0, 2, 0, &a, &b); + zephir_fetch_params_without_memory_grow(2, 0, &a, &b); diff --git a/ext/test/oo/oodestruct.zep.c b/ext/test/oo/oodestruct.zep.c index 29287b6709..d99776b38e 100644 --- a/ext/test/oo/oodestruct.zep.c +++ b/ext/test/oo/oodestruct.zep.c @@ -159,9 +159,9 @@ PHP_METHOD(Test_Oo_OoDestruct, __construct) { zend_bool _30$$13; zend_class_entry *_26$$11 = NULL, *_22$$12 = NULL, *_32$$14 = NULL; - zephir_fcall_cache_entry *_29 = NULL; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long width, height, ZEPHIR_LAST_CALL_STATUS; - zval *file_param = NULL, *width_param = NULL, *height_param = NULL, __$true, imageinfo, _0, _1, _2$$4, _3$$4, _4$$4, _9$$4, _28$$4, _5$$5, _6$$5, _7$$5, _8$$5, _10$$6, _11$$6, _12$$7, _13$$7, _14$$8, _15$$8, _16$$9, _17$$9, _18$$10, _19$$10, _20$$11, _25$$11, _27$$11, _21$$12, _23$$12, _24$$12, _35$$13, _36$$13, _37$$13, _38$$13, _39$$13, _40$$13, _31$$14, _33$$14, _34$$14; + zval *file_param = NULL, *width_param = NULL, *height_param = NULL, __$true, imageinfo, _0, _1, _2$$4, _3$$4, _4$$4, _9$$4, _28$$4, _29$$4, _5$$5, _6$$5, _7$$5, _8$$5, _10$$6, _11$$6, _12$$7, _13$$7, _14$$8, _15$$8, _16$$9, _17$$9, _18$$10, _19$$10, _20$$11, _25$$11, _27$$11, _21$$12, _23$$12, _24$$12, _35$$13, _36$$13, _37$$13, _38$$13, _39$$13, _40$$13, _31$$14, _33$$14, _34$$14; zval file; zval *this_ptr = getThis(); @@ -175,6 +175,7 @@ PHP_METHOD(Test_Oo_OoDestruct, __construct) { ZVAL_UNDEF(&_4$$4); ZVAL_UNDEF(&_9$$4); ZVAL_UNDEF(&_28$$4); + ZVAL_UNDEF(&_29$$4); ZVAL_UNDEF(&_5$$5); ZVAL_UNDEF(&_6$$5); ZVAL_UNDEF(&_7$$5); @@ -259,35 +260,35 @@ PHP_METHOD(Test_Oo_OoDestruct, __construct) { do { if (ZEPHIR_IS_LONG(&_9$$4, 1)) { zephir_read_property(&_10$$6, this_ptr, SL("file"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_11$$6, "imagecreatefromgif", NULL, 59, &_10$$6); + ZEPHIR_CALL_FUNCTION(&_11$$6, "imagecreatefromgif", NULL, 0, &_10$$6); zephir_check_call_status(); zephir_update_property_zval(this_ptr, SL("image"), &_11$$6); break; } if (ZEPHIR_IS_LONG(&_9$$4, 2)) { zephir_read_property(&_12$$7, this_ptr, SL("file"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_13$$7, "imagecreatefromjpeg", NULL, 60, &_12$$7); + ZEPHIR_CALL_FUNCTION(&_13$$7, "imagecreatefromjpeg", NULL, 0, &_12$$7); zephir_check_call_status(); zephir_update_property_zval(this_ptr, SL("image"), &_13$$7); break; } if (ZEPHIR_IS_LONG(&_9$$4, 3)) { zephir_read_property(&_14$$8, this_ptr, SL("file"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_15$$8, "imagecreatefrompng", NULL, 61, &_14$$8); + ZEPHIR_CALL_FUNCTION(&_15$$8, "imagecreatefrompng", NULL, 0, &_14$$8); zephir_check_call_status(); zephir_update_property_zval(this_ptr, SL("image"), &_15$$8); break; } if (ZEPHIR_IS_LONG(&_9$$4, 15)) { zephir_read_property(&_16$$9, this_ptr, SL("file"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_17$$9, "imagecreatefromwbmp", NULL, 62, &_16$$9); + ZEPHIR_CALL_FUNCTION(&_17$$9, "imagecreatefromwbmp", NULL, 0, &_16$$9); zephir_check_call_status(); zephir_update_property_zval(this_ptr, SL("image"), &_17$$9); break; } if (ZEPHIR_IS_LONG(&_9$$4, 16)) { zephir_read_property(&_18$$10, this_ptr, SL("file"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(&_19$$10, "imagecreatefromxbm", NULL, 63, &_18$$10); + ZEPHIR_CALL_FUNCTION(&_19$$10, "imagecreatefromxbm", NULL, 0, &_18$$10); zephir_check_call_status(); zephir_update_property_zval(this_ptr, SL("image"), &_19$$10); break; @@ -327,7 +328,8 @@ PHP_METHOD(Test_Oo_OoDestruct, __construct) { } while(0); zephir_read_property(&_28$$4, this_ptr, SL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", &_29, 64, &_28$$4, &__$true); + ZVAL_BOOL(&_29$$4, 1); + ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 0, &_28$$4, &_29$$4); zephir_check_call_status(); } else { _30$$13 = !width; @@ -353,14 +355,15 @@ PHP_METHOD(Test_Oo_OoDestruct, __construct) { } ZVAL_LONG(&_35$$13, width); ZVAL_LONG(&_36$$13, height); - ZEPHIR_CALL_FUNCTION(&_37$$13, "imagecreatetruecolor", NULL, 65, &_35$$13, &_36$$13); + ZEPHIR_CALL_FUNCTION(&_37$$13, "imagecreatetruecolor", NULL, 0, &_35$$13, &_36$$13); zephir_check_call_status(); zephir_update_property_zval(this_ptr, SL("image"), &_37$$13); zephir_read_property(&_35$$13, this_ptr, SL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 66, &_35$$13, &__$true); + ZEPHIR_CALL_FUNCTION(NULL, "imagealphablending", NULL, 59, &_35$$13, &__$true); zephir_check_call_status(); zephir_read_property(&_36$$13, this_ptr, SL("image"), PH_NOISY_CC | PH_READONLY); - ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", &_29, 64, &_36$$13, &__$true); + ZVAL_BOOL(&_38$$13, 1); + ZEPHIR_CALL_FUNCTION(NULL, "imagesavealpha", NULL, 0, &_36$$13, &_38$$13); zephir_check_call_status(); zephir_read_property(&_38$$13, this_ptr, SL("file"), PH_NOISY_CC | PH_READONLY); zephir_update_property_zval(this_ptr, SL("realpath"), &_38$$13); @@ -385,6 +388,7 @@ PHP_METHOD(Test_Oo_OoDestruct, __construct) { PHP_METHOD(Test_Oo_OoDestruct, __destruct) { zval image, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -396,7 +400,7 @@ PHP_METHOD(Test_Oo_OoDestruct, __destruct) { zephir_read_property(&_0, this_ptr, SL("image"), PH_NOISY_CC | PH_READONLY); ZEPHIR_CPY_WRT(&image, &_0); if (Z_TYPE_P(&image) == IS_RESOURCE) { - ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 67, &image); + ZEPHIR_CALL_FUNCTION(NULL, "imagedestroy", NULL, 0, &image); zephir_check_call_status(); } ZEPHIR_MM_RESTORE(); @@ -406,6 +410,7 @@ PHP_METHOD(Test_Oo_OoDestruct, __destruct) { PHP_METHOD(Test_Oo_OoDestruct, check) { zend_class_entry *_2$$4 = NULL, *_8$$5 = NULL; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$true, version, _0, _4, _5, _6, _10, _1$$4, _3$$4, _7$$5, _9$$5; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -450,7 +455,7 @@ PHP_METHOD(Test_Oo_OoDestruct, check) { ZVAL_STRING(&_4, "2.0.1"); ZEPHIR_INIT_VAR(&_5); ZVAL_STRING(&_5, ">="); - ZEPHIR_CALL_FUNCTION(&_6, "version_compare", NULL, 68, &version, &_4, &_5); + ZEPHIR_CALL_FUNCTION(&_6, "version_compare", NULL, 60, &version, &_4, &_5); zephir_check_call_status(); if (UNEXPECTED(!zephir_is_true(&_6))) { ZEPHIR_INIT_VAR(&_7$$5); @@ -478,6 +483,7 @@ PHP_METHOD(Test_Oo_OoDestruct, getVersion) { zend_class_entry *_1$$3 = NULL; zval version, info, matches, _3, _4, _0$$3, _2$$3, _5$$5, _6$$5, _7$$5, _8$$5; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -515,13 +521,13 @@ PHP_METHOD(Test_Oo_OoDestruct, getVersion) { ZVAL_NULL(&version); ZEPHIR_INIT_VAR(&_3); ZVAL_STRING(&_3, "GD_VERSION"); - ZEPHIR_CALL_FUNCTION(&_4, "defined", NULL, 69, &_3); + ZEPHIR_CALL_FUNCTION(&_4, "defined", NULL, 61, &_3); zephir_check_call_status(); if (zephir_is_true(&_4)) { ZEPHIR_INIT_NVAR(&version); - ZEPHIR_GET_CONSTANT(&version, "GD_VERSION"); + ZEPHIR_MM_GET_CONSTANT(&version, "GD_VERSION"); } else { - ZEPHIR_CALL_FUNCTION(&info, "gd_info", NULL, 70); + ZEPHIR_CALL_FUNCTION(&info, "gd_info", NULL, 62); zephir_check_call_status(); ZEPHIR_INIT_VAR(&matches); ZVAL_NULL(&matches); diff --git a/ext/test/oo/oodynamica.zep.c b/ext/test/oo/oodynamica.zep.c index 370b1f7b44..1690c504cd 100644 --- a/ext/test/oo/oodynamica.zep.c +++ b/ext/test/oo/oodynamica.zep.c @@ -33,6 +33,7 @@ PHP_METHOD(Test_Oo_OoDynamicA, getNew) { zend_class_entry *_1; zval className, fullClassName, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -59,6 +60,7 @@ PHP_METHOD(Test_Oo_OoDynamicA, getNew) { PHP_METHOD(Test_Oo_OoDynamicA, call2) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -73,6 +75,7 @@ PHP_METHOD(Test_Oo_OoDynamicA, call2) { PHP_METHOD(Test_Oo_OoDynamicA, call1) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); diff --git a/ext/test/oo/oonativeimplements.zep.c b/ext/test/oo/oonativeimplements.zep.c index 31a6251fa1..2c07cd93b2 100644 --- a/ext/test/oo/oonativeimplements.zep.c +++ b/ext/test/oo/oonativeimplements.zep.c @@ -114,7 +114,7 @@ PHP_METHOD(Test_Oo_OoNativeImplements, seek) { ZVAL_UNDEF(&position_sub); - zephir_fetch_params(0, 1, 0, &position); + zephir_fetch_params_without_memory_grow(1, 0, &position); @@ -136,7 +136,7 @@ PHP_METHOD(Test_Oo_OoNativeImplements, offsetExists) { ZVAL_UNDEF(&offset_sub); - zephir_fetch_params(0, 1, 0, &offset); + zephir_fetch_params_without_memory_grow(1, 0, &offset); @@ -150,7 +150,7 @@ PHP_METHOD(Test_Oo_OoNativeImplements, offsetGet) { ZVAL_UNDEF(&offset_sub); - zephir_fetch_params(0, 1, 0, &offset); + zephir_fetch_params_without_memory_grow(1, 0, &offset); @@ -165,7 +165,7 @@ PHP_METHOD(Test_Oo_OoNativeImplements, offsetSet) { ZVAL_UNDEF(&offset_sub); ZVAL_UNDEF(&value_sub); - zephir_fetch_params(0, 2, 0, &offset, &value); + zephir_fetch_params_without_memory_grow(2, 0, &offset, &value); @@ -179,7 +179,7 @@ PHP_METHOD(Test_Oo_OoNativeImplements, offsetUnset) { ZVAL_UNDEF(&offset_sub); - zephir_fetch_params(0, 1, 0, &offset); + zephir_fetch_params_without_memory_grow(1, 0, &offset); @@ -196,6 +196,7 @@ PHP_METHOD(Test_Oo_OoNativeImplements, serialize) { PHP_METHOD(Test_Oo_OoNativeImplements, unserialize) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *serialized_param = NULL; zval serialized; zval *this_ptr = getThis(); diff --git a/ext/test/oo/ooparams.zep.c b/ext/test/oo/ooparams.zep.c index eeb5d7efdb..cba1a6b5d3 100644 --- a/ext/test/oo/ooparams.zep.c +++ b/ext/test/oo/ooparams.zep.c @@ -33,6 +33,7 @@ ZEPHIR_INIT_CLASS(Test_Oo_OoParams) { PHP_METHOD(Test_Oo_OoParams, createThisClassWithoutWriteCurrentNamespace) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -50,6 +51,7 @@ PHP_METHOD(Test_Oo_OoParams, createThisClassWithoutWriteCurrentNamespace) { PHP_METHOD(Test_Oo_OoParams, createOtherClassWithoutWriteCurrentNamespace) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -72,7 +74,7 @@ PHP_METHOD(Test_Oo_OoParams, setAge) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &age_param); + zephir_fetch_params_without_memory_grow(1, 0, &age_param); age = zephir_get_intval(age_param); @@ -88,7 +90,7 @@ PHP_METHOD(Test_Oo_OoParams, setAverage) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &average_param); + zephir_fetch_params_without_memory_grow(1, 0, &average_param); average = zephir_get_doubleval(average_param); @@ -99,6 +101,7 @@ PHP_METHOD(Test_Oo_OoParams, setAverage) { PHP_METHOD(Test_Oo_OoParams, setName) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *name_param = NULL; zval name; zval *this_ptr = getThis(); @@ -122,7 +125,7 @@ PHP_METHOD(Test_Oo_OoParams, setEnabled) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &enabled_param); + zephir_fetch_params_without_memory_grow(1, 0, &enabled_param); enabled = zephir_get_boolval(enabled_param); @@ -133,6 +136,7 @@ PHP_METHOD(Test_Oo_OoParams, setEnabled) { PHP_METHOD(Test_Oo_OoParams, setList) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *someList_param = NULL; zval someList; zval *this_ptr = getThis(); @@ -156,7 +160,7 @@ PHP_METHOD(Test_Oo_OoParams, setStrictAge) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &age_param); + zephir_fetch_params_without_memory_grow(1, 0, &age_param); if (UNEXPECTED(Z_TYPE_P(age_param) != IS_LONG)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'age' must be of the type int") TSRMLS_CC); @@ -176,7 +180,7 @@ PHP_METHOD(Test_Oo_OoParams, setStrictAverage) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &average_param); + zephir_fetch_params_without_memory_grow(1, 0, &average_param); if (UNEXPECTED(Z_TYPE_P(average_param) != IS_DOUBLE)) { zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'average' must be of the type double") TSRMLS_CC); @@ -192,6 +196,7 @@ PHP_METHOD(Test_Oo_OoParams, setStrictAverage) { PHP_METHOD(Test_Oo_OoParams, setStrictNameFromZephirLand) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -208,6 +213,7 @@ PHP_METHOD(Test_Oo_OoParams, setStrictNameFromZephirLand) { PHP_METHOD(Test_Oo_OoParams, setStrictName) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *name_param = NULL; zval name; zval *this_ptr = getThis(); @@ -240,7 +246,7 @@ PHP_METHOD(Test_Oo_OoParams, setStrictEnabled) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &enabled_param); + zephir_fetch_params_without_memory_grow(1, 0, &enabled_param); enabled = zephir_get_boolval(enabled_param); @@ -251,6 +257,7 @@ PHP_METHOD(Test_Oo_OoParams, setStrictEnabled) { PHP_METHOD(Test_Oo_OoParams, setStrictList) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *someList_param = NULL; zval someList; zval *this_ptr = getThis(); @@ -274,7 +281,7 @@ PHP_METHOD(Test_Oo_OoParams, setAgeDefault) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 0, 1, &age_param); + zephir_fetch_params_without_memory_grow(0, 1, &age_param); if (!age_param) { age = 25; @@ -294,7 +301,7 @@ PHP_METHOD(Test_Oo_OoParams, setAverageDefault) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 0, 1, &average_param); + zephir_fetch_params_without_memory_grow(0, 1, &average_param); if (!average_param) { average = (double) 25; @@ -309,6 +316,7 @@ PHP_METHOD(Test_Oo_OoParams, setAverageDefault) { PHP_METHOD(Test_Oo_OoParams, setNameDefault) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *name_param = NULL; zval name; zval *this_ptr = getThis(); @@ -337,7 +345,7 @@ PHP_METHOD(Test_Oo_OoParams, setEnabledDefault) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 0, 1, &enabled_param); + zephir_fetch_params_without_memory_grow(0, 1, &enabled_param); if (!enabled_param) { enabled = 0; @@ -352,6 +360,7 @@ PHP_METHOD(Test_Oo_OoParams, setEnabledDefault) { PHP_METHOD(Test_Oo_OoParams, setListDefault) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *someList_param = NULL; zval someList; zval *this_ptr = getThis(); @@ -380,7 +389,7 @@ PHP_METHOD(Test_Oo_OoParams, setConstAge) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &age_param); + zephir_fetch_params_without_memory_grow(1, 0, &age_param); age = zephir_get_intval(age_param); @@ -396,7 +405,7 @@ PHP_METHOD(Test_Oo_OoParams, setConstAverage) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &average_param); + zephir_fetch_params_without_memory_grow(1, 0, &average_param); average = zephir_get_doubleval(average_param); @@ -412,7 +421,7 @@ PHP_METHOD(Test_Oo_OoParams, setObject) { ZVAL_UNDEF(&obj_sub); - zephir_fetch_params(0, 1, 0, &obj); + zephir_fetch_params_without_memory_grow(1, 0, &obj); @@ -428,7 +437,7 @@ PHP_METHOD(Test_Oo_OoParams, setCallable) { ZVAL_UNDEF(&obj_sub); - zephir_fetch_params(0, 1, 0, &obj); + zephir_fetch_params_without_memory_grow(1, 0, &obj); @@ -444,7 +453,7 @@ PHP_METHOD(Test_Oo_OoParams, setResource) { ZVAL_UNDEF(&obj_sub); - zephir_fetch_params(0, 1, 0, &obj); + zephir_fetch_params_without_memory_grow(1, 0, &obj); @@ -460,7 +469,7 @@ PHP_METHOD(Test_Oo_OoParams, setObjectClassCast) { ZVAL_UNDEF(¶meter_sub); - zephir_fetch_params(0, 1, 0, ¶meter); + zephir_fetch_params_without_memory_grow(1, 0, ¶meter); diff --git a/ext/test/oo/propertyaccess.zep.c b/ext/test/oo/propertyaccess.zep.c index f335a1b21e..3a485aeadd 100644 --- a/ext/test/oo/propertyaccess.zep.c +++ b/ext/test/oo/propertyaccess.zep.c @@ -38,6 +38,7 @@ PHP_METHOD(Test_Oo_PropertyAccess, __construct) { zval _0, _6; zval test, test1, _1, _2, _3, _4, _5, _7, _8, _9, _10; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&test); @@ -114,7 +115,7 @@ PHP_METHOD(Test_Oo_PropertyAccess, setPrivatevariable) { ZVAL_UNDEF(&value_sub); - zephir_fetch_params(0, 1, 0, &value); + zephir_fetch_params_without_memory_grow(1, 0, &value); diff --git a/ext/test/oo/scopes/hasprivatemethod.zep.c b/ext/test/oo/scopes/hasprivatemethod.zep.c index 1c10b940b3..41b7fb0999 100644 --- a/ext/test/oo/scopes/hasprivatemethod.zep.c +++ b/ext/test/oo/scopes/hasprivatemethod.zep.c @@ -27,6 +27,7 @@ ZEPHIR_INIT_CLASS(Test_Oo_Scopes_HasPrivateMethod) { PHP_METHOD(Test_Oo_Scopes_HasPrivateMethod, callPrivateMethod) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); diff --git a/ext/test/oo/scopes/privatescopetester.zep.c b/ext/test/oo/scopes/privatescopetester.zep.c index 0af1b9b75a..943ae21046 100644 --- a/ext/test/oo/scopes/privatescopetester.zep.c +++ b/ext/test/oo/scopes/privatescopetester.zep.c @@ -28,6 +28,7 @@ ZEPHIR_INIT_CLASS(Test_Oo_Scopes_PrivateScopeTester) { PHP_METHOD(Test_Oo_Scopes_PrivateScopeTester, run) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); diff --git a/ext/test/operator.zep.c b/ext/test/operator.zep.c index 59636994d2..a522bc6bde 100644 --- a/ext/test/operator.zep.c +++ b/ext/test/operator.zep.c @@ -34,7 +34,7 @@ PHP_METHOD(Test_Operator, testIdentical) { ZVAL_UNDEF(¶m1_sub); ZVAL_UNDEF(¶m2_sub); - zephir_fetch_params(0, 2, 0, ¶m1, ¶m2); + zephir_fetch_params_without_memory_grow(2, 0, ¶m1, ¶m2); @@ -45,6 +45,7 @@ PHP_METHOD(Test_Operator, testIdentical) { PHP_METHOD(Test_Operator, testIdenticalIfComplex) { zend_bool b = 0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *input, input_sub, a, _0; zval *this_ptr = getThis(); @@ -76,7 +77,7 @@ PHP_METHOD(Test_Operator, testIdenticalVarFalse) { ZVAL_UNDEF(¶m_sub); - zephir_fetch_params(0, 1, 0, ¶m); + zephir_fetch_params_without_memory_grow(1, 0, ¶m); @@ -91,7 +92,7 @@ PHP_METHOD(Test_Operator, testIdenticalFalseVar) { ZVAL_UNDEF(¶m_sub); - zephir_fetch_params(0, 1, 0, ¶m); + zephir_fetch_params_without_memory_grow(1, 0, ¶m); @@ -102,6 +103,7 @@ PHP_METHOD(Test_Operator, testIdenticalFalseVar) { PHP_METHOD(Test_Operator, testBoolComparison) { zend_bool var1, var2; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *varTrue, varTrue_sub, *varFalse, varFalse_sub, _0; zval *this_ptr = getThis(); diff --git a/ext/test/optimizers/acos.zep.c b/ext/test/optimizers/acos.zep.c index 12d0c97ea1..319b9e3f79 100644 --- a/ext/test/optimizers/acos.zep.c +++ b/ext/test/optimizers/acos.zep.c @@ -29,6 +29,7 @@ ZEPHIR_INIT_CLASS(Test_Optimizers_ACos) { PHP_METHOD(Test_Optimizers_ACos, testInt) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, a; zval *this_ptr = getThis(); @@ -47,6 +48,7 @@ PHP_METHOD(Test_Optimizers_ACos, testInt) { PHP_METHOD(Test_Optimizers_ACos, testVar) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, a; zval *this_ptr = getThis(); @@ -65,6 +67,7 @@ PHP_METHOD(Test_Optimizers_ACos, testVar) { PHP_METHOD(Test_Optimizers_ACos, testIntValue1) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -81,6 +84,7 @@ PHP_METHOD(Test_Optimizers_ACos, testIntValue1) { PHP_METHOD(Test_Optimizers_ACos, testIntParameter) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *a_param = NULL, _0; zend_long a, ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -102,6 +106,7 @@ PHP_METHOD(Test_Optimizers_ACos, testIntParameter) { PHP_METHOD(Test_Optimizers_ACos, testVarParameter) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *a, a_sub; zval *this_ptr = getThis(); diff --git a/ext/test/optimizers/arraymerge.zep.c b/ext/test/optimizers/arraymerge.zep.c index a9122f97a1..597ed4601c 100644 --- a/ext/test/optimizers/arraymerge.zep.c +++ b/ext/test/optimizers/arraymerge.zep.c @@ -28,6 +28,7 @@ ZEPHIR_INIT_CLASS(Test_Optimizers_ArrayMerge) { PHP_METHOD(Test_Optimizers_ArrayMerge, mergeTwoRequiredArrays) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *arr1_param = NULL, *arr2_param = NULL; zval arr1, arr2; zval *this_ptr = getThis(); diff --git a/ext/test/optimizers/asin.zep.c b/ext/test/optimizers/asin.zep.c index d794e7be83..31a867a55a 100644 --- a/ext/test/optimizers/asin.zep.c +++ b/ext/test/optimizers/asin.zep.c @@ -29,6 +29,7 @@ ZEPHIR_INIT_CLASS(Test_Optimizers_ASin) { PHP_METHOD(Test_Optimizers_ASin, testInt) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, a; zval *this_ptr = getThis(); @@ -47,6 +48,7 @@ PHP_METHOD(Test_Optimizers_ASin, testInt) { PHP_METHOD(Test_Optimizers_ASin, testVar) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, a; zval *this_ptr = getThis(); @@ -65,6 +67,7 @@ PHP_METHOD(Test_Optimizers_ASin, testVar) { PHP_METHOD(Test_Optimizers_ASin, testIntValue1) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -81,6 +84,7 @@ PHP_METHOD(Test_Optimizers_ASin, testIntValue1) { PHP_METHOD(Test_Optimizers_ASin, testIntParameter) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *a_param = NULL, _0; zend_long a, ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -102,6 +106,7 @@ PHP_METHOD(Test_Optimizers_ASin, testIntParameter) { PHP_METHOD(Test_Optimizers_ASin, testVarParameter) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *a, a_sub; zval *this_ptr = getThis(); diff --git a/ext/test/optimizers/cos.zep.c b/ext/test/optimizers/cos.zep.c index df7670ed23..9fb5ba6e5a 100644 --- a/ext/test/optimizers/cos.zep.c +++ b/ext/test/optimizers/cos.zep.c @@ -91,7 +91,7 @@ PHP_METHOD(Test_Optimizers_Cos, testIntParameter) { ZVAL_UNDEF(&_0); - zephir_fetch_params(0, 1, 0, &a_param); + zephir_fetch_params_without_memory_grow(1, 0, &a_param); a = zephir_get_intval(a_param); @@ -108,7 +108,7 @@ PHP_METHOD(Test_Optimizers_Cos, testVarParameter) { ZVAL_UNDEF(&a_sub); - zephir_fetch_params(0, 1, 0, &a); + zephir_fetch_params_without_memory_grow(1, 0, &a); diff --git a/ext/test/optimizers/createarray.zep.c b/ext/test/optimizers/createarray.zep.c index 4d2fcf1402..f7a3458dfa 100644 --- a/ext/test/optimizers/createarray.zep.c +++ b/ext/test/optimizers/createarray.zep.c @@ -46,7 +46,7 @@ PHP_METHOD(Test_Optimizers_CreateArray, createSize) { ZVAL_UNDEF(&_0); - zephir_fetch_params(0, 1, 0, &n_param); + zephir_fetch_params_without_memory_grow(1, 0, &n_param); n = zephir_get_intval(n_param); diff --git a/ext/test/optimizers/isscalar.zep.c b/ext/test/optimizers/isscalar.zep.c index cf6119bf0f..b5efedff89 100644 --- a/ext/test/optimizers/isscalar.zep.c +++ b/ext/test/optimizers/isscalar.zep.c @@ -72,6 +72,7 @@ PHP_METHOD(Test_Optimizers_IsScalar, testBoolVar) { PHP_METHOD(Test_Optimizers_IsScalar, testStringVar) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -87,6 +88,7 @@ PHP_METHOD(Test_Optimizers_IsScalar, testStringVar) { PHP_METHOD(Test_Optimizers_IsScalar, testEmptyArrayVar) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -121,7 +123,7 @@ PHP_METHOD(Test_Optimizers_IsScalar, testVarParameter) { ZVAL_UNDEF(&a_sub); - zephir_fetch_params(0, 1, 0, &a); + zephir_fetch_params_without_memory_grow(1, 0, &a); diff --git a/ext/test/optimizers/ldexp.zep.c b/ext/test/optimizers/ldexp.zep.c index 84910f8ef9..91ce53e838 100644 --- a/ext/test/optimizers/ldexp.zep.c +++ b/ext/test/optimizers/ldexp.zep.c @@ -123,7 +123,7 @@ PHP_METHOD(Test_Optimizers_Ldexp, testIntParameter) { ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); - zephir_fetch_params(0, 2, 0, &x_param, &exponent_param); + zephir_fetch_params_without_memory_grow(2, 0, &x_param, &exponent_param); x = zephir_get_intval(x_param); exponent = zephir_get_intval(exponent_param); @@ -143,7 +143,7 @@ PHP_METHOD(Test_Optimizers_Ldexp, testVarParameter) { ZVAL_UNDEF(&x_sub); ZVAL_UNDEF(&exponent_sub); - zephir_fetch_params(0, 2, 0, &x, &exponent); + zephir_fetch_params_without_memory_grow(2, 0, &x, &exponent); diff --git a/ext/test/optimizers/sin.zep.c b/ext/test/optimizers/sin.zep.c index e2d5895f8c..605df4e8dd 100644 --- a/ext/test/optimizers/sin.zep.c +++ b/ext/test/optimizers/sin.zep.c @@ -91,7 +91,7 @@ PHP_METHOD(Test_Optimizers_Sin, testIntParameter) { ZVAL_UNDEF(&_0); - zephir_fetch_params(0, 1, 0, &a_param); + zephir_fetch_params_without_memory_grow(1, 0, &a_param); a = zephir_get_intval(a_param); @@ -108,7 +108,7 @@ PHP_METHOD(Test_Optimizers_Sin, testVarParameter) { ZVAL_UNDEF(&a_sub); - zephir_fetch_params(0, 1, 0, &a); + zephir_fetch_params_without_memory_grow(1, 0, &a); diff --git a/ext/test/optimizers/sqrt.zep.c b/ext/test/optimizers/sqrt.zep.c index 2e195279b4..bb80e99d4c 100644 --- a/ext/test/optimizers/sqrt.zep.c +++ b/ext/test/optimizers/sqrt.zep.c @@ -91,7 +91,7 @@ PHP_METHOD(Test_Optimizers_Sqrt, testIntParameter) { ZVAL_UNDEF(&_0); - zephir_fetch_params(0, 1, 0, &a_param); + zephir_fetch_params_without_memory_grow(1, 0, &a_param); a = zephir_get_intval(a_param); @@ -108,7 +108,7 @@ PHP_METHOD(Test_Optimizers_Sqrt, testVarParameter) { ZVAL_UNDEF(&a_sub); - zephir_fetch_params(0, 1, 0, &a); + zephir_fetch_params_without_memory_grow(1, 0, &a); diff --git a/ext/test/optimizers/strreplace.zep.c b/ext/test/optimizers/strreplace.zep.c index 741514f0c0..c4f5b8ad9d 100644 --- a/ext/test/optimizers/strreplace.zep.c +++ b/ext/test/optimizers/strreplace.zep.c @@ -34,6 +34,7 @@ PHP_METHOD(Test_Optimizers_StrReplace, issue1055) { zval _1, _3; zval _0, _2; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -64,6 +65,7 @@ PHP_METHOD(Test_Optimizers_StrReplace, issue1055) { PHP_METHOD(Test_Optimizers_StrReplace, issue1087) { zval filtered, sanitize, _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&filtered); @@ -115,6 +117,7 @@ PHP_METHOD(Test_Optimizers_StrReplace, issue732A) { zval subject; zval _0; zval search, replace; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&search); @@ -171,6 +174,7 @@ PHP_METHOD(Test_Optimizers_StrReplace, issue732B) { zval subject; zval _0; zval patterns, replacements; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -205,7 +209,7 @@ PHP_METHOD(Test_Optimizers_StrReplace, issue732B) { zephir_array_fast_append(&replacements, &_0); ZEPHIR_INIT_VAR(&subject); ZVAL_STRING(&subject, "The quick brown fox jumped over the lazy dog."); - ZEPHIR_RETURN_CALL_FUNCTION("preg_replace", NULL, 71, &patterns, &replacements, &subject); + ZEPHIR_RETURN_CALL_FUNCTION("preg_replace", NULL, 63, &patterns, &replacements, &subject); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/test/optimizers/substr.zep.c b/ext/test/optimizers/substr.zep.c index 169472337c..6b5c81108b 100644 --- a/ext/test/optimizers/substr.zep.c +++ b/ext/test/optimizers/substr.zep.c @@ -34,7 +34,7 @@ PHP_METHOD(Test_Optimizers_Substr, testTwoArguments) { ZVAL_UNDEF(&str_sub); ZVAL_UNDEF(&start_sub); - zephir_fetch_params(0, 2, 0, &str, &start); + zephir_fetch_params_without_memory_grow(2, 0, &str, &start); @@ -52,7 +52,7 @@ PHP_METHOD(Test_Optimizers_Substr, testThreeArguments) { ZVAL_UNDEF(&start_sub); ZVAL_UNDEF(&offset_sub); - zephir_fetch_params(0, 3, 0, &str, &start, &offset); + zephir_fetch_params_without_memory_grow(3, 0, &str, &start, &offset); diff --git a/ext/test/optimizers/tan.zep.c b/ext/test/optimizers/tan.zep.c index 74fb008614..0f32d22c33 100644 --- a/ext/test/optimizers/tan.zep.c +++ b/ext/test/optimizers/tan.zep.c @@ -106,7 +106,7 @@ PHP_METHOD(Test_Optimizers_Tan, testIntParameter) { ZVAL_UNDEF(&_0); - zephir_fetch_params(0, 1, 0, &a_param); + zephir_fetch_params_without_memory_grow(1, 0, &a_param); a = zephir_get_intval(a_param); @@ -123,7 +123,7 @@ PHP_METHOD(Test_Optimizers_Tan, testVarParameter) { ZVAL_UNDEF(&a_sub); - zephir_fetch_params(0, 1, 0, &a); + zephir_fetch_params_without_memory_grow(1, 0, &a); diff --git a/ext/test/pregmatch.zep.c b/ext/test/pregmatch.zep.c index f90416bb69..2e7dc9af14 100644 --- a/ext/test/pregmatch.zep.c +++ b/ext/test/pregmatch.zep.c @@ -31,6 +31,7 @@ ZEPHIR_INIT_CLASS(Test_Pregmatch) { PHP_METHOD(Test_Pregmatch, testWithoutReturnAndMatches) { zval pattern, subject, _0, _1, _2; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&pattern); @@ -57,6 +58,7 @@ PHP_METHOD(Test_Pregmatch, testWithoutReturnAndMatches) { PHP_METHOD(Test_Pregmatch, testWithoutReturns) { zval pattern, subject, matches, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&pattern); @@ -81,6 +83,7 @@ PHP_METHOD(Test_Pregmatch, testWithoutReturns) { PHP_METHOD(Test_Pregmatch, testWithoutMatches) { zval pattern, subject, matched, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&pattern); @@ -104,6 +107,7 @@ PHP_METHOD(Test_Pregmatch, testWithoutMatches) { PHP_METHOD(Test_Pregmatch, testPregMatchAll) { zval pattern, subject, results; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&pattern); @@ -126,6 +130,7 @@ PHP_METHOD(Test_Pregmatch, testPregMatchAll) { PHP_METHOD(Test_Pregmatch, testPregMatchFallback) { zval pattern, subject, matches; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&pattern); @@ -149,6 +154,7 @@ PHP_METHOD(Test_Pregmatch, testPregMatchFallback) { PHP_METHOD(Test_Pregmatch, testPregMatch2Params) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *pattern, pattern_sub, *subject, subject_sub, _0; zval *this_ptr = getThis(); @@ -176,7 +182,7 @@ PHP_METHOD(Test_Pregmatch, testPregMatch3Params) { ZVAL_UNDEF(&subject_sub); ZVAL_UNDEF(&matches_sub); - zephir_fetch_params(0, 3, 0, &pattern, &subject, &matches); + zephir_fetch_params_without_memory_grow(3, 0, &pattern, &subject, &matches); @@ -195,7 +201,7 @@ PHP_METHOD(Test_Pregmatch, testPregMatch4Params) { ZVAL_UNDEF(&matches_sub); ZVAL_UNDEF(&flags_sub); - zephir_fetch_params(0, 4, 0, &pattern, &subject, &matches, &flags); + zephir_fetch_params_without_memory_grow(4, 0, &pattern, &subject, &matches, &flags); @@ -215,7 +221,7 @@ PHP_METHOD(Test_Pregmatch, testPregMatch5Params) { ZVAL_UNDEF(&flags_sub); ZVAL_UNDEF(&offset_sub); - zephir_fetch_params(0, 5, 0, &pattern, &subject, &matches, &flags, &offset); + zephir_fetch_params_without_memory_grow(5, 0, &pattern, &subject, &matches, &flags, &offset); @@ -229,6 +235,7 @@ PHP_METHOD(Test_Pregmatch, testPregMatch5Params) { */ PHP_METHOD(Test_Pregmatch, testPregMatchSaveMatches) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *str_param = NULL, *pattern_param = NULL, matches, _0; zval str, pattern; zval *this_ptr = getThis(); @@ -255,6 +262,7 @@ PHP_METHOD(Test_Pregmatch, testPregMatchSaveMatches) { PHP_METHOD(Test_Pregmatch, testMatchAll) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *flags, flags_sub, text, matches, _0, _1, _2; zval *this_ptr = getThis(); @@ -287,6 +295,7 @@ PHP_METHOD(Test_Pregmatch, testMatchAll) { PHP_METHOD(Test_Pregmatch, testMatchAllInZep) { zval m1, m2, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zephir_fcall_cache_entry *_1 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); diff --git a/ext/test/properties/app.zep.c b/ext/test/properties/app.zep.c index c2e82de7e0..c29c78ec97 100644 --- a/ext/test/properties/app.zep.c +++ b/ext/test/properties/app.zep.c @@ -42,6 +42,7 @@ PHP_METHOD(Test_Properties_App, getInstance) { PHP_METHOD(Test_Properties_App, __construct) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_1 = NULL; zval *this_ptr = getThis(); diff --git a/ext/test/properties/extendspublicproperties.zep.c b/ext/test/properties/extendspublicproperties.zep.c index eff49db378..91858d9ee3 100644 --- a/ext/test/properties/extendspublicproperties.zep.c +++ b/ext/test/properties/extendspublicproperties.zep.c @@ -35,6 +35,7 @@ zend_object *zephir_init_properties_Test_Properties_ExtendsPublicProperties(zend zval _1$$3, _2$$3, _4$$4, _6$$5, _11$$7; zval _0, _3, _5, _8, _10, _7$$5, _9$$6, _12$$7; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_3); ZVAL_UNDEF(&_5); diff --git a/ext/test/properties/propertyarray.zep.c b/ext/test/properties/propertyarray.zep.c index 8bfe25e881..e90e065f12 100644 --- a/ext/test/properties/propertyarray.zep.c +++ b/ext/test/properties/propertyarray.zep.c @@ -50,6 +50,7 @@ PHP_METHOD(Test_Properties_PropertyArray, __construct) { zval _1; zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -70,6 +71,7 @@ PHP_METHOD(Test_Properties_PropertyArray, __construct) { PHP_METHOD(Test_Properties_PropertyArray, appendSome) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *value, value_sub; zval *this_ptr = getThis(); @@ -94,7 +96,7 @@ PHP_METHOD(Test_Properties_PropertyArray, setOtherArray) { ZVAL_UNDEF(&arr_sub); - zephir_fetch_params(0, 1, 0, &arr); + zephir_fetch_params_without_memory_grow(1, 0, &arr); @@ -114,6 +116,7 @@ PHP_METHOD(Test_Properties_PropertyArray, getOtherArray) { PHP_METHOD(Test_Properties_PropertyArray, testIssues1831) { zval info, headers, _0$$3, _2$$3, _3$$3, _5$$5; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_1 = NULL, *_4 = NULL, *_6 = NULL; zval *this_ptr = getThis(); @@ -135,12 +138,12 @@ PHP_METHOD(Test_Properties_PropertyArray, testIssues1831) { } zephir_read_property(&_0$$3, this_ptr, SL("otherArray"), PH_NOISY_CC | PH_READONLY); ZEPHIR_MAKE_REF(&_0$$3); - ZEPHIR_CALL_FUNCTION(&info, "array_shift", &_1, 72, &_0$$3); + ZEPHIR_CALL_FUNCTION(&info, "array_shift", &_1, 64, &_0$$3); ZEPHIR_UNREF(&_0$$3); zephir_check_call_status(); ZEPHIR_INIT_NVAR(&_2$$3); ZVAL_STRING(&_2$$3, "header"); - ZEPHIR_CALL_FUNCTION(&_3$$3, "stripos", &_4, 73, &info, &_2$$3); + ZEPHIR_CALL_FUNCTION(&_3$$3, "stripos", &_4, 65, &info, &_2$$3); zephir_check_call_status(); if (!ZEPHIR_IS_FALSE_IDENTICAL(&_3$$3)) { zephir_array_append(&headers, &info, PH_SEPARATE, "test/properties/propertyarray.zep", 51); @@ -148,7 +151,7 @@ PHP_METHOD(Test_Properties_PropertyArray, testIssues1831) { } else { zephir_read_property(&_5$$5, this_ptr, SL("otherArray"), PH_NOISY_CC | PH_READONLY); ZEPHIR_MAKE_REF(&_5$$5); - ZEPHIR_CALL_FUNCTION(NULL, "array_unshift", &_6, 74, &_5$$5, &info); + ZEPHIR_CALL_FUNCTION(NULL, "array_unshift", &_6, 66, &_5$$5, &info); ZEPHIR_UNREF(&_5$$5); zephir_check_call_status(); break; @@ -162,6 +165,7 @@ zend_object *zephir_init_properties_Test_Properties_PropertyArray(zend_class_ent zval _3$$4; zval _0, _2, _5, _1$$3, _4$$4, _6$$5; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_2); ZVAL_UNDEF(&_5); diff --git a/ext/test/properties/protectedproperties.zep.c b/ext/test/properties/protectedproperties.zep.c index d18b0844fe..a1a6667e64 100644 --- a/ext/test/properties/protectedproperties.zep.c +++ b/ext/test/properties/protectedproperties.zep.c @@ -68,7 +68,7 @@ PHP_METHOD(Test_Properties_ProtectedProperties, setSomeVar) { ZVAL_UNDEF(&someVar_sub); - zephir_fetch_params(0, 1, 0, &someVar); + zephir_fetch_params_without_memory_grow(1, 0, &someVar); @@ -102,7 +102,7 @@ PHP_METHOD(Test_Properties_ProtectedProperties, setSomeNull) { ZVAL_UNDEF(¶m_sub); - zephir_fetch_params(0, 1, 0, ¶m); + zephir_fetch_params_without_memory_grow(1, 0, ¶m); diff --git a/ext/test/properties/publicproperties.zep.c b/ext/test/properties/publicproperties.zep.c index b5a6586c37..70ef3f1e5d 100644 --- a/ext/test/properties/publicproperties.zep.c +++ b/ext/test/properties/publicproperties.zep.c @@ -99,7 +99,7 @@ PHP_METHOD(Test_Properties_PublicProperties, setSomeGetterSetterArray) { ZVAL_UNDEF(&someGetterSetterArray_sub); - zephir_fetch_params(0, 1, 0, &someGetterSetterArray); + zephir_fetch_params_without_memory_grow(1, 0, &someGetterSetterArray); @@ -120,6 +120,7 @@ PHP_METHOD(Test_Properties_PublicProperties, getSomeGetterSetterArray) { PHP_METHOD(Test_Properties_PublicProperties, test394Issue) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -136,6 +137,7 @@ zend_object *zephir_init_properties_Test_Properties_PublicProperties(zend_class_ zval _3$$4, _4$$4, _6$$5, _8$$6; zval _0, _2, _5, _7, _10, _1$$3, _9$$6, _11$$7; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_2); ZVAL_UNDEF(&_5); diff --git a/ext/test/properties/staticprivateproperties.zep.c b/ext/test/properties/staticprivateproperties.zep.c index 01032ea071..e017cf05ca 100644 --- a/ext/test/properties/staticprivateproperties.zep.c +++ b/ext/test/properties/staticprivateproperties.zep.c @@ -30,6 +30,7 @@ ZEPHIR_INIT_CLASS(Test_Properties_StaticPrivateProperties) { PHP_METHOD(Test_Properties_StaticPrivateProperties, getInstance) { zval localInstance, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); diff --git a/ext/test/properties/staticpropertyarray.zep.c b/ext/test/properties/staticpropertyarray.zep.c index afaf1f4b5a..4c02291ddd 100644 --- a/ext/test/properties/staticpropertyarray.zep.c +++ b/ext/test/properties/staticpropertyarray.zep.c @@ -43,6 +43,7 @@ void zephir_init_static_properties_Test_Properties_StaticPropertyArray(TSRMLS_D) zval _1; zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); diff --git a/ext/test/properties/staticprotectedproperties.zep.c b/ext/test/properties/staticprotectedproperties.zep.c index a51d95a63c..e8f1b93185 100644 --- a/ext/test/properties/staticprotectedproperties.zep.c +++ b/ext/test/properties/staticprotectedproperties.zep.c @@ -68,7 +68,7 @@ PHP_METHOD(Test_Properties_StaticProtectedProperties, setSomeVar) { ZVAL_UNDEF(&someVar_sub); - zephir_fetch_params(0, 1, 0, &someVar); + zephir_fetch_params_without_memory_grow(1, 0, &someVar); @@ -106,7 +106,7 @@ PHP_METHOD(Test_Properties_StaticProtectedProperties, setSomeNull) { ZVAL_UNDEF(¶m_sub); - zephir_fetch_params(0, 1, 0, ¶m); + zephir_fetch_params_without_memory_grow(1, 0, ¶m); diff --git a/ext/test/quantum.zep.c b/ext/test/quantum.zep.c index 9a321b0f3f..7a6fcced26 100644 --- a/ext/test/quantum.zep.c +++ b/ext/test/quantum.zep.c @@ -36,6 +36,7 @@ PHP_METHOD(Test_Quantum, harmos) { zval _8$$4, _10$$4, _11$$4; zend_bool _12, _15$$5, _34$$5, _50$$5; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zephir_fcall_cache_entry *_5 = NULL, *_55 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, i = 0, j = 0, n = 0, _13, _14, _16$$5, _17$$5, _35$$5, _36$$5; zval *x_param = NULL, psr, psi, p2, v, paramater, fp, tmp, _0, _1, _2$$4, _3$$4, _4$$4, _6$$4, _7$$4, _9$$4, _18$$6, _19$$6, _20$$6, _21$$6, _22$$6, _23$$6, _24$$6, _25$$6, _26$$6, _27$$6, _28$$6, _29$$6, _30$$6, _31$$6, _32$$6, _33$$6, _37$$7, _38$$7, _39$$7, _40$$7, _41$$7, _42$$7, _43$$7, _44$$7, _45$$7, _46$$7, _47$$7, _48$$7, _49$$7, _51$$9, _52$$9, _53$$9, _54$$9, _56$$8, _57$$10, _58$$10, _59$$10; @@ -339,13 +340,13 @@ PHP_METHOD(Test_Quantum, harmos) { ZVAL_STRING(&_52$$9, "%16.8lf %16.8lf %16.8lf \n"); ZVAL_DOUBLE(&_53$$9, ((double) i * dx)); ZVAL_DOUBLE(&_54$$9, ((double) n * dt)); - ZEPHIR_CALL_FUNCTION(NULL, "fprintf", &_55, 75, &fp, &_52$$9, &_53$$9, &_54$$9, &_51$$9); + ZEPHIR_CALL_FUNCTION(NULL, "fprintf", &_55, 67, &fp, &_52$$9, &_53$$9, &_54$$9, &_51$$9); zephir_check_call_status(); i = (i + 10); } ZEPHIR_INIT_NVAR(&_56$$8); ZVAL_STRING(&_56$$8, "\n"); - ZEPHIR_CALL_FUNCTION(NULL, "fprintf", &_55, 75, &fp, &_56$$8); + ZEPHIR_CALL_FUNCTION(NULL, "fprintf", &_55, 67, &fp, &_56$$8); zephir_check_call_status(); } j = 1; diff --git a/ext/test/range.zep.c b/ext/test/range.zep.c index 549e12a08d..b98db53ff8 100644 --- a/ext/test/range.zep.c +++ b/ext/test/range.zep.c @@ -33,6 +33,7 @@ PHP_METHOD(Test_Range, inclusive1) { zval _3; zval _0, _1, _2; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -45,7 +46,7 @@ PHP_METHOD(Test_Range, inclusive1) { ZVAL_LONG(&_0, 0); ZVAL_LONG(&_1, 10); - ZEPHIR_CALL_FUNCTION(&_2, "range", NULL, 76, &_0, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "range", NULL, 68, &_0, &_1); zephir_check_call_status(); zephir_get_arrval(&_3, &_2); RETURN_CTOR(&_3); @@ -56,6 +57,7 @@ PHP_METHOD(Test_Range, exclusive1) { zval _3; zval _0, _1, _2; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -68,7 +70,7 @@ PHP_METHOD(Test_Range, exclusive1) { ZVAL_LONG(&_0, 0); ZVAL_LONG(&_1, 10); - ZEPHIR_CALL_FUNCTION(&_2, "range", NULL, 76, &_0, &_1); + ZEPHIR_CALL_FUNCTION(&_2, "range", NULL, 68, &_0, &_1); zephir_check_call_status(); zephir_get_arrval(&_3, &_2); RETURN_CTOR(&_3); diff --git a/ext/test/regexdna.zep.c b/ext/test/regexdna.zep.c index 9a8961698a..1cfedbab57 100644 --- a/ext/test/regexdna.zep.c +++ b/ext/test/regexdna.zep.c @@ -36,6 +36,7 @@ ZEPHIR_INIT_CLASS(Test_RegexDNA) { PHP_METHOD(Test_RegexDNA, process) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_3 = NULL; zval *path, path_sub, variants, vIUB, vIUBnew, stuffToRemove, contents, initialLength, regex, codeLength, discard, _0, _1, _2, *_4, _5, _6$$3, _7$$3, _8$$4, _9$$4; @@ -178,7 +179,7 @@ PHP_METHOD(Test_RegexDNA, process) { ZEPHIR_CONCAT_SVS(&_1, "/", &stuffToRemove, "/mS"); ZEPHIR_INIT_NVAR(&_0); ZVAL_STRING(&_0, ""); - ZEPHIR_CALL_FUNCTION(&_2, "preg_replace", &_3, 71, &_1, &_0, &contents); + ZEPHIR_CALL_FUNCTION(&_2, "preg_replace", &_3, 63, &_1, &_0, &contents); zephir_check_call_status(); ZEPHIR_CPY_WRT(&contents, &_2); ZEPHIR_INIT_VAR(&codeLength); @@ -222,7 +223,7 @@ PHP_METHOD(Test_RegexDNA, process) { } } ZEPHIR_INIT_NVAR(®ex); - ZEPHIR_CALL_FUNCTION(&_2, "preg_replace", &_3, 71, &vIUB, &vIUBnew, &contents); + ZEPHIR_CALL_FUNCTION(&_2, "preg_replace", &_3, 63, &vIUB, &vIUBnew, &contents); zephir_check_call_status(); ZEPHIR_CPY_WRT(&contents, &_2); php_printf("%c", '\n'); diff --git a/ext/test/requires.zep.c b/ext/test/requires.zep.c index 00e39de4ac..9868083497 100644 --- a/ext/test/requires.zep.c +++ b/ext/test/requires.zep.c @@ -33,6 +33,7 @@ ZEPHIR_INIT_CLASS(Test_Requires) { PHP_METHOD(Test_Requires, requireExternal1) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *path, path_sub, _0; zval *this_ptr = getThis(); @@ -59,7 +60,7 @@ PHP_METHOD(Test_Requires, requireExternal2) { ZVAL_UNDEF(&path_sub); - zephir_fetch_params(0, 1, 0, &path); + zephir_fetch_params_without_memory_grow(1, 0, &path); @@ -72,6 +73,7 @@ PHP_METHOD(Test_Requires, requireExternal2) { PHP_METHOD(Test_Requires, requireExternal3) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *path, path_sub, external3, _0; zval *this_ptr = getThis(); @@ -86,7 +88,7 @@ PHP_METHOD(Test_Requires, requireExternal3) { ZEPHIR_INIT_VAR(&_0); - zephir_create_symbol_table(TSRMLS_C); + ZEPHIR_CREATE_SYMBOL_TABLE(); ZEPHIR_INIT_VAR(&external3); object_init_ex(&external3, test_requires_external3_ce); @@ -94,7 +96,7 @@ PHP_METHOD(Test_Requires, requireExternal3) { ZEPHIR_CALL_METHOD(NULL, &external3, "__construct", NULL, 0); zephir_check_call_status(); } - ZEPHIR_CALL_METHOD(NULL, &external3, "req", NULL, 77, path, this_ptr); + ZEPHIR_CALL_METHOD(NULL, &external3, "req", NULL, 69, path, this_ptr); zephir_check_call_status(); RETURN_MM_MEMBER(getThis(), "content"); @@ -107,7 +109,7 @@ PHP_METHOD(Test_Requires, setContent) { ZVAL_UNDEF(&content_sub); - zephir_fetch_params(0, 1, 0, &content); + zephir_fetch_params_without_memory_grow(1, 0, &content); @@ -119,6 +121,7 @@ PHP_METHOD(Test_Requires, renderTemplate) { zend_string *_4$$3; zend_ulong _3$$3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *templatePath_param = NULL, *params, params_sub, _0, key, value, _7, *_1$$3, _2$$3, _5$$4, _6$$5; zval templatePath; @@ -150,7 +153,7 @@ PHP_METHOD(Test_Requires, renderTemplate) { ZEPHIR_INIT_VAR(&_0); - zephir_create_symbol_table(TSRMLS_C); + ZEPHIR_CREATE_SYMBOL_TABLE(); if (Z_TYPE_P(params) == IS_ARRAY) { zephir_is_iterable(params, 0, "test/requires.zep", 47); diff --git a/ext/test/requires/external3.zep.c b/ext/test/requires/external3.zep.c index ed964fac2c..af1e6dd62b 100644 --- a/ext/test/requires/external3.zep.c +++ b/ext/test/requires/external3.zep.c @@ -33,6 +33,7 @@ ZEPHIR_INIT_CLASS(Test_Requires_External3) { PHP_METHOD(Test_Requires_External3, req) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *path, path_sub, *requires, requires_sub, _0; zval *this_ptr = getThis(); @@ -46,12 +47,12 @@ PHP_METHOD(Test_Requires_External3, req) { - ZEPHIR_CALL_FUNCTION(NULL, "ob_clean", NULL, 78); + ZEPHIR_CALL_FUNCTION(NULL, "ob_clean", NULL, 70); zephir_check_call_status(); if (zephir_require_zval(path TSRMLS_CC) == FAILURE) { RETURN_MM_NULL(); } - ZEPHIR_CALL_FUNCTION(&_0, "ob_get_contents", NULL, 79); + ZEPHIR_CALL_FUNCTION(&_0, "ob_get_contents", NULL, 71); zephir_check_call_status(); ZEPHIR_CALL_METHOD(NULL, requires, "setcontent", NULL, 0, &_0); zephir_check_call_status(); diff --git a/ext/test/resourcetest.zep.c b/ext/test/resourcetest.zep.c index 0255a45477..3d345b083f 100644 --- a/ext/test/resourcetest.zep.c +++ b/ext/test/resourcetest.zep.c @@ -28,6 +28,7 @@ ZEPHIR_INIT_CLASS(Test_ResourceTest) { PHP_METHOD(Test_ResourceTest, testLetStatementSTDIN) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -35,7 +36,7 @@ PHP_METHOD(Test_ResourceTest, testLetStatementSTDIN) { ZEPHIR_MM_GROW(); ZEPHIR_INIT_VAR(&a); - ZEPHIR_GET_CONSTANT(&a, "STDIN"); + ZEPHIR_MM_GET_CONSTANT(&a, "STDIN"); RETURN_CCTOR(&a); } @@ -43,6 +44,7 @@ PHP_METHOD(Test_ResourceTest, testLetStatementSTDIN) { PHP_METHOD(Test_ResourceTest, testLetStatementSTDOUT) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -50,7 +52,7 @@ PHP_METHOD(Test_ResourceTest, testLetStatementSTDOUT) { ZEPHIR_MM_GROW(); ZEPHIR_INIT_VAR(&a); - ZEPHIR_GET_CONSTANT(&a, "STDOUT"); + ZEPHIR_MM_GET_CONSTANT(&a, "STDOUT"); RETURN_CCTOR(&a); } @@ -58,6 +60,7 @@ PHP_METHOD(Test_ResourceTest, testLetStatementSTDOUT) { PHP_METHOD(Test_ResourceTest, testLetStatementSTDERR) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -65,7 +68,7 @@ PHP_METHOD(Test_ResourceTest, testLetStatementSTDERR) { ZEPHIR_MM_GROW(); ZEPHIR_INIT_VAR(&a); - ZEPHIR_GET_CONSTANT(&a, "STDERR"); + ZEPHIR_MM_GET_CONSTANT(&a, "STDERR"); RETURN_CCTOR(&a); } @@ -73,6 +76,7 @@ PHP_METHOD(Test_ResourceTest, testLetStatementSTDERR) { PHP_METHOD(Test_ResourceTest, testTypeOffResource) { zval a, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -81,7 +85,7 @@ PHP_METHOD(Test_ResourceTest, testTypeOffResource) { ZEPHIR_MM_GROW(); ZEPHIR_INIT_VAR(&a); - ZEPHIR_GET_CONSTANT(&a, "STDIN"); + ZEPHIR_MM_GET_CONSTANT(&a, "STDIN"); ZEPHIR_INIT_VAR(&_0); zephir_gettype(&_0, &a TSRMLS_CC); RETURN_CCTOR(&_0); @@ -91,6 +95,7 @@ PHP_METHOD(Test_ResourceTest, testTypeOffResource) { PHP_METHOD(Test_ResourceTest, testIsResource) { zval a; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&a); @@ -98,7 +103,7 @@ PHP_METHOD(Test_ResourceTest, testIsResource) { ZEPHIR_MM_GROW(); ZEPHIR_INIT_VAR(&a); - ZEPHIR_GET_CONSTANT(&a, "STDIN"); + ZEPHIR_MM_GET_CONSTANT(&a, "STDIN"); RETURN_MM_BOOL(Z_TYPE_P(&a) == IS_RESOURCE); } @@ -106,6 +111,7 @@ PHP_METHOD(Test_ResourceTest, testIsResource) { PHP_METHOD(Test_ResourceTest, testFunctionsForSTDIN) { zval a, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -115,9 +121,9 @@ PHP_METHOD(Test_ResourceTest, testFunctionsForSTDIN) { ZEPHIR_MM_GROW(); ZEPHIR_INIT_VAR(&a); - ZEPHIR_GET_CONSTANT(&a, "STDIN"); + ZEPHIR_MM_GET_CONSTANT(&a, "STDIN"); ZVAL_LONG(&_0, 1); - ZEPHIR_CALL_FUNCTION(NULL, "stream_set_blocking", NULL, 80, &a, &_0); + ZEPHIR_CALL_FUNCTION(NULL, "stream_set_blocking", NULL, 72, &a, &_0); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); diff --git a/ext/test/returns.zep.c b/ext/test/returns.zep.c index 6a1f66dd63..44809bd898 100644 --- a/ext/test/returns.zep.c +++ b/ext/test/returns.zep.c @@ -67,6 +67,7 @@ PHP_METHOD(Test_Returns, testReturnCast4) { PHP_METHOD(Test_Returns, returnWithParameter) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *parameter_param = NULL; zval parameter; zval *this_ptr = getThis(); diff --git a/ext/test/router.zep.c b/ext/test/router.zep.c index 21d484ead4..d17d7582c9 100644 --- a/ext/test/router.zep.c +++ b/ext/test/router.zep.c @@ -104,6 +104,7 @@ ZEPHIR_INIT_CLASS(Test_Router) { PHP_METHOD(Test_Router, __construct) { zval _1$$3, _4$$3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zephir_fcall_cache_entry *_3 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *defaultRoutes_param = NULL, routes, _6, _0$$3, _2$$3, _5$$3; @@ -138,7 +139,7 @@ PHP_METHOD(Test_Router, __construct) { add_assoc_long_ex(&_1$$3, SL("controller"), 1); ZEPHIR_INIT_VAR(&_2$$3); ZVAL_STRING(&_2$$3, "#^/([a-zA-Z0-9\\_\\-]+)[/]{0,1}$#"); - ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", &_3, 81, &_2$$3, &_1$$3); + ZEPHIR_CALL_METHOD(NULL, &_0$$3, "__construct", &_3, 73, &_2$$3, &_1$$3); zephir_check_call_status(); zephir_array_append(&routes, &_0$$3, PH_SEPARATE, "test/router.zep", 89); ZEPHIR_INIT_NVAR(&_2$$3); @@ -150,7 +151,7 @@ PHP_METHOD(Test_Router, __construct) { add_assoc_long_ex(&_4$$3, SL("params"), 3); ZEPHIR_INIT_VAR(&_5$$3); ZVAL_STRING(&_5$$3, "#^/([a-zA-Z0-9\\_\\-]+)/([a-zA-Z0-9\\.\\_]+)(/.*)*$#"); - ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", &_3, 81, &_5$$3, &_4$$3); + ZEPHIR_CALL_METHOD(NULL, &_2$$3, "__construct", &_3, 73, &_5$$3, &_4$$3); zephir_check_call_status(); zephir_array_append(&routes, &_2$$3, PH_SEPARATE, "test/router.zep", 95); } @@ -174,7 +175,7 @@ PHP_METHOD(Test_Router, setDI) { ZVAL_UNDEF(&dependencyInjector_sub); - zephir_fetch_params(0, 1, 0, &dependencyInjector); + zephir_fetch_params_without_memory_grow(1, 0, &dependencyInjector); @@ -203,6 +204,7 @@ PHP_METHOD(Test_Router, getDI) { */ PHP_METHOD(Test_Router, getRewriteUri) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval _GET, _SERVER, url, urlParts, realUri, _0; zval *this_ptr = getThis(); @@ -257,7 +259,7 @@ PHP_METHOD(Test_Router, setUriSource) { ZVAL_UNDEF(&uriSource_sub); - zephir_fetch_params(0, 1, 0, &uriSource); + zephir_fetch_params_without_memory_grow(1, 0, &uriSource); @@ -279,7 +281,7 @@ PHP_METHOD(Test_Router, removeExtraSlashes) { ZVAL_UNDEF(&remove_sub); - zephir_fetch_params(0, 1, 0, &remove); + zephir_fetch_params_without_memory_grow(1, 0, &remove); @@ -301,7 +303,7 @@ PHP_METHOD(Test_Router, setDefaultNamespace) { ZVAL_UNDEF(&namespaceName_sub); - zephir_fetch_params(0, 1, 0, &namespaceName); + zephir_fetch_params_without_memory_grow(1, 0, &namespaceName); @@ -323,7 +325,7 @@ PHP_METHOD(Test_Router, setDefaultModule) { ZVAL_UNDEF(&moduleName_sub); - zephir_fetch_params(0, 1, 0, &moduleName); + zephir_fetch_params_without_memory_grow(1, 0, &moduleName); @@ -345,7 +347,7 @@ PHP_METHOD(Test_Router, setDefaultController) { ZVAL_UNDEF(&controllerName_sub); - zephir_fetch_params(0, 1, 0, &controllerName); + zephir_fetch_params_without_memory_grow(1, 0, &controllerName); @@ -367,7 +369,7 @@ PHP_METHOD(Test_Router, setDefaultAction) { ZVAL_UNDEF(&actionName_sub); - zephir_fetch_params(0, 1, 0, &actionName); + zephir_fetch_params_without_memory_grow(1, 0, &actionName); @@ -402,7 +404,7 @@ PHP_METHOD(Test_Router, setDefaults) { ZVAL_UNDEF(&action); ZVAL_UNDEF(¶ms); - zephir_fetch_params(0, 1, 0, &defaults); + zephir_fetch_params_without_memory_grow(1, 0, &defaults); @@ -439,7 +441,7 @@ PHP_METHOD(Test_Router, doRemoveExtraSlashes) { ZVAL_UNDEF(&route_sub); - zephir_fetch_params(0, 1, 0, &route); + zephir_fetch_params_without_memory_grow(1, 0, &route); @@ -465,6 +467,7 @@ PHP_METHOD(Test_Router, handle) { zend_string *_12$$28, *_21$$62; zend_ulong _11$$28, _20$$62; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *uri = NULL, uri_sub, __$true, __$false, __$null, realUri, request, currentHostName, routeFound, parts, params, matches, notFoundPaths, vnamespace, module, controller, action, paramsStr, strParams, paramsMerge, route, methods, dependencyInjector, hostname, regexHostName, matched, pattern, handledUri, beforeMatch, paths, converters, part, position, matchPosition, _0, _1, *_2, _3, _4$$9, _5$$9, _6$$8, _7$$13, _8$$17, *_9$$28, _10$$28, _13$$43, _14$$43, _15$$42, _16$$47, _17$$51, *_18$$62, _19$$62, _22$$82, _23$$85, _24$$88, _25$$91, _26$$92, _27$$96, _28$$96, _29$$96, _30$$96, _31$$96; zval *this_ptr = getThis(); @@ -1007,6 +1010,7 @@ PHP_METHOD(Test_Router, handle) { */ PHP_METHOD(Test_Router, add) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *pattern, pattern_sub, *paths = NULL, paths_sub, *httpMethods = NULL, httpMethods_sub, __$null, route; zval *this_ptr = getThis(); @@ -1032,7 +1036,7 @@ PHP_METHOD(Test_Router, add) { ZEPHIR_INIT_VAR(&route); object_init_ex(&route, test_router_route_ce); - ZEPHIR_CALL_METHOD(NULL, &route, "__construct", NULL, 81, pattern, paths, httpMethods); + ZEPHIR_CALL_METHOD(NULL, &route, "__construct", NULL, 73, pattern, paths, httpMethods); zephir_check_call_status(); zephir_update_property_array_append(this_ptr, SL("_routes"), &route); RETURN_CCTOR(&route); @@ -1048,6 +1052,7 @@ PHP_METHOD(Test_Router, add) { */ PHP_METHOD(Test_Router, addGet) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *pattern, pattern_sub, *paths = NULL, paths_sub, __$null, _0; zval *this_ptr = getThis(); @@ -1083,6 +1088,7 @@ PHP_METHOD(Test_Router, addGet) { */ PHP_METHOD(Test_Router, addPost) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *pattern, pattern_sub, *paths = NULL, paths_sub, __$null, _0; zval *this_ptr = getThis(); @@ -1118,6 +1124,7 @@ PHP_METHOD(Test_Router, addPost) { */ PHP_METHOD(Test_Router, addPut) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *pattern, pattern_sub, *paths = NULL, paths_sub, __$null, _0; zval *this_ptr = getThis(); @@ -1153,6 +1160,7 @@ PHP_METHOD(Test_Router, addPut) { */ PHP_METHOD(Test_Router, addPatch) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *pattern, pattern_sub, *paths = NULL, paths_sub, __$null, _0; zval *this_ptr = getThis(); @@ -1188,6 +1196,7 @@ PHP_METHOD(Test_Router, addPatch) { */ PHP_METHOD(Test_Router, addDelete) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *pattern, pattern_sub, *paths = NULL, paths_sub, __$null, _0; zval *this_ptr = getThis(); @@ -1223,6 +1232,7 @@ PHP_METHOD(Test_Router, addDelete) { */ PHP_METHOD(Test_Router, addOptions) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *pattern, pattern_sub, *paths = NULL, paths_sub, __$null, _0; zval *this_ptr = getThis(); @@ -1258,6 +1268,7 @@ PHP_METHOD(Test_Router, addOptions) { */ PHP_METHOD(Test_Router, addHead) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *pattern, pattern_sub, *paths = NULL, paths_sub, __$null, _0; zval *this_ptr = getThis(); @@ -1292,6 +1303,7 @@ PHP_METHOD(Test_Router, addHead) { */ PHP_METHOD(Test_Router, mount) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *group, group_sub, groupRoutes, beforeMatch, hostname, routes, route, *_0$$5, _1$$5, *_2$$8, _3$$8, _4$$11; zval *this_ptr = getThis(); @@ -1409,7 +1421,7 @@ PHP_METHOD(Test_Router, notFound) { ZVAL_UNDEF(&paths_sub); - zephir_fetch_params(0, 1, 0, &paths); + zephir_fetch_params_without_memory_grow(1, 0, &paths); @@ -1430,6 +1442,7 @@ PHP_METHOD(Test_Router, notFound) { PHP_METHOD(Test_Router, clear) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -1577,6 +1590,7 @@ PHP_METHOD(Test_Router, getRoutes) { */ PHP_METHOD(Test_Router, getRouteById) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *id, id_sub, route, _0, *_1, _2, _3$$3, _4$$5; zval *this_ptr = getThis(); @@ -1639,6 +1653,7 @@ PHP_METHOD(Test_Router, getRouteById) { */ PHP_METHOD(Test_Router, getRouteByName) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *name, name_sub, route, _0, *_1, _2, _3$$3, _4$$5; zval *this_ptr = getThis(); diff --git a/ext/test/router/route.zep.c b/ext/test/router/route.zep.c index d2e5ef3d4d..ac502be5d6 100644 --- a/ext/test/router/route.zep.c +++ b/ext/test/router/route.zep.c @@ -62,6 +62,7 @@ ZEPHIR_INIT_CLASS(Test_Router_Route) { */ PHP_METHOD(Test_Router_Route, __construct) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *pattern, pattern_sub, *paths = NULL, paths_sub, *httpMethods = NULL, httpMethods_sub, __$null; zval *this_ptr = getThis(); @@ -99,6 +100,7 @@ PHP_METHOD(Test_Router_Route, __construct) { */ PHP_METHOD(Test_Router_Route, compilePattern) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *pattern = NULL, pattern_sub, idPattern, _0$$4, _1$$4, _2$$5, _3$$5, _4$$6, _5$$6, _6$$7, _7$$7, _8$$8, _9$$8, _10$$8, _11$$9, _12$$9, _13$$9; zval *this_ptr = getThis(); @@ -206,7 +208,7 @@ PHP_METHOD(Test_Router_Route, via) { ZVAL_UNDEF(&httpMethods_sub); - zephir_fetch_params(0, 1, 0, &httpMethods); + zephir_fetch_params_without_memory_grow(1, 0, &httpMethods); @@ -226,6 +228,7 @@ PHP_METHOD(Test_Router_Route, extractNamedParams) { zend_bool notValid, _6$$12, _7$$12, _8$$12, _9$$12, _10$$12, _11$$12, _12$$12, _13$$12, _14$$12, _15$$12, _16$$12, _17$$12, _25$$18; zend_long tmp = 0, cursor = 0, cursorVar = 0, marker = 0, bracketCount, parenthesesCount, foundPattern, intermediate, numberMatches; char ch = 0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *pattern_param = NULL, matches, _1$$11, _2$$11, _3$$11, _18$$16, _19$$16, _20$$16, _22$$16, _23$$16, _27$$19, _28$$28; zval pattern, route, item, variable, regexp, _4$$11, _21$$16, _24$$16, _29$$29; zval *this_ptr = getThis(); @@ -459,6 +462,7 @@ PHP_METHOD(Test_Router_Route, extractNamedParams) { */ PHP_METHOD(Test_Router_Route, reConfigure) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, _0$$5; zval *pattern, pattern_sub, *paths = NULL, paths_sub, __$null, moduleName, controllerName, actionName, parts, routePaths, realClassName, namespaceName, pcrePattern, compiledPattern, extracted, _1$$10, _2$$19, _3$$19; zval *this_ptr = getThis(); @@ -621,7 +625,7 @@ PHP_METHOD(Test_Router_Route, setName) { ZVAL_UNDEF(&name_sub); - zephir_fetch_params(0, 1, 0, &name); + zephir_fetch_params_without_memory_grow(1, 0, &name); @@ -645,7 +649,7 @@ PHP_METHOD(Test_Router_Route, beforeMatch) { ZVAL_UNDEF(&callback_sub); - zephir_fetch_params(0, 1, 0, &callback); + zephir_fetch_params_without_memory_grow(1, 0, &callback); @@ -734,6 +738,7 @@ PHP_METHOD(Test_Router_Route, getReversedPaths) { zend_string *_4; zend_ulong _3; zval reversed, path, position, _0, *_1, _2; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -804,7 +809,7 @@ PHP_METHOD(Test_Router_Route, setHttpMethods) { ZVAL_UNDEF(&httpMethods_sub); - zephir_fetch_params(0, 1, 0, &httpMethods); + zephir_fetch_params_without_memory_grow(1, 0, &httpMethods); @@ -844,7 +849,7 @@ PHP_METHOD(Test_Router_Route, setHostname) { ZVAL_UNDEF(&hostname_sub); - zephir_fetch_params(0, 1, 0, &hostname); + zephir_fetch_params_without_memory_grow(1, 0, &hostname); @@ -882,7 +887,7 @@ PHP_METHOD(Test_Router_Route, convert) { ZVAL_UNDEF(&name_sub); ZVAL_UNDEF(&converter_sub); - zephir_fetch_params(0, 2, 0, &name, &converter); + zephir_fetch_params_without_memory_grow(2, 0, &name, &converter); diff --git a/ext/test/scall.zep.c b/ext/test/scall.zep.c index 5b1f73d3fd..031970d7d7 100644 --- a/ext/test/scall.zep.c +++ b/ext/test/scall.zep.c @@ -64,7 +64,7 @@ PHP_METHOD(Test_Scall, testMethod4) { ZVAL_UNDEF(&a_sub); ZVAL_UNDEF(&b_sub); - zephir_fetch_params(0, 2, 0, &a, &b); + zephir_fetch_params_without_memory_grow(2, 0, &a, &b); @@ -81,7 +81,7 @@ PHP_METHOD(Test_Scall, testMethod5) { ZVAL_UNDEF(&a_sub); ZVAL_UNDEF(&b_sub); - zephir_fetch_params(0, 2, 0, &a, &b); + zephir_fetch_params_without_memory_grow(2, 0, &a, &b); @@ -98,7 +98,7 @@ PHP_METHOD(Test_Scall, testMethod6) { ZVAL_UNDEF(&a_sub); ZVAL_UNDEF(&b_sub); - zephir_fetch_params(0, 2, 0, &a, &b); + zephir_fetch_params_without_memory_grow(2, 0, &a, &b); @@ -119,6 +119,7 @@ PHP_METHOD(Test_Scall, testMethod7) { PHP_METHOD(Test_Scall, testCall1) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -133,6 +134,7 @@ PHP_METHOD(Test_Scall, testCall1) { PHP_METHOD(Test_Scall, testCall2) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -147,6 +149,7 @@ PHP_METHOD(Test_Scall, testCall2) { PHP_METHOD(Test_Scall, testCall3) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *this_ptr = getThis(); @@ -154,7 +157,7 @@ PHP_METHOD(Test_Scall, testCall3) { ZEPHIR_MM_GROW(); - ZEPHIR_RETURN_CALL_SELF("testmethod3", &_0, 82); + ZEPHIR_RETURN_CALL_SELF("testmethod3", &_0, 74); zephir_check_call_status(); RETURN_MM(); @@ -162,6 +165,7 @@ PHP_METHOD(Test_Scall, testCall3) { PHP_METHOD(Test_Scall, testCall4) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *a, a_sub, *b, b_sub; zval *this_ptr = getThis(); @@ -182,6 +186,7 @@ PHP_METHOD(Test_Scall, testCall4) { PHP_METHOD(Test_Scall, testCall5) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *a, a_sub, *b, b_sub; zval *this_ptr = getThis(); @@ -202,6 +207,7 @@ PHP_METHOD(Test_Scall, testCall5) { PHP_METHOD(Test_Scall, testCall6) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *a, a_sub, *b, b_sub; @@ -215,7 +221,7 @@ PHP_METHOD(Test_Scall, testCall6) { - ZEPHIR_RETURN_CALL_SELF("testmethod6", &_0, 83, a, b); + ZEPHIR_RETURN_CALL_SELF("testmethod6", &_0, 75, a, b); zephir_check_call_status(); RETURN_MM(); @@ -223,6 +229,7 @@ PHP_METHOD(Test_Scall, testCall6) { PHP_METHOD(Test_Scall, testCall7) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -237,6 +244,7 @@ PHP_METHOD(Test_Scall, testCall7) { PHP_METHOD(Test_Scall, testCall8) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -251,6 +259,7 @@ PHP_METHOD(Test_Scall, testCall8) { PHP_METHOD(Test_Scall, testCall9) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *this_ptr = getThis(); @@ -258,7 +267,7 @@ PHP_METHOD(Test_Scall, testCall9) { ZEPHIR_MM_GROW(); - ZEPHIR_RETURN_CALL_SELF("testmethod3", &_0, 82); + ZEPHIR_RETURN_CALL_SELF("testmethod3", &_0, 74); zephir_check_call_status(); RETURN_MM(); @@ -266,6 +275,7 @@ PHP_METHOD(Test_Scall, testCall9) { PHP_METHOD(Test_Scall, testCall10) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *a, a_sub, *b, b_sub; zval *this_ptr = getThis(); @@ -286,6 +296,7 @@ PHP_METHOD(Test_Scall, testCall10) { PHP_METHOD(Test_Scall, testCall11) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *a, a_sub, *b, b_sub; zval *this_ptr = getThis(); @@ -306,6 +317,7 @@ PHP_METHOD(Test_Scall, testCall11) { PHP_METHOD(Test_Scall, testCall12) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *a, a_sub, *b, b_sub; @@ -319,7 +331,7 @@ PHP_METHOD(Test_Scall, testCall12) { - ZEPHIR_RETURN_CALL_SELF("testmethod6", &_0, 83, a, b); + ZEPHIR_RETURN_CALL_SELF("testmethod6", &_0, 75, a, b); zephir_check_call_status(); RETURN_MM(); @@ -327,6 +339,7 @@ PHP_METHOD(Test_Scall, testCall12) { PHP_METHOD(Test_Scall, testCall13) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *this_ptr = getThis(); @@ -342,6 +355,7 @@ PHP_METHOD(Test_Scall, testCall13) { PHP_METHOD(Test_Scall, testCall14) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *this_ptr = getThis(); @@ -357,6 +371,7 @@ PHP_METHOD(Test_Scall, testCall14) { PHP_METHOD(Test_Scall, testCall15) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -376,7 +391,7 @@ PHP_METHOD(Test_Scall, testMethod16) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 2, 0, &a_param, &b_param); + zephir_fetch_params_without_memory_grow(2, 0, &a_param, &b_param); a = zephir_get_intval(a_param); b = zephir_get_intval(b_param); @@ -389,6 +404,7 @@ PHP_METHOD(Test_Scall, testMethod16) { PHP_METHOD(Test_Scall, testCall17) { zend_bool _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, _1; zephir_fcall_cache_entry *_4 = NULL; zval *k_param = NULL, *p, p_sub, _3$$3; @@ -431,6 +447,7 @@ PHP_METHOD(Test_Scall, testCall17) { PHP_METHOD(Test_Scall, testCall18) { zend_bool _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, _1; zephir_fcall_cache_entry *_4 = NULL; zval *k_param = NULL, *p, p_sub, _3$$3; @@ -483,6 +500,7 @@ PHP_METHOD(Test_Scall, interpolatedStaticReturn) { zend_class_entry *_0; zval className, methodName; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -507,6 +525,7 @@ PHP_METHOD(Test_Scall, interpolatedStaticEcho) { zend_class_entry *_1; zval _0; zval className, methodName; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); diff --git a/ext/test/scalldynamic.zep.c b/ext/test/scalldynamic.zep.c index 827856356e..33d78d36f4 100644 --- a/ext/test/scalldynamic.zep.c +++ b/ext/test/scalldynamic.zep.c @@ -63,7 +63,7 @@ PHP_METHOD(Test_ScallDynamic, selfDynamicCall1) { ZVAL_UNDEF(&methodName_sub); - zephir_fetch_params(0, 1, 0, &methodName); + zephir_fetch_params_without_memory_grow(1, 0, &methodName); diff --git a/ext/test/scallexternal.zep.c b/ext/test/scallexternal.zep.c index f6d84b8ff9..2a1a212a4e 100644 --- a/ext/test/scallexternal.zep.c +++ b/ext/test/scallexternal.zep.c @@ -33,6 +33,7 @@ ZEPHIR_INIT_CLASS(Test_ScallExternal) { PHP_METHOD(Test_ScallExternal, testCall1) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *this_ptr = getThis(); @@ -48,6 +49,7 @@ PHP_METHOD(Test_ScallExternal, testCall1) { PHP_METHOD(Test_ScallExternal, testCall2) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zephir_fcall_cache_entry *_0 = NULL; zval *a, a_sub, *b, b_sub; @@ -74,7 +76,7 @@ PHP_METHOD(Test_ScallExternal, testMethod3) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 2, 0, &a_param, &b_param); + zephir_fetch_params_without_memory_grow(2, 0, &a_param, &b_param); a = zephir_get_intval(a_param); b = zephir_get_intval(b_param); diff --git a/ext/test/scallparent.zep.c b/ext/test/scallparent.zep.c index 89f4e3d7c4..6c756f2104 100644 --- a/ext/test/scallparent.zep.c +++ b/ext/test/scallparent.zep.c @@ -48,6 +48,7 @@ PHP_METHOD(Test_ScallParent, testMethod2) { PHP_METHOD(Test_ScallParent, testCallStatic) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); diff --git a/ext/test/scope.zep.c b/ext/test/scope.zep.c index 05b7aa1434..8eea743461 100644 --- a/ext/test/scope.zep.c +++ b/ext/test/scope.zep.c @@ -45,7 +45,7 @@ PHP_METHOD(Test_Scope, getDyStr) { ZVAL_UNDEF(&_0); - zephir_fetch_params(0, 1, 0, &g_param); + zephir_fetch_params_without_memory_grow(1, 0, &g_param); g = zephir_get_intval(g_param); @@ -60,6 +60,7 @@ PHP_METHOD(Test_Scope, getDyStr) { PHP_METHOD(Test_Scope, test1) { zval ret, k, k$$3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, r; zephir_fcall_cache_entry *_0 = NULL; zval *this_ptr = getThis(); @@ -72,7 +73,7 @@ PHP_METHOD(Test_Scope, test1) { ZEPHIR_INIT_VAR(&ret); ZVAL_STRING(&ret, ""); - ZEPHIR_CALL_SELF(&k, "getstr", &_0, 84); + ZEPHIR_CALL_SELF(&k, "getstr", &_0, 76); zephir_check_call_status(); r = 1; if (r == 1) { @@ -90,6 +91,7 @@ PHP_METHOD(Test_Scope, test2) { zend_bool _0; zval k, c, _5, _3$$3, _4$$3; zend_long p, _1, _2, p$$3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&k); @@ -139,6 +141,7 @@ PHP_METHOD(Test_Scope, test3) { zend_bool _0; zval k, c, str$$3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, _1, _2; zephir_fcall_cache_entry *_3 = NULL; zval *this_ptr = getThis(); @@ -166,7 +169,7 @@ PHP_METHOD(Test_Scope, test3) { } ZEPHIR_INIT_NVAR(&c); ZVAL_LONG(&c, _1); - ZEPHIR_CALL_SELF(&str$$3, "getdystr", &_3, 85, &c); + ZEPHIR_CALL_SELF(&str$$3, "getdystr", &_3, 77, &c); zephir_check_call_status(); zephir_concat_self(&k, &str$$3 TSRMLS_CC); } diff --git a/ext/test/sort.zep.c b/ext/test/sort.zep.c index 140a28f4f8..15b73c58ab 100644 --- a/ext/test/sort.zep.c +++ b/ext/test/sort.zep.c @@ -30,6 +30,7 @@ ZEPHIR_INIT_CLASS(Test_Sort) { PHP_METHOD(Test_Sort, quick) { zend_bool _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zephir_fcall_cache_entry *_8 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, i = 0, length = 0, pivot = 0, item = 0, _2, _3; zval *arr_param = NULL, left, right, _0, _7, _10, _11, _4$$4, _5$$5, _6$$6; @@ -93,16 +94,16 @@ PHP_METHOD(Test_Sort, quick) { } } } - ZEPHIR_CALL_METHOD(&_7, this_ptr, "quick", &_8, 86, &left); + ZEPHIR_CALL_METHOD(&_7, this_ptr, "quick", &_8, 78, &left); zephir_check_call_status(); ZEPHIR_INIT_VAR(&_9); zephir_create_array(&_9, 1, 0 TSRMLS_CC); ZEPHIR_INIT_VAR(&_10); ZVAL_LONG(&_10, pivot); zephir_array_fast_append(&_9, &_10); - ZEPHIR_CALL_METHOD(&_11, this_ptr, "quick", &_8, 86, &right); + ZEPHIR_CALL_METHOD(&_11, this_ptr, "quick", &_8, 78, &right); zephir_check_call_status(); - ZEPHIR_RETURN_CALL_FUNCTION("array_merge", NULL, 87, &_7, &_9, &_11); + ZEPHIR_RETURN_CALL_FUNCTION("array_merge", NULL, 79, &_7, &_9, &_11); zephir_check_call_status(); RETURN_MM(); diff --git a/ext/test/spectralnorm.zep.c b/ext/test/spectralnorm.zep.c index 31e667adab..eae4e1a5f6 100644 --- a/ext/test/spectralnorm.zep.c +++ b/ext/test/spectralnorm.zep.c @@ -35,6 +35,7 @@ ZEPHIR_INIT_CLASS(Test_SpectralNorm) { PHP_METHOD(Test_SpectralNorm, Ax) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *i, i_sub, *j, j_sub, _0, _1; zval *this_ptr = getThis(); @@ -59,6 +60,7 @@ PHP_METHOD(Test_SpectralNorm, Ax) { PHP_METHOD(Test_SpectralNorm, Au) { zend_bool _0, _3$$3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zephir_fcall_cache_entry *_9 = NULL, *_11 = NULL, *_15 = NULL; zval *n_param = NULL, *u, u_sub, *v, v_sub, _13$$3, _14$$3, _6$$4, _7$$4, _8$$4, _10$$4, _12$$4; zend_long n, ZEPHIR_LAST_CALL_STATUS, t = 0, i = 0, j = 0, _1, _2, _4$$3, _5$$3; @@ -111,7 +113,7 @@ PHP_METHOD(Test_SpectralNorm, Au) { j = _4$$3; ZVAL_LONG(&_7$$4, i); ZVAL_LONG(&_8$$4, j); - ZEPHIR_CALL_METHOD(&_6$$4, this_ptr, "ax", &_9, 88, &_7$$4, &_8$$4); + ZEPHIR_CALL_METHOD(&_6$$4, this_ptr, "ax", &_9, 80, &_7$$4, &_8$$4); zephir_check_call_status(); ZVAL_LONG(&_7$$4, j); ZEPHIR_CALL_METHOD(&_10$$4, u, "offsetget", &_11, 0, &_7$$4); @@ -134,6 +136,7 @@ PHP_METHOD(Test_SpectralNorm, Au) { PHP_METHOD(Test_SpectralNorm, Atu) { zend_bool _0, _3$$3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zephir_fcall_cache_entry *_9 = NULL, *_11 = NULL, *_15 = NULL; zval *n_param = NULL, *u, u_sub, *v, v_sub, _13$$3, _14$$3, _6$$4, _7$$4, _8$$4, _10$$4, _12$$4; zend_long n, ZEPHIR_LAST_CALL_STATUS, t = 0, i = 0, j = 0, _1, _2, _4$$3, _5$$3; @@ -186,7 +189,7 @@ PHP_METHOD(Test_SpectralNorm, Atu) { j = _4$$3; ZVAL_LONG(&_7$$4, j); ZVAL_LONG(&_8$$4, i); - ZEPHIR_CALL_METHOD(&_6$$4, this_ptr, "ax", &_9, 88, &_7$$4, &_8$$4); + ZEPHIR_CALL_METHOD(&_6$$4, this_ptr, "ax", &_9, 80, &_7$$4, &_8$$4); zephir_check_call_status(); ZVAL_LONG(&_7$$4, j); ZEPHIR_CALL_METHOD(&_10$$4, u, "offsetget", &_11, 0, &_7$$4); @@ -208,6 +211,7 @@ PHP_METHOD(Test_SpectralNorm, Atu) { PHP_METHOD(Test_SpectralNorm, AtAu) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *n, n_sub, *u, u_sub, *v, v_sub, *w, w_sub; zval *this_ptr = getThis(); @@ -222,9 +226,9 @@ PHP_METHOD(Test_SpectralNorm, AtAu) { - ZEPHIR_CALL_METHOD(NULL, this_ptr, "au", NULL, 89, n, u, w); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "au", NULL, 81, n, u, w); zephir_check_call_status(); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "atu", NULL, 90, n, w, v); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "atu", NULL, 82, n, w, v); zephir_check_call_status(); ZEPHIR_MM_RESTORE(); @@ -233,6 +237,7 @@ PHP_METHOD(Test_SpectralNorm, AtAu) { PHP_METHOD(Test_SpectralNorm, process) { zend_bool _1, _7, _12; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zephir_fcall_cache_entry *_6 = NULL, *_11 = NULL, *_17 = NULL; zval *n_param = NULL, u, v, w, _0, _4$$3, _5$$3, _10$$4, _15$$5, _16$$5, _18$$5, _19$$5, _20$$5; zend_long n, ZEPHIR_LAST_CALL_STATUS, i = 0, vv, vBv, _2, _3, _8, _9, _13, _14; @@ -262,17 +267,17 @@ PHP_METHOD(Test_SpectralNorm, process) { ZEPHIR_INIT_VAR(&u); object_init_ex(&u, spl_ce_SplFixedArray); ZVAL_LONG(&_0, n); - ZEPHIR_CALL_METHOD(NULL, &u, "__construct", NULL, 91, &_0); + ZEPHIR_CALL_METHOD(NULL, &u, "__construct", NULL, 83, &_0); zephir_check_call_status(); ZEPHIR_INIT_VAR(&v); object_init_ex(&v, spl_ce_SplFixedArray); ZVAL_LONG(&_0, n); - ZEPHIR_CALL_METHOD(NULL, &v, "__construct", NULL, 91, &_0); + ZEPHIR_CALL_METHOD(NULL, &v, "__construct", NULL, 83, &_0); zephir_check_call_status(); ZEPHIR_INIT_VAR(&w); object_init_ex(&w, spl_ce_SplFixedArray); ZVAL_LONG(&_0, n); - ZEPHIR_CALL_METHOD(NULL, &w, "__construct", NULL, 91, &_0); + ZEPHIR_CALL_METHOD(NULL, &w, "__construct", NULL, 83, &_0); zephir_check_call_status(); _3 = (n - 1); _2 = 0; @@ -290,15 +295,15 @@ PHP_METHOD(Test_SpectralNorm, process) { i = _2; ZVAL_LONG(&_4$$3, i); ZVAL_LONG(&_5$$3, 1); - ZEPHIR_CALL_METHOD(NULL, &u, "offsetset", &_6, 92, &_4$$3, &_5$$3); + ZEPHIR_CALL_METHOD(NULL, &u, "offsetset", &_6, 84, &_4$$3, &_5$$3); zephir_check_call_status(); ZVAL_LONG(&_4$$3, i); ZVAL_LONG(&_5$$3, 1); - ZEPHIR_CALL_METHOD(NULL, &v, "offsetset", &_6, 92, &_4$$3, &_5$$3); + ZEPHIR_CALL_METHOD(NULL, &v, "offsetset", &_6, 84, &_4$$3, &_5$$3); zephir_check_call_status(); ZVAL_LONG(&_4$$3, i); ZVAL_LONG(&_5$$3, 1); - ZEPHIR_CALL_METHOD(NULL, &w, "offsetset", &_6, 92, &_4$$3, &_5$$3); + ZEPHIR_CALL_METHOD(NULL, &w, "offsetset", &_6, 84, &_4$$3, &_5$$3); zephir_check_call_status(); } } @@ -317,10 +322,10 @@ PHP_METHOD(Test_SpectralNorm, process) { } i = _8; ZVAL_LONG(&_10$$4, n); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "atau", &_11, 93, &_10$$4, &u, &v, &w); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "atau", &_11, 85, &_10$$4, &u, &v, &w); zephir_check_call_status(); ZVAL_LONG(&_10$$4, n); - ZEPHIR_CALL_METHOD(NULL, this_ptr, "atau", &_11, 93, &_10$$4, &v, &u, &w); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "atau", &_11, 85, &_10$$4, &v, &u, &w); zephir_check_call_status(); } } @@ -339,19 +344,19 @@ PHP_METHOD(Test_SpectralNorm, process) { } i = _13; ZVAL_LONG(&_16$$5, i); - ZEPHIR_CALL_METHOD(&_15$$5, &u, "offsetget", &_17, 94, &_16$$5); + ZEPHIR_CALL_METHOD(&_15$$5, &u, "offsetget", &_17, 86, &_16$$5); zephir_check_call_status(); ZVAL_LONG(&_16$$5, i); - ZEPHIR_CALL_METHOD(&_18$$5, &v, "offsetget", &_17, 94, &_16$$5); + ZEPHIR_CALL_METHOD(&_18$$5, &v, "offsetget", &_17, 86, &_16$$5); zephir_check_call_status(); ZEPHIR_INIT_LNVAR(_19$$5); mul_function(&_19$$5, &_15$$5, &_18$$5 TSRMLS_CC); vBv += zephir_get_numberval(&_19$$5); ZVAL_LONG(&_16$$5, i); - ZEPHIR_CALL_METHOD(&_15$$5, &v, "offsetget", &_17, 94, &_16$$5); + ZEPHIR_CALL_METHOD(&_15$$5, &v, "offsetget", &_17, 86, &_16$$5); zephir_check_call_status(); ZVAL_LONG(&_16$$5, i); - ZEPHIR_CALL_METHOD(&_18$$5, &v, "offsetget", &_17, 94, &_16$$5); + ZEPHIR_CALL_METHOD(&_18$$5, &v, "offsetget", &_17, 86, &_16$$5); zephir_check_call_status(); ZEPHIR_INIT_LNVAR(_20$$5); mul_function(&_20$$5, &_15$$5, &_18$$5 TSRMLS_CC); diff --git a/ext/test/spropertyaccess.zep.c b/ext/test/spropertyaccess.zep.c index 947636effe..60e46a2c3a 100644 --- a/ext/test/spropertyaccess.zep.c +++ b/ext/test/spropertyaccess.zep.c @@ -40,6 +40,7 @@ ZEPHIR_INIT_CLASS(Test_SPropertyAccess) { PHP_METHOD(Test_SPropertyAccess, __construct) { zval _0, _1, _2, _3, _4; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -72,6 +73,7 @@ PHP_METHOD(Test_SPropertyAccess, __construct) { PHP_METHOD(Test_SPropertyAccess, testArgumentWithUnderscore) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *delimiter = NULL, delimiter_sub, __$null; zval *this_ptr = getThis(); @@ -100,6 +102,7 @@ PHP_METHOD(Test_SPropertyAccess, testArgumentWithUnderscore) { PHP_METHOD(Test_SPropertyAccess, testArgument) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *delimiter = NULL, delimiter_sub, __$null, _0$$3; zval *this_ptr = getThis(); diff --git a/ext/test/statements.zep.c b/ext/test/statements.zep.c index 2275eb9da9..46210898d4 100644 --- a/ext/test/statements.zep.c +++ b/ext/test/statements.zep.c @@ -50,6 +50,7 @@ ZEPHIR_INIT_CLASS(Test_Statements) { PHP_METHOD(Test_Statements, testPropertyAcccessAvoidTmpReuse) { zval result1, result2, result3, result4, _0, _1, _2, _3, _4, _5, _6, _7; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&result1); @@ -94,7 +95,7 @@ PHP_METHOD(Test_Statements, testElseIf) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &num_param); + zephir_fetch_params_without_memory_grow(1, 0, &num_param); num = zephir_get_intval(num_param); @@ -118,7 +119,7 @@ PHP_METHOD(Test_Statements, testElseIf1) { zval *this_ptr = getThis(); - zephir_fetch_params(0, 1, 0, &num_param); + zephir_fetch_params_without_memory_grow(1, 0, &num_param); num = zephir_get_intval(num_param); @@ -142,7 +143,7 @@ PHP_METHOD(Test_Statements, testElseIf2) { ZVAL_UNDEF(&total_sub); - zephir_fetch_params(0, 2, 0, &num_param, &total); + zephir_fetch_params_without_memory_grow(2, 0, &num_param, &total); num = zephir_get_intval(num_param); @@ -159,6 +160,7 @@ PHP_METHOD(Test_Statements, testElseIf2) { PHP_METHOD(Test_Statements, test544Issue) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zephir_fcall_cache_entry *_8 = NULL; zval *step_param = NULL, _0, _1, _2$$3, _3$$3, _4$$3, _5$$3, _6$$3, _7$$3, _9$$3, _10$$3, _11$$3, _12$$4, _13$$4, _14$$5, _15$$5; zend_long step, ZEPHIR_LAST_CALL_STATUS, filledWidth = 0, unfilledWidth = 0; @@ -227,6 +229,7 @@ PHP_METHOD(Test_Statements, test544Issue) { PHP_METHOD(Test_Statements, test544IssueWithVariable) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zephir_fcall_cache_entry *_6 = NULL; zval *step_param = NULL, _0, _1$$3, _2$$3, _3$$3, _4$$3, _5$$3, _7$$3, _8$$3, _9$$3, _10$$4, _11$$4, _12$$5, _13$$5; zend_long step, ZEPHIR_LAST_CALL_STATUS, filledWidth = 0, unfilledWidth = 0, totalSteps = 0; diff --git a/ext/test/strings.zep.c b/ext/test/strings.zep.c index 17c5e98b59..3b6240d60b 100644 --- a/ext/test/strings.zep.c +++ b/ext/test/strings.zep.c @@ -30,6 +30,7 @@ ZEPHIR_INIT_CLASS(Test_Strings) { PHP_METHOD(Test_Strings, camelize) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *str_param = NULL, *delimiter = NULL, delimiter_sub, __$null; zval str; zval *this_ptr = getThis(); @@ -55,6 +56,7 @@ PHP_METHOD(Test_Strings, camelize) { PHP_METHOD(Test_Strings, uncamelize) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *str_param = NULL, *delimiter = NULL, delimiter_sub, __$null; zval str; zval *this_ptr = getThis(); @@ -85,7 +87,7 @@ PHP_METHOD(Test_Strings, testTrim) { ZVAL_UNDEF(&str_sub); - zephir_fetch_params(0, 1, 0, &str); + zephir_fetch_params_without_memory_grow(1, 0, &str); @@ -101,7 +103,7 @@ PHP_METHOD(Test_Strings, testRtrim) { ZVAL_UNDEF(&str_sub); - zephir_fetch_params(0, 1, 0, &str); + zephir_fetch_params_without_memory_grow(1, 0, &str); @@ -117,7 +119,7 @@ PHP_METHOD(Test_Strings, testLtrim) { ZVAL_UNDEF(&str_sub); - zephir_fetch_params(0, 1, 0, &str); + zephir_fetch_params_without_memory_grow(1, 0, &str); @@ -134,7 +136,7 @@ PHP_METHOD(Test_Strings, testTrim2Params) { ZVAL_UNDEF(&str_sub); ZVAL_UNDEF(&charlist_sub); - zephir_fetch_params(0, 2, 0, &str, &charlist); + zephir_fetch_params_without_memory_grow(2, 0, &str, &charlist); @@ -151,7 +153,7 @@ PHP_METHOD(Test_Strings, testRtrim2Params) { ZVAL_UNDEF(&str_sub); ZVAL_UNDEF(&charlist_sub); - zephir_fetch_params(0, 2, 0, &str, &charlist); + zephir_fetch_params_without_memory_grow(2, 0, &str, &charlist); @@ -168,7 +170,7 @@ PHP_METHOD(Test_Strings, testLtrim2Params) { ZVAL_UNDEF(&str_sub); ZVAL_UNDEF(&charlist_sub); - zephir_fetch_params(0, 2, 0, &str, &charlist); + zephir_fetch_params_without_memory_grow(2, 0, &str, &charlist); @@ -185,7 +187,7 @@ PHP_METHOD(Test_Strings, testImplode) { ZVAL_UNDEF(&glue_sub); ZVAL_UNDEF(&pieces_sub); - zephir_fetch_params(0, 2, 0, &glue, &pieces); + zephir_fetch_params_without_memory_grow(2, 0, &glue, &pieces); @@ -202,7 +204,7 @@ PHP_METHOD(Test_Strings, testStrpos) { ZVAL_UNDEF(&haystack_sub); ZVAL_UNDEF(&needle_sub); - zephir_fetch_params(0, 2, 0, &haystack, &needle); + zephir_fetch_params_without_memory_grow(2, 0, &haystack, &needle); @@ -221,7 +223,7 @@ PHP_METHOD(Test_Strings, testStrposOffset) { ZVAL_UNDEF(&needle_sub); ZVAL_UNDEF(&_0); - zephir_fetch_params(0, 3, 0, &haystack, &needle, &offset_param); + zephir_fetch_params_without_memory_grow(3, 0, &haystack, &needle, &offset_param); offset = zephir_get_intval(offset_param); @@ -240,7 +242,7 @@ PHP_METHOD(Test_Strings, testExplode) { ZVAL_UNDEF(&delimiter_sub); ZVAL_UNDEF(&str_sub); - zephir_fetch_params(0, 2, 0, &delimiter, &str); + zephir_fetch_params_without_memory_grow(2, 0, &delimiter, &str); @@ -256,7 +258,7 @@ PHP_METHOD(Test_Strings, testExplodeStr) { ZVAL_UNDEF(&str_sub); - zephir_fetch_params(0, 1, 0, &str); + zephir_fetch_params_without_memory_grow(1, 0, &str); @@ -274,7 +276,7 @@ PHP_METHOD(Test_Strings, testExplodeLimit) { ZVAL_UNDEF(&str_sub); ZVAL_UNDEF(&_0); - zephir_fetch_params(0, 2, 0, &str, &limit_param); + zephir_fetch_params_without_memory_grow(2, 0, &str, &limit_param); limit = zephir_get_intval(limit_param); @@ -295,7 +297,7 @@ PHP_METHOD(Test_Strings, testSubstr) { ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); - zephir_fetch_params(0, 3, 0, &str, &from_param, &len_param); + zephir_fetch_params_without_memory_grow(3, 0, &str, &from_param, &len_param); from = zephir_get_intval(from_param); len = zephir_get_intval(len_param); @@ -317,7 +319,7 @@ PHP_METHOD(Test_Strings, testSubstr2) { ZVAL_UNDEF(&str_sub); ZVAL_UNDEF(&_0); - zephir_fetch_params(0, 2, 0, &str, &from_param); + zephir_fetch_params_without_memory_grow(2, 0, &str, &from_param); from = zephir_get_intval(from_param); @@ -336,7 +338,7 @@ PHP_METHOD(Test_Strings, testSubstr3) { ZVAL_UNDEF(&str_sub); ZVAL_UNDEF(&_0); - zephir_fetch_params(0, 1, 0, &str); + zephir_fetch_params_without_memory_grow(1, 0, &str); @@ -355,7 +357,7 @@ PHP_METHOD(Test_Strings, testSubstr4) { ZVAL_UNDEF(&_0); ZVAL_UNDEF(&_1); - zephir_fetch_params(0, 1, 0, &str); + zephir_fetch_params_without_memory_grow(1, 0, &str); @@ -373,7 +375,7 @@ PHP_METHOD(Test_Strings, testAddslashes) { ZVAL_UNDEF(&str_sub); - zephir_fetch_params(0, 1, 0, &str); + zephir_fetch_params_without_memory_grow(1, 0, &str); @@ -389,7 +391,7 @@ PHP_METHOD(Test_Strings, testStripslashes) { ZVAL_UNDEF(&str_sub); - zephir_fetch_params(0, 1, 0, &str); + zephir_fetch_params_without_memory_grow(1, 0, &str); @@ -405,7 +407,7 @@ PHP_METHOD(Test_Strings, testStripcslashes) { ZVAL_UNDEF(&str_sub); - zephir_fetch_params(0, 1, 0, &str); + zephir_fetch_params_without_memory_grow(1, 0, &str); @@ -422,7 +424,7 @@ PHP_METHOD(Test_Strings, testHashEquals) { ZVAL_UNDEF(&str1_sub); ZVAL_UNDEF(&str2_sub); - zephir_fetch_params(0, 2, 0, &str1, &str2); + zephir_fetch_params_without_memory_grow(2, 0, &str1, &str2); @@ -451,6 +453,7 @@ PHP_METHOD(Test_Strings, testEchoMultilineString) { PHP_METHOD(Test_Strings, testTrimMultilineString) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -467,6 +470,7 @@ PHP_METHOD(Test_Strings, testTrimMultilineString) { PHP_METHOD(Test_Strings, testWellEscapedMultilineString) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -492,6 +496,7 @@ PHP_METHOD(Test_Strings, testInternedString1) { PHP_METHOD(Test_Strings, testInternedString2) { zval _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -510,6 +515,7 @@ PHP_METHOD(Test_Strings, testInternedString2) { PHP_METHOD(Test_Strings, strToHex) { unsigned char _1$$3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS, i; zephir_fcall_cache_entry *_4 = NULL, *_6 = NULL; zval *value_param = NULL, _0, _2$$3, _3$$3, _5$$3; @@ -539,7 +545,7 @@ PHP_METHOD(Test_Strings, strToHex) { _1$$3 = ZEPHIR_STRING_OFFSET(&value, i); ZEPHIR_INIT_NVAR(&_2$$3); ZVAL_STRINGL(&_2$$3, &_1$$3, 1); - ZEPHIR_CALL_FUNCTION(&_3$$3, "ord", &_4, 95, &_2$$3); + ZEPHIR_CALL_FUNCTION(&_3$$3, "ord", &_4, 87, &_2$$3); zephir_check_call_status(); ZEPHIR_CALL_FUNCTION(&_5$$3, "dechex", &_6, 10, &_3$$3); zephir_check_call_status(); @@ -553,6 +559,7 @@ PHP_METHOD(Test_Strings, strToHex) { PHP_METHOD(Test_Strings, issue1267) { zval _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zephir_fcall_cache_entry *_5 = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *value = NULL, value_sub, x, _0, _2, _3, _4, _6, _7; @@ -591,17 +598,17 @@ PHP_METHOD(Test_Strings, issue1267) { zephir_fast_str_replace(&_0, &_1, &_2, value TSRMLS_CC); ZEPHIR_CPY_WRT(value, &_0); ZVAL_LONG(&_3, 513); - ZEPHIR_CALL_FUNCTION(&_4, "filter_var", NULL, 96, value, &_3); + ZEPHIR_CALL_FUNCTION(&_4, "filter_var", NULL, 88, value, &_3); zephir_check_call_status(); ZEPHIR_CPY_WRT(value, &_4); ZEPHIR_INIT_NVAR(&_0); - ZEPHIR_CALL_FUNCTION(&_4, "strip_tags", &_5, 97, value); + ZEPHIR_CALL_FUNCTION(&_4, "strip_tags", &_5, 89, value); zephir_check_call_status(); zephir_stripslashes(&_0, &_4); ZEPHIR_INIT_VAR(&x); zephir_fast_trim(&x, &_0, NULL , ZEPHIR_TRIM_BOTH TSRMLS_CC); ZEPHIR_INIT_VAR(&_6); - ZEPHIR_CALL_FUNCTION(&_7, "strip_tags", &_5, 97, value); + ZEPHIR_CALL_FUNCTION(&_7, "strip_tags", &_5, 89, value); zephir_check_call_status(); zephir_stripcslashes(&_6, &_7); zephir_fast_trim(return_value, &_6, NULL , ZEPHIR_TRIM_BOTH TSRMLS_CC); diff --git a/ext/test/stubs.zep.c b/ext/test/stubs.zep.c index 299e139ad6..f1b7f543ec 100644 --- a/ext/test/stubs.zep.c +++ b/ext/test/stubs.zep.c @@ -88,7 +88,7 @@ PHP_METHOD(Test_Stubs, testMixedInputParamsDocBlock) { ZVAL_UNDEF(&intOrString_sub); - zephir_fetch_params(0, 1, 1, &intOrString, &number_param); + zephir_fetch_params_without_memory_grow(1, 1, &intOrString, &number_param); if (!number_param) { number = 1; @@ -118,7 +118,7 @@ PHP_METHOD(Test_Stubs, testMixedInputParamsDocBlockDeclared) { ZVAL_UNDEF(&intOrString_sub); - zephir_fetch_params(0, 1, 1, &intOrString, &number_param); + zephir_fetch_params_without_memory_grow(1, 1, &intOrString, &number_param); if (!number_param) { number = 1; diff --git a/ext/test/ternary.zep.c b/ext/test/ternary.zep.c index b77b1bd4dc..191e5a5189 100644 --- a/ext/test/ternary.zep.c +++ b/ext/test/ternary.zep.c @@ -34,6 +34,7 @@ ZEPHIR_INIT_CLASS(Test_Ternary) { PHP_METHOD(Test_Ternary, testTernary1) { zval _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -52,6 +53,7 @@ PHP_METHOD(Test_Ternary, testTernary1) { PHP_METHOD(Test_Ternary, testTernary2) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *b_param = NULL, _0; zend_bool b; zval *this_ptr = getThis(); @@ -76,6 +78,7 @@ PHP_METHOD(Test_Ternary, testTernary2) { PHP_METHOD(Test_Ternary, testTernaryComplex1) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *a, a_sub, *y, y_sub, _0, _1; zval *this_ptr = getThis(); @@ -110,6 +113,7 @@ PHP_METHOD(Test_Ternary, testTernaryComplex1) { PHP_METHOD(Test_Ternary, testTernaryComplex2) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *a, a_sub, *y, y_sub, _0, _1; zval *this_ptr = getThis(); @@ -145,6 +149,7 @@ PHP_METHOD(Test_Ternary, testTernaryComplex2) { PHP_METHOD(Test_Ternary, testTernaryComplex3) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *a, a_sub, _0; zval *this_ptr = getThis(); @@ -175,6 +180,7 @@ PHP_METHOD(Test_Ternary, testTernaryComplex3) { PHP_METHOD(Test_Ternary, testTernaryWithPromotedTemporaryVariable) { zval var2, var3, _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&var2); @@ -212,6 +218,7 @@ PHP_METHOD(Test_Ternary, testTernaryWithPromotedTemporaryVariable) { PHP_METHOD(Test_Ternary, testTernaryAfterLetVariable) { zval s; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&s); @@ -233,6 +240,7 @@ PHP_METHOD(Test_Ternary, testTernaryAfterLetVariable) { PHP_METHOD(Test_Ternary, testShortTernary) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *a, a_sub, _0; zval *this_ptr = getThis(); @@ -256,6 +264,7 @@ PHP_METHOD(Test_Ternary, testShortTernary) { PHP_METHOD(Test_Ternary, testShortTernaryComplex) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *left, left_sub, *value, value_sub, _0; zval *this_ptr = getThis(); diff --git a/ext/test/trytest.zep.c b/ext/test/trytest.zep.c index b77ff954cf..187f15f68c 100644 --- a/ext/test/trytest.zep.c +++ b/ext/test/trytest.zep.c @@ -41,6 +41,7 @@ PHP_METHOD(Test_TryTest, testThrow1) { PHP_METHOD(Test_TryTest, testThrow2) { zval message, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -79,6 +80,7 @@ PHP_METHOD(Test_TryTest, testTry1) { PHP_METHOD(Test_TryTest, testTry2) { zval _0$$3, _1$$3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -109,6 +111,7 @@ PHP_METHOD(Test_TryTest, testTry2) { PHP_METHOD(Test_TryTest, testTry3) { zval _0$$3, _1$$3, _2, _3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -151,6 +154,7 @@ PHP_METHOD(Test_TryTest, testTry3) { PHP_METHOD(Test_TryTest, testTry4) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *a_param = NULL, _0$$4, _1$$4, _2$$5, _3$$5, _4, _5, _6; zend_bool a; @@ -188,7 +192,7 @@ PHP_METHOD(Test_TryTest, testTry4) { object_init_ex(&_2$$5, spl_ce_RuntimeException); ZEPHIR_INIT_VAR(&_3$$5); ZVAL_STRING(&_3$$5, "error!"); - ZEPHIR_CALL_METHOD(NULL, &_2$$5, "__construct", NULL, 98, &_3$$5); + ZEPHIR_CALL_METHOD(NULL, &_2$$5, "__construct", NULL, 90, &_3$$5); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(&_2$$5, "test/trytest.zep", 48 TSRMLS_CC); goto try_end_1; @@ -221,6 +225,7 @@ PHP_METHOD(Test_TryTest, testTry4) { PHP_METHOD(Test_TryTest, testTry5) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *a_param = NULL, _0$$4, _1$$4, _2$$5, _3$$5, _4, _5; zend_bool a; @@ -257,7 +262,7 @@ PHP_METHOD(Test_TryTest, testTry5) { object_init_ex(&_2$$5, spl_ce_RuntimeException); ZEPHIR_INIT_VAR(&_3$$5); ZVAL_STRING(&_3$$5, "error!"); - ZEPHIR_CALL_METHOD(NULL, &_2$$5, "__construct", NULL, 98, &_3$$5); + ZEPHIR_CALL_METHOD(NULL, &_2$$5, "__construct", NULL, 90, &_3$$5); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(&_2$$5, "test/trytest.zep", 65 TSRMLS_CC); goto try_end_1; @@ -289,6 +294,7 @@ PHP_METHOD(Test_TryTest, testTry5) { PHP_METHOD(Test_TryTest, testTry6) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *a_param = NULL, e, _4, _0$$4, _1$$4, _2$$5, _3$$5; zend_bool a; @@ -325,7 +331,7 @@ PHP_METHOD(Test_TryTest, testTry6) { object_init_ex(&_2$$5, spl_ce_RuntimeException); ZEPHIR_INIT_VAR(&_3$$5); ZVAL_STRING(&_3$$5, "error!"); - ZEPHIR_CALL_METHOD(NULL, &_2$$5, "__construct", NULL, 98, &_3$$5); + ZEPHIR_CALL_METHOD(NULL, &_2$$5, "__construct", NULL, 90, &_3$$5); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(&_2$$5, "test/trytest.zep", 82 TSRMLS_CC); goto try_end_1; @@ -356,6 +362,7 @@ PHP_METHOD(Test_TryTest, testTry6) { PHP_METHOD(Test_TryTest, testTry7) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *a_param = NULL, e, _4, _0$$4, _1$$4, _2$$5, _3$$5; zend_bool a; @@ -392,7 +399,7 @@ PHP_METHOD(Test_TryTest, testTry7) { object_init_ex(&_2$$5, spl_ce_RuntimeException); ZEPHIR_INIT_VAR(&_3$$5); ZVAL_STRING(&_3$$5, "error!"); - ZEPHIR_CALL_METHOD(NULL, &_2$$5, "__construct", NULL, 98, &_3$$5); + ZEPHIR_CALL_METHOD(NULL, &_2$$5, "__construct", NULL, 90, &_3$$5); zephir_check_call_status_or_jump(try_end_1); zephir_throw_exception_debug(&_2$$5, "test/trytest.zep", 101 TSRMLS_CC); goto try_end_1; @@ -423,6 +430,7 @@ PHP_METHOD(Test_TryTest, testTry7) { PHP_METHOD(Test_TryTest, testTry8) { zval _0$$3, _1$$3; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -475,6 +483,7 @@ PHP_METHOD(Test_TryTest, someMethod2) { PHP_METHOD(Test_TryTest, testTry9) { zval e, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -486,7 +495,7 @@ PHP_METHOD(Test_TryTest, testTry9) { /* try_start_1: */ - ZEPHIR_CALL_METHOD(NULL, this_ptr, "somemethod1", NULL, 99); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "somemethod1", NULL, 91); zephir_check_call_status_or_jump(try_end_1); RETURN_MM_STRING("not catched"); @@ -509,6 +518,7 @@ PHP_METHOD(Test_TryTest, testTry9) { PHP_METHOD(Test_TryTest, testTry10) { zval e, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -520,7 +530,7 @@ PHP_METHOD(Test_TryTest, testTry10) { /* try_start_1: */ - ZEPHIR_CALL_METHOD(NULL, this_ptr, "somemethod2", NULL, 100); + ZEPHIR_CALL_METHOD(NULL, this_ptr, "somemethod2", NULL, 92); zephir_check_call_status_or_jump(try_end_1); RETURN_MM_STRING("not catched"); @@ -543,6 +553,7 @@ PHP_METHOD(Test_TryTest, testTry10) { PHP_METHOD(Test_TryTest, testTry11) { zval ex, _0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&ex); diff --git a/ext/test/typeinstances.zep.c b/ext/test/typeinstances.zep.c index 924825518c..7eae198493 100644 --- a/ext/test/typeinstances.zep.c +++ b/ext/test/typeinstances.zep.c @@ -34,6 +34,7 @@ PHP_METHOD(Test_TypeInstances, testInstanceOfString1) { zval _2; zval _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -55,6 +56,7 @@ PHP_METHOD(Test_TypeInstances, testInstanceOfString2) { zval _2; zval _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -76,6 +78,7 @@ PHP_METHOD(Test_TypeInstances, testInstanceOfString3) { zval _2; zval _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); diff --git a/ext/test/typeoff.zep.c b/ext/test/typeoff.zep.c index 640605fdbc..049e13d917 100644 --- a/ext/test/typeoff.zep.c +++ b/ext/test/typeoff.zep.c @@ -32,6 +32,7 @@ ZEPHIR_INIT_CLASS(Test_Typeoff) { PHP_METHOD(Test_Typeoff, testNativeStringFalse) { zval testVar; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&testVar); @@ -47,6 +48,7 @@ PHP_METHOD(Test_Typeoff, testNativeStringFalse) { PHP_METHOD(Test_Typeoff, testNativeStringTrue) { zval testVar; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&testVar); @@ -110,6 +112,7 @@ PHP_METHOD(Test_Typeoff, testNativeBoolTrue) { PHP_METHOD(Test_Typeoff, testNotBoolTrue) { zval testVar; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&testVar); @@ -139,6 +142,7 @@ PHP_METHOD(Test_Typeoff, testNativeBoolFalse) { PHP_METHOD(Test_Typeoff, testArrayFalse) { zval testVar; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&testVar); @@ -154,6 +158,7 @@ PHP_METHOD(Test_Typeoff, testArrayFalse) { PHP_METHOD(Test_Typeoff, testArrayTrue) { zval testVar; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&testVar); @@ -169,6 +174,7 @@ PHP_METHOD(Test_Typeoff, testArrayTrue) { PHP_METHOD(Test_Typeoff, testClassPropertyAccess) { zval _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -188,6 +194,7 @@ PHP_METHOD(Test_Typeoff, testClassPropertyAccess) { PHP_METHOD(Test_Typeoff, testUnknownTypeOf) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *u, u_sub, _0; zval *this_ptr = getThis(); @@ -212,7 +219,7 @@ PHP_METHOD(Test_Typeoff, testCallableTypeOf) { ZVAL_UNDEF(&cb_sub); - zephir_fetch_params(0, 1, 0, &cb); + zephir_fetch_params_without_memory_grow(1, 0, &cb); diff --git a/ext/test/unsettest.zep.c b/ext/test/unsettest.zep.c index 86b3f57907..09491f3234 100644 --- a/ext/test/unsettest.zep.c +++ b/ext/test/unsettest.zep.c @@ -48,7 +48,7 @@ PHP_METHOD(Test_Unsettest, has) { ZVAL_UNDEF(&key_sub); ZVAL_UNDEF(&_0); - zephir_fetch_params(0, 1, 0, &key); + zephir_fetch_params_without_memory_grow(1, 0, &key); @@ -65,7 +65,7 @@ PHP_METHOD(Test_Unsettest, addValueToProperty) { ZVAL_UNDEF(&key_sub); ZVAL_UNDEF(&value_sub); - zephir_fetch_params(0, 2, 0, &key, &value); + zephir_fetch_params_without_memory_grow(2, 0, &key, &value); @@ -81,7 +81,7 @@ PHP_METHOD(Test_Unsettest, testUnsetValueFromProperty) { ZVAL_UNDEF(&key_sub); ZVAL_UNDEF(&_0); - zephir_fetch_params(0, 1, 0, &key); + zephir_fetch_params_without_memory_grow(1, 0, &key); @@ -92,6 +92,7 @@ PHP_METHOD(Test_Unsettest, testUnsetValueFromProperty) { PHP_METHOD(Test_Unsettest, testUnsetFromArray) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *arrayParameter, arrayParameter_sub; zval *this_ptr = getThis(); @@ -111,6 +112,7 @@ PHP_METHOD(Test_Unsettest, testUnsetFromArray) { PHP_METHOD(Test_Unsettest, testUnsetFromArrayByIndexVar) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *arrayParameter, arrayParameter_sub, *index, index_sub; zval *this_ptr = getThis(); @@ -142,6 +144,7 @@ PHP_METHOD(Test_Unsettest, testUnsetProperty) { PHP_METHOD(Test_Unsettest, testStdClassUnset) { zval simpleObject, _0, _1; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&simpleObject); @@ -169,6 +172,7 @@ PHP_METHOD(Test_Unsettest, testStdClassUnset) { PHP_METHOD(Test_Unsettest, testUnsetTypedArray) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval key; zval *arr_param = NULL, *key_param = NULL; zval arr; diff --git a/ext/test/usetest.zep.c b/ext/test/usetest.zep.c index 195de75eba..412a76e9b1 100644 --- a/ext/test/usetest.zep.c +++ b/ext/test/usetest.zep.c @@ -48,6 +48,7 @@ PHP_METHOD(Test_UseTest, count) { PHP_METHOD(Test_UseTest, testUseClass1) { zend_class_entry *_0 = NULL; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -69,6 +70,7 @@ PHP_METHOD(Test_UseTest, testUseClass1) { PHP_METHOD(Test_UseTest, testUseClass2) { zend_class_entry *_0 = NULL; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); @@ -90,6 +92,7 @@ PHP_METHOD(Test_UseTest, testUseClass2) { PHP_METHOD(Test_UseTest, testUseNamespaceAlias) { zend_class_entry *_0 = NULL; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zend_long ZEPHIR_LAST_CALL_STATUS; zval *this_ptr = getThis(); diff --git a/ext/test/vars.zep.c b/ext/test/vars.zep.c index b5d4215bcc..bac6b8755d 100644 --- a/ext/test/vars.zep.c +++ b/ext/test/vars.zep.c @@ -12,13 +12,13 @@ #include #include "kernel/main.h" -#include "kernel/memory.h" #include "kernel/array.h" -#include "kernel/variables.h" -#include "kernel/object.h" -#include "kernel/operators.h" +#include "kernel/memory.h" #include "ext/spl/spl_exceptions.h" #include "kernel/exception.h" +#include "kernel/object.h" +#include "kernel/variables.h" +#include "kernel/operators.h" ZEPHIR_INIT_CLASS(Test_Vars) { @@ -29,8 +29,32 @@ ZEPHIR_INIT_CLASS(Test_Vars) { } +PHP_METHOD(Test_Vars, testParam) { + + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; + zval *arr_param = NULL, _0; + zval arr; + zval *this_ptr = getThis(); + + ZVAL_UNDEF(&arr); + ZVAL_UNDEF(&_0); + + ZEPHIR_MM_GROW(); + zephir_fetch_params(1, 1, 0, &arr_param); + + ZEPHIR_OBS_COPY_OR_DUP(&arr, arr_param); + + + ZEPHIR_INIT_VAR(&_0); + ZVAL_STRING(&_0, "test"); + zephir_array_update_multi(&arr, &_0 TSRMLS_CC, SL("ss"), 4, SL("test"), SL("test")); + RETURN_CTOR(&arr); + +} + PHP_METHOD(Test_Vars, testVarDump) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$false, a, ar, _0; zval *this_ptr = getThis(); @@ -60,6 +84,7 @@ PHP_METHOD(Test_Vars, testVarDump) { PHP_METHOD(Test_Vars, testVarDump2) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *ret, ret_sub, _0; zval *this_ptr = getThis(); @@ -81,6 +106,7 @@ PHP_METHOD(Test_Vars, testVarDump2) { PHP_METHOD(Test_Vars, testVarExport) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval __$false, a, ar, ret, _0, _1, _2; zval *this_ptr = getThis(); @@ -121,6 +147,7 @@ PHP_METHOD(Test_Vars, testVarExport) { PHP_METHOD(Test_Vars, test88Issue) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *param1_param = NULL, *param2_param = NULL, _0, _1, _2, _3; zval param1, param2; zval *this_ptr = getThis(); @@ -171,6 +198,7 @@ PHP_METHOD(Test_Vars, test88Issue) { PHP_METHOD(Test_Vars, test88IssueParam2InitString) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *param1_param = NULL, *param2_param = NULL, _0; zval param1, param2; zval *this_ptr = getThis(); @@ -215,7 +243,7 @@ PHP_METHOD(Test_Vars, testVarDump2param) { ZVAL_UNDEF(&p1_sub); ZVAL_UNDEF(&p2_sub); - zephir_fetch_params(0, 2, 0, &p1, &p2); + zephir_fetch_params_without_memory_grow(2, 0, &p1, &p2); @@ -233,7 +261,7 @@ PHP_METHOD(Test_Vars, testVarDump3param) { ZVAL_UNDEF(&p2_sub); ZVAL_UNDEF(&p3_sub); - zephir_fetch_params(0, 3, 0, &p1, &p2, &p3); + zephir_fetch_params_without_memory_grow(3, 0, &p1, &p2, &p3); @@ -245,6 +273,7 @@ PHP_METHOD(Test_Vars, testVarDump3param) { PHP_METHOD(Test_Vars, testCountOptimizerVarDumpAndExport) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *testVar, testVar_sub, _0, _1; zval *this_ptr = getThis(); @@ -271,6 +300,7 @@ PHP_METHOD(Test_Vars, testCountOptimizerVarDumpAndExport) { PHP_METHOD(Test_Vars, testArrayTypeVarDumpAndExport) { + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *testVar_param = NULL, _0, _1; zval testVar; zval *this_ptr = getThis(); @@ -307,6 +337,7 @@ PHP_METHOD(Test_Vars, testIntVarDump) { zval _0, _1; zend_long a = 0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -331,6 +362,7 @@ PHP_METHOD(Test_Vars, testDoubleVarDump) { zval _0, _1; double a = 0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); @@ -355,6 +387,7 @@ PHP_METHOD(Test_Vars, testBoolVarDump) { zval _0, _1; zend_bool a = 0; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; zval *this_ptr = getThis(); ZVAL_UNDEF(&_0); diff --git a/ext/test/vars.zep.h b/ext/test/vars.zep.h index 7d5e28b7f6..287fbf6997 100644 --- a/ext/test/vars.zep.h +++ b/ext/test/vars.zep.h @@ -3,6 +3,7 @@ extern zend_class_entry *test_vars_ce; ZEPHIR_INIT_CLASS(Test_Vars); +PHP_METHOD(Test_Vars, testParam); PHP_METHOD(Test_Vars, testVarDump); PHP_METHOD(Test_Vars, testVarDump2); PHP_METHOD(Test_Vars, testVarExport); @@ -17,6 +18,10 @@ PHP_METHOD(Test_Vars, testDoubleVarDump); PHP_METHOD(Test_Vars, testBoolVarDump); PHP_METHOD(Test_Vars, testGetDefinedVars); +ZEND_BEGIN_ARG_INFO_EX(arginfo_test_vars_testparam, 0, 0, 1) + ZEND_ARG_ARRAY_INFO(0, arr, 0) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_test_vars_testvardump2, 0, 0, 1) ZEND_ARG_INFO(0, ret) ZEND_END_ARG_INFO() @@ -67,6 +72,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_test_vars_testarraytypevardumpandexport, 0, 0, 0) ZEND_END_ARG_INFO() ZEPHIR_INIT_FUNCS(test_vars_method_entry) { + PHP_ME(Test_Vars, testParam, arginfo_test_vars_testparam, ZEND_ACC_PUBLIC) PHP_ME(Test_Vars, testVarDump, NULL, ZEND_ACC_PUBLIC) PHP_ME(Test_Vars, testVarDump2, arginfo_test_vars_testvardump2, ZEND_ACC_PUBLIC) PHP_ME(Test_Vars, testVarExport, NULL, ZEND_ACC_PUBLIC) diff --git a/kernels/ZendEngine3/exception.c b/kernels/ZendEngine3/exception.c index 035c8e50af..13b77e6142 100644 --- a/kernels/ZendEngine3/exception.c +++ b/kernels/ZendEngine3/exception.c @@ -40,6 +40,7 @@ void zephir_throw_exception_debug(zval *object, const char *file, zend_uint line) { zend_class_entry *default_exception_ce; + zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL; int ZEPHIR_LAST_CALL_STATUS = 0; zval curline; zval object_copy; @@ -86,7 +87,7 @@ void zephir_throw_exception_string_debug(zend_class_entry *ce, const char *messa ZVAL_STRINGL(&msg, message, message_len); - ZEPHIR_CALL_METHOD(NULL, &object, "__construct", NULL, 0, &msg); + ZEPHIR_CALL_METHOD_WITHOUT_OBSERVE(NULL, &object, "__construct", NULL, 0, &msg); if (line > 0) { default_exception_ce = zend_exception_get_default(); @@ -113,7 +114,7 @@ void zephir_throw_exception_string(zend_class_entry *ce, const char *message, ze ZVAL_STRINGL(&msg, message, message_len); - ZEPHIR_CALL_METHOD(NULL, &object, "__construct", NULL, 0, &msg); + ZEPHIR_CALL_METHOD_WITHOUT_OBSERVE(NULL, &object, "__construct", NULL, 0, &msg); if (ZEPHIR_LAST_CALL_STATUS != FAILURE) { zend_throw_exception_object(&object); @@ -141,7 +142,7 @@ void zephir_throw_exception_format(zend_class_entry *ce, const char *format, ... ZVAL_STRINGL(&msg, buffer, len); efree(buffer); - ZEPHIR_CALL_METHOD(NULL, &object, "__construct", NULL, 0, &msg); + ZEPHIR_CALL_METHOD_WITHOUT_OBSERVE(NULL, &object, "__construct", NULL, 0, &msg); if (ZEPHIR_LAST_CALL_STATUS != FAILURE) { zend_throw_exception_object(&object); diff --git a/kernels/ZendEngine3/globals.h b/kernels/ZendEngine3/globals.h index 60980b3c3f..c65845458f 100644 --- a/kernels/ZendEngine3/globals.h +++ b/kernels/ZendEngine3/globals.h @@ -23,32 +23,8 @@ #include -#define ZEPHIR_MAX_MEMORY_STACK 48 #define ZEPHIR_MAX_CACHE_SLOTS 512 -/** Memory frame */ -typedef struct _zephir_memory_entry { - size_t pointer; - size_t capacity; - zval **addresses; - size_t hash_pointer; - size_t hash_capacity; - zval **hash_addresses; - struct _zephir_memory_entry *prev; - struct _zephir_memory_entry *next; -#ifndef ZEPHIR_RELEASE - int permanent; - const char *func; -#endif -} zephir_memory_entry; - -/** Virtual Symbol Table */ -typedef struct _zephir_symbol_table { - struct _zephir_memory_entry *scope; - zend_array *symbol_table; - struct _zephir_symbol_table *prev; -} zephir_symbol_table; - typedef struct _zephir_function_cache { zend_class_entry *ce; zend_function *func; diff --git a/kernels/ZendEngine3/main.h b/kernels/ZendEngine3/main.h index a76681e9d8..b15b0e4d79 100644 --- a/kernels/ZendEngine3/main.h +++ b/kernels/ZendEngine3/main.h @@ -266,6 +266,11 @@ int zephir_fetch_parameters(int num_args, int required_args, int optional_args, } \ } +#define zephir_fetch_params_without_memory_grow(required_params, optional_params, ...) \ + if (zephir_fetch_parameters(ZEND_NUM_ARGS(), required_params, optional_params, __VA_ARGS__) == FAILURE) { \ + RETURN_NULL(); \ + } + #define ZEPHIR_CREATE_OBJECT(obj, class_type) \ { \ zend_object *object = zend_objects_new(class_type); \ @@ -277,7 +282,7 @@ int zephir_fetch_parameters(int num_args, int required_args, int optional_args, #define ZEPHIR_MAKE_REF(obj) ZVAL_NEW_REF(obj, obj); #define ZEPHIR_UNREF(obj) ZVAL_UNREF(obj); -#define ZEPHIR_GET_CONSTANT(return_value, const_name) do { \ +#define ZEPHIR_MM_GET_CONSTANT(return_value, const_name) do { \ zval *_constant_ptr = zend_get_constant_str(SL(const_name)); \ if (_constant_ptr == NULL) { \ ZEPHIR_MM_RESTORE(); \ @@ -286,6 +291,14 @@ int zephir_fetch_parameters(int num_args, int required_args, int optional_args, ZVAL_COPY(return_value, _constant_ptr); \ } while(0) +#define ZEPHIR_GET_CONSTANT(return_value, const_name) do { \ + zval *_constant_ptr = zend_get_constant_str(SL(const_name)); \ + if (_constant_ptr == NULL) { \ + return; \ + } \ + ZVAL_COPY(return_value, _constant_ptr); \ +} while(0) + #define ZEPHIR_GET_IMKEY(var, it) it->funcs->get_current_key(it, &var); /* Declare class constants */ diff --git a/kernels/ZendEngine3/memory.c b/kernels/ZendEngine3/memory.c index 1cb64ad6ed..2f8b3b89e6 100644 --- a/kernels/ZendEngine3/memory.c +++ b/kernels/ZendEngine3/memory.c @@ -45,8 +45,7 @@ * Not all methods must grow/restore the zephir_memory_entry. */ -static zend_always_inline zend_execute_data* -find_symbol_table(zend_execute_data* ex) +static zend_always_inline zend_execute_data* find_symbol_table(zend_execute_data* ex) { while (ex && (!ex->func || !ZEND_USER_CODE(ex->func->common.type))) { ex = ex->prev_execute_data; @@ -55,46 +54,36 @@ find_symbol_table(zend_execute_data* ex) return ex; } -static zephir_memory_entry* zephir_memory_grow_stack_common(zend_zephir_globals_def *g) +/** + * Adds a memory frame in the current executed method + */ +void ZEPHIR_FASTCALL zephir_memory_grow_stack(zephir_method_globals *g, const char *func) { - assert(g->start_memory != NULL); - if (!g->active_memory) { - g->active_memory = g->start_memory; -#ifndef ZEPHIR_RELEASE - assert(g->active_memory->permanent == 1); -#endif - } - else if (!g->active_memory->next) { -#ifndef PHP_WIN32 - assert(g->active_memory >= g->end_memory - 1 || g->active_memory < g->start_memory); -#endif - zephir_memory_entry *entry = (zephir_memory_entry *) ecalloc(1, sizeof(zephir_memory_entry)); -#ifndef ZEPHIR_RELEASE - entry->permanent = 0; - entry->func = NULL; -#endif - entry->prev = g->active_memory; - entry->prev->next = entry; - g->active_memory = entry; - } - else { -#ifndef ZEPHIR_RELEASE - assert(g->active_memory->permanent == 1); -#endif - assert(g->active_memory < g->end_memory && g->active_memory >= g->start_memory); - g->active_memory = g->active_memory->next; + zephir_memory_entry *entry; + if (g->active_memory == NULL) { + zephir_memory_entry *active_memory; + size_t i; + + active_memory = (zephir_memory_entry *) pecalloc(1, sizeof(zephir_memory_entry), 1); + + active_memory->addresses = pecalloc(24, sizeof(zval*), 1); + active_memory->capacity = 24; + active_memory->hash_addresses = pecalloc(8, sizeof(zval*), 1); + active_memory->hash_capacity = 8; + + g->active_memory = active_memory; } + assert(g->active_memory != NULL); assert(g->active_memory->pointer == 0); assert(g->active_memory->hash_pointer == 0); - return g->active_memory; +#ifndef ZEPHIR_RELEASE + g->active_memory->func = func; +#endif } -/** - * Restore a memory stack applying GC to all observed variables - */ -static void zephir_memory_restore_stack_common(zend_zephir_globals_def *g) +void ZEPHIR_FASTCALL zephir_memory_restore_stack(zephir_method_globals *g, const char *func) { size_t i; zephir_memory_entry *prev, *active_memory; @@ -104,6 +93,24 @@ static void zephir_memory_restore_stack_common(zend_zephir_globals_def *g) int show_backtrace = 0; #endif +#ifndef ZEPHIR_RELEASE + if (UNEXPECTED(g->active_memory == NULL)) { + fprintf(stderr, "WARNING: calling zephir_memory_restore_stack() without an active memory frame!\n"); + fprintf(stderr, "The frame was created by %s\n", g->active_memory->func); + fprintf(stderr, "Calling function: %s\n", func); + zephir_print_backtrace(); + return; + } + + if (UNEXPECTED(g->active_memory->func != func)) { + fprintf(stderr, "Trying to free someone else's memory frame!\n"); + fprintf(stderr, "The frame was created by %s\n", g->active_memory->func); + fprintf(stderr, "Calling function: %s\n", func); + zephir_print_backtrace(); + return; + } +#endif + active_memory = g->active_memory; assert(active_memory != NULL); @@ -186,156 +193,29 @@ static void zephir_memory_restore_stack_common(zend_zephir_globals_def *g) active_memory->func = NULL; #endif - prev = active_memory->prev; - - if (active_memory >= g->end_memory || active_memory < g->start_memory) { -#ifndef ZEPHIR_RELEASE - assert(g->active_memory->permanent == 0); -#endif - assert(prev != NULL); - - if (active_memory->hash_addresses != NULL) { - efree(active_memory->hash_addresses); - } - - if (active_memory->addresses != NULL) { - efree(active_memory->addresses); - } - - efree(g->active_memory); - g->active_memory = prev; - prev->next = NULL; - } else { -#ifndef ZEPHIR_RELEASE - assert(g->active_memory->permanent == 1); -#endif - active_memory->pointer = 0; - active_memory->hash_pointer = 0; - g->active_memory = prev; - } - -#ifndef ZEPHIR_RELEASE - if (g->active_memory) { - zephir_memory_entry *f = g->active_memory; - if (f >= g->start_memory && f < g->end_memory - 1) { - assert(f->permanent == 1); - assert(f->next != NULL); - - if (f > g->start_memory) { - assert(f->prev != NULL); - } - } + if (active_memory->hash_addresses != NULL) { + pefree(active_memory->hash_addresses, 1); } - if (show_backtrace == 1) { - zephir_print_backtrace(); + if (active_memory->addresses != NULL) { + pefree(active_memory->addresses, 1); } -#endif -} + pefree(g->active_memory, 1); + g->active_memory = NULL; #ifndef ZEPHIR_RELEASE -/** - * Finishes the current memory stack by releasing allocated memory - */ -int ZEPHIR_FASTCALL zephir_memory_restore_stack(const char *func) -{ - zend_zephir_globals_def *zephir_globals_ptr = ZEPHIR_VGLOBAL; - - if (UNEXPECTED(zephir_globals_ptr->active_memory == NULL)) { - fprintf(stderr, "WARNING: calling zephir_memory_restore_stack() without an active memory frame!\n"); - zephir_print_backtrace(); - return FAILURE; - } - - if (UNEXPECTED(zephir_globals_ptr->active_memory->func != func)) { - fprintf(stderr, "Trying to free someone else's memory frame!\n"); - fprintf(stderr, "The frame was created by %s\n", zephir_globals_ptr->active_memory->func); - fprintf(stderr, "Calling function: %s\n", func); + if (show_backtrace == 1) { zephir_print_backtrace(); - return FAILURE; } - - zephir_memory_restore_stack_common(zephir_globals_ptr); - return SUCCESS; -} - -/** - * Adds a memory frame in the current executed method - */ -void ZEPHIR_FASTCALL zephir_memory_grow_stack(const char *func) -{ - zephir_memory_entry *entry; - zend_zephir_globals_def *g = ZEPHIR_VGLOBAL; - if (g->start_memory == NULL) { - zephir_initialize_memory(g); - } - entry = zephir_memory_grow_stack_common(g); - entry->func = func; -} - -#else - -/** - * Adds a memory frame in the current executed method - */ -void ZEPHIR_FASTCALL zephir_memory_grow_stack() -{ - zend_zephir_globals_def *g = ZEPHIR_VGLOBAL; - if (g->start_memory == NULL) { - zephir_initialize_memory(g); - } - zephir_memory_grow_stack_common(g); -} - -/** - * Finishes the current memory stack by releasing allocated memory - */ -int ZEPHIR_FASTCALL zephir_memory_restore_stack() -{ - zephir_memory_restore_stack_common(ZEPHIR_VGLOBAL); - return SUCCESS; -} - #endif +} /** * Pre-allocates memory for further use in execution */ void zephir_initialize_memory(zend_zephir_globals_def *zephir_globals_ptr) { - zephir_memory_entry *start; - size_t i; - - start = (zephir_memory_entry *) pecalloc(ZEPHIR_NUM_PREALLOCATED_FRAMES, sizeof(zephir_memory_entry), 1); -/* pecalloc() will take care of these members for every frame - start->pointer = 0; - start->hash_pointer = 0; - start->prev = NULL; - start->next = NULL; -*/ - for (i = 0; i < ZEPHIR_NUM_PREALLOCATED_FRAMES; ++i) { - start[i].addresses = pecalloc(24, sizeof(zval*), 1); - start[i].capacity = 24; - start[i].hash_addresses = pecalloc(8, sizeof(zval*), 1); - start[i].hash_capacity = 8; - -#ifndef ZEPHIR_RELEASE - start[i].permanent = 1; -#endif - } - - start[0].next = &start[1]; - start[ZEPHIR_NUM_PREALLOCATED_FRAMES - 1].prev = &start[ZEPHIR_NUM_PREALLOCATED_FRAMES - 2]; - - for (i = 1; i < ZEPHIR_NUM_PREALLOCATED_FRAMES - 1; ++i) { - start[i].next = &start[i + 1]; - start[i].prev = &start[i - 1]; - } - - zephir_globals_ptr->start_memory = start; - zephir_globals_ptr->end_memory = start + ZEPHIR_NUM_PREALLOCATED_FRAMES; - zephir_globals_ptr->fcache = pemalloc(sizeof(HashTable), 1); zend_hash_init(zephir_globals_ptr->fcache, 128, NULL, NULL, 1); // zephir_fcall_cache_dtor @@ -355,40 +235,6 @@ void zephir_deinitialize_memory() return; } - if (zephir_globals_ptr->start_memory != NULL) { - zephir_clean_restore_stack(); - } - -// { -// size_t i; -// for (i=0; iscache[i]; -// if (e) { -// free(e); -// } -// } -// zephir_fcall_cache_entry *cache_entry_temp = NULL; -// ZEND_HASH_FOREACH_PTR(zephir_globals_ptr->fcache, cache_entry_temp) { -// free(cache_entry_temp); -// } ZEND_HASH_FOREACH_END(); -// } - -#if 0 - zend_hash_apply_with_arguments(zephir_globals_ptr->fcache, zephir_cleanup_fcache, 0); -#endif - -#ifndef ZEPHIR_RELEASE - assert(zephir_globals_ptr->start_memory != NULL); -#endif - - for (i = 0; i < ZEPHIR_NUM_PREALLOCATED_FRAMES; ++i) { - pefree(zephir_globals_ptr->start_memory[i].hash_addresses, 1); - pefree(zephir_globals_ptr->start_memory[i].addresses, 1); - } - - pefree(zephir_globals_ptr->start_memory, 1); - zephir_globals_ptr->start_memory = NULL; - zend_hash_destroy(zephir_globals_ptr->fcache); pefree(zephir_globals_ptr->fcache, 1); zephir_globals_ptr->fcache = NULL; @@ -399,10 +245,9 @@ void zephir_deinitialize_memory() /** * Creates a virtual symbol tables dynamically */ -void zephir_create_symbol_table() +void zephir_create_symbol_table(zephir_method_globals *gptr) { zephir_symbol_table *entry; - zend_zephir_globals_def *gptr = ZEPHIR_VGLOBAL; zend_array *symbol_table; #ifndef ZEPHIR_RELEASE @@ -513,25 +358,7 @@ int zephir_cleanup_fcache(void *pDest, int num_args, va_list args, zend_hash_key return ZEND_HASH_APPLY_KEEP; } -ZEPHIR_ATTR_NONNULL static void zephir_reallocate_memory(const zend_zephir_globals_def *g) -{ - zephir_memory_entry *frame = g->active_memory; - int persistent = (frame >= g->start_memory && frame < g->end_memory); - void *buf = perealloc(frame->addresses, sizeof(zval *) * (frame->capacity + 16), persistent); - if (EXPECTED(buf != NULL)) { - frame->capacity += 16; - frame->addresses = buf; - } - else { - zend_error(E_CORE_ERROR, "Memory allocation failed"); - } - -#ifndef ZEPHIR_RELEASE - assert(frame->permanent == persistent); -#endif -} - -ZEPHIR_ATTR_NONNULL1(2) static inline void zephir_do_memory_observe(zval *var, const zend_zephir_globals_def *g) +void zephir_do_memory_observe(zval *var, const zephir_method_globals *g) { zephir_memory_entry *frame = g->active_memory; #ifndef ZEPHIR_RELEASE @@ -543,7 +370,14 @@ ZEPHIR_ATTR_NONNULL1(2) static inline void zephir_do_memory_observe(zval *var, c #endif if (UNEXPECTED(frame->pointer == frame->capacity)) { - zephir_reallocate_memory(g); + void *buf = perealloc(frame->addresses, sizeof(zval *) * (frame->capacity + 16), 1); + if (EXPECTED(buf != NULL)) { + frame->capacity += 16; + frame->addresses = buf; + } else { + zend_error(E_CORE_ERROR, "Memory allocation failed"); + return; + } } #ifndef ZEPHIR_RELEASE @@ -562,104 +396,3 @@ ZEPHIR_ATTR_NONNULL1(2) static inline void zephir_do_memory_observe(zval *var, c frame->addresses[frame->pointer] = var; ++frame->pointer; } - -/** - * Observes a memory pointer to release its memory at the end of the request - */ -void ZEPHIR_FASTCALL zephir_memory_observe(zval *var) -{ - zend_zephir_globals_def *g = ZEPHIR_VGLOBAL; - zephir_do_memory_observe(var, g); -} - -/** - * Observes a variable and allocates memory for it - */ -void ZEPHIR_FASTCALL zephir_memory_alloc(zval *var) -{ - zend_zephir_globals_def *g = ZEPHIR_VGLOBAL; - zephir_do_memory_observe(var, g); - ZVAL_NULL(var); -} - -/** - * Cleans the zephir memory stack recursively - */ -int ZEPHIR_FASTCALL zephir_clean_restore_stack() { - - zend_zephir_globals_def *zephir_globals_ptr = ZEPHIR_VGLOBAL; - - while (zephir_globals_ptr->active_memory != NULL) { - zephir_memory_restore_stack_common(zephir_globals_ptr); - } - - return SUCCESS; -} - -/* Debugging */ -#ifndef ZEPHIR_RELEASE - -/** - * Dumps a memory frame for debug purposes - */ -void zephir_dump_memory_frame(zephir_memory_entry *active_memory) -{ - size_t i; - - assert(active_memory != NULL); - - fprintf(stderr, "Dump of the memory frame %p (%s)\n", active_memory, active_memory->func); - - if (active_memory->hash_pointer) { - for (i = 0; i < active_memory->hash_pointer; ++i) { - assert(active_memory->hash_addresses[i] != NULL); - fprintf(stderr, "Hash ptr %lu (%p), type=%u, refcnted=%d, refcnt=%u\n", (ulong)i, active_memory->hash_addresses[i], Z_TYPE_P(active_memory->hash_addresses[i]), - Z_REFCOUNTED_P(active_memory->hash_addresses[i]), - Z_REFCOUNTED_P(active_memory->hash_addresses[i]) ? Z_REFCOUNT_P(active_memory->hash_addresses[i]) : 0 - ); - } - } - - for (i = 0; i < active_memory->pointer; ++i) { - if (EXPECTED(active_memory->addresses[i] != NULL)) { - zval *var = active_memory->addresses[i]; - fprintf(stderr, "Obs var %lu (%p), type=%u, refcnted=%d, refcnt=%u; ", (ulong)i, var, Z_TYPE_P(var), Z_REFCOUNTED_P(var), Z_REFCOUNTED_P(var) ? Z_REFCOUNT_P(var) : 0); - switch (Z_TYPE_P(var)) { - case IS_NULL: fprintf(stderr, "value=NULL\n"); break; -#ifdef ZEPHIR_ENABLE_64BITS - case IS_LONG: fprintf(stderr, "value=%lld\n", (long long int)Z_LVAL_P(var)); break; -#else - case IS_LONG: fprintf(stderr, "value=%ld\n", Z_LVAL_P(var)); break; -#endif - case IS_DOUBLE: fprintf(stderr, "value=%E\n", Z_DVAL_P(var)); break; - case IS_TRUE: fprintf(stderr, "value=(bool)true\n"); break; - case IS_FALSE: fprintf(stderr, "value=(bool)false\n"); break; - case IS_ARRAY: fprintf(stderr, "value=array(%p), %d elements\n", Z_ARRVAL_P(var), zend_hash_num_elements(Z_ARRVAL_P(var))); break; - case IS_OBJECT: fprintf(stderr, "value=object(%u), %s\n", Z_OBJ_HANDLE_P(var), ZSTR_VAL(Z_OBJCE_P(var)->name)); break; - case IS_STRING: fprintf(stderr, "value=%s (%zu)\n", Z_STRVAL_P(var), Z_STRLEN_P(var)); break; -#ifdef ZEPHIR_ENABLE_64BITS - case IS_RESOURCE: fprintf(stderr, "value=(resource)%lld\n", (long long int)Z_LVAL_P(var)); break; -#else - case IS_RESOURCE: fprintf(stderr, "value=(resource)%ld\n", Z_LVAL_P(var)); break; -#endif - default: fprintf(stderr, "\n"); break; - } - } - } - - fprintf(stderr, "End of the dump of the memory frame %p\n", active_memory); -} - -void zephir_dump_current_frame() -{ - zend_zephir_globals_def *zephir_globals_ptr = ZEPHIR_VGLOBAL; - - if (UNEXPECTED(zephir_globals_ptr->active_memory == NULL)) { - fprintf(stderr, "WARNING: calling %s() without an active memory frame!\n", __func__); - zephir_print_backtrace(); - return; - } - - zephir_dump_memory_frame(zephir_globals_ptr->active_memory); -} -#endif diff --git a/kernels/ZendEngine3/memory.h b/kernels/ZendEngine3/memory.h index d50802ee62..d530d183c3 100644 --- a/kernels/ZendEngine3/memory.h +++ b/kernels/ZendEngine3/memory.h @@ -32,42 +32,70 @@ #define ZEPHIR_NUM_PREALLOCATED_FRAMES 25 -void zephir_initialize_memory(zend_zephir_globals_def *zephir_globals_ptr); -int zephir_cleanup_fcache(void *pDest, int num_args, va_list args, zend_hash_key *hash_key); -void zephir_deinitialize_memory(); - -/* Memory Frames */ +/** Memory frame */ +typedef struct _zephir_memory_entry { + size_t pointer; + size_t capacity; + zval **addresses; + size_t hash_pointer; + size_t hash_capacity; + zval **hash_addresses; #ifndef ZEPHIR_RELEASE -void ZEPHIR_FASTCALL zephir_memory_grow_stack(const char *func); -int ZEPHIR_FASTCALL zephir_memory_restore_stack(const char *func); + int permanent; + const char *func; +#endif +} zephir_memory_entry; -#define ZEPHIR_MM_GROW() zephir_memory_grow_stack(NULL) -#define ZEPHIR_MM_RESTORE() zephir_memory_restore_stack(NULL) +/** Virtual Symbol Table */ +typedef struct _zephir_symbol_table { + struct _zephir_memory_entry *scope; + zend_array *symbol_table; + struct _zephir_symbol_table *prev; +} zephir_symbol_table; -#else -void ZEPHIR_FASTCALL zephir_memory_grow_stack(); -int ZEPHIR_FASTCALL zephir_memory_restore_stack(); +typedef struct _zephir_method_globals { + /* Memory */ + zephir_memory_entry *active_memory; /**< The current memory frame */ -#define ZEPHIR_MM_GROW() zephir_memory_grow_stack() -#define ZEPHIR_MM_RESTORE() zephir_memory_restore_stack() + /* Virtual Symbol Tables */ + zephir_symbol_table *active_symbol_table; +} zephir_method_globals; -#endif +/* Memory Frames */ +void ZEPHIR_FASTCALL zephir_memory_grow_stack(zephir_method_globals *g, const char *func); +void ZEPHIR_FASTCALL zephir_memory_restore_stack(zephir_method_globals *g, const char *func); + +#define ZEPHIR_MM_GROW() \ + ZEPHIR_METHOD_GLOBALS_PTR = pecalloc(1, sizeof(zephir_method_globals), 1); \ + zephir_memory_grow_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); + +#define ZEPHIR_MM_RESTORE() \ + zephir_memory_restore_stack(ZEPHIR_METHOD_GLOBALS_PTR, __func__); \ + pefree(ZEPHIR_METHOD_GLOBALS_PTR, 1); \ + ZEPHIR_METHOD_GLOBALS_PTR = NULL; + +void zephir_initialize_memory(zend_zephir_globals_def *zephir_globals_ptr); +int zephir_cleanup_fcache(void *pDest, int num_args, va_list args, zend_hash_key *hash_key); +void zephir_deinitialize_memory(); #define zephir_dtor(x) zval_dtor(x) #define zephir_ptr_dtor(x) zval_ptr_dtor(x) -void ZEPHIR_FASTCALL zephir_memory_observe(zval *var); -void ZEPHIR_FASTCALL zephir_memory_alloc(zval *var); - -int ZEPHIR_FASTCALL zephir_clean_restore_stack(); +void zephir_do_memory_observe(zval *var, const zephir_method_globals *g); +#define zephir_memory_observe(var) zephir_do_memory_observe(var, ZEPHIR_METHOD_GLOBALS_PTR); #define zephir_safe_zval_ptr_dtor(pzval) -void zephir_create_symbol_table(); +void zephir_create_symbol_table(zephir_method_globals *g); + +#define ZEPHIR_CREATE_SYMBOL_TABLE() zephir_create_symbol_table(ZEPHIR_METHOD_GLOBALS_PTR); + int zephir_set_symbol(zval *key_name, zval *value); int zephir_set_symbol_str(char *key_name, unsigned int key_length, zval *value); -#define ZEPHIR_INIT_VAR(z) zephir_memory_alloc(z); +#define ZEPHIR_INIT_VAR(z) \ + zephir_memory_observe(z); \ + ZVAL_NULL(z); #define ZEPHIR_SINIT_VAR(z) ZVAL_NULL(&z); diff --git a/templates/ZendEngine3/php_project.h b/templates/ZendEngine3/php_project.h index bb0ef08297..54564e6f36 100644 --- a/templates/ZendEngine3/php_project.h +++ b/templates/ZendEngine3/php_project.h @@ -23,14 +23,6 @@ ZEND_BEGIN_MODULE_GLOBALS(%PROJECT_LOWER%) int initialized; - /* Memory */ - zephir_memory_entry *start_memory; /**< The first preallocated frame */ - zephir_memory_entry *end_memory; /**< The last preallocate frame */ - zephir_memory_entry *active_memory; /**< The current memory frame */ - - /* Virtual Symbol Tables */ - zephir_symbol_table *active_symbol_table; - /** Function cache */ HashTable *fcache; diff --git a/templates/ZendEngine3/project.c b/templates/ZendEngine3/project.c index 6236c88234..bc8b2a0ef2 100644 --- a/templates/ZendEngine3/project.c +++ b/templates/ZendEngine3/project.c @@ -57,12 +57,6 @@ static void php_zephir_init_globals(zend_%PROJECT_LOWER%_globals *%PROJECT_LOWER { %PROJECT_LOWER%_globals->initialized = 0; - /* Memory options */ - %PROJECT_LOWER%_globals->active_memory = NULL; - - /* Virtual Symbol Tables */ - %PROJECT_LOWER%_globals->active_symbol_table = NULL; - /* Cache Enabled */ %PROJECT_LOWER%_globals->cache_enabled = 1; diff --git a/test/vars.zep b/test/vars.zep index 47fb9d8391..7c66942689 100644 --- a/test/vars.zep +++ b/test/vars.zep @@ -2,6 +2,12 @@ namespace Test; class Vars { + public function testParam(array! arr) + { + let arr["test"]["test"] = "test"; + return arr; + } + public function testVarDump() { var a, ar; diff --git a/unit-tests/fixtures/lifecycle/expected3.c b/unit-tests/fixtures/lifecycle/expected3.c index c925eba27e..4e960654b9 100644 --- a/unit-tests/fixtures/lifecycle/expected3.c +++ b/unit-tests/fixtures/lifecycle/expected3.c @@ -62,12 +62,6 @@ static void php_zephir_init_globals(zend_lifecycle_globals *lifecycle_globals TS { lifecycle_globals->initialized = 0; - /* Memory options */ - lifecycle_globals->active_memory = NULL; - - /* Virtual Symbol Tables */ - lifecycle_globals->active_symbol_table = NULL; - /* Cache Enabled */ lifecycle_globals->cache_enabled = 1; diff --git a/unit-tests/fixtures/typehints/expected3.c b/unit-tests/fixtures/typehints/expected3.c index 75783240a3..e1241be5fb 100644 --- a/unit-tests/fixtures/typehints/expected3.c +++ b/unit-tests/fixtures/typehints/expected3.c @@ -61,12 +61,6 @@ static void php_zephir_init_globals(zend_typehints_globals *typehints_globals TS { typehints_globals->initialized = 0; - /* Memory options */ - typehints_globals->active_memory = NULL; - - /* Virtual Symbol Tables */ - typehints_globals->active_symbol_table = NULL; - /* Cache Enabled */ typehints_globals->cache_enabled = 1;