Skip to content

Commit 57ad25b

Browse files
committed
Partial typed properties support (incomplete)
1 parent 6f335ed commit 57ad25b

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

ext/opcache/jit/zend_jit.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1999,6 +1999,7 @@ static void zend_calc_checked_this_r(zend_bitset checked_this, zend_op_array *op
19991999
case ZEND_FETCH_OBJ_FUNC_ARG:
20002000
case ZEND_FETCH_OBJ_UNSET:
20012001
case ZEND_ASSIGN_OBJ:
2002+
case ZEND_ASSIGN_OBJ_REF:
20022003
case ZEND_INIT_METHOD_CALL:
20032004
case ZEND_CLONE:
20042005
case ZEND_UNSET_OBJ:

ext/opcache/jit/zend_jit_helpers.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1672,6 +1672,7 @@ static zval* ZEND_FASTCALL zend_jit_new_ref_helper(zval *value)
16721672
zend_reference *ref = (zend_reference*)emalloc(sizeof(zend_reference));
16731673
GC_SET_REFCOUNT(ref, 1);
16741674
GC_TYPE_INFO(ref) = IS_REFERENCE;
1675+
ref->sources.ptr = NULL;
16751676
ZVAL_COPY_VALUE(&ref->val, value);
16761677
Z_REF_P(value) = ref;
16771678
Z_TYPE_INFO_P(value) = IS_REFERENCE_EX;

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2261,6 +2261,8 @@ static int zend_jit_handler(dasm_State **Dst, const zend_op *opline, int may_thr
22612261
switch (opline->opcode) {
22622262
case ZEND_ASSIGN_DIM:
22632263
case ZEND_ASSIGN_OBJ:
2264+
case ZEND_ASSIGN_STATIC_PROP:
2265+
case ZEND_ASSIGN_OBJ_REF:
22642266
last_valid_opline++;
22652267
break;
22662268
case ZEND_ASSIGN_ADD:
@@ -4745,7 +4747,7 @@ static int zend_jit_assign_op(dasm_State **Dst, const zend_op *opline, zend_op_a
47454747

47464748
if (opline->extended_value == ZEND_ASSIGN_DIM) {
47474749
return zend_jit_assign_dim_op(Dst, opline, op_array, ssa);
4748-
} else if (opline->extended_value == ZEND_ASSIGN_OBJ) {
4750+
} else if (opline->extended_value == ZEND_ASSIGN_OBJ || opline->extended_value == ZEND_ASSIGN_STATIC_PROP) {
47494751
goto fallback;
47504752
}
47514753

@@ -7433,7 +7435,8 @@ static int zend_jit_send_ref(dasm_State **Dst, const zend_op *opline, zend_op_ar
74337435
| SET_ZVAL_PTR arg_addr, r0
74347436
| SET_ZVAL_TYPE_INFO arg_addr, IS_REFERENCE_EX
74357437
| mov dword [r0], 1
7436-
| mov dword [r0 + 4], IS_REFERENCE;
7438+
| mov dword [r0 + offsetof(zend_reference, gc.u.type_info)], IS_REFERENCE
7439+
| mov aword [r0 + offsetof(zend_reference, sources.ptr)], 0
74377440
ref_addr = ZEND_ADDR_MEM_ZVAL(ZREG_R0, 8);
74387441
| // ZVAL_NULL(Z_REFVAL_P(arg));
74397442
| SET_ZVAL_TYPE_INFO ref_addr, IS_NULL
@@ -7483,7 +7486,8 @@ static int zend_jit_send_ref(dasm_State **Dst, const zend_op *opline, zend_op_ar
74837486
}
74847487
| EMALLOC sizeof(zend_reference), op_array, opline
74857488
| mov dword [r0], 2
7486-
| mov dword [r0 + 4], IS_REFERENCE;
7489+
| mov dword [r0 + offsetof(zend_reference, gc.u.type_info)], IS_REFERENCE
7490+
| mov aword [r0 + offsetof(zend_reference, sources.ptr)], 0
74877491
ref_addr = ZEND_ADDR_MEM_ZVAL(ZREG_R0, 8);
74887492
if (opline->op1_type == IS_VAR) {
74897493
zend_jit_addr val_addr = ZEND_ADDR_MEM_ZVAL(ZREG_R1, 0);
@@ -8841,14 +8845,14 @@ static int zend_jit_recv(dasm_State **Dst, const zend_op *opline, zend_op_array
88418845
if (!ZEND_TYPE_IS_CLASS(type)) {
88428846
unsigned char code = ZEND_TYPE_CODE(type);
88438847

8844-
if (type == _IS_BOOL) {
8848+
if (code == _IS_BOOL) {
88458849
| cmp byte [r0 + 8], IS_FALSE
88468850
| je >1
88478851
| cmp byte [r0 + 8], IS_TRUE
88488852
| jne >8
88498853
|1:
88508854
} else {
8851-
| cmp byte [r0 + 8], code
8855+
| cmp byte [r0 + 8], code
88528856
| jne >8
88538857
}
88548858
} else {

0 commit comments

Comments
 (0)