summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Zend/zend_compile.c18
-rw-r--r--Zend/zend_compile.h32
-rw-r--r--Zend/zend_opcode.c6
-rw-r--r--ext/opcache/Optimizer/zend_cfg.c4
-rw-r--r--ext/opcache/Optimizer/zend_dump.c7
-rw-r--r--ext/opcache/Optimizer/zend_func_info.h3
6 files changed, 39 insertions, 31 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 0f978ca8d3..7260cba5a6 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -1410,11 +1410,11 @@ static void zend_add_to_list(void *result, void *item) /* {{{ */
}
/* }}} */
-void zend_do_extended_info(void) /* {{{ */
+void zend_do_extended_stmt(void) /* {{{ */
{
zend_op *opline;
- if (!(CG(compiler_options) & ZEND_COMPILE_EXTENDED_INFO)) {
+ if (!(CG(compiler_options) & ZEND_COMPILE_EXTENDED_STMT)) {
return;
}
@@ -1428,7 +1428,7 @@ void zend_do_extended_fcall_begin(void) /* {{{ */
{
zend_op *opline;
- if (!(CG(compiler_options) & ZEND_COMPILE_EXTENDED_INFO)) {
+ if (!(CG(compiler_options) & ZEND_COMPILE_EXTENDED_FCALL)) {
return;
}
@@ -1442,7 +1442,7 @@ void zend_do_extended_fcall_end(void) /* {{{ */
{
zend_op *opline;
- if (!(CG(compiler_options) & ZEND_COMPILE_EXTENDED_INFO)) {
+ if (!(CG(compiler_options) & ZEND_COMPILE_EXTENDED_FCALL)) {
return;
}
@@ -4529,7 +4529,7 @@ void zend_compile_for(zend_ast *ast) /* {{{ */
zend_update_jump_target_to_next(opnum_jmp);
zend_compile_expr_list(&result, cond_ast);
- zend_do_extended_info();
+ zend_do_extended_stmt();
zend_emit_cond_jump(ZEND_JMPNZ, &result, opnum_start);
@@ -5789,7 +5789,7 @@ void zend_compile_func_decl(znode *result, zend_ast *ast, zend_bool toplevel) /*
zend_oparray_context_begin(&orig_oparray_context);
- if (CG(compiler_options) & ZEND_COMPILE_EXTENDED_INFO) {
+ if (CG(compiler_options) & ZEND_COMPILE_EXTENDED_STMT) {
zend_op *opline_ext = zend_emit_op(NULL, ZEND_EXT_NOP, NULL, NULL);
opline_ext->lineno = decl->start_lineno;
}
@@ -5820,7 +5820,7 @@ void zend_compile_func_decl(znode *result, zend_ast *ast, zend_bool toplevel) /*
/* put the implicit return on the really last line */
CG(zend_lineno) = decl->end_lineno;
- zend_do_extended_info();
+ zend_do_extended_stmt();
zend_emit_final_return(0);
pass_two(CG(active_op_array));
@@ -8108,8 +8108,8 @@ 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();
+ if ((CG(compiler_options) & ZEND_COMPILE_EXTENDED_STMT) && !zend_is_unticked_stmt(ast)) {
+ zend_do_extended_stmt();
}
switch (ast->kind) {
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index 401ebcfe76..965f4a1e05 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -1019,51 +1019,53 @@ END_EXTERN_C()
* to change the default compiler behavior */
/* generate extended debug information */
-#define ZEND_COMPILE_EXTENDED_INFO (1<<0)
+#define ZEND_COMPILE_EXTENDED_STMT (1<<0)
+#define ZEND_COMPILE_EXTENDED_FCALL (1<<1)
+#define ZEND_COMPILE_EXTENDED_INFO (ZEND_COMPILE_EXTENDED_STMT|ZEND_COMPILE_EXTENDED_FCALL)
/* call op_array handler of extendions */
-#define ZEND_COMPILE_HANDLE_OP_ARRAY (1<<1)
+#define ZEND_COMPILE_HANDLE_OP_ARRAY (1<<2)
/* generate ZEND_INIT_FCALL_BY_NAME for internal functions instead of ZEND_INIT_FCALL */
-#define ZEND_COMPILE_IGNORE_INTERNAL_FUNCTIONS (1<<2)
+#define ZEND_COMPILE_IGNORE_INTERNAL_FUNCTIONS (1<<3)
/* don't perform early binding for classes inherited form internal ones;
* in namespaces assume that internal class that doesn't exist at compile-time
* may apper in run-time */
-#define ZEND_COMPILE_IGNORE_INTERNAL_CLASSES (1<<3)
+#define ZEND_COMPILE_IGNORE_INTERNAL_CLASSES (1<<4)
/* generate ZEND_DECLARE_INHERITED_CLASS_DELAYED opcode to delay early binding */
-#define ZEND_COMPILE_DELAYED_BINDING (1<<4)
+#define ZEND_COMPILE_DELAYED_BINDING (1<<5)
/* disable constant substitution at compile-time */
-#define ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION (1<<5)
+#define ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION (1<<6)
/* disable substitution of persistent constants at compile-time */
-#define ZEND_COMPILE_NO_PERSISTENT_CONSTANT_SUBSTITUTION (1<<7)
+#define ZEND_COMPILE_NO_PERSISTENT_CONSTANT_SUBSTITUTION (1<<8)
/* generate ZEND_INIT_FCALL_BY_NAME for userland functions instead of ZEND_INIT_FCALL */
-#define ZEND_COMPILE_IGNORE_USER_FUNCTIONS (1<<8)
+#define ZEND_COMPILE_IGNORE_USER_FUNCTIONS (1<<9)
/* force ZEND_ACC_USE_GUARDS for all classes */
-#define ZEND_COMPILE_GUARDS (1<<9)
+#define ZEND_COMPILE_GUARDS (1<<10)
/* disable builtin special case function calls */
-#define ZEND_COMPILE_NO_BUILTINS (1<<10)
+#define ZEND_COMPILE_NO_BUILTINS (1<<11)
/* result of compilation may be stored in file cache */
-#define ZEND_COMPILE_WITH_FILE_CACHE (1<<11)
+#define ZEND_COMPILE_WITH_FILE_CACHE (1<<12)
/* ignore functions and classes declared in other files */
-#define ZEND_COMPILE_IGNORE_OTHER_FILES (1<<12)
+#define ZEND_COMPILE_IGNORE_OTHER_FILES (1<<13)
/* this flag is set when compiler invoked by opcache_compile_file() */
-#define ZEND_COMPILE_WITHOUT_EXECUTION (1<<13)
+#define ZEND_COMPILE_WITHOUT_EXECUTION (1<<14)
/* this flag is set when compiler invoked during preloading */
-#define ZEND_COMPILE_PRELOAD (1<<14)
+#define ZEND_COMPILE_PRELOAD (1<<15)
/* disable jumptable optimization for switch statements */
-#define ZEND_COMPILE_NO_JUMPTABLES (1<<15)
+#define ZEND_COMPILE_NO_JUMPTABLES (1<<16)
/* The default value for CG(compiler_options) */
#define ZEND_COMPILE_DEFAULT ZEND_COMPILE_HANDLE_OP_ARRAY
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index 1093909c83..5b1914c99d 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -478,7 +478,7 @@ ZEND_API void destroy_op_array(zend_op_array *op_array)
}
}
-static void zend_update_extended_info(zend_op_array *op_array)
+static void zend_update_extended_stmts(zend_op_array *op_array)
{
zend_op *opline = op_array->opcodes, *end=opline+op_array->last;
@@ -839,8 +839,8 @@ ZEND_API int pass_two(zend_op_array *op_array)
if (!ZEND_USER_CODE(op_array->type)) {
return 0;
}
- if (CG(compiler_options) & ZEND_COMPILE_EXTENDED_INFO) {
- zend_update_extended_info(op_array);
+ if (CG(compiler_options) & ZEND_COMPILE_EXTENDED_STMT) {
+ zend_update_extended_stmts(op_array);
}
if (CG(compiler_options) & ZEND_COMPILE_HANDLE_OP_ARRAY) {
if (zend_extension_flags & ZEND_EXTENSIONS_HAVE_OP_ARRAY_HANDLER) {
diff --git a/ext/opcache/Optimizer/zend_cfg.c b/ext/opcache/Optimizer/zend_cfg.c
index d6c6565779..ccfdaa3425 100644
--- a/ext/opcache/Optimizer/zend_cfg.c
+++ b/ext/opcache/Optimizer/zend_cfg.c
@@ -419,9 +419,11 @@ int zend_build_cfg(zend_arena **arena, const zend_op_array *op_array, uint32_t b
break;
case ZEND_EXT_NOP:
case ZEND_EXT_STMT:
+ flags |= ZEND_FUNC_HAS_EXTENDED_STMT;
+ break;
case ZEND_EXT_FCALL_BEGIN:
case ZEND_EXT_FCALL_END:
- flags |= ZEND_FUNC_HAS_EXTENDED_INFO;
+ flags |= ZEND_FUNC_HAS_EXTENDED_FCALL;
break;
case ZEND_FREE:
if (opline->extended_value == ZEND_FREE_SWITCH) {
diff --git a/ext/opcache/Optimizer/zend_dump.c b/ext/opcache/Optimizer/zend_dump.c
index 0cc0875898..6f5d8ace18 100644
--- a/ext/opcache/Optimizer/zend_dump.c
+++ b/ext/opcache/Optimizer/zend_dump.c
@@ -924,8 +924,11 @@ void zend_dump_op_array(const zend_op_array *op_array, uint32_t dump_flags, cons
if (func_flags & ZEND_FUNC_NO_LOOPS) {
fprintf(stderr, ", no_loops");
}
- if (func_flags & ZEND_FUNC_HAS_EXTENDED_INFO) {
- fprintf(stderr, ", extended_info");
+ if (func_flags & ZEND_FUNC_HAS_EXTENDED_STMT) {
+ fprintf(stderr, ", extended_stmt");
+ }
+ if (func_flags & ZEND_FUNC_HAS_EXTENDED_FCALL) {
+ fprintf(stderr, ", extended_fcall");
}
//TODO: this is useful only for JIT???
#if 0
diff --git a/ext/opcache/Optimizer/zend_func_info.h b/ext/opcache/Optimizer/zend_func_info.h
index 7042d6dd9c..7eeb363da5 100644
--- a/ext/opcache/Optimizer/zend_func_info.h
+++ b/ext/opcache/Optimizer/zend_func_info.h
@@ -31,7 +31,8 @@
#define ZEND_FUNC_RECURSIVE (1<<7)
#define ZEND_FUNC_RECURSIVE_DIRECTLY (1<<8)
#define ZEND_FUNC_RECURSIVE_INDIRECTLY (1<<9)
-#define ZEND_FUNC_HAS_EXTENDED_INFO (1<<10)
+#define ZEND_FUNC_HAS_EXTENDED_FCALL (1<<10)
+#define ZEND_FUNC_HAS_EXTENDED_STMT (1<<11)
/* The following flags are valid only for return values of internal functions
* returned by zend_get_func_info()