Skip to content

Commit ed03204

Browse files
committed
Merge branch 'PHP-8.1'
* PHP-8.1: JIT: Split zend_jit_hash_index_lookup_rw() into zend_jit_hash_index_lookup_rw() and zend_jit_hash_index_lookup_rw_no_packed().
2 parents b6800c7 + be8dfa7 commit ed03204

File tree

4 files changed

+22
-3
lines changed

4 files changed

+22
-3
lines changed

ext/opcache/jit/zend_jit_arm64.dasc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5167,7 +5167,11 @@ static int zend_jit_fetch_dimension_address_inner(dasm_State **Dst, const zend_o
51675167
| GET_ZVAL_LVAL ZREG_FCARG2, op2_addr, TMP1
51685168
}
51695169
| SET_EX_OPLINE opline, REG0
5170-
| EXT_CALL zend_jit_hash_index_lookup_rw, REG0
5170+
if (packed_loaded) {
5171+
| EXT_CALL zend_jit_hash_index_lookup_rw_no_packed, REG0
5172+
} else {
5173+
| EXT_CALL zend_jit_hash_index_lookup_rw, REG0
5174+
}
51715175
| mov REG0, RETVALx
51725176
if (not_found_exit_addr) {
51735177
if (packed_loaded) {

ext/opcache/jit/zend_jit_disasm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,7 @@ static int zend_jit_disasm_init(void)
615615
REGISTER_HELPER(zend_jit_leave_top_func_helper);
616616
REGISTER_HELPER(zend_jit_leave_func_helper);
617617
REGISTER_HELPER(zend_jit_symtable_find);
618+
REGISTER_HELPER(zend_jit_hash_index_lookup_rw_no_packed);
618619
REGISTER_HELPER(zend_jit_hash_index_lookup_rw);
619620
REGISTER_HELPER(zend_jit_hash_lookup_rw);
620621
REGISTER_HELPER(zend_jit_symtable_lookup_rw);

ext/opcache/jit/zend_jit_helpers.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ static zval* ZEND_FASTCALL zend_jit_symtable_find(HashTable *ht, zend_string *st
252252
return zend_hash_find(ht, str);
253253
}
254254

255-
static zval* ZEND_FASTCALL zend_jit_hash_index_lookup_rw(HashTable *ht, zend_long idx)
255+
static zval* ZEND_FASTCALL zend_jit_hash_index_lookup_rw_no_packed(HashTable *ht, zend_long idx)
256256
{
257257
zval *retval = _zend_hash_index_find(ht, idx);
258258

@@ -262,6 +262,16 @@ static zval* ZEND_FASTCALL zend_jit_hash_index_lookup_rw(HashTable *ht, zend_lon
262262
return retval;
263263
}
264264

265+
static zval* ZEND_FASTCALL zend_jit_hash_index_lookup_rw(HashTable *ht, zend_long idx)
266+
{
267+
zval *retval = zend_hash_index_find(ht, idx);
268+
269+
if (!retval) {
270+
retval = zend_undefined_offset_write(ht, idx);
271+
}
272+
return retval;
273+
}
274+
265275
static zval* ZEND_FASTCALL zend_jit_hash_lookup_rw(HashTable *ht, zend_string *str)
266276
{
267277
zval *retval = zend_hash_find_known_hash(ht, str);

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5646,7 +5646,11 @@ static int zend_jit_fetch_dimension_address_inner(dasm_State **Dst, const zend_o
56465646
| GET_ZVAL_LVAL ZREG_FCARG2, op2_addr
56475647
}
56485648
| SET_EX_OPLINE opline, r0
5649-
| EXT_CALL zend_jit_hash_index_lookup_rw, r0
5649+
if (packed_loaded) {
5650+
| EXT_CALL zend_jit_hash_index_lookup_rw_no_packed, r0
5651+
} else {
5652+
| EXT_CALL zend_jit_hash_index_lookup_rw, r0
5653+
}
56505654
| test r0, r0
56515655
if (not_found_exit_addr) {
56525656
if (packed_loaded) {

0 commit comments

Comments
 (0)