From 608d568686d80652e385301557f98fc5ec22fdd0 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 30 Aug 2021 13:19:04 +0300 Subject: [PATCH] JIT: Avoid reloading of EX(run_time_cache) --- ext/opcache/jit/zend_jit_arm64.dasc | 5 ++--- ext/opcache/jit/zend_jit_x86.dasc | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ext/opcache/jit/zend_jit_arm64.dasc b/ext/opcache/jit/zend_jit_arm64.dasc index 08dd092fdbb..06e49d699e8 100644 --- a/ext/opcache/jit/zend_jit_arm64.dasc +++ b/ext/opcache/jit/zend_jit_arm64.dasc @@ -11443,8 +11443,8 @@ static int zend_jit_bind_global(dasm_State **Dst, const zend_op *opline, uint32_ zend_string *varname = Z_STR_P(RT_CONSTANT(opline, opline->op2)); | // idx = (uint32_t)(uintptr_t)CACHED_PTR(opline->extended_value) - 1; - | ldr REG0, EX->run_time_cache - | MEM_ACCESS_64_WITH_UOFFSET ldr, REG0, REG0, opline->extended_value, TMP1 + | ldr FCARG2x, EX->run_time_cache + | MEM_ACCESS_64_WITH_UOFFSET ldr, REG0, FCARG2x, opline->extended_value, TMP1 | sub REG0, REG0, #1 | // if (EXPECTED(idx < EG(symbol_table).nNumUsed * sizeof(Bucket))) | MEM_LOAD_32_ZTS ldr, REG1w, executor_globals, symbol_table.nNumUsed, REG1 @@ -11506,7 +11506,6 @@ static int zend_jit_bind_global(dasm_State **Dst, const zend_op *opline, uint32_ |.cold_code |9: | LOAD_ADDR FCARG1x, (ptrdiff_t)varname - | ldr FCARG2x, EX->run_time_cache if (opline->extended_value) { | ADD_SUB_64_WITH_CONST_32 add, FCARG2x, FCARG2x, opline->extended_value, TMP1 } diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc index 07d8828ae6c..417ab6f234a 100644 --- a/ext/opcache/jit/zend_jit_x86.dasc +++ b/ext/opcache/jit/zend_jit_x86.dasc @@ -12107,8 +12107,8 @@ static int zend_jit_bind_global(dasm_State **Dst, const zend_op *opline, uint32_ zend_string *varname = Z_STR_P(RT_CONSTANT(opline, opline->op2)); | // idx = (uint32_t)(uintptr_t)CACHED_PTR(opline->extended_value) - 1; - | mov r0, EX->run_time_cache - | mov r0, aword [r0 + opline->extended_value] + | mov FCARG2a, EX->run_time_cache + | mov r0, aword [FCARG2a + opline->extended_value] | sub r0, 1 | // if (EXPECTED(idx < EG(symbol_table).nNumUsed * sizeof(Bucket))) | MEM_LOAD_ZTS ecx, dword, executor_globals, symbol_table.nNumUsed, r1 @@ -12172,7 +12172,6 @@ static int zend_jit_bind_global(dasm_State **Dst, const zend_op *opline, uint32_ |.cold_code |9: | LOAD_ADDR FCARG1a, (ptrdiff_t)varname - | mov FCARG2a, EX->run_time_cache if (opline->extended_value) { | add FCARG2a, opline->extended_value }