Skip to content

Commit 4c70079

Browse files
committed
Try to add arm jit support (blindly...)
1 parent b5c4ea9 commit 4c70079

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

ext/opcache/jit/zend_jit_arm64.dasc

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11830,7 +11830,6 @@ static int zend_jit_fetch_obj(dasm_State **Dst,
1183011830
| mov FCARG1x, TMP1
1183111831
prop_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FCARG1x, 0);
1183211832
if (opline->opcode == ZEND_FETCH_OBJ_W
11833-
&& (opline->extended_value & ZEND_FETCH_OBJ_FLAGS)
1183411833
&& (!ce || ce_is_instanceof || (ce->ce_flags & ZEND_ACC_HAS_TYPE_HINTS))) {
1183511834
uint32_t flags = opline->extended_value & ZEND_FETCH_OBJ_FLAGS;
1183611835

@@ -11839,6 +11838,14 @@ static int zend_jit_fetch_obj(dasm_State **Dst,
1183911838
| cbnz FCARG2x, >1
1184011839
|.cold_code
1184111840
|1:
11841+
| ldr TMP1w, [FCARG2x, #offsetof(zend_property_info, flags)]
11842+
| tst TMP1w, #ZEND_ACC_READONLY
11843+
| bne >2
11844+
| IF_TYPE REG2w, IS_OBJECT, >2
11845+
| mov FCARG1x, FCARG2x
11846+
| EXT_CALL zend_readonly_property_modification_error, REG0
11847+
| b >9
11848+
|2:
1184211849
if (flags == ZEND_FETCH_DIM_WRITE) {
1184311850
| SET_EX_OPLINE opline, REG0
1184411851
| EXT_CALL zend_jit_check_array_promotion, REG0
@@ -11848,7 +11855,7 @@ static int zend_jit_fetch_obj(dasm_State **Dst,
1184811855
| EXT_CALL zend_jit_create_typed_ref, REG0
1184911856
| b >9
1185011857
} else {
11851-
ZEND_UNREACHABLE();
11858+
ZEND_ASSERT(flags == 0);
1185211859
}
1185311860
|.code
1185411861
}
@@ -11869,6 +11876,15 @@ static int zend_jit_fetch_obj(dasm_State **Dst,
1186911876
} else {
1187011877
| IF_UNDEF REG2w, >5
1187111878
}
11879+
if (opline->opcode == ZEND_FETCH_OBJ_W && (prop_info->flags & ZEND_ACC_READONLY)) {
11880+
| IF_NOT_TYPE REG2w, IS_OBJECT, >4
11881+
|.cold_code
11882+
|4:
11883+
| LOAD_ADDR FCARG1x, prop_info
11884+
| EXT_CALL zend_readonly_property_modification_error, REG0
11885+
| b >9
11886+
|.code
11887+
}
1187211888
if (opline->opcode == ZEND_FETCH_OBJ_W
1187311889
&& (opline->extended_value & ZEND_FETCH_OBJ_FLAGS)
1187411890
&& ZEND_TYPE_IS_SET(prop_info->type)) {
@@ -12895,7 +12911,7 @@ static int zend_jit_assign_obj(dasm_State **Dst,
1289512911
}
1289612912
} else {
1289712913
prop_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FCARG1x, prop_info->offset);
12898-
if (!ce || ce_is_instanceof || !(ce->ce_flags & ZEND_ACC_IMMUTABLE) || ce->__get || ce->__set) {
12914+
if (!ce || ce_is_instanceof || !(ce->ce_flags & ZEND_ACC_IMMUTABLE) || ce->__get || ce->__set || (prop_info->flags & ZEND_ACC_READONLY)) {
1289912915
// Undefined property with magic __get()/__set()
1290012916
if (JIT_G(trigger) == ZEND_JIT_ON_HOT_TRACE) {
1290112917
int32_t exit_point = zend_jit_trace_get_exit_point(opline, ZEND_JIT_EXIT_TO_VM);

0 commit comments

Comments
 (0)