]> granicus.if.org Git - php/commitdiff
- Avoid zend_do_ticks() call for each statement in parsing
authorFelipe Pena <felipe@php.net>
Sun, 12 Jun 2011 01:43:10 +0000 (01:43 +0000)
committerFelipe Pena <felipe@php.net>
Sun, 12 Jun 2011 01:43:10 +0000 (01:43 +0000)
Zend/zend_compile.c
Zend/zend_compile.h
Zend/zend_language_parser.y

index d6ac7e3e4dccfd0ae43b483d3a558755f3c1b0f4..9b5166f9aec8ad6ddad80e23521227ff607c0573 100644 (file)
@@ -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);
 }
 /* }}} */
 
index cbbb6722a53d622dca2458af114a0df4db6bf7e1..cd8be85388dbc176f994a1cc3de969cfa6721804 100644 (file)
@@ -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()        \
     {                              \
index d4881bd1624bfd004e52cea52bb970267bc1bab1..9ad186e7d3d51b7c3a9b17d1f89ea6b19fdb509b 100644 (file)
@@ -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(); }
 ;