com php-src: Emit EXT_STMT for each statement: Zend /zend_compile.c
| From: | Nikita Popov | Date: | Wed, 22 Jul 2015 11:38:42 +0000 |
| Subject: | com php-src: Emit EXT_STMT for each statement: Zend /zend_compile.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-88112@lists.php.net to get a copy of this message | ||
Commit: cff6cbc01f64029abe76421d332e91ed655b5b43
Author: Nikita Popov <nikic@php.net> Wed, 22 Jul 2015 13:12:54 +0200
Parents: f56b89b0affebc916ec3c8f3275d31933dc76841
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cff6cbc01f64029abe76421d332e91ed655b5b43
Log:
Emit EXT_STMT for each statement
I'm excluding unticked statements for this (in 5.x they were included)
as this would just result in two consecutive EXT_STMTs.
Also add all class statements to unticked statements, these would
generate superfluous EXT_STMT/TICKS in the parent op_array.
Changed paths:
M Zend/zend_compile.c
Diff:
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index ce43658..64ad77d 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -2047,7 +2047,9 @@ static inline zend_bool zend_is_call(zend_ast *ast) /* {{{ */
static inline zend_bool zend_is_unticked_stmt(zend_ast *ast) /* {{{ */
{
- return ast->kind == ZEND_AST_STMT_LIST || ast->kind == ZEND_AST_LABEL;
+ return ast->kind == ZEND_AST_STMT_LIST || ast->kind == ZEND_AST_LABEL
+ || ast->kind == ZEND_AST_PROP_DECL || ast->kind == ZEND_AST_CLASS_CONST_DECL
+ || ast->kind == ZEND_AST_USE_TRAIT || ast->kind == ZEND_AST_METHOD;
}
/* }}} */
@@ -6969,6 +6971,10 @@ void zend_compile_stmt(zend_ast *ast) /* {{{ */
CG(zend_lineno) = ast->lineno;
+ if ((CG(compiler_options) & ZEND_COMPILE_EXTENDED_INFO) &&
!zend_is_unticked_stmt(ast)) {
+ zend_do_extended_info();
+ }
+
switch (ast->kind) {
case ZEND_AST_STMT_LIST:
zend_compile_stmt_list(ast);