cvs: ZendEngine2(PHP_5_3) / zend_compile.c zend_vm_def.h zend_vm_execute.h

[email protected] ("Dmitry Stogov") Tue, 10 Mar 2009 10:01:49 -0000
Newsgroups php.zend-engine.cvs
Message-ID <cvsdmitry1236679309@cvsserver>
dmitry		Tue Mar 10 10:01:49 2009 UTC

  Modified files:              (Branch: PHP_5_3)
    /ZendEngine2	zend_compile.c zend_vm_def.h zend_vm_execute.h 
  Log:
  Clenaup deprecated namespace code
dmitry-20090310100149.txt (text/plain, 8.7 KB)
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?r1=1.647.2.27.2.41.2.102&r2=1.647.2.27.2.41.2.103&diff_format=u
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.647.2.27.2.41.2.102 ZendEngine2/zend_compile.c:1.647.2.27.2.41.2.103
--- ZendEngine2/zend_compile.c:1.647.2.27.2.41.2.102	Mon Jan 26 22:54:19 2009
+++ ZendEngine2/zend_compile.c	Tue Mar 10 10:01:44 2009
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_compile.c,v 1.647.2.27.2.41.2.102 2009/01/26 22:54:19 cseiler Exp $ */
+/* $Id: zend_compile.c,v 1.647.2.27.2.41.2.103 2009/03/10 10:01:44 dmitry Exp $ */
 
 #include <zend_language_parser.h>
 #include "zend.h"
@@ -1990,25 +1990,6 @@
 	zend_op *opline;
 	ulong fetch_type = 0;
 
