Remove CG(filenames_table)
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 3 Sep 2020 09:30:58 +0000 (11:30 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 3 Sep 2020 09:33:54 +0000 (11:33 +0200)
This doesn't seem to serve any purpose anymore.

Zend/zend_compile.c
Zend/zend_globals.h

index c403a1f54e3a14c9a46bb91f901fea0087f52cd4..a60ceb1c8431d42174359689bb238a936db6dc22 100644 (file)
@@ -412,7 +412,6 @@ void init_compiler(void) /* {{{ */
        memset(&CG(context), 0, sizeof(CG(context)));
        zend_init_compiler_data_structures();
        zend_init_rsrc_list();
-       zend_hash_init(&CG(filenames_table), 8, NULL, ZVAL_PTR_DTOR, 0);
        zend_llist_init(&CG(open_files), sizeof(zend_file_handle), (void (*)(void *)) file_handle_dtor, 0);
        CG(unclean_shutdown) = 0;
 
@@ -426,7 +425,6 @@ void shutdown_compiler(void) /* {{{ */
        zend_stack_destroy(&CG(loop_var_stack));
        zend_stack_destroy(&CG(delayed_oplines_stack));
        zend_stack_destroy(&CG(short_circuiting_opnums));
-       zend_hash_destroy(&CG(filenames_table));
        zend_arena_destroy(CG(arena));
 
        if (CG(delayed_variance_obligations)) {
@@ -444,18 +442,7 @@ void shutdown_compiler(void) /* {{{ */
 
 ZEND_API zend_string *zend_set_compiled_filename(zend_string *new_compiled_filename) /* {{{ */
 {
-       zval *p, rv;
-
-       if ((p = zend_hash_find(&CG(filenames_table), new_compiled_filename))) {
-               ZEND_ASSERT(Z_TYPE_P(p) == IS_STRING);
-               CG(compiled_filename) = Z_STR_P(p);
-               return Z_STR_P(p);
-       }
-
        new_compiled_filename = zend_new_interned_string(zend_string_copy(new_compiled_filename));
-       ZVAL_STR(&rv, new_compiled_filename);
-       zend_hash_add_new(&CG(filenames_table), new_compiled_filename, &rv);
-
        CG(compiled_filename) = new_compiled_filename;
        return new_compiled_filename;
 }
index 652e0ef1e132973d61f47521e896f8c67cafbe38..e0e8ac770065e6caa3a7ca9c40fa9e6f37f8a645 100644 (file)
@@ -77,8 +77,6 @@ struct _zend_compiler_globals {
        HashTable *function_table;      /* function symbol table */
        HashTable *class_table;         /* class table */
 
-       HashTable filenames_table;
-
        HashTable *auto_globals;
 
        /* Refer to zend_yytnamerr() in zend_language_parser.y for meaning of values */