Skip to content

Commit fa919f9

Browse files
committed
Fixed JIT with ON_HOT_COUNTERS trigger (opcache.jit=1235)
1 parent c6a6ca0 commit fa919f9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2196,7 +2196,7 @@ static int zend_jit_hybrid_func_counter_stub(dasm_State **Dst)
21962196
|->hybrid_func_counter:
21972197
| mov r0, EX->func
21982198
| mov r1, aword [r0 + offsetof(zend_op_array, reserved[zend_func_info_rid])]
2199-
| mov r2, aword [r1]
2199+
| mov r2, aword [r1 + offsetof(zend_jit_op_array_hot_extension, counter)]
22002200
| sub word [r2], ZEND_JIT_HOT_FUNC_COST
22012201
| jle >1
22022202
| GET_IP r2
@@ -2211,9 +2211,9 @@ static int zend_jit_hybrid_func_counter_stub(dasm_State **Dst)
22112211
| imul r2, 0xb6db6db7
22122212
| .endif
22132213
| .if X64
2214-
| jmp aword [r1+r2*8+8]
2214+
| jmp aword [r1+r2*8+offsetof(zend_jit_op_array_hot_extension, orig_handlers)]
22152215
| .else
2216-
| jmp aword [r1+r2*4+4]
2216+
| jmp aword [r1+r2*4+offsetof(zend_jit_op_array_hot_extension, orig_handlers)]
22172217
| .endif
22182218
|1:
22192219
| mov word [r2], ZEND_JIT_HOT_COUNTER_INIT
@@ -2229,7 +2229,7 @@ static int zend_jit_hybrid_loop_counter_stub(dasm_State **Dst)
22292229
|->hybrid_loop_counter:
22302230
| mov r0, EX->func
22312231
| mov r1, aword [r0 + offsetof(zend_op_array, reserved[zend_func_info_rid])]
2232-
| mov r2, aword [r1]
2232+
| mov r2, aword [r1 + offsetof(zend_jit_op_array_hot_extension, counter)]
22332233
| sub word [r2], ZEND_JIT_HOT_LOOP_COST
22342234
| jle >1
22352235
| GET_IP r2
@@ -2244,9 +2244,9 @@ static int zend_jit_hybrid_loop_counter_stub(dasm_State **Dst)
22442244
| imul r2, 0xb6db6db7
22452245
| .endif
22462246
| .if X64
2247-
| jmp aword [r1+r2*8+8]
2247+
| jmp aword [r1+r2*8+offsetof(zend_jit_op_array_hot_extension, orig_handlers)]
22482248
| .else
2249-
| jmp aword [r1+r2*4+4]
2249+
| jmp aword [r1+r2*4+offsetof(zend_jit_op_array_hot_extension, orig_handlers)]
22502250
| .endif
22512251
|1:
22522252
| mov word [r2], ZEND_JIT_HOT_COUNTER_INIT

0 commit comments

Comments
 (0)