- Avoid zend_do_ticks() call for each statement in parsing

This commit is contained in:
Felipe Pena 2011-06-12 01:43:10 +00:00
parent 8d52500d41
commit 80d432ca62
3 changed files with 9 additions and 10 deletions

View File

@ -6170,7 +6170,6 @@ 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);
opline->opcode = ZEND_TICKS;
@ -6178,7 +6177,6 @@ void zend_do_ticks(TSRMLS_D) /* {{{ */
SET_UNUSED(opline->op2);
opline->extended_value = Z_LVAL(CG(declarables).ticks);
}
}
/* }}} */
zend_bool zend_is_auto_global(const char *name, uint name_len TSRMLS_DC) /* {{{ */

View 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() \
{ \

View 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(); }
;