Skip to content

Commit 3e99662

Browse files
committed
Replace function with macro
1 parent 5b01c48 commit 3e99662

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

ext/opcache/jit/zend_jit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,7 +1510,7 @@ static int zend_jit_try_allocate_free_reg(const zend_op_array *op_array, const z
15101510
if (!ZEND_REGSET_IN(*hints, it->reg) &&
15111511
/* TODO: Avoid most often scratch registers. Find a better way ??? */
15121512
(!current->used_as_hint ||
1513-
!ZEND_REGSET_IN(zend_jit_get_low_priority_regset(), it->reg))) {
1513+
!ZEND_REGSET_IN(ZEND_REGSET_LOW_PRIORITY, it->reg))) {
15141514
hint = it->reg;
15151515
}
15161516
} else {
@@ -1640,7 +1640,7 @@ static int zend_jit_try_allocate_free_reg(const zend_op_array *op_array, const z
16401640
low_priority_regs = *hints;
16411641
if (current->used_as_hint) {
16421642
/* TODO: Avoid most often scratch registers. Find a better way ??? */
1643-
low_priority_regs = ZEND_REGSET_UNION(low_priority_regs, zend_jit_get_low_priority_regset());
1643+
low_priority_regs = ZEND_REGSET_UNION(low_priority_regs, ZEND_REGSET_LOW_PRIORITY);
16441644
}
16451645

16461646
ZEND_REGSET_FOREACH(available, i) {

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15796,17 +15796,6 @@ static zend_regset zend_jit_get_scratch_regset(const zend_op *opline, const zend
1579615796
return regset;
1579715797
}
1579815798

15799-
static zend_regset zend_jit_get_low_priority_regset(void)
15800-
{
15801-
zend_regset regset = ZEND_REGSET_EMPTY;
15802-
15803-
ZEND_REGSET_INCL(regset, ZREG_R0);
15804-
ZEND_REGSET_INCL(regset, ZREG_R1);
15805-
ZEND_REGSET_INCL(regset, ZREG_XMM0);
15806-
ZEND_REGSET_INCL(regset, ZREG_XMM1);
15807-
return regset;
15808-
}
15809-
1581015799
#if defined(__clang__)
1581115800
# pragma clang diagnostic pop
1581215801
#endif

ext/opcache/jit/zend_jit_x86.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,7 @@ typedef uint32_t zend_regset;
148148
(ZEND_REGSET(ZREG_RBX) | ZEND_REGSET(ZREG_RBP))
149149
#endif
150150

151+
#define ZEND_REGSET_LOW_PRIORITY \
152+
(ZEND_REGSET(ZREG_R0) | ZEND_REGSET(ZREG_R1) | ZEND_REGSET(ZREG_XMM0) | ZEND_REGSET(ZREG_XMM1))
153+
151154
#endif /* ZEND_JIT_X86_H */

0 commit comments

Comments
 (0)