cvs: ZendEngine2 / zend_vm_def.h zend_vm_execute.h

[email protected] ("Dmitry Stogov")
Newsgroups php.zend-engine.cvs
Message-ID <cvsdmitry1209552265@cvsserver>
dmitry		Wed Apr 30 10:44:25 2008 UTC

  Modified files:              
    /ZendEngine2	zend_vm_def.h zend_vm_execute.h 
  Log:
  IS_CONST operands are always have is_ref==1 and refcount==2, so we can eliminate
   unnecessary checks at specialization/compilation stage
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_vm_def.h?r1=1.226&r2=1.227&diff_format=u
Index: ZendEngine2/zend_vm_def.h
diff -u ZendEngine2/zend_vm_def.h:1.226 ZendEngine2/zend_vm_def.h:1.227
--- ZendEngine2/zend_vm_def.h:1.226	Tue Apr 29 08:15:49 2008
+++ ZendEngine2/zend_vm_def.h	Wed Apr 30 10:44:24 2008
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_vm_def.h,v 1.226 2008/04/29 08:15:49 dmitry Exp $ */
+/* $Id: zend_vm_def.h,v 1.227 2008/04/30 10:44:24 dmitry Exp $ */
 
 /* If you change this file, please regenerate the zend_vm_execute.h and
  * zend_vm_opcodes.h files by running:
@@ -2374,7 +2374,8 @@
 				FREE_OP1();
 			}
 		} else if (!IS_OP1_TMP_FREE()) { /* Not a temp var */
