Skip to content

Commit 1347d90

Browse files
committed
JIT: Avoid reloading of EX(run_time_cache)
1 parent c51b0d9 commit 1347d90

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

ext/opcache/jit/zend_jit_arm64.dasc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8447,8 +8447,8 @@ static int zend_jit_init_fcall(dasm_State **Dst, const zend_op *opline, uint32_t
84478447
| ldr REG0, EX->func
84488448
} else {
84498449
| // if (CACHED_PTR(opline->result.num))
8450-
| ldr REG0, EX->run_time_cache
8451-
| ldr REG0, [REG0, #opline->result.num]
8450+
| ldr REG2, EX->run_time_cache
8451+
| ldr REG0, [REG2, #opline->result.num]
84528452
| cbz REG0, >1
84538453
|.cold_code
84548454
|1:
@@ -8457,11 +8457,10 @@ static int zend_jit_init_fcall(dasm_State **Dst, const zend_op *opline, uint32_t
84578457
&& func->type == ZEND_USER_FUNCTION
84588458
&& (func->op_array.fn_flags & ZEND_ACC_IMMUTABLE)) {
84598459
| LOAD_ADDR FCARG1x, func
8460+
| str FCARG1x, [REG2, #opline->result.num]
84608461
| EXT_CALL zend_jit_init_func_run_time_cache_helper, REG0
8461-
| ldr REG1, EX->run_time_cache
84628462
| mov REG0, RETVALx
84638463
|| ZEND_ASSERT(opline->result.num <= LDR_STR_PIMM64);
8464-
| str REG0, [REG1, #opline->result.num]
84658464
| b >3
84668465
} else {
84678466
zval *zv = RT_CONSTANT(opline, opline->op2);

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9014,8 +9014,8 @@ static int zend_jit_init_fcall(dasm_State **Dst, const zend_op *opline, uint32_t
90149014
}
90159015
} else {
90169016
| // if (CACHED_PTR(opline->result.num))
9017-
| mov r0, EX->run_time_cache
9018-
| mov r0, aword [r0 + opline->result.num]
9017+
| mov r2, EX->run_time_cache
9018+
| mov r0, aword [r2 + opline->result.num]
90199019
| test r0, r0
90209020
| jz >1
90219021
|.cold_code
@@ -9025,9 +9025,8 @@ static int zend_jit_init_fcall(dasm_State **Dst, const zend_op *opline, uint32_t
90259025
&& func->type == ZEND_USER_FUNCTION
90269026
&& (func->op_array.fn_flags & ZEND_ACC_IMMUTABLE)) {
90279027
| LOAD_ADDR FCARG1a, func
9028+
| mov aword [r2 + opline->result.num], FCARG1a
90289029
| EXT_CALL zend_jit_init_func_run_time_cache_helper, r0
9029-
| mov r1, EX->run_time_cache
9030-
| mov aword [r1 + opline->result.num], r0
90319030
| jmp >3
90329031
} else {
90339032
zval *zv = RT_CONSTANT(opline, opline->op2);

0 commit comments

Comments
 (0)