Skip to content

Commit a8eecec

Browse files
committed
Fixed AAech64 build
1 parent 9fa7763 commit a8eecec

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

ext/opcache/jit/zend_jit_ir.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,9 @@ static void* zend_jit_stub_handlers[sizeof(zend_jit_stubs) / sizeof(zend_jit_stu
351351
#endif
352352

353353
#if defined(IR_TARGET_AARCH64)
354+
355+
#define IR_HAS_VENEERS (1U<<31) /* IR_RESERVED_FLAG_1 */
356+
354357
static const void *zend_jit_get_veneer(ir_ctx *ctx, const void *addr)
355358
{
356359
int i, count = sizeof(zend_jit_stubs) / sizeof(zend_jit_stubs[0]);
@@ -369,7 +372,7 @@ static const void *zend_jit_get_veneer(ir_ctx *ctx, const void *addr)
369372
zend_jit_trace_info *t = ((zend_jit_ctx*)ctx)->trace;
370373

371374
ZEND_ASSERT(exit_point < t->exit_count);
372-
return (const void*)((char*)ctx->code_buffer + ctx->code_size - (t->exit_count - exit_point) * 4);
375+
return (const void*)((char*)ctx->deoptimization_exits_base + (exit_point * 4));
373376
}
374377
}
375378

@@ -389,6 +392,7 @@ static bool zend_jit_set_veneer(ir_ctx *ctx, const void *addr, const void *venee
389392
if (zend_jit_stub_handlers[i] == addr) {
390393
const void **ptr = (const void**)&zend_jit_stub_handlers[count + i];
391394
*ptr = veneer;
395+
ctx->flags2 |= IR_HAS_VENEERS;
392396
#ifdef HAVE_CAPSTONE
393397
if (JIT_G(debug) & ZEND_JIT_DEBUG_ASM) {
394398
const char *name = ir_disasm_find_symbol((uint64_t)(uintptr_t)addr, &offset);
@@ -2827,14 +2831,9 @@ static void *zend_jit_ir_compile(ir_ctx *ctx, size_t *size, const char *name)
28272831

28282832
*dasm_ptr = code_buffer.pos;
28292833

2830-
if (entry) {
2831-
*dasm_ptr = (char*)entry + ZEND_MM_ALIGNED_SIZE_EX(*size, 16);
2832-
}
2833-
28342834
#if defined(IR_TARGET_AARCH64)
2835-
if (ctx->veneers_size) {
2835+
if (ctx->flags2 & IR_HAS_VENEERS) {
28362836
zend_jit_commit_veneers();
2837-
*size -= ctx->veneers_size;
28382837
}
28392838
#endif
28402839

@@ -15809,7 +15808,6 @@ static const void *zend_jit_trace_allocate_exit_group(uint32_t n)
1580915808
*dasm_ptr = code_buffer.pos;
1581015809

1581115810
if (entry) {
15812-
*dasm_ptr = (char*)entry + ZEND_MM_ALIGNED_SIZE_EX(size, 16);
1581315811
#ifdef HAVE_CAPSTONE
1581415812
if (JIT_G(debug) & ZEND_JIT_DEBUG_ASM) {
1581515813
uint32_t i;

0 commit comments

Comments
 (0)