php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
zend_compile.c File Reference
#include <zend_language_parser.h>
#include "zend.h"
#include "zend_ast.h"
#include "zend_attributes.h"
#include "zend_compile.h"
#include "zend_constants.h"
#include "zend_llist.h"
#include "zend_API.h"
#include "zend_exceptions.h"
#include "zend_interfaces.h"
#include "zend_virtual_cwd.h"
#include "zend_multibyte.h"
#include "zend_language_scanner.h"
#include "zend_inheritance.h"
#include "zend_vm.h"
#include "zend_enum.h"
#include "zend_observer.h"
#include "zend_call_stack.h"
#include "zend_frameless_function.h"
#include "zend_property_hooks.h"

Go to the source code of this file.

Data Structures

struct  _zend_loop_var
 
struct  reserved_class_name
 
struct  _builtin_type_info
 
struct  confusable_type_info
 
struct  find_property_usage_context
 
struct  closure_info
 
struct  const_expr_context
 

Macros

#define SET_NODE(target, src)
 
#define GET_NODE(target, src)
 
#define FC(member)
 
#define LITERAL_STR(op, str)
 
#define ZEND_SHORT_CIRCUITING_INNER   0x8000
 

Typedefs

typedef struct _zend_loop_var zend_loop_var
 
typedef struct _builtin_type_info builtin_type_info
 

Functions

void zend_assert_valid_class_name (const zend_string *name, const char *type)
 
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)
 
void zend_init_compiler_data_structures (void)
 
void init_compiler (void)
 
void shutdown_compiler (void)
 
ZEND_API zend_stringzend_set_compiled_filename (zend_string *new_compiled_filename)
 
ZEND_API void zend_restore_compiled_filename (zend_string *original_compiled_filename)
 
ZEND_API zend_stringzend_get_compiled_filename (void)
 
ZEND_API int zend_get_compiled_lineno (void)
 
ZEND_API bool zend_is_compiling (void)
 
zend_stringzval_make_interned_string (zval *zv)
 
void zend_stop_lexing (void)
 
uint32_t zend_modifier_token_to_flag (zend_modifier_target target, uint32_t token)
 
uint32_t zend_modifier_list_to_flags (zend_modifier_target target, zend_ast *modifiers)
 
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)
 
ZEND_API zend_stringzend_create_member_string (zend_string *class_name, zend_string *member_name)
 
ZEND_API void function_add_ref (zend_function *function)
 
ZEND_API zend_result do_bind_function (zend_function *func, zval *lcname)
 
ZEND_API zend_class_entryzend_bind_class_in_slot (zval *class_table_slot, zval *lcname, zend_string *lc_parent_name)
 
ZEND_API zend_result do_bind_class (zval *lcname, zend_string *lc_parent_name)
 
zend_stringzend_type_to_string_resolved (zend_type type, zend_class_entry *scope)
 
ZEND_API zend_stringzend_type_to_string (zend_type type)
 
ZEND_API zend_stringzend_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)
 
uint32_t zend_get_class_fetch_type (const zend_string *name)
 
ZEND_API bool zend_is_auto_global_str (const char *name, size_t len)
 
ZEND_API bool zend_is_auto_global (zend_string *name)
 
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)
 
int ZEND_FASTCALL zendlex (zend_parser_stack_elem *elem)
 
ZEND_API void zend_initialize_class_data (zend_class_entry *ce, bool nullify_handlers)
 
ZEND_API zend_stringzend_get_compiled_variable_name (const zend_op_array *op_array, uint32_t var)
 
zend_astzend_ast_append_str (zend_ast *left_ast, zend_ast *right_ast)
 
zend_astzend_negate_num_string (zend_ast *ast)
 
ZEND_API size_t zend_dirname (char *path, size_t len)
 
ZEND_API bool zend_is_smart_branch (const zend_op *opline)
 
void zend_emit_final_return (bool return_one)
 
ZEND_API uint8_t zend_get_call_op (const zend_op *init_op, zend_function *fbc)
 
