Skip to content

Commit 41e0a52

Browse files
committed
Try to fix JIT
1 parent 61f399a commit 41e0a52

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

ext/opcache/jit/zend_jit_helpers.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,3 +1533,28 @@ static void ZEND_FASTCALL zend_jit_pre_dec(zval *var_ptr, zval *ret)
15331533
decrement_function(var_ptr);
15341534
ZVAL_COPY(ret, var_ptr);
15351535
}
1536+
1537+
static int ZEND_FASTCALL zend_jit_may_be_to_is(int type)
1538+
{
1539+
if (type & MAY_BE_LONG) {
1540+
return IS_LONG;
1541+
}
1542+
1543+
if (type & MAY_BE_DOUBLE) {
1544+
return IS_DOUBLE;
1545+
}
1546+
1547+
if (type & MAY_BE_STRING) {
1548+
return IS_STRING;
1549+
}
1550+
1551+
if (type & MAY_BE_FALSE || type & MAY_BE_TRUE) {
1552+
return IS_FALSE;
1553+
}
1554+
1555+
if (type & MAY_BE_NULL) {
1556+
return IS_NULL;
1557+
}
1558+
1559+
return IS_ARRAY;
1560+
}

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10512,11 +10512,11 @@ static int zend_jit_fetch_obj_read(dasm_State **Dst, const zend_op *opline, cons
1051210512
| mov CARG1, E_WARNING
1051310513
| LOAD_ADDR CARG2, "Access to property '%s' on %s"
1051410514
| LOAD_ADDR CARG3, Z_STRVAL_P(member)
10515-
| LOAD_ADDR CARG4, "non-object"
10515+
| LOAD_ADDR CARG4, zend_get_type_by_const(op1_info & MAY_BE_UNDEF ? IS_NULL : zend_jit_may_be_to_is(op1_info))
1051610516
| EXT_CALL zend_error, r0
1051710517
|.else
1051810518
| sub r4, 4
10519-
| push "non-object"
10519+
| push zend_get_type_by_const(op1_info & MAY_BE_UNDEF ? IS_NULL : zend_jit_may_be_to_is(op1_info))
1052010520
| push Z_STRVAL_P(member)
1052110521
| push "Access to property '%s' on %s"
1052210522
| push E_WARNING

0 commit comments

Comments
 (0)