cvs: ZendEngine2(PHP_5_3) / zend_vm_gen.php

"Marcus Boerger" <[email protected]>
Newsgroups gmane.comp.php.cvs.zend
Message-ID <cvshelly1216628064@cvsserver>
helly		Mon Jul 21 08:14:24 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /ZendEngine2	zend_vm_gen.php 
  Log:
  - MFH Little debug hack to allow printing vm function
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_vm_gen.php?r1=1.12.2.5.2.4.2.3&r2=1.12.2.5.2.4.2.4&diff_format=u
Index: ZendEngine2/zend_vm_gen.php
diff -u ZendEngine2/zend_vm_gen.php:1.12.2.5.2.4.2.3 ZendEngine2/zend_vm_gen.php:1.12.2.5.2.4.2.4
--- ZendEngine2/zend_vm_gen.php:1.12.2.5.2.4.2.3	Wed Jun 11 13:18:41 2008
+++ ZendEngine2/zend_vm_gen.php	Mon Jul 21 08:14:24 2008
@@ -16,7 +16,7 @@
    | Authors: Dmitry Stogov <[email protected]>                             |
    +----------------------------------------------------------------------+
 
-	 $Id: zend_vm_gen.php,v 1.12.2.5.2.4.2.3 2008/06/11 13:18:41 dmitry Exp $
+	 $Id: zend_vm_gen.php,v 1.12.2.5.2.4.2.4 2008/07/21 08:14:24 helly Exp $
 */
 
 $header_text = <<< DATA
@@ -304,7 +304,7 @@
 }
 
 // Generates code for opcode handler or helper
-function gen_code($f, $spec, $kind, $export, $code, $op1, $op2) {
+function gen_code($f, $spec, $kind, $export, $code, $op1, $op2, $name) {
 	global $op1_type, $op2_type, $op1_get_zval_ptr, $op2_get_zval_ptr,
 		$op1_get_zval_ptr_ptr, $op2_get_zval_ptr_ptr,
 		$op1_get_obj_zval_ptr, $op2_get_obj_zval_ptr,
@@ -381,6 +381,9 @@
 		),
 		$code);
 
+	if (0 && strpos($code, '{') === 0) {
+		$code = "{\n\tfprintf(stderr, \"$name\\n\");\n" . substr($code, 1);
+	}
 	// Updating code according to selected threading model
 	switch($kind) {
 		case ZEND_VM_KIND_CALL:
@@ -506,7 +509,7 @@
 	}
 
 	// Generate opcode handler's code
-	gen_code($f, $spec, $kind, 0, $code, $op1, $op2);
+	gen_code($f, $spec, $kind, 0, $code, $op1, $op2, $name);
 }
 
 // Generates helper
@@ -537,7 +540,7 @@
 	}
 
 	// Generate helper's code
-	gen_code($f, $spec, $kind, 0, $code, $op1, $op2);
+	gen_code($f, $spec, $kind, 0, $code, $op1, $op2, $name);
 }
 
 // Generates array of opcode handlers (specialized or unspecialized)
@@ -1254,7 +1257,7 @@
 			}
 		}
 		if (!$done) {
-			gen_code($f, 0, ZEND_VM_KIND_CALL, 1, $code, 'ANY', 'ANY');
+			gen_code($f, 0, ZEND_VM_KIND_CALL, 1, $code, 'ANY', 'ANY', $name);
 		}
 	}
 



-- 
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
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.