void zend_resolve_goto_label (zend_op_array *op_array, zend_op *opline)
 
bool zend_handle_encoding_declaration (zend_ast *ast)
 
ZEND_API void zend_set_function_arg_flags (zend_function *func)
 
zend_property_hook_kind zend_get_property_hook_kind_from_name (zend_string *name)
 
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)
 
void zend_const_expr_to_zval (zval *result, zend_ast **ast_ptr, bool allow_dynamic)
 
void zend_compile_top_stmt (zend_ast *ast)
 

Variables

ZEND_API zend_op_array *(* zend_compile_file )(zend_file_handle *file_handle, int type)
 
ZEND_API zend_op_array *(* zend_compile_string )(zend_string *source_string, const char *filename, zend_compile_position position)
 
ZEND_API zend_compiler_globals compiler_globals
 
ZEND_API zend_executor_globals executor_globals
 

Macro Definition Documentation

◆ FC

#define FC ( member)
Value:
(CG(file_context).member)
#define CG(v)

Definition at line 60 of file zend_compile.c.

◆ GET_NODE

#define GET_NODE ( target,
src )
Value:
do { \
(target)->op_type = src ## _type; \
if ((target)->op_type == IS_CONST) { \
ZVAL_COPY_VALUE(&(target)->u.constant, CT_CONSTANT(src)); \
} else { \
(target)->u.op = src; \
} \
} while (0)
uint32_t u
Definition cdf.c:78
#define CT_CONSTANT(node)
#define IS_CONST

Definition at line 51 of file zend_compile.c.

◆ LITERAL_STR

#define LITERAL_STR ( op,
str )
Value:
do { \
zval _c; \
ZVAL_STR(&_c, str); \
op.constant = zend_add_literal(&_c); \
} while (0)
struct _zval_struct zval

Definition at line 692 of file zend_compile.c.

◆ SET_NODE

#define SET_NODE ( target,
src )
Value:
do { \
target ## _type = (src)->op_type; \
if ((src)->op_type == IS_CONST) { \
target.constant = zend_add_literal(&(src)->u.constant); \
} else { \
target = (src)->u.op; \
} \
} while (0)

Definition at line 42 of file zend_compile.c.

◆ ZEND_SHORT_CIRCUITING_INNER

#define ZEND_SHORT_CIRCUITING_INNER   0x8000

Definition at line 2539 of file zend_compile.c.

Typedef Documentation

◆ builtin_type_info

◆ zend_loop_var

typedef struct _zend_loop_var zend_loop_var

Function Documentation

◆ do_bind_class()

ZEND_API zend_result do_bind_class ( zval * lcname,
zend_string * lc_parent_name )

Definition at line 1356 of file zend_compile.c.

◆ do_bind_function()

ZEND_API zend_result do_bind_function ( zend_function * func,
zval * lcname )

Definition at line 1295 of file zend_compile.c.

◆ function_add_ref()

ZEND_API void function_add_ref ( zend_function * function)

Definition at line 1257 of file zend_compile.c.

◆ init_compiler()

void init_compiler ( void )

Definition at line 448 of file zend_compile.c.

◆ shutdown_compiler()

void shutdown_compiler ( void )

Definition at line 465 of file zend_compile.c.

◆ zend_activate_auto_globals()

ZEND_API void zend_activate_auto_globals ( void )

Definition at line 2021 of file zend_compile.c.

◆ zend_add_anonymous_class_modifier()

uint32_t zend_add_anonymous_class_modifier ( uint32_t flags,
uint32_t new_flag )

Definition at line 995 of file zend_compile.c.

◆ zend_add_class_modifier()

uint32_t zend_add_class_modifier ( uint32_t flags,
uint32_t new_flag )

Definition at line 970 of file zend_compile.c.

◆ zend_add_member_modifier()

uint32_t zend_add_member_modifier ( uint32_t flags,
uint32_t new_flag,
zend_modifier_target target )

Definition at line 1014 of file zend_compile.c.

◆ zend_assert_valid_class_name()

void zend_assert_valid_class_name ( const zend_string * name,
const char * type )

