Skip to content

Commit fd55b50

Browse files
committed
Merge branch 'PHP-8.1' into PHP-8.2
2 parents 3071d85 + 52f4ed1 commit fd55b50

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ PHP NEWS
1212
. Fixed bug GH-8805 (finfo returns wrong mime type for woff/woff2 files).
1313
(Anatol)
1414

15+
- Opcache:
16+
. Added indirect call reduction for jit on x86 architectures. (wxue1)
17+
1518
- Sockets:
1619
. Fixed socket constants regression as of PHP 8.2.0beta3. (Bruce Dou)
1720

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ static size_t tsrm_tls_offset;
152152

153153
#define IS_SIGNED_32BIT(val) ((((intptr_t)(val)) <= 0x7fffffff) && (((intptr_t)(val)) >= (-2147483647 - 1)))
154154

155+
/* Call range is before or after 2GB */
156+
#define MAY_USE_32BIT_ADDR(addr) \
157+
(IS_SIGNED_32BIT((char*)(addr) - (char*)dasm_buf) && \
158+
IS_SIGNED_32BIT((char*)(addr) - (char*)dasm_end))
159+
155160
#define CAN_USE_AVX() (JIT_G(opt_flags) & allowed_opt_flags & ZEND_JIT_CPU_AVX)
156161

157162
/* Not Implemented Yet */
@@ -353,7 +358,7 @@ static size_t tsrm_tls_offset;
353358

354359
|.macro EXT_CALL, func, tmp_reg
355360
| .if X64
356-
|| if (IS_32BIT(dasm_end) && IS_32BIT(func)) {
361+
|| if (MAY_USE_32BIT_ADDR(func)) {
357362
| call qword &func
358363
|| } else {
359364
| LOAD_ADDR tmp_reg, func
@@ -366,7 +371,7 @@ static size_t tsrm_tls_offset;
366371

367372
|.macro EXT_JMP, func, tmp_reg
368373
| .if X64
369-
|| if (IS_32BIT(dasm_end) && IS_32BIT(func)) {
374+
|| if (MAY_USE_32BIT_ADDR(func)) {
370375
| jmp qword &func
371376
|| } else {
372377
| LOAD_ADDR tmp_reg, func

0 commit comments

Comments
 (0)