From: Dmitry Stogov Date: Thu, 9 Jul 2020 09:40:56 +0000 (+0300) Subject: Use RIP-relative addressing X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5872bfc481d7a969eb80c7be35f248841d9d8e65;p=php Use RIP-relative addressing --- diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc index 25678e206a..7ba23e3d10 100644 --- a/ext/opcache/jit/zend_jit_x86.dasc +++ b/ext/opcache/jit/zend_jit_x86.dasc @@ -11440,7 +11440,12 @@ static int zend_jit_switch(dasm_State **Dst, const zend_op *opline, const zend_o | cmp FCARG2a, jumptable->nNumUsed | jae >3 |.if X64 - | jmp aword [FCARG2a * 8 + >4] + if (!IS_32BIT(dasm_end)) { + | lea r0, aword [>4] + | jmp aword [r0 + FCARG2a * 8] + } else { + | jmp aword [FCARG2a * 8 + >4] + } |.else | jmp aword [FCARG2a * 4 + >4] |.endif @@ -11474,7 +11479,16 @@ static int zend_jit_switch(dasm_State **Dst, const zend_op *opline, const zend_o | cdq |.endif | idiv FCARG1a + |.if X64 + if (!IS_32BIT(dasm_end)) { + | lea FCARG1a, aword [>4] + | jmp aword [FCARG1a + r0] + } else { + | jmp aword [r0 + >4] + } + |.else | jmp aword [r0 + >4] + |.endif |3: |.cold_code |.align aword @@ -11520,7 +11534,16 @@ static int zend_jit_switch(dasm_State **Dst, const zend_op *opline, const zend_o | cdq |.endif | idiv FCARG1a + |.if X64 + if (!IS_32BIT(dasm_end)) { + | lea FCARG1a, aword [>4] + | jmp aword [FCARG1a + r0] + } else { + | jmp aword [r0 + >4] + } + |.else | jmp aword [r0 + >4] + |.endif |3: |.cold_code |.align aword