com php-src: Remove some unused compiler globals: Zend/zend.c Zend/zend_compile.c Zend/zend_compile.h Zend/zend _globals.h
| From: | Nikita Popov | Date: | Mon, 28 Jul 2014 13:52:18 +0000 |
| Subject: | com php-src: Remove some unused compiler globals: Zend/zend.c Zend/zend_compile.c Zend/zend_compile.h Zend/zend _globals.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-80900@lists.php.net to get a copy of this message | ||
Commit: 4c05bec536bf3751ea63a39754c4c5e6cf4fe185
Author: Nikita Popov <nikic@php.net> Mon, 28 Jul 2014 15:49:33 +0200
Parents: 31a886c346d268cd448125922c7ae32000d4ee87
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4c05bec536bf3751ea63a39754c4c5e6cf4fe185
Log:
Remove some unused compiler globals
Changed paths:
M Zend/zend.c
M Zend/zend_compile.c
M Zend/zend_compile.h
M Zend/zend_globals.h
Diff:
diff --git a/Zend/zend.c b/Zend/zend.c
index 6717bf2..c0fd373 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -1024,11 +1024,8 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
zval orig_user_error_handler;
zend_bool in_compilation;
zend_class_entry *saved_class_entry;
- zend_stack bp_stack;
- zend_stack function_call_stack;
zend_stack switch_cond_stack;
zend_stack foreach_copy_stack;
- zend_stack list_stack;
zend_stack context_stack;
zend_array *symbol_table;
TSRMLS_FETCH();
@@ -1191,11 +1188,8 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
if (in_compilation) {
saved_class_entry = CG(active_class_entry);
CG(active_class_entry) = NULL;
- SAVE_STACK(bp_stack);
- SAVE_STACK(function_call_stack);
SAVE_STACK(switch_cond_stack);
SAVE_STACK(foreach_copy_stack);
- SAVE_STACK(list_stack);
SAVE_STACK(context_stack);
CG(in_compilation) = 0;
}
@@ -1215,11 +1209,8 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
if (in_compilation) {
CG(active_class_entry) = saved_class_entry;
- RESTORE_STACK(bp_stack);
- RESTORE_STACK(function_call_stack);
RESTORE_STACK(switch_cond_stack);
RESTORE_STACK(foreach_copy_stack);
- RESTORE_STACK(list_stack);
RESTORE_STACK(context_stack);
CG(in_compilation) = 1;
}
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 92bd8f4..4b00e5b 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -195,14 +195,9 @@ void zend_init_compiler_context(TSRMLS_D) /* {{{ */
void zend_init_compiler_data_structures(TSRMLS_D) /* {{{ */
{
- zend_stack_init(&CG(bp_stack), sizeof(zend_llist));
- 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));
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);
- zend_stack_init(&CG(list_stack), sizeof(zend_llist));
CG(in_compilation) = 0;
CG(start_lineno) = 0;
ZVAL_UNDEF(&CG(current_namespace));
@@ -242,11 +237,8 @@ void init_compiler(TSRMLS_D) /* {{{ */
void shutdown_compiler(TSRMLS_D) /* {{{ */
{
- zend_stack_destroy(&CG(bp_stack));
- 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(list_stack));
zend_hash_destroy(&CG(filenames_table));
zend_hash_destroy(&CG(const_filenames));
zend_stack_destroy(&CG(context_stack));
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index ef136a7..a91ec99 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -359,26 +359,12 @@ union _zend_function {
zend_internal_function internal_function;
};
-typedef struct _zend_function_call_entry {
- zend_function *fbc;
- zend_uint op_number;
- zend_uint arg_num;
- zend_bool uses_argument_unpacking;
-} zend_function_call_entry;
-
typedef struct _zend_switch_entry {
znode cond;
int default_case;
int control_var;
} zend_switch_entry;
-
-typedef struct _list_llist_element {
- znode var;
- zend_llist dimensions;
- znode value;
-} list_llist_element;
-
typedef enum _vm_frame_kind {
VM_FRAME_NESTED_FUNCTION, /* stackless VM call to function */
VM_FRAME_NESTED_CODE, /* stackless VM call to include/require/eval */
@@ -545,9 +531,6 @@ int print_class(zend_class_entry *class_entry TSRMLS_DC);
void print_op_array(zend_op_array *op_array, int optimizations);
ZEND_API int pass_two(zend_op_array *op_array TSRMLS_DC);
zend_brk_cont_element *get_next_brk_cont_element(zend_op_array *op_array);
-void zend_do_first_catch(znode *open_parentheses TSRMLS_DC);
-void zend_initialize_try_catch_element(znode *catch_token TSRMLS_DC);
-void zend_do_mark_last_catch(const znode *first_catch, const znode *last_additional_catch
TSRMLS_DC);
ZEND_API zend_bool zend_is_compiling(TSRMLS_D);
ZEND_API char *zend_make_compiled_string_description(const char *name TSRMLS_DC);
ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify_handlers
TSRMLS_DC);
diff --git a/Zend/zend_globals.h b/Zend/zend_globals.h
index dd8098e..f327493 100644
--- a/Zend/zend_globals.h
+++ b/Zend/zend_globals.h
@@ -71,20 +71,11 @@ typedef struct _zend_ini_entry zend_ini_entry;
struct _zend_compiler_globals {
- zend_stack bp_stack;
zend_stack switch_cond_stack;
zend_stack foreach_copy_stack;
- zend_stack object_stack; /* TODO: remove */
zend_class_entry *active_class_entry;
- /* variables for list() compilation */
- zend_llist list_llist;
- zend_llist dimension_llist;
- zend_stack list_stack;
-
- zend_stack function_call_stack;
-
zend_string *compiled_filename;
int zend_lineno;
@@ -111,8 +102,6 @@ struct _zend_compiler_globals {
zend_llist open_files;
- long catch_begin;
-
struct _zend_ini_parser_param *ini_parser_param;
int interactive;
@@ -122,8 +111,6 @@ struct _zend_compiler_globals {
znode implementing_class;
- zend_uint access_type;
-
zend_string *doc_comment;
zend_uint compiler_options; /* set of ZEND_COMPILE_* constants */
@@ -153,13 +140,13 @@ struct _zend_compiler_globals {
zend_bool detect_unicode;
zend_bool encoding_declared;
+ zend_ast *ast;
+ zend_arena *ast_arena;
+
#ifdef ZTS
zval **static_members_table;
int last_static_member;
#endif
-
- zend_ast *ast;
- zend_arena *ast_arena;
};