Remove declare_stack

This commit is contained in:
Nikita Popov 2014-07-22 16:18:13 +02:00
parent a7fc995fa2
commit 43b2973ee7
3 changed files with 2 additions and 11 deletions

View File

@ -1036,7 +1036,6 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
zend_stack function_call_stack;
zend_stack switch_cond_stack;
zend_stack foreach_copy_stack;
zend_stack declare_stack;
zend_stack list_stack;
zend_stack context_stack;
TSRMLS_FETCH();
@ -1191,7 +1190,6 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
SAVE_STACK(function_call_stack);
SAVE_STACK(switch_cond_stack);
SAVE_STACK(foreach_copy_stack);
SAVE_STACK(declare_stack);
SAVE_STACK(list_stack);
SAVE_STACK(context_stack);
CG(in_compilation) = 0;
@ -1216,7 +1214,6 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
RESTORE_STACK(function_call_stack);
RESTORE_STACK(switch_cond_stack);
RESTORE_STACK(foreach_copy_stack);
RESTORE_STACK(declare_stack);
RESTORE_STACK(list_stack);
RESTORE_STACK(context_stack);
CG(in_compilation) = 1;

View File

@ -187,7 +187,6 @@ void zend_init_compiler_data_structures(TSRMLS_D) /* {{{ */
zend_stack_init(&CG(function_call_stack), sizeof(zend_function_call_entry));
zend_stack_init(&CG(switch_cond_stack), sizeof(zend_switch_entry));
zend_stack_init(&CG(foreach_copy_stack), sizeof(zend_op));
zend_stack_init(&CG(declare_stack), sizeof(zend_declarables));
CG(active_class_entry) = NULL;
zend_llist_init(&CG(list_llist), sizeof(list_llist_element), NULL, 0);
zend_llist_init(&CG(dimension_llist), sizeof(int), NULL, 0);
@ -234,7 +233,6 @@ void shutdown_compiler(TSRMLS_D) /* {{{ */
zend_stack_destroy(&CG(function_call_stack));
zend_stack_destroy(&CG(switch_cond_stack));
zend_stack_destroy(&CG(foreach_copy_stack));
zend_stack_destroy(&CG(declare_stack));
zend_stack_destroy(&CG(list_stack));
zend_hash_destroy(&CG(filenames_table));
zend_hash_destroy(&CG(const_filenames));
@ -5159,10 +5157,9 @@ void zend_compile_try(zend_ast *ast TSRMLS_DC) {
void zend_compile_declare(zend_ast *ast TSRMLS_DC) {
zend_ast *declares_ast = ast->child[0];
zend_ast *stmt_ast = ast->child[1];
zend_declarables orig_declarables = CG(declarables);
zend_uint i;
zend_stack_push(&CG(declare_stack), &CG(declarables));
for (i = 0; i < declares_ast->children; ++i) {
zend_ast *declare_ast = declares_ast->child[i];
zend_ast *name_ast = declare_ast->child[0];
@ -5235,11 +5232,9 @@ void zend_compile_declare(zend_ast *ast TSRMLS_DC) {
}
if (stmt_ast) {
zend_declarables *declarables = zend_stack_top(&CG(declare_stack));
zend_compile_stmt(stmt_ast TSRMLS_CC);
CG(declarables) = *declarables;
CG(declarables) = orig_declarables;
}
}

View File

@ -74,7 +74,6 @@ struct _zend_compiler_globals {
zend_stack switch_cond_stack;
zend_stack foreach_copy_stack;
zend_stack object_stack; /* TODO: remove */
zend_stack declare_stack;
zend_class_entry *active_class_entry;