Definition at line 240 of file zend_compile.c.

◆ zend_ast_append_str()

zend_ast * zend_ast_append_str ( zend_ast * left_ast,
zend_ast * right_ast )

Definition at line 2129 of file zend_compile.c.

◆ zend_binary_op_produces_error()

ZEND_API bool zend_binary_op_produces_error ( uint32_t opcode,
const zval * op1,
const zval * op2 )

Definition at line 9680 of file zend_compile.c.

◆ zend_bind_class_in_slot()

ZEND_API zend_class_entry * zend_bind_class_in_slot ( zval * class_table_slot,
zval * lcname,
zend_string * lc_parent_name )

Definition at line 1314 of file zend_compile.c.

◆ zend_compile_top_stmt()

void zend_compile_top_stmt ( zend_ast * ast)

Definition at line 11289 of file zend_compile.c.

◆ zend_const_expr_to_zval()

void zend_const_expr_to_zval ( zval * result,
zend_ast ** ast_ptr,
bool allow_dynamic )

Definition at line 11270 of file zend_compile.c.

◆ zend_create_member_string()

ZEND_API zend_string * zend_create_member_string ( zend_string * class_name,
zend_string * member_name )

Definition at line 1062 of file zend_compile.c.

◆ zend_dirname()

ZEND_API size_t zend_dirname ( char * path,
size_t len )

Definition at line 2182 of file zend_compile.c.

◆ zend_emit_final_return()

void zend_emit_final_return ( bool return_one)

Definition at line 2723 of file zend_compile.c.

◆ zend_file_context_begin()

void zend_file_context_begin ( zend_file_context * prev_context)

Definition at line 395 of file zend_compile.c.

◆ zend_file_context_end()

void zend_file_context_end ( zend_file_context * prev_context)

Definition at line 409 of file zend_compile.c.

◆ zend_get_call_op()

ZEND_API uint8_t zend_get_call_op ( const zend_op * init_op,
zend_function * fbc )

Definition at line 3935 of file zend_compile.c.

◆ zend_get_class_fetch_type()

uint32_t zend_get_class_fetch_type ( const zend_string * name)

Definition at line 1744 of file zend_compile.c.

◆ zend_get_compiled_filename()

ZEND_API zend_string * zend_get_compiled_filename ( void )

Definition at line 510 of file zend_compile.c.

◆ zend_get_compiled_lineno()

ZEND_API int zend_get_compiled_lineno ( void )

Definition at line 516 of file zend_compile.c.

◆ zend_get_compiled_variable_name()

ZEND_API zend_string * zend_get_compiled_variable_name ( const zend_op_array * op_array,
uint32_t var )

Definition at line 2123 of file zend_compile.c.

◆ zend_get_property_hook_kind_from_name()

zend_property_hook_kind zend_get_property_hook_kind_from_name ( zend_string * name)

Definition at line 8409 of file zend_compile.c.

◆ zend_handle_encoding_declaration()

bool zend_handle_encoding_declaration ( zend_ast * ast)

Definition at line 6788 of file zend_compile.c.

◆ zend_init_compiler_data_structures()

void zend_init_compiler_data_structures ( void )

Definition at line 417 of file zend_compile.c.

◆ zend_initialize_class_data()

ZEND_API void zend_initialize_class_data ( zend_class_entry * ce,
bool nullify_handlers )

Definition at line 2054 of file zend_compile.c.

◆ zend_is_auto_global()

ZEND_API bool zend_is_auto_global ( zend_string * name)

Definition at line 1992 of file zend_compile.c.

◆ zend_is_auto_global_str()

ZEND_API bool zend_is_auto_global_str ( const char * name,
size_t len )

Definition at line 1979 of file zend_compile.c.

◆ zend_is_compiling()

ZEND_API bool zend_is_compiling ( void )

Definition at line 522 of file zend_compile.c.

◆ zend_is_op_long_compatible()

ZEND_API bool zend_is_op_long_compatible ( const zval * op)

Definition at line 9658 of file zend_compile.c.

◆ zend_is_smart_branch()

