diff options
author | Felipe Pena <felipe@php.net> | 2011-06-12 01:43:10 +0000 |
---|---|---|
committer | Felipe Pena <felipe@php.net> | 2011-06-12 01:43:10 +0000 |
commit | 86ed2eeb5d7420fe67f0061e66106233904faeeb (patch) | |
tree | 00a7043012821917aa09539ac5faacce41ed52de | |
parent | a54847a0fbfa7e585cd82e71db697dc663593061 (diff) | |
download | php-git-86ed2eeb5d7420fe67f0061e66106233904faeeb.tar.gz |
- Avoid zend_do_ticks() call for each statement in parsing
-rw-r--r-- | Zend/zend_compile.c | 12 | ||||
-rw-r--r-- | Zend/zend_compile.h | 1 | ||||
-rw-r--r-- | Zend/zend_language_parser.y | 6 |
3 files changed, 9 insertions, 10 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index d6ac7e3e4d..9b5166f9ae 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -4901,14 +4901,12 @@ void zend_do_extended_fcall_end(TSRMLS_D) /* {{{ */ void zend_do_ticks(TSRMLS_D) /* {{{ */ { - if (Z_LVAL(CG(declarables).ticks)) { - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); + zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); - opline->opcode = ZEND_TICKS; - opline->op1.u.constant = CG(declarables).ticks; - opline->op1.op_type = IS_CONST; - SET_UNUSED(opline->op2); - } + opline->opcode = ZEND_TICKS; + opline->op1.u.constant = CG(declarables).ticks; + opline->op1.op_type = IS_CONST; + SET_UNUSED(opline->op2); } /* }}} */ diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index cbbb6722a5..cd8be85388 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -39,6 +39,7 @@ #define INC_BPC(op_array) if (op_array->fn_flags & ZEND_ACC_INTERACTIVE) { ((op_array)->backpatch_count++); } #define DEC_BPC(op_array) if (op_array->fn_flags & ZEND_ACC_INTERACTIVE) { ((op_array)->backpatch_count--); } #define HANDLE_INTERACTIVE() if (CG(active_op_array)->fn_flags & ZEND_ACC_INTERACTIVE) { execute_new_code(TSRMLS_C); } +#define DO_TICKS() if (Z_LVAL(CG(declarables).ticks)) { zend_do_ticks(TSRMLS_C); } #define RESET_DOC_COMMENT() \ { \ diff --git a/Zend/zend_language_parser.y b/Zend/zend_language_parser.y index d4881bd162..9ad186e7d3 100644 --- a/Zend/zend_language_parser.y +++ b/Zend/zend_language_parser.y @@ -211,7 +211,7 @@ inner_statement: statement: - unticked_statement { zend_do_ticks(TSRMLS_C); } + unticked_statement { DO_TICKS(); } | T_STRING ':' { zend_do_label(&$1 TSRMLS_CC); } ; @@ -291,11 +291,11 @@ unset_variable: ; function_declaration_statement: - unticked_function_declaration_statement { zend_do_ticks(TSRMLS_C); } + unticked_function_declaration_statement { DO_TICKS(); } ; class_declaration_statement: - unticked_class_declaration_statement { zend_do_ticks(TSRMLS_C); } + unticked_class_declaration_statement { DO_TICKS(); } ; |