diff options
author | Dmitry Stogov <dmitry@zend.com> | 2021-03-24 10:36:47 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2021-03-24 10:36:47 +0300 |
commit | 3e996622c7846529a094bc33098b53326b97b25f (patch) | |
tree | 4fa55be576bc20cd1c65a175a12ae7469dd17cbf | |
parent | 5b01c4863fe9e4bc2702b2bbf66d292d23001a18 (diff) | |
download | php-git-3e996622c7846529a094bc33098b53326b97b25f.tar.gz |
Replace function with macro
-rw-r--r-- | ext/opcache/jit/zend_jit.c | 4 | ||||
-rw-r--r-- | ext/opcache/jit/zend_jit_x86.dasc | 11 | ||||
-rw-r--r-- | ext/opcache/jit/zend_jit_x86.h | 3 |
3 files changed, 5 insertions, 13 deletions
diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c index edee5f2573..4e8e089e50 100644 --- a/ext/opcache/jit/zend_jit.c +++ b/ext/opcache/jit/zend_jit.c @@ -1510,7 +1510,7 @@ static int zend_jit_try_allocate_free_reg(const zend_op_array *op_array, const z if (!ZEND_REGSET_IN(*hints, it->reg) && /* TODO: Avoid most often scratch registers. Find a better way ??? */ (!current->used_as_hint || - !ZEND_REGSET_IN(zend_jit_get_low_priority_regset(), it->reg))) { + !ZEND_REGSET_IN(ZEND_REGSET_LOW_PRIORITY, it->reg))) { hint = it->reg; } } else { @@ -1640,7 +1640,7 @@ static int zend_jit_try_allocate_free_reg(const zend_op_array *op_array, const z low_priority_regs = *hints; if (current->used_as_hint) { /* TODO: Avoid most often scratch registers. Find a better way ??? */ - low_priority_regs = ZEND_REGSET_UNION(low_priority_regs, zend_jit_get_low_priority_regset()); + low_priority_regs = ZEND_REGSET_UNION(low_priority_regs, ZEND_REGSET_LOW_PRIORITY); } ZEND_REGSET_FOREACH(available, i) { diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc index 6bb4c78778..21d478c253 100644 --- a/ext/opcache/jit/zend_jit_x86.dasc +++ b/ext/opcache/jit/zend_jit_x86.dasc @@ -15796,17 +15796,6 @@ static zend_regset zend_jit_get_scratch_regset(const zend_op *opline, const zend return regset; } -static zend_regset zend_jit_get_low_priority_regset(void) -{ - zend_regset regset = ZEND_REGSET_EMPTY; - - ZEND_REGSET_INCL(regset, ZREG_R0); - ZEND_REGSET_INCL(regset, ZREG_R1); - ZEND_REGSET_INCL(regset, ZREG_XMM0); - ZEND_REGSET_INCL(regset, ZREG_XMM1); - return regset; -} - #if defined(__clang__) # pragma clang diagnostic pop #endif diff --git a/ext/opcache/jit/zend_jit_x86.h b/ext/opcache/jit/zend_jit_x86.h index f811a1d520..c521a661a0 100644 --- a/ext/opcache/jit/zend_jit_x86.h +++ b/ext/opcache/jit/zend_jit_x86.h @@ -148,4 +148,7 @@ typedef uint32_t zend_regset; (ZEND_REGSET(ZREG_RBX) | ZEND_REGSET(ZREG_RBP)) #endif +#define ZEND_REGSET_LOW_PRIORITY \ + (ZEND_REGSET(ZREG_R0) | ZEND_REGSET(ZREG_R1) | ZEND_REGSET(ZREG_XMM0) | ZEND_REGSET(ZREG_XMM1)) + #endif /* ZEND_JIT_X86_H */ |