Skip to content

Commit 94b637d

Browse files
committed
Avoid $this check
1 parent 1434983 commit 94b637d

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11178,29 +11178,31 @@ static int zend_jit_fetch_this(dasm_State **Dst, const zend_op *opline, const ze
1117811178
{
1117911179
zend_jit_addr res_addr = RES_ADDR();
1118011180

11181-
if (JIT_G(trigger) == ZEND_JIT_ON_HOT_TRACE) {
11182-
if (!JIT_G(current_frame) ||
11183-
!TRACE_FRAME_IS_THIS_CHECKED(JIT_G(current_frame))) {
11181+
if (!op_array->scope || (op_array->fn_flags & ZEND_ACC_STATIC)) {
11182+
if (JIT_G(trigger) == ZEND_JIT_ON_HOT_TRACE) {
11183+
if (!JIT_G(current_frame) ||
11184+
!TRACE_FRAME_IS_THIS_CHECKED(JIT_G(current_frame))) {
1118411185

11185-
int32_t exit_point = zend_jit_trace_get_exit_point(opline, opline, NULL, ZEND_JIT_EXIT_TO_VM);
11186-
const void *exit_addr = zend_jit_trace_get_exit_addr(exit_point);
11186+
int32_t exit_point = zend_jit_trace_get_exit_point(opline, opline, NULL, ZEND_JIT_EXIT_TO_VM);
11187+
const void *exit_addr = zend_jit_trace_get_exit_addr(exit_point);
1118711188

11188-
| cmp byte EX->This.u1.v.type, IS_OBJECT
11189-
| jne &exit_addr
11189+
| cmp byte EX->This.u1.v.type, IS_OBJECT
11190+
| jne &exit_addr
1119011191

11191-
if (JIT_G(current_frame)) {
11192-
TRACE_FRAME_SET_THIS_CHECKED(JIT_G(current_frame));
11192+
if (JIT_G(current_frame)) {
11193+
TRACE_FRAME_SET_THIS_CHECKED(JIT_G(current_frame));
11194+
}
1119311195
}
11194-
}
11195-
} else {
11196+
} else {
1119611197

11197-
| cmp byte EX->This.u1.v.type, IS_OBJECT
11198-
| jne >1
11199-
|.cold_code
11200-
|1:
11201-
| SAVE_VALID_OPLINE opline, r0
11202-
| jmp ->invalid_this
11203-
|.code
11198+
| cmp byte EX->This.u1.v.type, IS_OBJECT
11199+
| jne >1
11200+
|.cold_code
11201+
|1:
11202+
| SAVE_VALID_OPLINE opline, r0
11203+
| jmp ->invalid_this
11204+
|.code
11205+
}
1120411206
}
1120511207

1120611208
| mov r0, aword EX->This.value.ptr

0 commit comments

Comments
 (0)