Download src/php/php-src/Zend/zend_compile.h from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 54.2 kB
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/zend_compile.h
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/zend_compile.h
-
curl -L -o zend_compile.h https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/zend_compile.h
54.2 kB
| /* | |
| +----------------------------------------------------------------------+ | |
| | Zend Engine | | |
| +----------------------------------------------------------------------+ | |
| | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) | | |
| +----------------------------------------------------------------------+ | |
| | This source file is subject to version 2.00 of the Zend license, | | |
| | that is bundled with this package in the file LICENSE, and is | | |
| | available through the world-wide-web at the following url: | | |
| | http://www.zend.com/license/2_00.txt. | | |
| | If you did not receive a copy of the Zend license and are unable to | | |
| | obtain it through the world-wide-web, please send a note to | | |
| | license@zend.com so we can mail you a copy immediately. | | |
| +----------------------------------------------------------------------+ | |
| | Authors: Andi Gutmans <andi@php.net> | | |
| | Zeev Suraski <zeev@php.net> | | |
| +----------------------------------------------------------------------+ | |
| */ | |
| typedef struct _zend_op_array zend_op_array; | |
| typedef struct _zend_op zend_op; | |
| /* On 64-bit systems less optimal, but more compact VM code leads to better | |
| * performance. So on 32-bit systems we use absolute addresses for jump | |
| * targets and constants, but on 64-bit systems relative 32-bit offsets */ | |
| typedef union _znode_op { | |
| uint32_t constant; | |
| uint32_t var; | |
| uint32_t num; | |
| uint32_t opline_num; /* Needs to be signed */ | |
| zend_op *jmp_addr; | |
| uint32_t jmp_offset; | |
| zval *zv; | |
| } znode_op; | |
| typedef struct _znode { /* used only during compilation */ | |
| uint8_t op_type; | |
| uint8_t flag; | |
| union { | |
| znode_op op; | |
| zval constant; /* replaced by literal/zv */ | |
| } u; | |
| } znode; | |
| typedef struct _zend_ast_znode { | |
| zend_ast_kind kind; | |
| zend_ast_attr attr; | |
| uint32_t lineno; | |
| znode node; | |
| } zend_ast_znode; | |
| ZEND_API zend_ast * ZEND_FASTCALL zend_ast_create_znode(znode *node); | |
| static zend_always_inline znode *zend_ast_get_znode(zend_ast *ast) { | |
| return &((zend_ast_znode *) ast)->node; | |
| } | |
| typedef struct _zend_declarables { | |
| zend_long ticks; | |
| } zend_declarables; | |
| /* Compilation context that is different for each file, but shared between op arrays. */ | |
| typedef struct _zend_file_context { | |
| zend_declarables declarables; | |
| zend_string *current_namespace; | |
| bool in_namespace; | |
| bool has_bracketed_namespaces; | |
| HashTable *imports; | |
| HashTable *imports_function; | |
| HashTable *imports_const; | |
| HashTable seen_symbols; | |
| } zend_file_context; | |
| typedef union _zend_parser_stack_elem { | |
| zend_ast *ast; | |
| zend_string *str; | |
| zend_ulong num; | |
| unsigned char *ptr; | |
| unsigned char *ident; | |
| } zend_parser_stack_elem; | |
| void zend_compile_top_stmt(zend_ast *ast); | |
| void zend_const_expr_to_zval(zval *result, zend_ast **ast_ptr, bool allow_dynamic); | |
| typedef int (*user_opcode_handler_t) (zend_execute_data *execute_data); | |
| struct _zend_op { | |
| const void *handler; | |
| znode_op op1; | |
| znode_op op2; | |
| znode_op result; | |
| uint32_t extended_value; | |
| uint32_t lineno; | |
| uint8_t opcode; /* Opcodes defined in Zend/zend_vm_opcodes.h */ | |
| uint8_t op1_type; /* IS_UNUSED, IS_CONST, IS_TMP_VAR, IS_VAR, IS_CV */ | |
| uint8_t op2_type; /* IS_UNUSED, IS_CONST, IS_TMP_VAR, IS_VAR, IS_CV */ | |
| uint8_t result_type; /* IS_UNUSED, IS_CONST, IS_TMP_VAR, IS_VAR, IS_CV */ | |
| uint32_t op1_use_type; | |
| uint32_t op2_use_type; | |
| uint32_t result_use_type; | |
| uint32_t op1_def_type; | |
| uint32_t op2_def_type; | |
| uint32_t result_def_type; | |
| }; | |
| typedef struct _zend_brk_cont_element { | |
| int start; | |
| int cont; | |
| int brk; | |
| int parent; | |
| bool is_switch; | |
| } zend_brk_cont_element; | |
| typedef struct _zend_label { | |
| int brk_cont; | |
| uint32_t opline_num; | |
| } zend_label; | |
| typedef struct _zend_try_catch_element { | |
| uint32_t try_op; | |
| uint32_t catch_op; /* ketchup! */ | |
| uint32_t finally_op; | |
| uint32_t finally_end; | |
| } zend_try_catch_element; | |
| typedef struct _zend_live_range { | |
| uint32_t var; /* low bits are used for variable type (ZEND_LIVE_* macros) */ | |
| uint32_t start; | |
| uint32_t end; | |
| } zend_live_range; | |
| typedef struct _zend_property_info zend_property_info; | |
| /* Compilation context that is different for each op array. */ | |
| typedef struct _zend_oparray_context { | |
| struct _zend_oparray_context *prev; | |
| zend_op_array *op_array; | |
| uint32_t opcodes_size; | |
| int vars_size; | |
| int literals_size; | |
| uint32_t fast_call_var; | |
| uint32_t try_catch_offset; | |
| int current_brk_cont; | |
| int last_brk_cont; | |
| zend_brk_cont_element *brk_cont_array; | |
| HashTable *labels; | |
| zend_string *active_property_info_name; | |
| zend_property_hook_kind active_property_hook_kind; | |
| bool in_jmp_frameless_branch; | |
| } zend_oparray_context; | |
| /* Class, property and method flags class|meth.|prop.|const*/ | |
| /* | | | */ | |
| /* Common flags | | | */ | |
| /* ============ | | | */ | |
| /* | | | */ | |
| /* Visibility flags (public < protected < private) | | | */ | |
| /* | | | */ | |
| /* Property or method overrides private one | | | */ | |
| /* | | | */ | |
| /* Static method or property | | | */ | |
| /* | | | */ | |
| /* Final class or method | | | */ | |
| /* | | | */ | |
| /* Abstract method | | | */ | |
| /* | | | */ | |
| /* Readonly property | | | */ | |
| /* | | | */ | |
| /* Immutable op_array and class_entries | | | */ | |
| /* (implemented only for lazy loading of op_arrays) | | | */ | |
| /* | | | */ | |
| /* Function has typed arguments / class has typed props | | | */ | |
| /* | | | */ | |
| /* Top-level class or function declaration | | | */ | |
| /* | | | */ | |
| /* op_array or class is preloaded | | | */ | |
| /* | | | */ | |
| /* Flag to differentiate cases from constants. | | | */ | |
| /* Must not conflict with ZEND_ACC_ visibility flags | | | */ | |
| /* or IS_CONSTANT_VISITED_MARK | | | */ | |
| /* | | | */ | |
| /* Property Flags (unused: 13...) | | | */ | |
| /* =========== | | | */ | |
| /* | | | */ | |
| /* Promoted property / parameter | | | */ | |
| /* | | | */ | |
| /* Virtual property without backing storage | | | */ | |
| /* | | | */ | |
| /* Asymmetric visibility | | | */ | |
| /* | | | */ | |
| /* Class Flags (unused: 30,31) | | | */ | |
| /* =========== | | | */ | |
| /* | | | */ | |
| /* Special class types | | | */ | |
| /* | | | */ | |
| /* Class linked with parent, interfaces and traits | | | */ | |
| /* | | | */ | |
| /* Class is abstract, since it is set by any | | | */ | |
| /* abstract method | | | */ | |
| /* | | | */ | |
| /* Class has magic methods __get/__set/__unset/ | | | */ | |
| /* __isset that use guards | | | */ | |
| /* | | | */ | |
| /* Class constants updated | | | */ | |
| /* | | | */ | |
| /* Objects of this class may not have dynamic properties | | | */ | |
| /* | | | */ | |
| /* User class has methods with static variables | | | */ | |
| /* | | | */ | |
| /* Objects of this class may have dynamic properties | | | */ | |
| /* without triggering a deprecation warning | | | */ | |
| /* | | | */ | |
| /* Readonly class | | | */ | |
| /* | | | */ | |
| /* Parent class is resolved (CE). | | | */ | |
| /* | | | */ | |
| /* Interfaces are resolved (CEs). | | | */ | |
| /* | | | */ | |
| /* Class has unresolved variance obligations. | | | */ | |
| /* | | | */ | |
| /* Class is linked apart from variance obligations. | | | */ | |
| /* Class has readonly props | | | */ | |
| /* | | | */ | |
| /* stored in opcache (may be partially) | | | */ | |
| /* | | | */ | |
| /* temporary flag used during delayed variance checks | | | */ | |
| /* | | | */ | |
| /* | | | */ | |
| /* loaded from file cache to process memory | | | */ | |
| /* | | | */ | |
| /* Class cannot be serialized or unserialized | | | */ | |
| /* | | | */ | |
| /* Function Flags (unused: 30) | | | */ | |
| /* ============== | | | */ | |
| /* | | | */ | |
| /* deprecation flag | | | */ | |
| /* | | | */ | |
| /* Function returning by reference | | | */ | |
| /* | | | */ | |
| /* Function has a return type | | | */ | |
| /* | | | */ | |
| /* Function with variable number of arguments | | | */ | |
| /* | | | */ | |
| /* op_array has finally blocks (user only) | | | */ | |
| /* | | | */ | |
| /* "main" op_array with | | | */ | |
| /* ZEND_DECLARE_CLASS_DELAYED opcodes | | | */ | |
| /* | | | */ | |
| /* closure uses $this | | | */ | |
| /* | | | */ | |
| /* call through user function trampoline. e.g. | | | */ | |
| /* __call, __callstatic | | | */ | |
| /* | | | */ | |
| /* disable inline caching | | | */ | |
| /* | | | */ | |
| /* op_array is a clone of trait method | | | */ | |
| /* | | | */ | |
| /* functions is a constructor | | | */ | |
| /* | | | */ | |
| /* Closure related | | | */ | |
| /* | | | */ | |
| /* | | | */ | |
| /* function was processed by pass two (user only) | | | */ | |
| /* | | | */ | |
| /* internal function is allocated at arena (int only) | | | */ | |
| /* | | | */ | |
| /* run_time_cache allocated on heap (user only) | | | */ | |
| /* | | | */ | |
| /* method flag used by Closure::__invoke() (int only) | | | */ | |
| /* | | | */ | |
| /* supports opcache compile-time evaluation (funcs) | | | */ | |
| /* | | | */ | |
| /* has #[\Override] attribute | | | */ | |
| /* | | | */ | |
| /* Has IS_PTR operands that needs special cleaning; same | | | */ | |
| /* value as ZEND_ACC_OVERRIDE but override is for class | | | */ | |
| /* methods and this is for the top level op array | | | */ | |
| /* | | | */ | |
| /* has #[\NoDiscard] attribute | | | */ | |
| /* | | | */ | |
| /* op_array uses strict mode types | | | */ | |
| static zend_always_inline uint32_t zend_visibility_to_set_visibility(uint32_t visibility) | |
| { | |
| switch (visibility) { | |
| case ZEND_ACC_PUBLIC: | |
| return ZEND_ACC_PUBLIC_SET; | |
| case ZEND_ACC_PROTECTED: | |
| return ZEND_ACC_PROTECTED_SET; | |
| case ZEND_ACC_PRIVATE: | |
| return ZEND_ACC_PRIVATE_SET; | |
| EMPTY_SWITCH_DEFAULT_CASE(); | |
| } | |
| } | |
| /* call through internal function handler. e.g. Closure::invoke() */ | |
| // Must not clash with ZEND_SHORT_CIRCUITING_CHAIN_MASK | |
| char *zend_visibility_string(uint32_t fn_flags); | |
| /* Stored in zend_property_info.offset, not returned by zend_get_property_offset(). */ | |
| zend_property_hook_kind zend_get_property_hook_kind_from_name(zend_string *name); | |
| typedef struct _zend_property_info { | |
| uint32_t offset; /* property offset for object properties or | |
| property index for static properties */ | |
| uint32_t flags; | |
| zend_string *name; | |
| zend_string *doc_comment; | |
| HashTable *attributes; | |
| zend_class_entry *ce; | |
| zend_type type; | |
| const zend_property_info *prototype; | |
| zend_function **hooks; | |
| } zend_property_info; | |
| typedef struct _zend_class_constant { | |
| zval value; /* flags are stored in u2 */ | |
| zend_string *doc_comment; | |
| HashTable *attributes; | |
| zend_class_entry *ce; | |
| zend_type type; | |
| } zend_class_constant; | |
| /* arg_info for internal functions */ | |
| typedef struct _zend_internal_arg_info { | |
| const char *name; | |
| zend_type type; | |
| const char *default_value; | |
| } zend_internal_arg_info; | |
| /* arg_info for user functions */ | |
| typedef struct _zend_arg_info { | |
| zend_string *name; | |
| zend_type type; | |
| zend_string *default_value; | |
| } zend_arg_info; | |
| /* the following structure repeats the layout of zend_internal_arg_info, | |
| * but its fields have different meaning. It's used as the first element of | |
| * arg_info array to define properties of internal functions. | |
| * It's also used for the return type. | |
| */ | |
| typedef struct _zend_internal_function_info { | |
| uintptr_t required_num_args; | |
| zend_type type; | |
| const char *default_value; | |
| } zend_internal_function_info; | |
| struct _zend_op_array { | |
| /* Common elements */ | |
| uint8_t type; | |
| uint8_t arg_flags[3]; /* bitset of arg_info.pass_by_reference */ | |
| uint32_t fn_flags; | |
| zend_string *function_name; | |
| zend_class_entry *scope; | |
| zend_function *prototype; | |
| uint32_t num_args; | |
| uint32_t required_num_args; | |
| zend_arg_info *arg_info; | |
| HashTable *attributes; | |
| ZEND_MAP_PTR_DEF(void **, run_time_cache); | |
| zend_string *doc_comment; | |
| uint32_t T; /* number of temporary variables */ | |
| const zend_property_info *prop_info; /* The corresponding prop_info if this is a hook. */ | |
| /* END of common elements */ | |
| int cache_size; /* number of run_time_cache_slots * sizeof(void*) */ | |
| int last_var; /* number of CV variables */ | |
| uint32_t last; /* number of opcodes */ | |
| zend_op *opcodes; | |
| ZEND_MAP_PTR_DEF(HashTable *, static_variables_ptr); | |
| HashTable *static_variables; | |
| zend_string **vars; /* names of CV variables */ | |
| uint32_t *refcount; | |
| int last_live_range; | |
| int last_try_catch; | |
| zend_live_range *live_range; | |
| zend_try_catch_element *try_catch_array; | |
| zend_string *filename; | |
| uint32_t line_start; | |
| uint32_t line_end; | |
| int last_literal; | |
| uint32_t num_dynamic_func_defs; | |
| zval *literals; | |
| /* Functions that are declared dynamically are stored here and | |
| * referenced by index from opcodes. */ | |
| zend_op_array **dynamic_func_defs; | |
| void *reserved[ZEND_MAX_RESERVED_RESOURCES]; | |
| }; | |
| /* zend_internal_function_handler */ | |
| typedef void (ZEND_FASTCALL *zif_handler)(INTERNAL_FUNCTION_PARAMETERS); | |
| typedef struct _zend_internal_function { | |
| /* Common elements */ | |
| uint8_t type; | |
| uint8_t arg_flags[3]; /* bitset of arg_info.pass_by_reference */ | |
| uint32_t fn_flags; | |
| zend_string* function_name; | |
| zend_class_entry *scope; | |
| zend_function *prototype; | |
| uint32_t num_args; | |
| uint32_t required_num_args; | |
| zend_internal_arg_info *arg_info; | |
| HashTable *attributes; | |
| ZEND_MAP_PTR_DEF(void **, run_time_cache); | |
| zend_string *doc_comment; | |
| uint32_t T; /* number of temporary variables */ | |
| const zend_property_info *prop_info; /* The corresponding prop_info if this is a hook. */ | |
| /* END of common elements */ | |
| zif_handler handler; | |
| struct _zend_module_entry *module; | |
| const zend_frameless_function_info *frameless_function_infos; | |
| void *reserved[ZEND_MAX_RESERVED_RESOURCES]; | |
| } zend_internal_function; | |
| union _zend_function { | |
| uint8_t type; /* MUST be the first element of this struct! */ | |
| uint32_t quick_arg_flags; | |
| struct { | |
| uint8_t type; /* never used */ | |
| uint8_t arg_flags[3]; /* bitset of arg_info.pass_by_reference */ | |
| uint32_t fn_flags; | |
| zend_string *function_name; | |
| zend_class_entry *scope; | |
| zend_function *prototype; | |
| uint32_t num_args; | |
| uint32_t required_num_args; | |
| zend_arg_info *arg_info; /* index -1 represents the return value info, if any */ | |
| HashTable *attributes; | |
| ZEND_MAP_PTR_DEF(void **, run_time_cache); | |
| zend_string *doc_comment; | |
| uint32_t T; /* number of temporary variables */ | |
| const zend_property_info *prop_info; /* The corresponding prop_info if this is a hook. */ | |
| } common; | |
| zend_op_array op_array; | |
| zend_internal_function internal_function; | |
| }; | |
| struct _zend_execute_data { | |
| const zend_op *opline; /* executed opline */ | |
| zend_execute_data *call; /* current call */ | |
| zval *return_value; | |
| zend_function *func; /* executed function */ | |
| zval This; /* this + call_info + num_args */ | |
| zend_execute_data *prev_execute_data; | |
| zend_array *symbol_table; | |
| void **run_time_cache; /* cache op_array->run_time_cache */ | |
| zend_array *extra_named_params; | |
| }; | |
| /* Top 16 bits of Z_TYPE_INFO(EX(This)) are used as call_info flags */ | |
| /* to prevent optimization in RETURN handler and */ | |
| /* keep all local variables for "fcall_end" handler */ | |
| /* Ensure the correct alignment before slots calculation */ | |
| ZEND_STATIC_ASSERT(ZEND_MM_ALIGNED_SIZE(sizeof(zval)) == sizeof(zval), | |
| "zval must be aligned by ZEND_MM_ALIGNMENT"); | |
| /* A number of call frame slots (zvals) reserved for zend_execute_data. */ | |
| /* run-time jump target */ | |
| /* convert jump target from compile-time to run-time */ | |
| /* convert jump target back from run-time to compile-time */ | |
| /* run-time jump target */ | |
| /* convert jump target from compile-time to run-time */ | |
| /* convert jump target back from run-time to compile-time */ | |
| /* constant-time constant */ | |
| /* run-time constant */ | |
| /* convert constant from compile-time to run-time */ | |
| /* At run-time, constants are allocated together with op_array->opcodes | |
| * and addressed relatively to current opline. | |
| */ | |
| /* run-time constant */ | |
| /* convert constant from compile-time to run-time */ | |
| /* convert constant back from run-time to compile-time */ | |
| /* Used for result.type of smart branch instructions */ | |
| typedef enum _zend_compile_position { | |
| ZEND_COMPILE_POSITION_AT_SHEBANG = 0, | |
| ZEND_COMPILE_POSITION_AT_OPEN_TAG, | |
| ZEND_COMPILE_POSITION_AFTER_OPEN_TAG | |
| } zend_compile_position; | |
| BEGIN_EXTERN_C() | |
| void init_compiler(void); | |
| void shutdown_compiler(void); | |
| void zend_init_compiler_data_structures(void); | |
| void zend_oparray_context_begin(zend_oparray_context *prev_context, zend_op_array *op_array); | |
| void zend_oparray_context_end(zend_oparray_context *prev_context); | |
| void zend_file_context_begin(zend_file_context *prev_context); | |
| void zend_file_context_end(zend_file_context *prev_context); | |
| extern ZEND_API zend_op_array *(*zend_compile_file)(zend_file_handle *file_handle, int type); | |
| extern ZEND_API zend_op_array *(*zend_compile_string)(zend_string *source_string, const char *filename, zend_compile_position position); | |
| ZEND_API int ZEND_FASTCALL lex_scan(zval *zendlval, zend_parser_stack_elem *elem); | |
| void startup_scanner(void); | |
| void shutdown_scanner(void); | |
| ZEND_API zend_string *zend_set_compiled_filename(zend_string *new_compiled_filename); | |
| ZEND_API void zend_restore_compiled_filename(zend_string *original_compiled_filename); | |
| ZEND_API zend_string *zend_get_compiled_filename(void); | |
| ZEND_API int zend_get_compiled_lineno(void); | |
| ZEND_API size_t zend_get_scanned_file_offset(void); | |
| ZEND_API zend_string *zend_get_compiled_variable_name(const zend_op_array *op_array, uint32_t var); | |
| const char *zend_get_zendtext(void); | |
| int zend_get_zendleng(void); | |
| typedef zend_result (ZEND_FASTCALL *unary_op_type)(zval *, zval *); | |
| typedef zend_result (ZEND_FASTCALL *binary_op_type)(zval *, zval *, zval *); | |
| ZEND_API unary_op_type get_unary_op(int opcode); | |
| ZEND_API binary_op_type get_binary_op(int opcode); | |
| void zend_stop_lexing(void); | |
| void zend_emit_final_return(bool return_one); | |
| typedef enum { | |
| ZEND_MODIFIER_TARGET_PROPERTY = 0, | |
| ZEND_MODIFIER_TARGET_METHOD, | |
| ZEND_MODIFIER_TARGET_CONSTANT, | |
| ZEND_MODIFIER_TARGET_CPP, | |
| ZEND_MODIFIER_TARGET_PROPERTY_HOOK, | |
| } zend_modifier_target; | |
| /* Used during AST construction */ | |
| zend_ast *zend_ast_append_str(zend_ast *left, zend_ast *right); | |
| zend_ast *zend_negate_num_string(zend_ast *ast); | |
| uint32_t zend_add_class_modifier(uint32_t flags, uint32_t new_flag); | |
| uint32_t zend_add_anonymous_class_modifier(uint32_t flags, uint32_t new_flag); | |
| uint32_t zend_add_member_modifier(uint32_t flags, uint32_t new_flag, zend_modifier_target target); | |
| uint32_t zend_modifier_token_to_flag(zend_modifier_target target, uint32_t flags); | |
| uint32_t zend_modifier_list_to_flags(zend_modifier_target target, zend_ast *modifiers); | |
| bool zend_handle_encoding_declaration(zend_ast *ast); | |
| ZEND_API zend_class_entry *zend_bind_class_in_slot( | |
| zval *class_table_slot, zval *lcname, zend_string *lc_parent_name); | |
| ZEND_API zend_result do_bind_function(zend_function *func, zval *lcname); | |
| ZEND_API zend_result do_bind_class(zval *lcname, zend_string *lc_parent_name); | |
| void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline); | |
| ZEND_API void function_add_ref(zend_function *function); | |
| zend_string *zval_make_interned_string(zval *zv); | |
| /* helper functions in zend_language_scanner.l */ | |
| struct _zend_arena; | |
| ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type); | |
| ZEND_API zend_op_array *compile_string(zend_string *source_string, const char *filename, zend_compile_position position); | |
| ZEND_API zend_op_array *compile_filename(int type, zend_string *filename); | |
| ZEND_API zend_ast *zend_compile_string_to_ast( | |
| zend_string *code, struct _zend_arena **ast_arena, zend_string *filename); | |
| ZEND_API zend_result zend_execute_scripts(int type, zval *retval, int file_count, ...); | |
| ZEND_API zend_result zend_execute_script(int type, zval *retval, zend_file_handle *file_handle); | |
| ZEND_API zend_result open_file_for_scanning(zend_file_handle *file_handle); | |
| ZEND_API void init_op_array(zend_op_array *op_array, uint8_t type, int initial_ops_size); | |
| ZEND_API void destroy_op_array(zend_op_array *op_array); | |
| ZEND_API void zend_destroy_static_vars(zend_op_array *op_array); | |
| ZEND_API void zend_destroy_file_handle(zend_file_handle *file_handle); | |
| ZEND_API void zend_cleanup_mutable_class_data(zend_class_entry *ce); | |
| ZEND_API void zend_cleanup_internal_class_data(zend_class_entry *ce); | |
| ZEND_API void zend_type_release(zend_type type, bool persistent); | |
| ZEND_API zend_string *zend_create_member_string(zend_string *class_name, zend_string *member_name); | |
| ZEND_API ZEND_COLD void zend_user_exception_handler(void); | |
| void zend_free_internal_arg_info(zend_internal_function *function); | |
| ZEND_API void destroy_zend_function(zend_function *function); | |
| ZEND_API void zend_function_dtor(zval *zv); | |
| ZEND_API void destroy_zend_class(zval *zv); | |
| void zend_class_add_ref(zval *zv); | |
| ZEND_API zend_string *zend_mangle_property_name(const char *src1, size_t src1_length, const char *src2, size_t src2_length, bool internal); | |
| ZEND_API zend_result zend_unmangle_property_name_ex(const zend_string *name, const char **class_name, const char **prop_name, size_t *prop_len); | |
| static zend_always_inline const char *zend_get_unmangled_property_name(const zend_string *mangled_prop) { | |
| const char *class_name, *prop_name; | |
| zend_unmangle_property_name(mangled_prop, &class_name, &prop_name); | |
| return prop_name; | |
| } | |
| typedef bool (*zend_needs_live_range_cb)(zend_op_array *op_array, zend_op *opline); | |
| ZEND_API void zend_recalc_live_ranges( | |
| zend_op_array *op_array, zend_needs_live_range_cb needs_live_range); | |
| ZEND_API void pass_two(zend_op_array *op_array); | |
| ZEND_API bool zend_is_compiling(void); | |
| ZEND_API char *zend_make_compiled_string_description(const char *name); | |
| ZEND_API void zend_initialize_class_data(zend_class_entry *ce, bool nullify_handlers); | |
| uint32_t zend_get_class_fetch_type(const zend_string *name); | |
| ZEND_API uint8_t zend_get_call_op(const zend_op *init_op, zend_function *fbc, bool result_used); | |
| ZEND_API bool zend_is_smart_branch(const zend_op *opline); | |
| typedef bool (*zend_auto_global_callback)(zend_string *name); | |
| typedef struct _zend_auto_global { | |
| zend_string *name; | |
| zend_auto_global_callback auto_global_callback; | |
| bool jit; | |
| bool armed; | |
| } zend_auto_global; | |
| ZEND_API zend_result zend_register_auto_global(zend_string *name, bool jit, zend_auto_global_callback auto_global_callback); | |
| ZEND_API void zend_activate_auto_globals(void); | |
| ZEND_API bool zend_is_auto_global(zend_string *name); | |
| ZEND_API bool zend_is_auto_global_str(const char *name, size_t len); | |
| ZEND_API size_t zend_dirname(char *path, size_t len); | |
| ZEND_API void zend_set_function_arg_flags(zend_function *func); | |
| int ZEND_FASTCALL zendlex(zend_parser_stack_elem *elem); | |
| void zend_assert_valid_class_name(const zend_string *const_name, const char *type); | |
| zend_string *zend_type_to_string_resolved(zend_type type, zend_class_entry *scope); | |
| ZEND_API zend_string *zend_type_to_string(zend_type type); | |
| /* BEGIN: OPCODES */ | |
| /* END: OPCODES */ | |
| /* class fetches */ | |
| /* These should not clash with ZEND_ACC_PPP_MASK and ZEND_ACC_PPP_SET_MASK */ | |
| /* ZEND_FETCH_ flags in class name AST of new const expression must not clash with ZEND_NAME_ flags */ | |
| /* var status for backpatching */ | |
| /* global/local fetches */ | |
| /* Only one of these can ever be in use */ | |
| /* Used to mark what kind of operation a writing FETCH_DIM is used in, | |
| * to produce a more precise error on incorrect string offset use. */ | |
| /* The send mode, the is_variadic, the is_promoted, and the is_tentative flags are stored as part of zend_type */ | |
| /* Attributes for ${} encaps var in strings (ZEND_AST_DIM or ZEND_AST_VAR node) */ | |
| /* ZEND_AST_VAR nodes can have any of the ZEND_ENCAPS_VAR_* flags */ | |
| /* ZEND_AST_DIM flags can have ZEND_ENCAPS_VAR_DOLLAR_CURLY during the parse phase. */ | |
| /* Make sure these don't clash with ZEND_FETCH_CLASS_* flags. */ | |
| static zend_always_inline bool zend_check_arg_send_type(const zend_function *zf, uint32_t arg_num, uint32_t mask) | |
| { | |
| arg_num--; | |
| if (UNEXPECTED(arg_num >= zf->common.num_args)) { | |
| if (EXPECTED((zf->common.fn_flags & ZEND_ACC_VARIADIC) == 0)) { | |
| return 0; | |
| } | |
| arg_num = zf->common.num_args; | |
| } | |
| return UNEXPECTED((ZEND_ARG_SEND_MODE(&zf->common.arg_info[arg_num]) & mask) != 0); | |
| } | |
| /* Quick API to check first 12 arguments */ | |
| /* Attribute for ternary inside parentheses */ | |
| /* Used to distinguish (parent::$prop)::get() from parent hook call. */ | |
| /* For "use" AST nodes and the seen symbol table */ | |
| /* All increment opcodes are even (decrement are odd) */ | |
| /* Pseudo-opcodes that are used only temporarily during compilation */ | |
| END_EXTERN_C() | |
| /* The following constants may be combined in CG(compiler_options) | |
| * to change the default compiler behavior */ | |
| /* generate extended debug information */ | |
| /* call op_array handler of extensions */ | |
| /* generate ZEND_INIT_FCALL_BY_NAME for internal functions instead of ZEND_INIT_FCALL */ | |
| /* 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 appear in run-time */ | |
| /* generate ZEND_DECLARE_CLASS_DELAYED opcode to delay early binding */ | |
| /* disable constant substitution at compile-time */ | |
| /* disable substitution of persistent constants at compile-time */ | |
| /* generate ZEND_INIT_FCALL_BY_NAME for userland functions instead of ZEND_INIT_FCALL */ | |
| /* force ZEND_ACC_USE_GUARDS for all classes */ | |
| /* disable builtin special case function calls */ | |
| /* result of compilation may be stored in file cache */ | |
| /* ignore functions and classes declared in other files */ | |
| /* this flag is set when compiler invoked by opcache_compile_file() */ | |
| /* this flag is set when compiler invoked during preloading */ | |
| /* disable jumptable optimization for switch statements */ | |
| /* this flag is set when compiler invoked during preloading in separate process */ | |
| /* ignore observer notifications, e.g. to manually notify afterwards in a post-processing step after compilation */ | |
| /* The default value for CG(compiler_options) */ | |
| /* The default value for CG(compiler_options) during eval() */ | |
| ZEND_API bool zend_is_op_long_compatible(const zval *op); | |
| ZEND_API bool zend_binary_op_produces_error(uint32_t opcode, const zval *op1, const zval *op2); | |
| ZEND_API bool zend_unary_op_produces_error(uint32_t opcode, const zval *op); | |
| bool zend_try_ct_eval_cast(zval *result, uint32_t type, zval *op1); | |