@@ -351,6 +351,9 @@ static void* zend_jit_stub_handlers[sizeof(zend_jit_stubs) / sizeof(zend_jit_stu
351
351
#endif
352
352
353
353
#if defined(IR_TARGET_AARCH64)
354
+
355
+ #define IR_HAS_VENEERS (1U<<31) /* IR_RESERVED_FLAG_1 */
356
+
354
357
static const void *zend_jit_get_veneer(ir_ctx *ctx, const void *addr)
355
358
{
356
359
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)
369
372
zend_jit_trace_info *t = ((zend_jit_ctx*)ctx)->trace;
370
373
371
374
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) );
373
376
}
374
377
}
375
378
@@ -389,6 +392,7 @@ static bool zend_jit_set_veneer(ir_ctx *ctx, const void *addr, const void *venee
389
392
if (zend_jit_stub_handlers[i] == addr) {
390
393
const void **ptr = (const void**)&zend_jit_stub_handlers[count + i];
391
394
*ptr = veneer;
395
+ ctx->flags2 |= IR_HAS_VENEERS;
392
396
#ifdef HAVE_CAPSTONE
393
397
if (JIT_G(debug) & ZEND_JIT_DEBUG_ASM) {
394
398
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)
2827
2831
2828
2832
*dasm_ptr = code_buffer.pos;
2829
2833
2830
- if (entry) {
2831
- *dasm_ptr = (char*)entry + ZEND_MM_ALIGNED_SIZE_EX(*size, 16);
2832
- }
2833
-
2834
2834
#if defined(IR_TARGET_AARCH64)
2835
- if (ctx->veneers_size ) {
2835
+ if (ctx->flags2 & IR_HAS_VENEERS ) {
2836
2836
zend_jit_commit_veneers();
2837
- *size -= ctx->veneers_size;
2838
2837
}
2839
2838
#endif
2840
2839
@@ -15809,7 +15808,6 @@ static const void *zend_jit_trace_allocate_exit_group(uint32_t n)
15809
15808
*dasm_ptr = code_buffer.pos;
15810
15809
15811
15810
if (entry) {
15812
- *dasm_ptr = (char*)entry + ZEND_MM_ALIGNED_SIZE_EX(size, 16);
15813
15811
#ifdef HAVE_CAPSTONE
15814
15812
if (JIT_G(debug) & ZEND_JIT_DEBUG_ASM) {
15815
15813
uint32_t i;
0 commit comments