]> 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 1cad70f77a2055c2eed317c6e65f00efa39920b7..2f3fad9ba482d928df60a0ad864f3a929c87acaf 100644 (file)
@@ -6170,14 +6170,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;
-               SET_UNUSED(opline->op1);
-               SET_UNUSED(opline->op2);
-               opline->extended_value = Z_LVAL(CG(declarables).ticks);
-       }
+       opline->opcode = ZEND_TICKS;
+       SET_UNUSED(opline->op1);
+       SET_UNUSED(opline->op2);
+       opline->extended_value = Z_LVAL(CG(declarables).ticks);
 }
 /* }}} */
 
index 9aeac1416ce182b8f11fb931e59c5d3219c0b1e1..8ce7c405f80a9aabbb186a2eebf34699cab55537 100644 (file)
@@ -39,6 +39,7 @@
 #define INC_BPC(op_array)      if (op_array->fn_flags & ZEND_ACC_INTERACTIVE) { (CG(context).backpatch_count++); }
 #define DEC_BPC(op_array)      if (op_array->fn_flags & ZEND_ACC_INTERACTIVE) { (CG(context).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 e0a956bc23e6195bbec0e8c0f0d97148064623d9..e3d079c5519404a0032eca14bf7838bc157d08fb 100644 (file)
@@ -213,7 +213,7 @@ inner_statement:
 
 
 statement:
-               unticked_statement { zend_do_ticks(TSRMLS_C); }
+               unticked_statement { DO_TICKS(); }
        |       T_STRING ':' { zend_do_label(&$1 TSRMLS_CC); }
 ;
 
@@ -293,11 +293,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(); }
 ;