Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

- Avoid zend_do_ticks() call for each statement in parsing

  • Loading branch information...
commit 86ed2eeb5d7420fe67f0061e66106233904faeeb 1 parent a54847a
@felipensp felipensp authored
View
12 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);
}
/* }}} */
View
1  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() \
{ \
View
6 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(); }
;
Please sign in to comment.
Something went wrong with that request. Please try again.