Skip to content

Commit

Permalink
JIT: Avoid reloading of EX(run_time_cache)
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov committed Aug 30, 2021
1 parent c51b0d9 commit 1347d90
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions ext/opcache/jit/zend_jit_arm64.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -8447,8 +8447,8 @@ static int zend_jit_init_fcall(dasm_State **Dst, const zend_op *opline, uint32_t
| ldr REG0, EX->func
} else {
| // if (CACHED_PTR(opline->result.num))
| ldr REG0, EX->run_time_cache
| ldr REG0, [REG0, #opline->result.num]
| ldr REG2, EX->run_time_cache
| ldr REG0, [REG2, #opline->result.num]
| cbz REG0, >1
|.cold_code
|1:
Expand All @@ -8457,11 +8457,10 @@ static int zend_jit_init_fcall(dasm_State **Dst, const zend_op *opline, uint32_t
&& func->type == ZEND_USER_FUNCTION
&& (func->op_array.fn_flags & ZEND_ACC_IMMUTABLE)) {
| LOAD_ADDR FCARG1x, func
| str FCARG1x, [REG2, #opline->result.num]
| EXT_CALL zend_jit_init_func_run_time_cache_helper, REG0
| ldr REG1, EX->run_time_cache
| mov REG0, RETVALx
|| ZEND_ASSERT(opline->result.num <= LDR_STR_PIMM64);
| str REG0, [REG1, #opline->result.num]
| b >3
} else {
zval *zv = RT_CONSTANT(opline, opline->op2);
Expand Down
7 changes: 3 additions & 4 deletions ext/opcache/jit/zend_jit_x86.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -9014,8 +9014,8 @@ static int zend_jit_init_fcall(dasm_State **Dst, const zend_op *opline, uint32_t
}
} else {
| // if (CACHED_PTR(opline->result.num))
| mov r0, EX->run_time_cache
| mov r0, aword [r0 + opline->result.num]
| mov r2, EX->run_time_cache
| mov r0, aword [r2 + opline->result.num]
| test r0, r0
| jz >1
|.cold_code
Expand All @@ -9025,9 +9025,8 @@ static int zend_jit_init_fcall(dasm_State **Dst, const zend_op *opline, uint32_t
&& func->type == ZEND_USER_FUNCTION
&& (func->op_array.fn_flags & ZEND_ACC_IMMUTABLE)) {
| LOAD_ADDR FCARG1a, func
| mov aword [r2 + opline->result.num], FCARG1a
| EXT_CALL zend_jit_init_func_run_time_cache_helper, r0
| mov r1, EX->run_time_cache
| mov aword [r1 + opline->result.num], r0
| jmp >3
} else {
zval *zv = RT_CONSTANT(opline, opline->op2);
Expand Down

0 comments on commit 1347d90

Please sign in to comment.