Skip to content

Commit 7714f1f

Browse files
committed
Support for IR API changes
1 parent f6376f5 commit 7714f1f

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

ext/opcache/jit/zend_jit_ir.c

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2729,6 +2729,7 @@ static int zend_jit_free_ctx(zend_jit_ctx *jit)
27292729
static void *zend_jit_ir_compile(ir_ctx *ctx, size_t *size, const char *name)
27302730
{
27312731
void *entry;
2732+
ir_code_buffer code_buffer;
27322733

27332734
if (JIT_G(debug) & ZEND_JIT_DEBUG_IR_SRC) {
27342735
if (name) fprintf(stderr, "%s: ; after folding\n", name);
@@ -2817,10 +2818,15 @@ static void *zend_jit_ir_compile(ir_ctx *ctx, size_t *size, const char *name)
28172818
ir_check(ctx);
28182819
#endif
28192820

2820-
ctx->code_buffer = *dasm_ptr;
2821-
ctx->code_buffer_size = (char*)dasm_end - (char*)*dasm_ptr;
2821+
code_buffer.start = dasm_buf;
2822+
code_buffer.end = dasm_end;
2823+
code_buffer.pos = *dasm_ptr;
2824+
ctx->code_buffer = &code_buffer;
28222825

28232826
entry = ir_emit_code(ctx, size);
2827+
2828+
*dasm_ptr = code_buffer.pos;
2829+
28242830
if (entry) {
28252831
*dasm_ptr = (char*)entry + ZEND_MM_ALIGNED_SIZE_EX(*size, 16);
28262832
}
@@ -15791,9 +15797,16 @@ static const void *zend_jit_trace_allocate_exit_group(uint32_t n)
1579115797
{
1579215798
const void *entry;
1579315799
size_t size;
15800+
ir_code_buffer code_buffer;
15801+
15802+
code_buffer.start = dasm_buf;
15803+
code_buffer.end = dasm_end;
15804+
code_buffer.pos = *dasm_ptr;
1579415805

1579515806
entry = ir_emit_exitgroup(n, ZEND_JIT_EXIT_POINTS_PER_GROUP, zend_jit_stub_handlers[jit_stub_trace_exit],
15796-
*dasm_ptr, (char*)dasm_end - (char*)*dasm_ptr, &size);
15807+
&code_buffer, &size);
15808+
15809+
*dasm_ptr = code_buffer.pos;
1579715810

1579815811
if (entry) {
1579915812
*dasm_ptr = (char*)entry + ZEND_MM_ALIGNED_SIZE_EX(size, 16);

0 commit comments

Comments
 (0)