22#if defined(__x86_64__) || defined(i386) || defined(ZEND_WIN32)
23# define ZEND_JIT_TARGET_X86 1
24# define ZEND_JIT_TARGET_ARM64 0
25#elif defined (__aarch64__)
26# define ZEND_JIT_TARGET_X86 0
27# define ZEND_JIT_TARGET_ARM64 1
29# error "JIT not supported on this platform"
32#define ZEND_JIT_LEVEL_NONE 0
33#define ZEND_JIT_LEVEL_MINIMAL 1
34#define ZEND_JIT_LEVEL_INLINE 2
35#define ZEND_JIT_LEVEL_OPT_FUNC 3
36#define ZEND_JIT_LEVEL_OPT_FUNCS 4
37#define ZEND_JIT_LEVEL_OPT_SCRIPT 5
39#define ZEND_JIT_ON_SCRIPT_LOAD 0
40#define ZEND_JIT_ON_FIRST_EXEC 1
41#define ZEND_JIT_ON_PROF_REQUEST 2
42#define ZEND_JIT_ON_HOT_COUNTERS 3
43#define ZEND_JIT_ON_DOC_COMMENT 4
44#define ZEND_JIT_ON_HOT_TRACE 5
46#define ZEND_JIT_REG_ALLOC_LOCAL (1<<0)
47#define ZEND_JIT_REG_ALLOC_GLOBAL (1<<1)
48#define ZEND_JIT_CPU_AVX (1<<2)
50#define ZEND_JIT_DEFAULT_BUFFER_SIZE "64M"
52#define ZEND_JIT_COUNTER_INIT 32531
54#define ZEND_JIT_DEBUG_ASM (1<<0)
55#define ZEND_JIT_DEBUG_SSA (1<<1)
56#define ZEND_JIT_DEBUG_REG_ALLOC (1<<2)
57#define ZEND_JIT_DEBUG_ASM_STUBS (1<<3)
59#define ZEND_JIT_DEBUG_PERF (1<<4)
60#define ZEND_JIT_DEBUG_PERF_DUMP (1<<5)
61#define ZEND_JIT_DEBUG_VTUNE (1<<7)
63#define ZEND_JIT_DEBUG_GDB (1<<8)
64#define ZEND_JIT_DEBUG_SIZE (1<<9)
65#define ZEND_JIT_DEBUG_ASM_ADDR (1<<10)
67#define ZEND_JIT_DEBUG_TRACE_START (1<<12)
68#define ZEND_JIT_DEBUG_TRACE_STOP (1<<13)
69#define ZEND_JIT_DEBUG_TRACE_COMPILED (1<<14)
70#define ZEND_JIT_DEBUG_TRACE_EXIT (1<<15)
71#define ZEND_JIT_DEBUG_TRACE_ABORT (1<<16)
72#define ZEND_JIT_DEBUG_TRACE_BLACKLIST (1<<17)
73#define ZEND_JIT_DEBUG_TRACE_BYTECODE (1<<18)
74#define ZEND_JIT_DEBUG_TRACE_TSSA (1<<19)
75#define ZEND_JIT_DEBUG_TRACE_EXIT_INFO (1<<20)
77#define ZEND_JIT_DEBUG_IR_SRC (1<<24)
78#define ZEND_JIT_DEBUG_IR_FINAL (1<<25)
79#define ZEND_JIT_DEBUG_IR_AFTER_SCCP (1<<26)
80#define ZEND_JIT_DEBUG_IR_AFTER_CFG (1<<27)
82#define ZEND_JIT_DEBUG_IR_AFTER_GCM (1<<28)
83#define ZEND_JIT_DEBUG_IR_AFTER_SCHEDULE (1<<29)
84#define ZEND_JIT_DEBUG_IR_AFTER_REGS (1<<30)
85#define ZEND_JIT_DEBUG_IR_CODEGEN (1U<<31)
87#define ZEND_JIT_DEBUG_PERSISTENT 0x1f0
89#define ZEND_JIT_TRACE_MAX_LENGTH 1024
90#define ZEND_JIT_TRACE_MAX_EXITS 512
92#define ZEND_JIT_TRACE_MAX_FUNCS 30
93#define ZEND_JIT_TRACE_MAX_CALL_DEPTH 10
94#define ZEND_JIT_TRACE_MAX_RET_DEPTH 4
95#define ZEND_JIT_TRACE_MAX_LOOPS_UNROLL 10
97#define ZEND_JIT_TRACE_BAD_ROOT_SLOTS 64
148# define JIT_G(v) ZEND_TSRMG(jit_globals_id, zend_jit_globals *, v)
149extern int jit_globals_id;
151# define JIT_G(v) (jit_globals.v)
171#define ZREG_LOAD (1<<0)
172#define ZREG_STORE (1<<1)
173#define ZREG_LAST_USE (1<<2)
175#define ZREG_PI (1<<3)
176#define ZREG_PHI (1<<4)
177#define ZREG_FORWARD (1<<5)
179#define ZREG_SPILL_SLOT (1<<3)
181#define ZREG_CONST (1<<4)
182#define ZREG_ZVAL_COPY (2<<4)
183#define ZREG_TYPE_ONLY (3<<4)
184#define ZREG_ZVAL_ADDREF (4<<4)
185#define ZREG_THIS (5<<4)
zend_long max_exit_counters
const zend_op * bad_root_cache_opline[ZEND_JIT_TRACE_BAD_ROOT_SLOTS]
zend_long max_recursive_calls
zend_long max_polymorphic_calls
zend_long max_trace_length
zend_jit_trace_stack_frame * current_frame
zend_long max_side_traces
zend_long max_root_traces
zend_long blacklist_root_trace
zend_jit_trace_rec * current_trace
zend_long max_recursive_returns
uint8_t bad_root_cache_count[ZEND_JIT_TRACE_BAD_ROOT_SLOTS]
zend_long max_loop_unrolls
uint8_t bad_root_cache_stop[ZEND_JIT_TRACE_BAD_ROOT_SLOTS]
zend_long blacklist_side_trace
struct _zend_op_array zend_op_array
struct _zend_jit_globals zend_jit_globals
struct _zend_jit_trace_rec zend_jit_trace_rec
int zend_jit_script(zend_script *script)
void zend_jit_unprotect(void)
zend_jit_globals jit_globals
ZEND_EXT_API void zend_jit_blacklist_function(zend_op_array *op_array)
struct _zend_jit_trace_stack_frame zend_jit_trace_stack_frame
int zend_jit_debug_config(zend_long old_val, zend_long new_val, int stage)
void zend_jit_activate(void)
struct _sym_node zend_sym_node
void zend_jit_protect(void)
void zend_jit_deactivate(void)
int zend_jit_op_array(zend_op_array *op_array, zend_script *script)
void zend_jit_shutdown(void)
int zend_jit_check_support(void)
#define ZEND_JIT_TRACE_BAD_ROOT_SLOTS
int zend_jit_config(zend_string *jit_options, int stage)
void zend_jit_restart(void)
ZEND_EXT_API void zend_jit_status(zval *ret)
void zend_jit_startup(void *jit_buffer, size_t size, bool reattached)
struct _zend_string zend_string
struct _zend_script zend_script