-			if (EG(active_op_array)->return_reference == ZEND_RETURN_REF ||
+			if (OP1_TYPE == IS_CONST ||
+			    EG(active_op_array)->return_reference == ZEND_RETURN_REF ||
 			    (PZVAL_IS_REF(retval_ptr) && Z_REFCOUNT_P(retval_ptr) > 0)) {
 				zval *ret;
 
@@ -2964,7 +2965,7 @@
 			Z_ADDREF_P(expr_ptr);
 		} else
 #endif
-		if (PZVAL_IS_REF(expr_ptr)) {
+		if (OP1_TYPE == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
 			zval *new_expr;
 
 			ALLOC_ZVAL(new_expr);
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_vm_execute.h?r1=1.230&r2=1.231&diff_format=u
Index: ZendEngine2/zend_vm_execute.h
diff -u ZendEngine2/zend_vm_execute.h:1.230 ZendEngine2/zend_vm_execute.h:1.231
--- ZendEngine2/zend_vm_execute.h:1.230	Tue Apr 29 08:15:49 2008
+++ ZendEngine2/zend_vm_execute.h	Wed Apr 30 10:44:24 2008
@@ -1429,7 +1429,8 @@
 
 			}
 		} else if (!0) { /* Not a temp var */
-			if (EG(active_op_array)->return_reference == ZEND_RETURN_REF ||
+			if (IS_CONST == IS_CONST ||
+			    EG(active_op_array)->return_reference == ZEND_RETURN_REF ||
 			    (PZVAL_IS_REF(retval_ptr) && Z_REFCOUNT_P(retval_ptr) > 0)) {
 				zval *ret;
 
@@ -2716,7 +2717,7 @@
 			Z_ADDREF_P(expr_ptr);
 		} else
 #endif
-		if (PZVAL_IS_REF(expr_ptr)) {
+		if (IS_CONST == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
 			zval *new_expr;
 
 			ALLOC_ZVAL(new_expr);
@@ -3223,7 +3224,7 @@
 			Z_ADDREF_P(expr_ptr);
 		} else
 #endif
-		if (PZVAL_IS_REF(expr_ptr)) {
+		if (IS_CONST == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
 			zval *new_expr;
 
 			ALLOC_ZVAL(new_expr);
@@ -3692,7 +3693,7 @@
 			Z_ADDREF_P(expr_ptr);
 		} else
 #endif
-		if (PZVAL_IS_REF(expr_ptr)) {
+		if (IS_CONST == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
 			zval *new_expr;
 
 			ALLOC_ZVAL(new_expr);
@@ -3885,7 +3886,7 @@
 			Z_ADDREF_P(expr_ptr);
 		} else
 #endif
-		if (PZVAL_IS_REF(expr_ptr)) {
+		if (IS_CONST == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
 			zval *new_expr;
 
 			ALLOC_ZVAL(new_expr);
@@ -4353,7 +4354,7 @@
 			Z_ADDREF_P(expr_ptr);
 		} else
 #endif
-		if (PZVAL_IS_REF(expr_ptr)) {
+		if (IS_CONST == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
 			zval *new_expr;
 
 			ALLOC_ZVAL(new_expr);
@@ -4780,7 +4781,8 @@
 				zval_dtor(free_op1.var);
 			}
 		} else if (!1) { /* Not a temp var */
-			if (EG(active_op_array)->return_reference == ZEND_RETURN_REF ||
+			if (IS_TMP_VAR == IS_CONST ||
+			    EG(active_op_array)->return_reference == ZEND_RETURN_REF ||
 			    (PZVAL_IS_REF(retval_ptr) && Z_REFCOUNT_P(retval_ptr) > 0)) {
 				zval *ret;
 
@@ -6009,7 +6011,7 @@
 			Z_ADDREF_P(expr_ptr);
 		} else
 #endif
-		if (PZVAL_IS_REF(expr_ptr)) {
+		if (IS_TMP_VAR == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
 			zval *new_expr;
 
 			ALLOC_ZVAL(new_expr);
@@ -6472,7 +6474,7 @@
 			Z_ADDREF_P(expr_ptr);
 		} else
 #endif
-		if (PZVAL_IS_REF(expr_ptr)) {
+		if (IS_TMP_VAR == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
 			zval *new_expr;
 
 			ALLOC_ZVAL(new_expr);
@@ -6935,7 +6937,7 @@
 			Z_ADDREF_P(expr_ptr);
 		} else
 #endif
-		if (PZVAL_IS_REF(expr_ptr)) {
+		if (IS_TMP_VAR == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
 			zval *new_expr;
 
 			ALLOC_ZVAL(new_expr);
@@ -7029,7 +7031,7 @@
 			Z_ADDREF_P(expr_ptr);
 		} else
 #endif
-		if (PZVAL_IS_REF(expr_ptr)) {
+		if (IS_TMP_VAR == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
 			zval *new_expr;
 
 			ALLOC_ZVAL(new_expr);
@@ -7489,7 +7491,7 @@
 			Z_ADDREF_P(expr_ptr);
 		} else
 #endif
-		if (PZVAL_IS_REF(expr_ptr)) {
+		if (IS_TMP_VAR == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
 			zval *new_expr;
 
 			ALLOC_ZVAL(new_expr);
@@ -8068,7 +8070,8 @@
 				if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
 			}
 		} else if (!0) { /* Not a temp var */
-			if (EG(active_op_array)->return_reference == ZEND_RETURN_REF ||
+			if (IS_VAR == IS_CONST ||
+			    EG(active_op_array)->return_reference == ZEND_RETURN_REF ||
 			    (PZVAL_IS_REF(retval_ptr) && Z_REFCOUNT_P(retval_ptr) > 0)) {
 				zval *ret;
 
@@ -10662,7 +10665,7 @@
 			Z_ADDREF_P(expr_ptr);
 		} else
 #endif
-		if (PZVAL_IS_REF(expr_ptr)) {
+		if (IS_VAR == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
 			zval *new_expr;
 
 			ALLOC_ZVAL(new_expr);
@@ -12479,7 +12482,7 @@
 			Z_ADDREF_P(expr_ptr);
 		} else
 #endif
-		if (PZVAL_IS_REF(expr_ptr)) {
+		if (IS_VAR == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
 			zval *new_expr;
 
 			ALLOC_ZVAL(new_expr);
@@ -14337,7 +14340,7 @@
 			Z_ADDREF_P(expr_ptr);
 		} else
 #endif
-		if (PZVAL_IS_REF(expr_ptr)) {
+		if (IS_VAR == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
 			zval *new_expr;
 
 			ALLOC_ZVAL(new_expr);
@@ -15261,7 +15264,7 @@
 			Z_ADDREF_P(expr_ptr);
 		} else
 #endif
-		if (PZVAL_IS_REF(expr_ptr)) {
+		if (IS_VAR == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
 			zval *new_expr;
 
 			ALLOC_ZVAL(new_expr);
@@ -16800,7 +16803,7 @@
 			Z_ADDREF_P(expr_ptr);
 		} else
 #endif
-		if (PZVAL_IS_REF(expr_ptr)) {
+		if (IS_VAR == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
 			zval *new_expr;
 
 			ALLOC_ZVAL(new_expr);
@@ -22386,7 +22389,8 @@
 
 			}
 		} else if (!0) { /* Not a temp var */
-			if (EG(active_op_array)->return_reference == ZEND_RETURN_REF ||
+			if (IS_CV == IS_CONST ||
+			    EG(active_op_array)->return_reference == ZEND_RETURN_REF ||
 			    (PZVAL_IS_REF(retval_ptr) && Z_REFCOUNT_P(retval_ptr) > 0)) {
 				zval *ret;
 
@@ -24634,7 +24638,7 @@
 			Z_ADDREF_P(expr_ptr);
 		} else
 #endif
-		if (PZVAL_IS_REF(expr_ptr)) {
+		if (IS_CV == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
 			zval *new_expr;
 
 			ALLOC_ZVAL(new_expr);
@@ -26340,7 +26344,7 @@
 			Z_ADDREF_P(expr_ptr);
 		} else
 #endif
-		if (PZVAL_IS_REF(expr_ptr)) {
+		if (IS_CV == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
 			zval *new_expr;
 
 			ALLOC_ZVAL(new_expr);
@@ -28086,7 +28090,7 @@
 			Z_ADDREF_P(expr_ptr);
 		} else
 #endif
-		if (PZVAL_IS_REF(expr_ptr)) {
+		if (IS_CV == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
 			zval *new_expr;
 
 			ALLOC_ZVAL(new_expr);
@@ -28905,7 +28909,7 @@
 			Z_ADDREF_P(expr_ptr);
 		} else
 #endif
-		if (PZVAL_IS_REF(expr_ptr)) {
+		if (IS_CV == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
 			zval *new_expr;
 
 			ALLOC_ZVAL(new_expr);
@@ -30336,7 +30340,7 @@
 			Z_ADDREF_P(expr_ptr);
 		} else
 #endif
-		if (PZVAL_IS_REF(expr_ptr)) {
+		if (IS_CV == IS_CONST || PZVAL_IS_REF(expr_ptr)) {
 			zval *new_expr;
 
 			ALLOC_ZVAL(new_expr);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.