mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Mark "top-level" functions.
This commit is contained in:
parent
03384cae3c
commit
3fe698b904
2 changed files with 30 additions and 26 deletions
|
@ -5895,6 +5895,10 @@ void zend_compile_func_decl(znode *result, zend_ast *ast, zend_bool toplevel) /*
|
|||
|
||||
CG(active_op_array) = op_array;
|
||||
|
||||
if (toplevel) {
|
||||
op_array->fn_flags |= ZEND_ACC_TOP_LEVEL;
|
||||
}
|
||||
|
||||
zend_oparray_context_begin(&orig_oparray_context);
|
||||
|
||||
if (CG(compiler_options) & ZEND_COMPILE_EXTENDED_INFO) {
|
||||
|
|
|
@ -223,6 +223,9 @@ typedef struct _zend_oparray_context {
|
|||
/* Function has typed arguments / class has typed props | | | */
|
||||
#define ZEND_ACC_HAS_TYPE_HINTS (1 << 8) /* ? | X | | */
|
||||
/* | | | */
|
||||
/* Top-level class or function declaration | | | */
|
||||
#define ZEND_ACC_TOP_LEVEL (1 << 9) /* X | X | | */
|
||||
/* | | | */
|
||||
/* Class Flags (unused: 16...) | | | */
|
||||
/* =========== | | | */
|
||||
/* | | | */
|
||||
|
@ -240,75 +243,72 @@ typedef struct _zend_oparray_context {
|
|||
/* | | | */
|
||||
/* Class has magic methods __get/__set/__unset/ | | | */
|
||||
/* __isset that use guards | | | */
|
||||
#define ZEND_ACC_USE_GUARDS (1 << 9) /* X | | | */
|
||||
#define ZEND_ACC_USE_GUARDS (1 << 10) /* X | | | */
|
||||
/* | | | */
|
||||
/* Class constants updated | | | */
|
||||
#define ZEND_ACC_CONSTANTS_UPDATED (1 << 10) /* X | | | */
|
||||
#define ZEND_ACC_CONSTANTS_UPDATED (1 << 11) /* X | | | */
|
||||
/* | | | */
|
||||
/* Class extends another class | | | */
|
||||
#define ZEND_ACC_INHERITED (1 << 11) /* X | | | */
|
||||
#define ZEND_ACC_INHERITED (1 << 12) /* X | | | */
|
||||
/* | | | */
|
||||
/* Class implements interface(s) | | | */
|
||||
#define ZEND_ACC_IMPLEMENT_INTERFACES (1 << 12) /* X | | | */
|
||||
#define ZEND_ACC_IMPLEMENT_INTERFACES (1 << 13) /* X | | | */
|
||||
/* | | | */
|
||||
/* Class uses trait(s) | | | */
|
||||
#define ZEND_ACC_IMPLEMENT_TRAITS (1 << 13) /* X | | | */
|
||||
#define ZEND_ACC_IMPLEMENT_TRAITS (1 << 14) /* X | | | */
|
||||
/* | | | */
|
||||
/* User class has methods with static variables | | | */
|
||||
#define ZEND_HAS_STATIC_IN_METHODS (1 << 14) /* X | | | */
|
||||
#define ZEND_HAS_STATIC_IN_METHODS (1 << 15) /* X | | | */
|
||||
/* | | | */
|
||||
/* Top-level class declaration | | | */
|
||||
#define ZEND_ACC_TOP_LEVEL (1 << 15) /* X | | | */
|
||||
/* | | | */
|
||||
/* Function Flags (unused: 25...30) | | | */
|
||||
/* Function Flags (unused: 26...30) | | | */
|
||||
/* ============== | | | */
|
||||
/* | | | */
|
||||
/* deprecation flag | | | */
|
||||
#define ZEND_ACC_DEPRECATED (1 << 9) /* | X | | */
|
||||
#define ZEND_ACC_DEPRECATED (1 << 10) /* | X | | */
|
||||
/* | | | */
|
||||
/* Function returning by reference | | | */
|
||||
#define ZEND_ACC_RETURN_REFERENCE (1 << 10) /* | X | | */
|
||||
#define ZEND_ACC_RETURN_REFERENCE (1 << 11) /* | X | | */
|
||||
/* | | | */
|
||||
/* Function has a return type | | | */
|
||||
#define ZEND_ACC_HAS_RETURN_TYPE (1 << 11) /* | X | | */
|
||||
#define ZEND_ACC_HAS_RETURN_TYPE (1 << 12) /* | X | | */
|
||||
/* | | | */
|
||||
/* Function with variable number of arguments | | | */
|
||||
#define ZEND_ACC_VARIADIC (1 << 12) /* | X | | */
|
||||
#define ZEND_ACC_VARIADIC (1 << 13) /* | X | | */
|
||||
/* | | | */
|
||||
/* op_array has finally blocks (user only) | | | */
|
||||
#define ZEND_ACC_HAS_FINALLY_BLOCK (1 << 13) /* | X | | */
|
||||
#define ZEND_ACC_HAS_FINALLY_BLOCK (1 << 14) /* | X | | */
|
||||
/* | | | */
|
||||
/* "main" op_array with | | | */
|
||||
/* ZEND_DECLARE_INHERITED_CLASS_DELAYED opcodes | | | */
|
||||
#define ZEND_ACC_EARLY_BINDING (1 << 14) /* | X | | */
|
||||
#define ZEND_ACC_EARLY_BINDING (1 << 15) /* | X | | */
|
||||
/* | | | */
|
||||
/* method flag (bc only), any method that has this | | | */
|
||||
/* flag can be used statically and non statically. | | | */
|
||||
#define ZEND_ACC_ALLOW_STATIC (1 << 15) /* | X | | */
|
||||
#define ZEND_ACC_ALLOW_STATIC (1 << 16) /* | X | | */
|
||||
/* | | | */
|
||||
/* call through user function trampoline. e.g. | | | */
|
||||
/* __call, __callstatic | | | */
|
||||
#define ZEND_ACC_CALL_VIA_TRAMPOLINE (1 << 16) /* | X | | */
|
||||
#define ZEND_ACC_CALL_VIA_TRAMPOLINE (1 << 17) /* | X | | */
|
||||
/* | | | */
|
||||
/* disable inline caching | | | */
|
||||
#define ZEND_ACC_NEVER_CACHE (1 << 17) /* | X | | */
|
||||
#define ZEND_ACC_NEVER_CACHE (1 << 18) /* | X | | */
|
||||
/* | | | */
|
||||
/* Closure related | | | */
|
||||
#define ZEND_ACC_CLOSURE (1 << 18) /* | X | | */
|
||||
#define ZEND_ACC_FAKE_CLOSURE (1 << 19) /* | X | | */
|
||||
#define ZEND_ACC_CLOSURE (1 << 19) /* | X | | */
|
||||
#define ZEND_ACC_FAKE_CLOSURE (1 << 20) /* | X | | */
|
||||
/* | | | */
|
||||
/* run_time_cache allocated on heap (user only) | | | */
|
||||
#define ZEND_ACC_HEAP_RT_CACHE (1 << 20) /* | X | | */
|
||||
#define ZEND_ACC_HEAP_RT_CACHE (1 << 21) /* | X | | */
|
||||
/* | | | */
|
||||
/* method flag used by Closure::__invoke() | | | */
|
||||
#define ZEND_ACC_USER_ARG_INFO (1 << 21) /* | X | | */
|
||||
#define ZEND_ACC_USER_ARG_INFO (1 << 22) /* | X | | */
|
||||
/* | | | */
|
||||
#define ZEND_ACC_GENERATOR (1 << 22) /* | X | | */
|
||||
#define ZEND_ACC_GENERATOR (1 << 23) /* | X | | */
|
||||
/* | | | */
|
||||
#define ZEND_ACC_DONE_PASS_TWO (1 << 23) /* | X | | */
|
||||
#define ZEND_ACC_DONE_PASS_TWO (1 << 24) /* | X | | */
|
||||
/* | | | */
|
||||
/* internal function is allocated at arena (int only) | | | */
|
||||
#define ZEND_ACC_ARENA_ALLOCATED (1 << 24) /* | X | | */
|
||||
#define ZEND_ACC_ARENA_ALLOCATED (1 << 25) /* | X | | */
|
||||
/* | | | */
|
||||
/* op_array uses strict mode types | | | */
|
||||
#define ZEND_ACC_STRICT_TYPES (1 << 31) /* | X | | */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue