Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

- Avoid zend_do_ticks() call for each statement in parsing

  • Loading branch information...
commit 86ed2eeb5d7420fe67f0061e66106233904faeeb 1 parent a54847a
Felipe Pena felipensp authored
12 Zend/zend_compile.c
@@ -4901,14 +4901,12 @@ void zend_do_extended_fcall_end(TSRMLS_D) /* {{{ */
4901 4901
4902 4902 void zend_do_ticks(TSRMLS_D) /* {{{ */
4903 4903 {
4904   - if (Z_LVAL(CG(declarables).ticks)) {
4905   - zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
  4904 + zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
4906 4905
4907   - opline->opcode = ZEND_TICKS;
4908   - opline->op1.u.constant = CG(declarables).ticks;
4909   - opline->op1.op_type = IS_CONST;
4910   - SET_UNUSED(opline->op2);
4911   - }
  4906 + opline->opcode = ZEND_TICKS;
  4907 + opline->op1.u.constant = CG(declarables).ticks;
  4908 + opline->op1.op_type = IS_CONST;
  4909 + SET_UNUSED(opline->op2);
4912 4910 }
4913 4911 /* }}} */
4914 4912
1  Zend/zend_compile.h
@@ -39,6 +39,7 @@
39 39 #define INC_BPC(op_array) if (op_array->fn_flags & ZEND_ACC_INTERACTIVE) { ((op_array)->backpatch_count++); }
40 40 #define DEC_BPC(op_array) if (op_array->fn_flags & ZEND_ACC_INTERACTIVE) { ((op_array)->backpatch_count--); }
41 41 #define HANDLE_INTERACTIVE() if (CG(active_op_array)->fn_flags & ZEND_ACC_INTERACTIVE) { execute_new_code(TSRMLS_C); }
  42 +#define DO_TICKS() if (Z_LVAL(CG(declarables).ticks)) { zend_do_ticks(TSRMLS_C); }
42 43
43 44 #define RESET_DOC_COMMENT() \
44 45 { \
6 Zend/zend_language_parser.y
@@ -211,7 +211,7 @@ inner_statement:
211 211
212 212
213 213 statement:
214   - unticked_statement { zend_do_ticks(TSRMLS_C); }
  214 + unticked_statement { DO_TICKS(); }
215 215 | T_STRING ':' { zend_do_label(&$1 TSRMLS_CC); }
216 216 ;
217 217
@@ -291,11 +291,11 @@ unset_variable:
291 291 ;
292 292
293 293 function_declaration_statement:
294   - unticked_function_declaration_statement { zend_do_ticks(TSRMLS_C); }
  294 + unticked_function_declaration_statement { DO_TICKS(); }
295 295 ;
296 296
297 297 class_declaration_statement:
298   - unticked_class_declaration_statement { zend_do_ticks(TSRMLS_C); }
  298 + unticked_class_declaration_statement { DO_TICKS(); }
299 299 ;
300 300
301 301

0 comments on commit 86ed2ee

Please sign in to comment.
Something went wrong with that request. Please try again.