Skip to content

Commit 9fa7763

Browse files
committed
Update IR
IR commit: eeed93083e73396985d8ade7d90006021b517315
1 parent b90c9ca commit 9fa7763

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

ext/opcache/jit/ir/ir.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ struct _ir_ctx {
547547
ir_ref consts_count; /* number of constants stored in constants buffer */
548548
ir_ref consts_limit; /* size of allocated constants buffer (it's extended when overflow) */
549549
uint32_t flags; /* IR context flags (see IR_* defines above) */
550-
uint32_t flags2; /* IR context provate flags (see IR_* defines in ir_private.h) */
550+
uint32_t flags2; /* IR context private flags (see IR_* defines in ir_private.h) */
551551
ir_type ret_type; /* Function return type */
552552
uint32_t mflags; /* CPU specific flags (see IR_X86_... macros below) */
553553
int32_t status; /* non-zero error code (see IR_ERROR_... macros), app may use negative codes */
@@ -602,6 +602,7 @@ struct _ir_ctx {
602602
ir_code_buffer *code_buffer;
603603
#if defined(IR_TARGET_AARCH64)
604604
int32_t deoptimization_exits;
605+
const void *deoptimization_exits_base;
605606
ir_get_exit_addr_t get_exit_addr;
606607
ir_get_veneer_t get_veneer;
607608
ir_set_veneer_t set_veneer;

ext/opcache/jit/ir/ir_aarch64.dasc

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5349,8 +5349,8 @@ void *ir_emit_code(ir_ctx *ctx, size_t *size_ptr)
53495349
dasm_init(&data.dasm_state, DASM_MAXSECTION);
53505350
dasm_setupglobal(&data.dasm_state, dasm_labels, ir_lb_MAX);
53515351
dasm_setup(&data.dasm_state, dasm_actions);
5352-
/* labels for each block + for each constant + rodata label + jmp_table label + for each entry */
5353-
dasm_growpc(&data.dasm_state, ctx->cfg_blocks_count + 1 + ctx->consts_count + 1 + 1 + 1 + ctx->entries_count);
5352+
/* labels for each block + for each constant + rodata label + jmp_table label + for each entry + exit_table label */
5353+
dasm_growpc(&data.dasm_state, ctx->cfg_blocks_count + 1 + ctx->consts_count + 1 + 1 + 1 + ctx->entries_count + 1);
53545354
data.emit_constants = ir_bitset_malloc(ctx->consts_count);
53555355

53565356
if (!(ctx->flags & IR_SKIP_PROLOGUE)) {
@@ -5607,6 +5607,9 @@ void *ir_emit_code(ir_ctx *ctx, size_t *size_ptr)
56075607
}
56085608

56095609
if (ctx->deoptimization_exits) {
5610+
uint32_t exit_table_label = ctx->cfg_blocks_count + 1 + ctx->consts_count + 1 + 1 + 1 + ctx->entries_count;
5611+
5612+
|=>exit_table_label:
56105613
for (i = 0; i < ctx->deoptimization_exits; i++) {
56115614
const void *exit_addr = ctx->get_exit_addr(i);
56125615

@@ -5757,6 +5760,12 @@ void *ir_emit_code(ir_ctx *ctx, size_t *size_ptr)
57575760
ir_mem_unprotect(entry, size);
57585761
}
57595762

5763+
if (ctx->deoptimization_exits) {
5764+
uint32_t exit_table_label = ctx->cfg_blocks_count + 1 + ctx->consts_count + 1 + 1 + 1 + ctx->entries_count;
5765+
5766+
ctx->deoptimization_exits_base = (const void*)((char*)entry + dasm_getpclabel(&data.dasm_state, exit_table_label));
5767+
}
5768+
57605769
ir_current_ctx = ctx;
57615770
ret = dasm_encode(&data.dasm_state, entry);
57625771
if (ret != DASM_S_OK) {

ext/opcache/jit/ir/ir_private.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,8 @@ IR_ALWAYS_INLINE uint32_t ir_insn_len(const ir_insn *insn)
904904
#define IR_RA_HAVE_SPLITS (1<<25)
905905
#define IR_RA_HAVE_SPILLS (1<<26)
906906

907+
#define IR_RESERVED_FLAG_1 (1U<<31)
908+
907909
/*** IR Binding ***/
908910
IR_ALWAYS_INLINE ir_ref ir_binding_find(const ir_ctx *ctx, ir_ref ref)
909911
{

0 commit comments

Comments
 (0)