-#if 0
-	if (class_name->op_type == IS_CONST &&
-	    Z_TYPE(class_name->u.constant) == IS_STRING &&
-	    Z_STRLEN(class_name->u.constant) == 0) {
-		/* namespace\func() not in namespace */
-		zval_dtor(&class_name->u.constant);
-		if (CG(current_namespace)) {
-			znode tmp;
-
-			tmp.op_type = IS_CONST;
-			tmp.u.constant = *CG(current_namespace);
-			zval_copy_ctor(&tmp.u.constant);
-			zend_do_build_namespace_name(&tmp, &tmp, method_name TSRMLS_CC);
-			*method_name = tmp;
-		}
-		return zend_do_begin_function_call(method_name, 0 TSRMLS_CC);
-	}
-#endif
-
 	if (method_name->op_type == IS_CONST) {
 		char *lcname = zend_str_tolower_dup(Z_STRVAL(method_name->u.constant), Z_STRLEN(method_name->u.constant));
 		if ((sizeof(ZEND_CONSTRUCTOR_FUNC_NAME)-1) == Z_STRLEN(method_name->u.constant) &&
@@ -2020,7 +2001,6 @@
 	}
 
 	if (class_name->op_type == IS_CONST &&
-		method_name->op_type == IS_CONST &&
 	    ZEND_FETCH_CLASS_DEFAULT == zend_get_class_fetch_type(Z_STRVAL(class_name->u.constant), Z_STRLEN(class_name->u.constant))) {
 		fetch_type = ZEND_FETCH_CLASS_GLOBAL;
 		zend_resolve_class_name(class_name, &fetch_type, 1 TSRMLS_CC);
@@ -2033,32 +2013,6 @@
 	opline->op1 = class_node;
 	opline->op2 = *method_name;
 
-	if (class_node.op_type == IS_CONST &&
-		method_name->op_type == IS_CONST) {
-		/* Prebuild ns\func name to speedup run-time check.
-		   The additional names are stored in additional OP_DATA opcode. */
-		char *nsname, *fname;
-		unsigned int nsname_len, len;
-
-		opline = get_next_op(CG(active_op_array) TSRMLS_CC);
-		opline->opcode = ZEND_OP_DATA;
-		opline->op1.op_type = IS_CONST;
-		SET_UNUSED(opline->op2);
-
-		nsname = Z_STRVAL(class_node.u.constant);
-		nsname_len = Z_STRLEN(class_node.u.constant);
-		len = nsname_len + 1 + Z_STRLEN(method_name->u.constant);
-		fname = emalloc(len + 1);
-		memcpy(fname, nsname, nsname_len);
-		fname[nsname_len] = '\\';
-		memcpy(fname + nsname_len + 1,
-			Z_STRVAL(method_name->u.constant),
-			Z_STRLEN(method_name->u.constant)+1);
-		zend_str_tolower(fname, len);
-		opline->extended_value = zend_hash_func(fname, len + 1);
-		ZVAL_STRINGL(&opline->op1.u.constant, fname, len, 0);
- 	}
-
 	zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
 	zend_do_extended_fcall_begin(TSRMLS_C);
 	return 1; /* Dynamic */
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_vm_def.h?r1=1.59.2.29.2.48.2.84&r2=1.59.2.29.2.48.2.85&diff_format=u
Index: ZendEngine2/zend_vm_def.h
diff -u ZendEngine2/zend_vm_def.h:1.59.2.29.2.48.2.84 ZendEngine2/zend_vm_def.h:1.59.2.29.2.48.2.85
--- ZendEngine2/zend_vm_def.h:1.59.2.29.2.48.2.84	Mon Jan 26 22:54:20 2009
+++ ZendEngine2/zend_vm_def.h	Tue Mar 10 10:01:44 2009
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_vm_def.h,v 1.59.2.29.2.48.2.84 2009/01/26 22:54:20 cseiler Exp $ */
+/* $Id: zend_vm_def.h,v 1.59.2.29.2.48.2.85 2009/03/10 10:01:44 dmitry Exp $ */
 
 /* If you change this file, please regenerate the zend_vm_execute.h and
  * zend_vm_opcodes.h files by running:
@@ -1961,10 +1961,7 @@
 
 	zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
 
-	if (OP1_TYPE == IS_CONST && OP2_TYPE == IS_CONST) {
-
-		ZEND_VM_INC_OPCODE();
-
+	if (OP1_TYPE == IS_CONST) {
 		/* no function found. try a static method in class */
 		ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
 		if (!ce) {
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_vm_execute.h?r1=1.62.2.30.2.49.2.84&r2=1.62.2.30.2.49.2.85&diff_format=u
Index: ZendEngine2/zend_vm_execute.h
diff -u ZendEngine2/zend_vm_execute.h:1.62.2.30.2.49.2.84 ZendEngine2/zend_vm_execute.h:1.62.2.30.2.49.2.85
--- ZendEngine2/zend_vm_execute.h:1.62.2.30.2.49.2.84	Mon Jan 26 22:54:22 2009
+++ ZendEngine2/zend_vm_execute.h	Tue Mar 10 10:01:44 2009
@@ -2593,10 +2593,7 @@
 
 	zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
 
-	if (IS_CONST == IS_CONST && IS_CONST == IS_CONST) {
-
-		ZEND_VM_INC_OPCODE();
-
+	if (IS_CONST == IS_CONST) {
 		/* no function found. try a static method in class */
 		ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
 		if (!ce) {
@@ -3169,10 +3166,7 @@
 
 	zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
 
-	if (IS_CONST == IS_CONST && IS_TMP_VAR == IS_CONST) {
-
-		ZEND_VM_INC_OPCODE();
-
+	if (IS_CONST == IS_CONST) {
 		/* no function found. try a static method in class */
 		ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
 		if (!ce) {
@@ -3640,10 +3634,7 @@
 
 	zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
 
-	if (IS_CONST == IS_CONST && IS_VAR == IS_CONST) {
-
-		ZEND_VM_INC_OPCODE();
-
+	if (IS_CONST == IS_CONST) {
 		/* no function found. try a static method in class */
 		ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
 		if (!ce) {
@@ -3867,10 +3858,7 @@
 
 	zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
 
-	if (IS_CONST == IS_CONST && IS_UNUSED == IS_CONST) {
-
-		ZEND_VM_INC_OPCODE();
-
+	if (IS_CONST == IS_CONST) {
 		/* no function found. try a static method in class */
 		ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
 		if (!ce) {
@@ -4306,10 +4294,7 @@
 
 	zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
 
-	if (IS_CONST == IS_CONST && IS_CV == IS_CONST) {
-
-		ZEND_VM_INC_OPCODE();
-
+	if (IS_CONST == IS_CONST) {
 		/* no function found. try a static method in class */
 		ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
 		if (!ce) {
@@ -10323,10 +10308,7 @@
 
 	zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
 
-	if (IS_VAR == IS_CONST && IS_CONST == IS_CONST) {
-
-		ZEND_VM_INC_OPCODE();
-
+	if (IS_VAR == IS_CONST) {
 		/* no function found. try a static method in class */
 		ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
 		if (!ce) {
@@ -12162,10 +12144,7 @@
 
 	zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
 
-	if (IS_VAR == IS_CONST && IS_TMP_VAR == IS_CONST) {
-
-		ZEND_VM_INC_OPCODE();
-
+	if (IS_VAR == IS_CONST) {
 		/* no function found. try a static method in class */
 		ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
 		if (!ce) {
@@ -13996,10 +13975,7 @@
 
 	zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
 
-	if (IS_VAR == IS_CONST && IS_VAR == IS_CONST) {
-
-		ZEND_VM_INC_OPCODE();
-
+	if (IS_VAR == IS_CONST) {
 		/* no function found. try a static method in class */
 		ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
 		if (!ce) {
@@ -14918,10 +14894,7 @@
 
 	zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
 
-	if (IS_VAR == IS_CONST && IS_UNUSED == IS_CONST) {
-
-		ZEND_VM_INC_OPCODE();
-
+	if (IS_VAR == IS_CONST) {
 		/* no function found. try a static method in class */
 		ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
 		if (!ce) {
@@ -16439,10 +16412,7 @@
 
 	zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
 
-	if (IS_VAR == IS_CONST && IS_CV == IS_CONST) {
-
-		ZEND_VM_INC_OPCODE();
-
+	if (IS_VAR == IS_CONST) {
 		/* no function found. try a static method in class */
 		ce = zend_fetch_class(Z_STRVAL(opline->op1.u.constant), Z_STRLEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
 		if (!ce) {