Skip to content

Commit 2beb44a

Browse files
committed
Merge branch 'PHP-8.4'
* PHP-8.4: Revert "Update IR"
2 parents 4d9fc50 + 9abb0fb commit 2beb44a

File tree

12 files changed

+114
-483
lines changed

12 files changed

+114
-483
lines changed

ext/opcache/jit/ir/ir.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -803,9 +803,7 @@ ir_ref ir_proto(ir_ctx *ctx, uint8_t flags, ir_type ret_type, uint32_t params_co
803803
proto->flags = flags;
804804
proto->ret_type = ret_type;
805805
proto->params_count = params_count;
806-
if (params_count) {
807-
memcpy(proto->param_types, param_types, params_count);
808-
}
806+
memcpy(proto->param_types, param_types, params_count);
809807
return ir_strl(ctx, (const char *)proto, offsetof(ir_proto_t, param_types) + params_count);
810808
}
811809

ext/opcache/jit/ir/ir.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -854,9 +854,6 @@ void ir_gdb_unregister_all(void);
854854
bool ir_gdb_present(void);
855855

856856
/* IR load API (implementation in ir_load.c) */
857-
#define IR_RESOLVE_SYM_ADD_THUNK (1<<0)
858-
#define IR_RESOLVE_SYM_SILENT (1<<1)
859-
860857
struct _ir_loader {
861858
uint32_t default_func_flags;
862859
bool (*init_module) (ir_loader *loader, const char *name, const char *filename, const char *target);
@@ -873,7 +870,7 @@ struct _ir_loader {
873870
bool (*sym_data_end) (ir_loader *loader, uint32_t flags);
874871
bool (*func_init) (ir_loader *loader, ir_ctx *ctx, const char *name);
875872
bool (*func_process) (ir_loader *loader, ir_ctx *ctx, const char *name);
876-
void*(*resolve_sym_name) (ir_loader *loader, const char *name, uint32_t flags);
873+
void*(*resolve_sym_name) (ir_loader *loader, const char *name, bool add_thunk);
877874
bool (*has_sym) (ir_loader *loader, const char *name);
878875
bool (*add_sym) (ir_loader *loader, const char *name, void *addr);
879876
};

ext/opcache/jit/ir/ir_aarch64.dasc

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4366,15 +4366,11 @@ static void ir_emit_va_arg(ir_ctx *ctx, ir_ref def, ir_insn *insn)
43664366
ir_backend_data *data = ctx->data;
43674367
dasm_State **Dst = &data->dasm_state;
43684368
ir_type type = insn->type;
4369-
ir_reg def_reg = IR_REG_NUM(ctx->regs[def][0]);
4369+
ir_reg def_reg = ctx->regs[def][0];
43704370
ir_reg op2_reg = ctx->regs[def][2];
43714371
ir_reg tmp_reg = ctx->regs[def][3];
43724372
int32_t offset;
43734373

4374-
if (ctx->use_lists[def].count == 1) {
4375-
/* dead load */
4376-
return;
4377-
}
43784374
IR_ASSERT(def_reg != IR_REG_NONE && tmp_reg != IR_REG_NONE);
43794375
if (op2_reg != IR_REG_NONE) {
43804376
if (IR_REG_SPILLED(op2_reg)) {
@@ -4398,15 +4394,11 @@ static void ir_emit_va_arg(ir_ctx *ctx, ir_ref def, ir_insn *insn)
43984394
ir_backend_data *data = ctx->data;
43994395
dasm_State **Dst = &data->dasm_state;
44004396
ir_type type = insn->type;
4401-
ir_reg def_reg = IR_REG_NUM(ctx->regs[def][0]);
4397+
ir_reg def_reg = ctx->regs[def][0];
44024398
ir_reg op2_reg = ctx->regs[def][2];
44034399
ir_reg tmp_reg = ctx->regs[def][3];
44044400
int32_t offset;
44054401

4406-
if (ctx->use_lists[def].count == 1) {
4407-
/* dead load */
4408-
return;
4409-
}
44104402
IR_ASSERT(def_reg != IR_REG_NONE && tmp_reg != IR_REG_NONE);
44114403
if (op2_reg != IR_REG_NONE) {
44124404
if (IR_REG_SPILLED(op2_reg)) {
@@ -4943,28 +4935,6 @@ static void ir_emit_tailcall(ir_ctx *ctx, ir_ref def, ir_insn *insn)
49434935
return;
49444936
}
49454937

4946-
/* Move op2 to a tmp register before epilogue if it's in
4947-
* used_preserved_regs, because it will be overridden. */
4948-
4949-
ir_reg op2_reg = IR_REG_NONE;
4950-
if (!IR_IS_CONST_REF(insn->op2)) {
4951-
op2_reg = ctx->regs[def][2];
4952-
IR_ASSERT(op2_reg != IR_REG_NONE);
4953-
4954-
if (IR_REG_SPILLED(op2_reg)) {
4955-
op2_reg = IR_REG_INT_TMP;
4956-
ir_emit_load(ctx, IR_ADDR, op2_reg, insn->op2);
4957-
} else if (IR_REGSET_IN((ir_regset)ctx->used_preserved_regs, IR_REG_NUM(op2_reg))) {
4958-
ir_reg orig_op2_reg = op2_reg;
4959-
op2_reg = IR_REG_INT_TMP;
4960-
4961-
ir_type type = ctx->ir_base[insn->op2].type;
4962-
| ASM_REG_REG_OP mov, type, op2_reg, IR_REG_NUM(orig_op2_reg)
4963-
} else {
4964-
op2_reg = IR_REG_NUM(op2_reg);
4965-
}
4966-
}
4967-
49684938
ir_emit_epilogue(ctx);
49694939

49704940
if (IR_IS_CONST_REF(insn->op2)) {
@@ -4977,8 +4947,13 @@ static void ir_emit_tailcall(ir_ctx *ctx, ir_ref def, ir_insn *insn)
49774947
| br Rx(IR_REG_INT_TMP)
49784948
}
49794949
} else {
4950+
ir_reg op2_reg = ctx->regs[def][2];
4951+
49804952
IR_ASSERT(op2_reg != IR_REG_NONE);
4981-
IR_ASSERT(!IR_REGSET_IN((ir_regset)ctx->used_preserved_regs, op2_reg));
4953+
if (IR_REG_SPILLED(op2_reg)) {
4954+
op2_reg = IR_REG_NUM(op2_reg);
4955+
ir_emit_load(ctx, IR_ADDR, op2_reg, insn->op2);
4956+
}
49824957
| br Rx(op2_reg)
49834958
}
49844959
}

0 commit comments

Comments
 (0)