diff options
Diffstat (limited to 'Zend/zend_vm_gen.php')
-rw-r--r-- | Zend/zend_vm_gen.php | 49 |
1 files changed, 38 insertions, 11 deletions
diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php index bc96a3b66..fc6c6177b 100644 --- a/Zend/zend_vm_gen.php +++ b/Zend/zend_vm_gen.php @@ -3,7 +3,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | @@ -24,7 +24,7 @@ $header_text = <<< DATA +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2013 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2014 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | @@ -143,6 +143,8 @@ $op1_get_zval_ptr_ptr = array( "UNUSED" => "NULL", "CV" => "_get_zval_ptr_ptr_cv_\\1(execute_data, opline->op1.var TSRMLS_CC)", ); +$op1_get_zval_ptr_ptr_fast = $op1_get_zval_ptr_ptr; +$op1_get_zval_ptr_ptr_fast["VAR"] = "_get_zval_ptr_ptr_var_fast(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)"; $op2_get_zval_ptr_ptr = array( "ANY" => "get_zval_ptr_ptr(opline->op2_type, &opline->op2, execute_data, &free_op2, \\1)", @@ -152,6 +154,8 @@ $op2_get_zval_ptr_ptr = array( "UNUSED" => "NULL", "CV" => "_get_zval_ptr_ptr_cv_\\1(execute_data, opline->op2.var TSRMLS_CC)", ); +$op2_get_zval_ptr_ptr_fast = $op2_get_zval_ptr_ptr; +$op2_get_zval_ptr_ptr_fast["VAR"] = "_get_zval_ptr_ptr_var_fast(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)"; $op1_get_obj_zval_ptr = array( "ANY" => "get_obj_zval_ptr(opline->op1_type, &opline->op1, execute_data, &free_op1, \\1)", @@ -179,6 +183,8 @@ $op1_get_obj_zval_ptr_ptr = array( "UNUSED" => "_get_obj_zval_ptr_ptr_unused(TSRMLS_C)", "CV" => "_get_zval_ptr_ptr_cv_\\1(execute_data, opline->op1.var TSRMLS_CC)", ); +$op1_get_obj_zval_ptr_ptr_fast = $op1_get_obj_zval_ptr_ptr; +$op1_get_obj_zval_ptr_ptr_fast["VAR"] = "_get_zval_ptr_ptr_var_fast(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)"; $op2_get_obj_zval_ptr_ptr = array( "ANY" => "get_obj_zval_ptr_ptr(opline->op2_type, &opline->op2, execute_data, &free_op2, \\1)", @@ -188,6 +194,8 @@ $op2_get_obj_zval_ptr_ptr = array( "UNUSED" => "_get_obj_zval_ptr_ptr_unused(TSRMLS_C)", "CV" => "_get_zval_ptr_ptr_cv_\\1(execute_data, opline->op2.var TSRMLS_CC)", ); +$op2_get_obj_zval_ptr_ptr_fast = $op2_get_obj_zval_ptr_ptr; +$op2_get_obj_zval_ptr_ptr_fast["VAR"] = "_get_zval_ptr_ptr_var_fast(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)"; $op1_is_tmp_free = array( "ANY" => "IS_TMP_FREE(free_op1)", @@ -210,7 +218,7 @@ $op2_is_tmp_free = array( $op1_free_op = array( "ANY" => "FREE_OP(free_op1)", "TMP" => "zval_dtor(free_op1.var)", - "VAR" => "if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}", + "VAR" => "zval_ptr_dtor_nogc(&free_op1.var)", "CONST" => "", "UNUSED" => "", "CV" => "", @@ -219,7 +227,7 @@ $op1_free_op = array( $op2_free_op = array( "ANY" => "FREE_OP(free_op2)", "TMP" => "zval_dtor(free_op2.var)", - "VAR" => "if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}", + "VAR" => "zval_ptr_dtor_nogc(&free_op2.var)", "CONST" => "", "UNUSED" => "", "CV" => "", @@ -228,7 +236,7 @@ $op2_free_op = array( $op1_free_op_if_var = array( "ANY" => "FREE_OP_IF_VAR(free_op1)", "TMP" => "", - "VAR" => "if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}", + "VAR" => "zval_ptr_dtor_nogc(&free_op1.var)", "CONST" => "", "UNUSED" => "", "CV" => "", @@ -237,29 +245,33 @@ $op1_free_op_if_var = array( $op2_free_op_if_var = array( "ANY" => "FREE_OP_IF_VAR(free_op2)", "TMP" => "", - "VAR" => "if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}", + "VAR" => "zval_ptr_dtor_nogc(&free_op2.var)", "CONST" => "", "UNUSED" => "", "CV" => "", ); $op1_free_op_var_ptr = array( - "ANY" => "if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}", + "ANY" => "if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}", "TMP" => "", - "VAR" => "if (free_op1.var) {zval_ptr_dtor(&free_op1.var);}", + "VAR" => "if (free_op1.var) {zval_ptr_dtor_nogc(&free_op1.var);}", "CONST" => "", "UNUSED" => "", "CV" => "", ); +$op1_free_op_var_ptr_fast = $op1_free_op_var_ptr; +$op1_free_op_var_ptr_fast["VAR"] = "zval_ptr_dtor_nogc(&free_op1.var)"; $op2_free_op_var_ptr = array( - "ANY" => "if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}", + "ANY" => "if (free_op2.var) {zval_ptr_dtor_nogc(&free_op2.var);}", "TMP" => "", - "VAR" => "if (free_op2.var) {zval_ptr_dtor(&free_op2.var);}", + "VAR" => "if (free_op2.var) {zval_ptr_dtor_nogc(&free_op2.var);}", "CONST" => "", "UNUSED" => "", "CV" => "", ); +$op2_free_op_var_ptr_fast = $op2_free_op_var_ptr; +$op2_free_op_var_ptr_fast["VAR"] = "zval_ptr_dtor_nogc(&free_op2.var)"; $list = array(); // list of opcode handlers and helpers in original order $opcodes = array(); // opcode handlers by code @@ -311,7 +323,10 @@ function gen_code($f, $spec, $kind, $export, $code, $op1, $op2, $name) { $op1_get_obj_zval_ptr_ptr, $op2_get_obj_zval_ptr_ptr, $op1_is_tmp_free, $op2_is_tmp_free, $op1_free, $op2_free, $op1_free_op, $op2_free_op, $op1_free_op_if_var, $op2_free_op_if_var, - $op1_free_op_var_ptr, $op2_free_op_var_ptr, $prefix; + $op1_free_op_var_ptr, $op2_free_op_var_ptr, $prefix, + $op1_get_zval_ptr_ptr_fast, $op2_get_zval_ptr_ptr_fast, + $op1_get_obj_zval_ptr_ptr_fast, $op2_get_obj_zval_ptr_ptr_fast, + $op1_free_op_var_ptr_fast, $op2_free_op_var_ptr_fast; // Specializing $code = preg_replace( @@ -336,6 +351,12 @@ function gen_code($f, $spec, $kind, $export, $code, $op1, $op2, $name) { "/FREE_OP2_IF_VAR\(\)/", "/FREE_OP1_VAR_PTR\(\)/", "/FREE_OP2_VAR_PTR\(\)/", + "/GET_OP1_ZVAL_PTR_PTR_FAST\(([^)]*)\)/", + "/GET_OP2_ZVAL_PTR_PTR_FAST\(([^)]*)\)/", + "/GET_OP1_OBJ_ZVAL_PTR_PTR_FAST\(([^)]*)\)/", + "/GET_OP2_OBJ_ZVAL_PTR_PTR_FAST\(([^)]*)\)/", + "/FREE_OP1_VAR_PTR_FAST\(\)/", + "/FREE_OP2_VAR_PTR_FAST\(\)/", "/^#ifdef\s+ZEND_VM_SPEC\s*\n/m", "/^#ifndef\s+ZEND_VM_SPEC\s*\n/m", "/\!defined\(ZEND_VM_SPEC\)/m", @@ -368,6 +389,12 @@ function gen_code($f, $spec, $kind, $export, $code, $op1, $op2, $name) { $op2_free_op_if_var[$op2], $op1_free_op_var_ptr[$op1], $op2_free_op_var_ptr[$op2], + $op1_get_zval_ptr_ptr_fast[$op1], + $op2_get_zval_ptr_ptr_fast[$op2], + $op1_get_obj_zval_ptr_ptr_fast[$op1], + $op2_get_obj_zval_ptr_ptr_fast[$op2], + $op1_free_op_var_ptr_fast[$op1], + $op2_free_op_var_ptr_fast[$op2], ($op1!="ANY"||$op2!="ANY")?"#if 1\n":"#if 0\n", ($op1!="ANY"||$op2!="ANY")?"#if 0\n":"#if 1\n", ($op1!="ANY"||$op2!="ANY")?"0":"1", |