cvs: ZendEngine2 / zend.h zend_compile.c zend_compile.h zend_execute.c zend_globals.h zend_opcode.c
| From: | Stanislav Malyshev | Date: | Wed, 23 Jul 2003 08:58:47 +0000 |
| Subject: | cvs: ZendEngine2 / zend.h zend_compile.c zend_compile.h zend_execute.c zend_globals.h zend_opcode.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-1519@lists.php.net to get a copy of this message | ||
stas Wed Jul 23 04:58:47 2003 EDT
Modified files:
/ZendEngine2 zend.h zend_compile.c zend_compile.h zend_execute.c
zend_globals.h zend_opcode.c
Log:
Remove namespace leftovers
Index: ZendEngine2/zend.h diff -u ZendEngine2/zend.h:1.212 ZendEngine2/zend.h:1.213 --- ZendEngine2/zend.h:1.212 Sat Jul 19 09:10:24 2003 +++ ZendEngine2/zend.h Wed Jul 23 04:58:46 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend.h,v 1.212 2003/07/19 13:10:24 sniper Exp $ */ +/* $Id: zend.h,v 1.213 2003/07/23 08:58:46 stas Exp $ */ #ifndef ZEND_H #define ZEND_H @@ -304,7 +304,6 @@ HashTable function_table; HashTable default_properties; HashTable properties_info; - HashTable class_table; HashTable *static_members; HashTable constants_table; zend_function_entry *builtin_functions; Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.438 ZendEngine2/zend_compile.c:1.439 --- ZendEngine2/zend_compile.c:1.438 Wed Jul 16 05:13:47 2003 +++ ZendEngine2/zend_compile.c Wed Jul 23 04:58:46 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.c,v 1.438 2003/07/16 09:13:47 zeev Exp $ */ +/* $Id: zend_compile.c,v 1.439 2003/07/23 08:58:46 stas Exp $ */ #include "zend_language_parser.h" #include "zend.h" @@ -678,62 +678,6 @@ return ((type & ZEND_PARSED_METHOD_CALL) || (type == ZEND_PARSED_FUNCTION_CALL)); } - -void zend_do_begin_import(TSRMLS_D) -{ - zend_llist_init(&CG(import_commands), sizeof(zend_op), NULL, 0); -} - - -void zend_do_import(int type, znode *what TSRMLS_DC) -{ - zend_op opline; - - init_op(&opline TSRMLS_CC); - - switch (type) { - case T_FUNCTION: - opline.opcode = ZEND_IMPORT_FUNCTION; - break; - case T_CLASS: - opline.opcode = ZEND_IMPORT_CLASS; - break; - case T_CONST: - opline.opcode = ZEND_IMPORT_CONST; - break; - } - - if (what) { - if (type == T_FUNCTION || type == T_CLASS) { - zend_str_tolower(what->u.constant.value.str.val, what->u.constant.value.str.len); - } - opline.op2 = *what; - } else { - SET_UNUSED(opline.op2); - } - - zend_llist_add_element(&CG(import_commands), &opline); -} - - -void zend_do_end_import(znode *import_from TSRMLS_DC) -{ - zend_llist_element *le; - zend_op *opline, *opline_ptr; - - le = CG(import_commands).head; - - while (le) { - opline_ptr = (zend_op *)le->data; - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - memcpy(opline, opline_ptr, sizeof(zend_op)); - opline->op1 = *import_from; - le = le->next; - } - zend_llist_destroy(&CG(import_commands)); -} - - void zend_do_begin_variable_parse(TSRMLS_D) { zend_llist fetch_list; @@ -3413,7 +3357,6 @@ zend_hash_init_ex(ce->static_members, 0, NULL, ZVAL_PTR_DTOR, persistent_hashes, 0); zend_hash_init_ex(&ce->constants_table, 0, NULL, ZVAL_PTR_DTOR, persistent_hashes, 0); zend_hash_init_ex(&ce->function_table, 0, NULL, ZEND_FUNCTION_DTOR, persistent_hashes, 0); - zend_hash_init_ex(&ce->class_table, 10, NULL, ZEND_CLASS_DTOR, persistent_hashes, 0); if (nullify_handlers) { ce->constructor = NULL; Index: ZendEngine2/zend_compile.h diff -u ZendEngine2/zend_compile.h:1.247 ZendEngine2/zend_compile.h:1.248 --- ZendEngine2/zend_compile.h:1.247 Wed Jul 16 04:57:08 2003 +++ ZendEngine2/zend_compile.h Wed Jul 23 04:58:46 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.h,v 1.247 2003/07/16 08:57:08 zeev Exp $ */ +/* $Id: zend_compile.h,v 1.248 2003/07/23 08:58:46 stas Exp $ */ #ifndef ZEND_COMPILE_H #define ZEND_COMPILE_H @@ -428,10 +428,6 @@ void zend_do_extended_fcall_end(TSRMLS_D); void zend_do_ticks(TSRMLS_D); - -void zend_do_begin_import(TSRMLS_D); -void zend_do_import(int type, znode *what TSRMLS_DC); -void zend_do_end_import(znode *import_from TSRMLS_DC); void zend_do_abstract_method(znode *function_name, znode *modifiers, znode *body TSRMLS_DC); Index: ZendEngine2/zend_execute.c diff -u ZendEngine2/zend_execute.c:1.498 ZendEngine2/zend_execute.c:1.499 --- ZendEngine2/zend_execute.c:1.498 Tue Jul 22 12:06:07 2003 +++ ZendEngine2/zend_execute.c Wed Jul 23 04:58:46 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute.c,v 1.498 2003/07/22 16:06:07 zeev Exp $ */ +/* $Id: zend_execute.c,v 1.499 2003/07/23 08:58:46 stas Exp $ */ #define ZEND_INTENSIVE_DEBUGGING 0 @@ -2214,131 +2214,6 @@ NEXT_OPCODE(); } -static int zend_import_check_function(HashTable *target_ht, zend_function *function, zend_hash_key *hash_key, void *param) -{ - if (zend_hash_quick_exists(target_ht, hash_key->arKey, hash_key->nKeyLength, hash_key->h)) { - zend_error(E_ERROR, "Import: function %s() already exists in current scope", function->common.function_name?function->common.function_name:"main"); - } - return 1; /* OK */ -} - -int zend_import_function_handler(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_class_entry *ce; - zend_function *function; - - ce = EX_T(EX(opline)->op1.u.var).EA.class_entry; - - if (EX(opline)->op2.op_type != IS_UNUSED) { - char *function_name_strval; - int function_name_strlen; - - function_name_strval = EX(opline)->op2.u.constant.value.str.val; - function_name_strlen = EX(opline)->op2.u.constant.value.str.len; - - if (zend_hash_find(&ce->function_table, function_name_strval, function_name_strlen + 1, (void **) &function)==FAILURE) { - zend_error(E_ERROR, "Import: function %s() not found", function_name_strval); - } - if (zend_hash_add(EG(function_table), function_name_strval, function_name_strlen + 1, function, sizeof(zend_function), NULL) == FAILURE) { - zend_error(E_ERROR, "Import: function %s() already exists in current scope", function_name_strval); - } - function_add_ref(function); - } else { - zend_hash_merge_ex(EG(function_table), &ce->function_table, (copy_ctor_func_t) function_add_ref, sizeof(zend_function), (merge_checker_func_t)zend_import_check_function, NULL); - } - NEXT_OPCODE(); -} - -static int zend_import_check_class(HashTable *target_ht, zend_class_entry **ce, zend_hash_key *hash_key, void *param) -{ - if (zend_hash_quick_exists(target_ht, hash_key->arKey, hash_key->nKeyLength, hash_key->h)) { - zend_error(E_ERROR, "Import: class '%s' already exists in current scope", (*ce)->name); - } - return 1; /* OK */ -} - -int zend_import_class_handler(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_class_entry *ce; - zend_class_entry **import_ce; - - ce = EX_T(EX(opline)->op1.u.var).EA.class_entry; - - if (EX(opline)->op2.op_type != IS_UNUSED) { - char *class_name_strval; - int class_name_strlen; - - class_name_strval = EX(opline)->op2.u.constant.value.str.val; - class_name_strlen = EX(opline)->op2.u.constant.value.str.len; - - if (zend_hash_find(&ce->class_table, class_name_strval, class_name_strlen + 1, (void **) &import_ce)==FAILURE) { - zend_error(E_ERROR, "Import: class %s not found", class_name_strval); - } - if (zend_hash_add(EG(class_table), class_name_strval, class_name_strlen + 1, import_ce, sizeof(zend_class_entry *), NULL) == FAILURE) { - zend_error(E_ERROR, "Import: class %s already exists in current scope", class_name_strval); - } - zend_class_add_ref(import_ce); - } else { - zend_hash_merge_ex(EG(class_table), &ce->class_table, (copy_ctor_func_t) zend_class_add_ref, sizeof(zend_class_entry *), (merge_checker_func_t)zend_import_check_class, NULL); - } - - NEXT_OPCODE(); -} - - -int zend_import_const_handler(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_class_entry *ce; - zval **import_constant; - zend_constant c; - - ce = EX_T(EX(opline)->op1.u.var).EA.class_entry; - if (EX(opline)->op2.op_type != IS_UNUSED) { - char *const_name_strval; - int const_name_strlen; - - const_name_strval = EX(opline)->op2.u.constant.value.str.val; - const_name_strlen = EX(opline)->op2.u.constant.value.str.len; - - if (zend_hash_find(&ce->constants_table, const_name_strval, const_name_strlen + 1, (void **) &import_constant)==FAILURE) { - zend_error(E_ERROR, "Import: constant %s not found", const_name_strval); - } - c.value = **import_constant; - zval_copy_ctor(&c.value); - c.flags = CONST_CS; - c.name = zend_strndup(const_name_strval, const_name_strlen); - c.name_len = const_name_strlen + 1; - - if (zend_register_constant(&c TSRMLS_CC) == FAILURE) { - zend_error(E_ERROR, "Import: unable to register constant %s", const_name_strval); - } - } else { - HashPosition pos; - char *key; - uint key_length; - int key_type; - ulong dummy; - - zend_hash_internal_pointer_reset_ex(&ce->constants_table, &pos); - while (zend_hash_get_current_data_ex(&ce->constants_table, (void **)&import_constant, &pos) == SUCCESS) { - key_type = zend_hash_get_current_key_ex(&ce->constants_table, &key, &key_length, &dummy, 0, &pos); - - c.value = **import_constant; - zval_copy_ctor(&c.value); - c.flags = CONST_CS; - c.name = zend_strndup(key, key_length - 1); - c.name_len = key_length; - - if (zend_register_constant(&c TSRMLS_CC) == FAILURE) { - zend_error(E_ERROR, "Import: unable to register constant %s", key); - } - zend_hash_move_forward_ex(&ce->constants_table, &pos); - } - } - NEXT_OPCODE(); -} - - int zend_fetch_class_handler(ZEND_OPCODE_HANDLER_ARGS) { zend_class_entry **pce; @@ -2381,6 +2256,7 @@ ce = Z_OBJCE_P(class_name); break; case IS_STRING: + convert_to_string_ex(&class_name); class_name_strval = zend_str_tolower_dup(class_name->value.str.val, class_name->value.str.len); class_name_strlen = class_name->value.str.len; free_class_name = 1; @@ -4204,10 +4080,6 @@ zend_opcode_handlers[ZEND_ISSET_ISEMPTY_VAR] = zend_isset_isempty_var_handler; zend_opcode_handlers[ZEND_ISSET_ISEMPTY_DIM_OBJ] = zend_isset_isempty_dim_obj_handler; - - zend_opcode_handlers[ZEND_IMPORT_FUNCTION] = zend_import_function_handler; - zend_opcode_handlers[ZEND_IMPORT_CLASS] = zend_import_class_handler; - zend_opcode_handlers[ZEND_IMPORT_CONST] = zend_import_const_handler; zend_opcode_handlers[ZEND_PRE_INC_OBJ] = zend_pre_inc_obj_handler; zend_opcode_handlers[ZEND_PRE_DEC_OBJ] = zend_pre_dec_obj_handler; Index: ZendEngine2/zend_globals.h diff -u ZendEngine2/zend_globals.h:1.126 ZendEngine2/zend_globals.h:1.127 --- ZendEngine2/zend_globals.h:1.126 Wed Jul 2 12:52:07 2003 +++ ZendEngine2/zend_globals.h Wed Jul 23 04:58:46 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_globals.h,v 1.126 2003/07/02 16:52:07 andi Exp $ */ +/* $Id: zend_globals.h,v 1.127 2003/07/23 08:58:46 stas Exp $ */ #ifndef ZEND_GLOBALS_H #define ZEND_GLOBALS_H @@ -121,7 +121,6 @@ zend_uint start_lineno; zend_bool increment_lineno; - zend_llist import_commands; znode implementing_class; zend_uint access_type; Index: ZendEngine2/zend_opcode.c diff -u ZendEngine2/zend_opcode.c:1.93 ZendEngine2/zend_opcode.c:1.94 --- ZendEngine2/zend_opcode.c:1.93 Mon Jun 30 16:22:35 2003 +++ ZendEngine2/zend_opcode.c Wed Jul 23 04:58:46 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_opcode.c,v 1.93 2003/06/30 20:22:35 andi Exp $ */ +/* $Id: zend_opcode.c,v 1.94 2003/07/23 08:58:46 stas Exp $ */ #include <stdio.h> @@ -132,7 +132,6 @@ /* Note that only run-time accessed data need to be cleaned up, pre-defined data can not contain objects and thus are not probelmatic */ zend_hash_clean((*pce)->static_members); - zend_hash_apply(&(*pce)->class_table, (apply_func_t) zend_cleanup_class_data TSRMLS_CC); zend_hash_apply(&(*pce)->function_table, (apply_func_t) zend_cleanup_function_data TSRMLS_CC); } return 0; @@ -154,7 +153,6 @@ zend_hash_destroy(&ce->function_table); FREE_HASHTABLE(ce->static_members); zend_hash_destroy(&ce->constants_table); - zend_hash_destroy(&ce->class_table); if (ce->num_interfaces > 0 && ce->interfaces) { efree(ce->interfaces); } @@ -171,7 +169,6 @@ zend_hash_destroy(&ce->function_table); free(ce->static_members); zend_hash_destroy(&ce->constants_table); - zend_hash_destroy(&ce->class_table); if (ce->num_interfaces > 0) { free(ce->interfaces); }
Index: ZendEngine2/zend.h diff -u ZendEngine2/zend.h:1.212 ZendEngine2/zend.h:1.213 --- ZendEngine2/zend.h:1.212 Sat Jul 19 09:10:24 2003 +++ ZendEngine2/zend.h Wed Jul 23 04:58:46 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend.h,v 1.212 2003/07/19 13:10:24 sniper Exp $ */ +/* $Id: zend.h,v 1.213 2003/07/23 08:58:46 stas Exp $ */ #ifndef ZEND_H #define ZEND_H @@ -304,7 +304,6 @@ HashTable function_table; HashTable default_properties; HashTable properties_info; - HashTable class_table; HashTable *static_members; HashTable constants_table; zend_function_entry *builtin_functions; Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.438 ZendEngine2/zend_compile.c:1.439 --- ZendEngine2/zend_compile.c:1.438 Wed Jul 16 05:13:47 2003 +++ ZendEngine2/zend_compile.c Wed Jul 23 04:58:46 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.c,v 1.438 2003/07/16 09:13:47 zeev Exp $ */ +/* $Id: zend_compile.c,v 1.439 2003/07/23 08:58:46 stas Exp $ */ #include "zend_language_parser.h" #include "zend.h" @@ -678,62 +678,6 @@ return ((type & ZEND_PARSED_METHOD_CALL) || (type == ZEND_PARSED_FUNCTION_CALL)); } - -void zend_do_begin_import(TSRMLS_D) -{ - zend_llist_init(&CG(import_commands), sizeof(zend_op), NULL, 0); -} - - -void zend_do_import(int type, znode *what TSRMLS_DC) -{ - zend_op opline; - - init_op(&opline TSRMLS_CC); - - switch (type) { - case T_FUNCTION: - opline.opcode = ZEND_IMPORT_FUNCTION; - break; - case T_CLASS: - opline.opcode = ZEND_IMPORT_CLASS; - break; - case T_CONST: - opline.opcode = ZEND_IMPORT_CONST; - break; - } - - if (what) { - if (type == T_FUNCTION || type == T_CLASS) { - zend_str_tolower(what->u.constant.value.str.val, what->u.constant.value.str.len); - } - opline.op2 = *what; - } else { - SET_UNUSED(opline.op2); - } - - zend_llist_add_element(&CG(import_commands), &opline); -} - - -void zend_do_end_import(znode *import_from TSRMLS_DC) -{ - zend_llist_element *le; - zend_op *opline, *opline_ptr; - - le = CG(import_commands).head; - - while (le) { - opline_ptr = (zend_op *)le->data; - opline = get_next_op(CG(active_op_array) TSRMLS_CC); - memcpy(opline, opline_ptr, sizeof(zend_op)); - opline->op1 = *import_from; - le = le->next; - } - zend_llist_destroy(&CG(import_commands)); -} - - void zend_do_begin_variable_parse(TSRMLS_D) { zend_llist fetch_list; @@ -3413,7 +3357,6 @@ zend_hash_init_ex(ce->static_members, 0, NULL, ZVAL_PTR_DTOR, persistent_hashes, 0); zend_hash_init_ex(&ce->constants_table, 0, NULL, ZVAL_PTR_DTOR, persistent_hashes, 0); zend_hash_init_ex(&ce->function_table, 0, NULL, ZEND_FUNCTION_DTOR, persistent_hashes, 0); - zend_hash_init_ex(&ce->class_table, 10, NULL, ZEND_CLASS_DTOR, persistent_hashes, 0); if (nullify_handlers) { ce->constructor = NULL; Index: ZendEngine2/zend_compile.h diff -u ZendEngine2/zend_compile.h:1.247 ZendEngine2/zend_compile.h:1.248 --- ZendEngine2/zend_compile.h:1.247 Wed Jul 16 04:57:08 2003 +++ ZendEngine2/zend_compile.h Wed Jul 23 04:58:46 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.h,v 1.247 2003/07/16 08:57:08 zeev Exp $ */ +/* $Id: zend_compile.h,v 1.248 2003/07/23 08:58:46 stas Exp $ */ #ifndef ZEND_COMPILE_H #define ZEND_COMPILE_H @@ -428,10 +428,6 @@ void zend_do_extended_fcall_end(TSRMLS_D); void zend_do_ticks(TSRMLS_D); - -void zend_do_begin_import(TSRMLS_D); -void zend_do_import(int type, znode *what TSRMLS_DC); -void zend_do_end_import(znode *import_from TSRMLS_DC); void zend_do_abstract_method(znode *function_name, znode *modifiers, znode *body TSRMLS_DC); Index: ZendEngine2/zend_execute.c diff -u ZendEngine2/zend_execute.c:1.498 ZendEngine2/zend_execute.c:1.499 --- ZendEngine2/zend_execute.c:1.498 Tue Jul 22 12:06:07 2003 +++ ZendEngine2/zend_execute.c Wed Jul 23 04:58:46 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute.c,v 1.498 2003/07/22 16:06:07 zeev Exp $ */ +/* $Id: zend_execute.c,v 1.499 2003/07/23 08:58:46 stas Exp $ */ #define ZEND_INTENSIVE_DEBUGGING 0 @@ -2214,131 +2214,6 @@ NEXT_OPCODE(); } -static int zend_import_check_function(HashTable *target_ht, zend_function *function, zend_hash_key *hash_key, void *param) -{ - if (zend_hash_quick_exists(target_ht, hash_key->arKey, hash_key->nKeyLength, hash_key->h)) { - zend_error(E_ERROR, "Import: function %s() already exists in current scope", function->common.function_name?function->common.function_name:"main"); - } - return 1; /* OK */ -} - -int zend_import_function_handler(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_class_entry *ce; - zend_function *function; - - ce = EX_T(EX(opline)->op1.u.var).EA.class_entry; - - if (EX(opline)->op2.op_type != IS_UNUSED) { - char *function_name_strval; - int function_name_strlen; - - function_name_strval = EX(opline)->op2.u.constant.value.str.val; - function_name_strlen = EX(opline)->op2.u.constant.value.str.len; - - if (zend_hash_find(&ce->function_table, function_name_strval, function_name_strlen + 1, (void **) &function)==FAILURE) { - zend_error(E_ERROR, "Import: function %s() not found", function_name_strval); - } - if (zend_hash_add(EG(function_table), function_name_strval, function_name_strlen + 1, function, sizeof(zend_function), NULL) == FAILURE) { - zend_error(E_ERROR, "Import: function %s() already exists in current scope", function_name_strval); - } - function_add_ref(function); - } else { - zend_hash_merge_ex(EG(function_table), &ce->function_table, (copy_ctor_func_t) function_add_ref, sizeof(zend_function), (merge_checker_func_t)zend_import_check_function, NULL); - } - NEXT_OPCODE(); -} - -static int zend_import_check_class(HashTable *target_ht, zend_class_entry **ce, zend_hash_key *hash_key, void *param) -{ - if (zend_hash_quick_exists(target_ht, hash_key->arKey, hash_key->nKeyLength, hash_key->h)) { - zend_error(E_ERROR, "Import: class '%s' already exists in current scope", (*ce)->name); - } - return 1; /* OK */ -} - -int zend_import_class_handler(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_class_entry *ce; - zend_class_entry **import_ce; - - ce = EX_T(EX(opline)->op1.u.var).EA.class_entry; - - if (EX(opline)->op2.op_type != IS_UNUSED) { - char *class_name_strval; - int class_name_strlen; - - class_name_strval = EX(opline)->op2.u.constant.value.str.val; - class_name_strlen = EX(opline)->op2.u.constant.value.str.len; - - if (zend_hash_find(&ce->class_table, class_name_strval, class_name_strlen + 1, (void **) &import_ce)==FAILURE) { - zend_error(E_ERROR, "Import: class %s not found", class_name_strval); - } - if (zend_hash_add(EG(class_table), class_name_strval, class_name_strlen + 1, import_ce, sizeof(zend_class_entry *), NULL) == FAILURE) { - zend_error(E_ERROR, "Import: class %s already exists in current scope", class_name_strval); - } - zend_class_add_ref(import_ce); - } else { - zend_hash_merge_ex(EG(class_table), &ce->class_table, (copy_ctor_func_t) zend_class_add_ref, sizeof(zend_class_entry *), (merge_checker_func_t)zend_import_check_class, NULL); - } - - NEXT_OPCODE(); -} - - -int zend_import_const_handler(ZEND_OPCODE_HANDLER_ARGS) -{ - zend_class_entry *ce; - zval **import_constant; - zend_constant c; - - ce = EX_T(EX(opline)->op1.u.var).EA.class_entry; - if (EX(opline)->op2.op_type != IS_UNUSED) { - char *const_name_strval; - int const_name_strlen; - - const_name_strval = EX(opline)->op2.u.constant.value.str.val; - const_name_strlen = EX(opline)->op2.u.constant.value.str.len; - - if (zend_hash_find(&ce->constants_table, const_name_strval, const_name_strlen + 1, (void **) &import_constant)==FAILURE) { - zend_error(E_ERROR, "Import: constant %s not found", const_name_strval); - } - c.value = **import_constant; - zval_copy_ctor(&c.value); - c.flags = CONST_CS; - c.name = zend_strndup(const_name_strval, const_name_strlen); - c.name_len = const_name_strlen + 1; - - if (zend_register_constant(&c TSRMLS_CC) == FAILURE) { - zend_error(E_ERROR, "Import: unable to register constant %s", const_name_strval); - } - } else { - HashPosition pos; - char *key; - uint key_length; - int key_type; - ulong dummy; - - zend_hash_internal_pointer_reset_ex(&ce->constants_table, &pos); - while (zend_hash_get_current_data_ex(&ce->constants_table, (void **)&import_constant, &pos) == SUCCESS) { - key_type = zend_hash_get_current_key_ex(&ce->constants_table, &key, &key_length, &dummy, 0, &pos); - - c.value = **import_constant; - zval_copy_ctor(&c.value); - c.flags = CONST_CS; - c.name = zend_strndup(key, key_length - 1); - c.name_len = key_length; - - if (zend_register_constant(&c TSRMLS_CC) == FAILURE) { - zend_error(E_ERROR, "Import: unable to register constant %s", key); - } - zend_hash_move_forward_ex(&ce->constants_table, &pos); - } - } - NEXT_OPCODE(); -} - - int zend_fetch_class_handler(ZEND_OPCODE_HANDLER_ARGS) { zend_class_entry **pce; @@ -2381,6 +2256,7 @@ ce = Z_OBJCE_P(class_name); break; case IS_STRING: + convert_to_string_ex(&class_name); class_name_strval = zend_str_tolower_dup(class_name->value.str.val, class_name->value.str.len); class_name_strlen = class_name->value.str.len; free_class_name = 1; @@ -4204,10 +4080,6 @@ zend_opcode_handlers[ZEND_ISSET_ISEMPTY_VAR] = zend_isset_isempty_var_handler; zend_opcode_handlers[ZEND_ISSET_ISEMPTY_DIM_OBJ] = zend_isset_isempty_dim_obj_handler; - - zend_opcode_handlers[ZEND_IMPORT_FUNCTION] = zend_import_function_handler; - zend_opcode_handlers[ZEND_IMPORT_CLASS] = zend_import_class_handler; - zend_opcode_handlers[ZEND_IMPORT_CONST] = zend_import_const_handler; zend_opcode_handlers[ZEND_PRE_INC_OBJ] = zend_pre_inc_obj_handler; zend_opcode_handlers[ZEND_PRE_DEC_OBJ] = zend_pre_dec_obj_handler; Index: ZendEngine2/zend_globals.h diff -u ZendEngine2/zend_globals.h:1.126 ZendEngine2/zend_globals.h:1.127 --- ZendEngine2/zend_globals.h:1.126 Wed Jul 2 12:52:07 2003 +++ ZendEngine2/zend_globals.h Wed Jul 23 04:58:46 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_globals.h,v 1.126 2003/07/02 16:52:07 andi Exp $ */ +/* $Id: zend_globals.h,v 1.127 2003/07/23 08:58:46 stas Exp $ */ #ifndef ZEND_GLOBALS_H #define ZEND_GLOBALS_H @@ -121,7 +121,6 @@ zend_uint start_lineno; zend_bool increment_lineno; - zend_llist import_commands; znode implementing_class; zend_uint access_type; Index: ZendEngine2/zend_opcode.c diff -u ZendEngine2/zend_opcode.c:1.93 ZendEngine2/zend_opcode.c:1.94 --- ZendEngine2/zend_opcode.c:1.93 Mon Jun 30 16:22:35 2003 +++ ZendEngine2/zend_opcode.c Wed Jul 23 04:58:46 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_opcode.c,v 1.93 2003/06/30 20:22:35 andi Exp $ */ +/* $Id: zend_opcode.c,v 1.94 2003/07/23 08:58:46 stas Exp $ */ #include <stdio.h> @@ -132,7 +132,6 @@ /* Note that only run-time accessed data need to be cleaned up, pre-defined data can not contain objects and thus are not probelmatic */ zend_hash_clean((*pce)->static_members); - zend_hash_apply(&(*pce)->class_table, (apply_func_t) zend_cleanup_class_data TSRMLS_CC); zend_hash_apply(&(*pce)->function_table, (apply_func_t) zend_cleanup_function_data TSRMLS_CC); } return 0; @@ -154,7 +153,6 @@ zend_hash_destroy(&ce->function_table); FREE_HASHTABLE(ce->static_members); zend_hash_destroy(&ce->constants_table); - zend_hash_destroy(&ce->class_table); if (ce->num_interfaces > 0 && ce->interfaces) { efree(ce->interfaces); } @@ -171,7 +169,6 @@ zend_hash_destroy(&ce->function_table); free(ce->static_members); zend_hash_destroy(&ce->constants_table); - zend_hash_destroy(&ce->class_table); if (ce->num_interfaces > 0) { free(ce->interfaces); }