@@ -1079,7 +1079,7 @@ static void* dasm_labels[zend_lb_MAX];
1079
1079
|| if (opline) {
1080
1080
| brk #0 // TODO
1081
1081
|| }
1082
- | EXT_CALL zend_objects_store_del, REG0
1082
+ | EXT_CALL zend_objects_store_del, tmp_reg
1083
1083
|| break;
1084
1084
|| }
1085
1085
|| }
@@ -5267,7 +5267,6 @@ static int zend_jit_bool_jmpznz(dasm_State **Dst, const zend_op *opline, uint32_
5267
5267
if ((op1_info & MAY_BE_UNDEF) && (op1_info & MAY_BE_ANY)) {
5268
5268
set_delayed = 1;
5269
5269
} else {
5270
- | brk #0 // TODO
5271
5270
| SET_ZVAL_TYPE_INFO_FROM_REG res_addr, REG0w, TMP1
5272
5271
}
5273
5272
}
@@ -5332,13 +5331,83 @@ static int zend_jit_bool_jmpznz(dasm_State **Dst, const zend_op *opline, uint32_
5332
5331
5333
5332
if (op1_info & MAY_BE_LONG) {
5334
5333
|2:
5335
- | brk #0 // TODO
5334
+ if (op1_info & (MAY_BE_ANY-(MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG))) {
5335
+ | IF_NOT_ZVAL_TYPE op1_addr, IS_LONG, >2, TMP1w, TMP2
5336
+ }
5337
+ | brk #0
5336
5338
}
5337
5339
5338
5340
if ((op1_info & MAY_BE_ANY) == MAY_BE_DOUBLE) {
5339
5341
| brk #0 // TODO
5340
5342
} else if (op1_info & (MAY_BE_ANY - (MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG))) {
5341
- | brk #0 // TODO
5343
+ if (op1_info & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG)) {
5344
+ |.cold_code
5345
+ |2:
5346
+ }
5347
+ if (Z_REG(op1_addr) != ZREG_FCARG1x || Z_OFFSET(op1_addr) != 0) {
5348
+ | LOAD_ZVAL_ADDR FCARG1x, op1_addr
5349
+ }
5350
+ | SET_EX_OPLINE opline, REG0
5351
+ | EXT_CALL zend_is_true, REG0
5352
+ | mov REG0, RETVALx
5353
+
5354
+ if ((opline->op1_type & (IS_VAR|IS_TMP_VAR)) &&
5355
+ (op1_info & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE))) {
5356
+ op1_addr = ZEND_ADDR_MEM_ZVAL(ZREG_FP, opline->op1.var);
5357
+
5358
+ if (op1_info & ((MAY_BE_ANY|MAY_BE_UNDEF)-(MAY_BE_OBJECT|MAY_BE_RESOURCE))) {
5359
+ | IF_NOT_ZVAL_REFCOUNTED op1_addr, >3, TMP1w, TMP2
5360
+ }
5361
+ | GET_ZVAL_PTR FCARG1x, op1_addr, TMP1
5362
+ | GC_DELREF FCARG1x, TMP1w
5363
+ | bne >3
5364
+ | brk #0 // TODO: currently jump to label 3.
5365
+ // In x86, r0 is used in macro ZVAL_DTOR_FUNC as temporary register, hence, r0 should be saved/restored
5366
+ // before/after this macro. In AArch64, TMP1 is used. As a result, we needn't save/resotre REG0.
5367
+ | ZVAL_DTOR_FUNC op1_info, opline, TMP1
5368
+ |3:
5369
+ }
5370
+ if (may_throw) {
5371
+ | MEM_LOAD_CMP_ZTS ldr, xzr, executor_globals, exception, REG1, TMP1
5372
+ | bne ->exception_handler_undef
5373
+ }
5374
+
5375
+ if (set_bool) {
5376
+ if (set_bool_not) {
5377
+ | brk #0 // TODO
5378
+ | neg REG0w, REG0w
5379
+ | add REG0w, REG0w, #3
5380
+ } else {
5381
+ | add REG0w, REG0w, #2
5382
+ }
5383
+ | SET_ZVAL_TYPE_INFO_FROM_REG res_addr, REG0w, TMP1
5384
+ if (exit_addr) {
5385
+ | brk #0 // TODO
5386
+ } else if (true_label != (uint32_t)-1 || false_label != (uint32_t)-1) {
5387
+ | CMP_ZVAL_TYPE res_addr, IS_FALSE, TMP1w, TMP2
5388
+ if (true_label != (uint32_t)-1) {
5389
+ | brk #0 // TODO
5390
+ | bne =>true_label
5391
+ if (false_label != (uint32_t)-1) {
5392
+ | b =>false_label
5393
+ } else if (op1_info & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG)) {
5394
+ | b >9
5395
+ }
5396
+ } else {
5397
+ | beq =>false_label
5398
+ }
5399
+ }
5400
+ if (op1_info & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG)) {
5401
+ | b >9
5402
+ |.code
5403
+ }
5404
+ } else {
5405
+ | brk #0 // TODO
5406
+
5407
+ if (op1_info & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG)) {
5408
+ |.code
5409
+ }
5410
+ }
5342
5411
}
5343
5412
5344
5413
|9:
@@ -6012,7 +6081,6 @@ static int zend_jit_init_method_call(dasm_State **Dst,
6012
6081
| mov CARG3, sp
6013
6082
| SET_EX_OPLINE opline, REG0
6014
6083
if ((opline->op1_type & (IS_VAR|IS_TMP_VAR)) && !use_this) {
6015
- | brk #0 // TODO
6016
6084
| EXT_CALL zend_jit_find_method_tmp_helper, REG0
6017
6085
} else {
6018
6086
| EXT_CALL zend_jit_find_method_helper, REG0
@@ -7496,9 +7564,9 @@ static int zend_jit_zval_copy_deref(dasm_State **Dst, zend_jit_addr res_addr, ze
7496
7564
| lsr TMP1w, REG2w, #8
7497
7565
| and TMP1w, TMP1w, #0xff // TMP1w -> 8-15 bits of REG2w
7498
7566
| IF_NOT_REFCOUNTED TMP1w, >2
7499
- | brk #0 // TODO: currently jump to label 2 directly.
7500
7567
| and TMP2w, REG2w, #0xff // TMP2w -> low 8 bits of REG2w
7501
7568
| IF_NOT_TYPE TMP2w, IS_REFERENCE, >1
7569
+ | brk #0 // TODO
7502
7570
| add TMP3, REG1, #offsetof(zend_reference, val)
7503
7571
| GET_Z_TYPE_INFO REG2w, TMP3
7504
7572
| GET_Z_PTR REG1, TMP3
@@ -8128,7 +8196,6 @@ static int zend_jit_fetch_obj(dasm_State **Dst,
8128
8196
prop_info = zend_get_known_property_info(op_array, ce, Z_STR_P(member), opline->op1_type == IS_UNUSED, op_array->filename);
8129
8197
8130
8198
if (opline->op1_type == IS_UNUSED || use_this) {
8131
- | brk #0 // TODO
8132
8199
| GET_ZVAL_PTR FCARG1x, this_addr, TMP1
8133
8200
} else {
8134
8201
if (opline->op1_type == IS_VAR
0 commit comments