ZEND_API bool zend_is_smart_branch ( const zend_op * opline)

Definition at line 2366 of file zend_compile.c.

◆ zend_mangle_property_name()

ZEND_API zend_string * zend_mangle_property_name ( const char * src1,
size_t src1_length,
const char * src2,
size_t src2_length,
bool internal )

Definition at line 1575 of file zend_compile.c.

◆ zend_modifier_list_to_flags()

uint32_t zend_modifier_list_to_flags ( zend_modifier_target target,
zend_ast * modifiers )

Definition at line 951 of file zend_compile.c.

◆ zend_modifier_token_to_flag()

uint32_t zend_modifier_token_to_flag ( zend_modifier_target target,
uint32_t token )

Definition at line 873 of file zend_compile.c.

◆ zend_negate_num_string()

zend_ast * zend_negate_num_string ( zend_ast * ast)

Definition at line 2150 of file zend_compile.c.

◆ zend_oparray_context_begin()

void zend_oparray_context_begin ( zend_oparray_context * prev_context,
zend_op_array * op_array )

Definition at line 326 of file zend_compile.c.

◆ zend_oparray_context_end()

void zend_oparray_context_end ( zend_oparray_context * prev_context)

Definition at line 346 of file zend_compile.c.

◆ zend_register_auto_global()

ZEND_API zend_result zend_register_auto_global ( zend_string * name,
bool jit,
zend_auto_global_callback auto_global_callback )

Definition at line 2006 of file zend_compile.c.

◆ zend_resolve_goto_label()

void zend_resolve_goto_label ( zend_op_array * op_array,
zend_op * opline )

Definition at line 5850 of file zend_compile.c.

◆ zend_restore_compiled_filename()

ZEND_API void zend_restore_compiled_filename ( zend_string * original_compiled_filename)

Definition at line 500 of file zend_compile.c.

◆ zend_set_compiled_filename()

ZEND_API zend_string * zend_set_compiled_filename ( zend_string * new_compiled_filename)

Definition at line 493 of file zend_compile.c.

◆ zend_set_function_arg_flags()

ZEND_API void zend_set_function_arg_flags ( zend_function * func)

Definition at line 6935 of file zend_compile.c.

◆ zend_stop_lexing()

void zend_stop_lexing ( void )

Definition at line 698 of file zend_compile.c.

◆ zend_type_to_string()

ZEND_API zend_string * zend_type_to_string ( zend_type type)

Definition at line 1532 of file zend_compile.c.

◆ zend_type_to_string_resolved()

zend_string * zend_type_to_string_resolved ( zend_type type,
zend_class_entry * scope )

Definition at line 1442 of file zend_compile.c.

◆ zend_unary_op_produces_error()

ZEND_API bool zend_unary_op_produces_error ( uint32_t opcode,
const zval * op )

Definition at line 9757 of file zend_compile.c.

◆ zend_unmangle_property_name_ex()

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 )

Definition at line 1587 of file zend_compile.c.

◆ zendlex()

int ZEND_FASTCALL zendlex ( zend_parser_stack_elem * elem)

Definition at line 2037 of file zend_compile.c.

◆ zval_make_interned_string()

zend_string * zval_make_interned_string ( zval * zv)

Definition at line 558 of file zend_compile.c.

Variable Documentation

◆ compiler_globals

ZEND_API zend_compiler_globals compiler_globals

Definition at line 91 of file zend_compile.c.

◆ executor_globals

ZEND_API zend_executor_globals executor_globals

Definition at line 92 of file zend_compile.c.

◆ zend_compile_file

ZEND_API zend_op_array *(* zend_compile_file) (zend_file_handle *file_handle, int type) ( zend_file_handle * file_handle,
int type )

Definition at line 87 of file zend_compile.c.

◆ zend_compile_string

ZEND_API zend_op_array *(* zend_compile_string) (zend_string *source_string, const char *filename, zend_compile_position position) ( zend_string * source_string,
const char * filename,
zend_compile_position position )

Definition at line 88 of file zend_compile.c.