Skip to content

Commit 54fd1fc

Browse files
committed
Support for CASE_STRICT
1 parent ef7904b commit 54fd1fc

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

ext/opcache/jit/zend_jit_x86.dasc

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6238,6 +6238,7 @@ static int zend_jit_cmp_long_long(dasm_State **Dst, const zend_op *opline, zend_
62386238
case ZEND_IS_EQUAL:
62396239
case ZEND_IS_IDENTICAL:
62406240
case ZEND_CASE:
6241+
case ZEND_CASE_STRICT:
62416242
| sete al
62426243
break;
62436244
case ZEND_IS_NOT_EQUAL:
@@ -6271,6 +6272,7 @@ static int zend_jit_cmp_long_long(dasm_State **Dst, const zend_op *opline, zend_
62716272
case ZEND_IS_EQUAL:
62726273
case ZEND_IS_IDENTICAL:
62736274
case ZEND_CASE:
6275+
case ZEND_CASE_STRICT:
62746276
if (exit_addr) {
62756277
| jne &exit_addr
62766278
} else {
@@ -6330,6 +6332,7 @@ static int zend_jit_cmp_long_long(dasm_State **Dst, const zend_op *opline, zend_
63306332
case ZEND_IS_EQUAL:
63316333
case ZEND_IS_IDENTICAL:
63326334
case ZEND_CASE:
6335+
case ZEND_CASE_STRICT:
63336336
if (exit_addr) {
63346337
| je &exit_addr
63356338
} else {
@@ -6388,6 +6391,7 @@ static int zend_jit_cmp_long_long(dasm_State **Dst, const zend_op *opline, zend_
63886391
case ZEND_IS_EQUAL:
63896392
case ZEND_IS_IDENTICAL:
63906393
case ZEND_CASE:
6394+
case ZEND_CASE_STRICT:
63916395
| jne => target_label
63926396
break;
63936397
case ZEND_IS_NOT_EQUAL:
@@ -6420,6 +6424,7 @@ static int zend_jit_cmp_long_long(dasm_State **Dst, const zend_op *opline, zend_
64206424
case ZEND_IS_EQUAL:
64216425
case ZEND_IS_IDENTICAL:
64226426
case ZEND_CASE:
6427+
case ZEND_CASE_STRICT:
64236428
| sete al
64246429
break;
64256430
case ZEND_IS_NOT_EQUAL:
@@ -6459,6 +6464,7 @@ static int zend_jit_cmp_double_common(dasm_State **Dst, const zend_op *opline, z
64596464
case ZEND_IS_EQUAL:
64606465
case ZEND_IS_IDENTICAL:
64616466
case ZEND_CASE:
6467+
case ZEND_CASE_STRICT:
64626468
if (exit_addr) {
64636469
| jne &exit_addr
64646470
| jp &exit_addr
@@ -6528,6 +6534,7 @@ static int zend_jit_cmp_double_common(dasm_State **Dst, const zend_op *opline, z
65286534
case ZEND_IS_EQUAL:
65296535
case ZEND_IS_IDENTICAL:
65306536
case ZEND_CASE:
6537+
case ZEND_CASE_STRICT:
65316538
| jp >1
65326539
if (exit_addr) {
65336540
| je &exit_addr
@@ -6597,6 +6604,7 @@ static int zend_jit_cmp_double_common(dasm_State **Dst, const zend_op *opline, z
65976604
case ZEND_IS_EQUAL:
65986605
case ZEND_IS_IDENTICAL:
65996606
case ZEND_CASE:
6607+
case ZEND_CASE_STRICT:
66006608
| jne => target_label
66016609
| jp => target_label
66026610
break;
@@ -6630,6 +6638,7 @@ static int zend_jit_cmp_double_common(dasm_State **Dst, const zend_op *opline, z
66306638
case ZEND_IS_EQUAL:
66316639
case ZEND_IS_IDENTICAL:
66326640
case ZEND_CASE:
6641+
case ZEND_CASE_STRICT:
66336642
| SET_ZVAL_TYPE_INFO res_addr, IS_FALSE
66346643
| jne => target_label
66356644
| jp => target_label
@@ -6675,6 +6684,7 @@ static int zend_jit_cmp_double_common(dasm_State **Dst, const zend_op *opline, z
66756684
case ZEND_IS_EQUAL:
66766685
case ZEND_IS_IDENTICAL:
66776686
case ZEND_CASE:
6687+
case ZEND_CASE_STRICT:
66786688
| jp >1
66796689
| SET_ZVAL_TYPE_INFO res_addr, IS_TRUE
66806690
| je => target_label
@@ -6729,6 +6739,7 @@ static int zend_jit_cmp_double_common(dasm_State **Dst, const zend_op *opline, z
67296739
case ZEND_IS_EQUAL:
67306740
case ZEND_IS_IDENTICAL:
67316741
case ZEND_CASE:
6742+
case ZEND_CASE_STRICT:
67326743
| jp >1
67336744
| mov eax, IS_TRUE
67346745
| je >2
@@ -7362,7 +7373,7 @@ static int zend_jit_identical(dasm_State **Dst, const zend_op *opline, uint32_t
73627373
| jmp =>not_identical_label
73637374
}
73647375
} else {
7365-
| SET_ZVAL_TYPE_INFO res_addr, (opline->opcode == ZEND_IS_IDENTICAL ? IS_FALSE : IS_TRUE)
7376+
| SET_ZVAL_TYPE_INFO res_addr, (opline->opcode != ZEND_IS_NOT_IDENTICAL ? IS_FALSE : IS_TRUE)
73667377
zend_jit_check_exception(Dst);
73677378
}
73687379
} else if (has_concrete_type(op1_info) &&
@@ -7378,7 +7389,7 @@ static int zend_jit_identical(dasm_State **Dst, const zend_op *opline, uint32_t
73787389
| jmp =>identical_label
73797390
}
73807391
} else {
7381-
| SET_ZVAL_TYPE_INFO res_addr, (opline->opcode == ZEND_IS_IDENTICAL ? IS_TRUE : IS_FALSE)
7392+
| SET_ZVAL_TYPE_INFO res_addr, (opline->opcode != ZEND_IS_NOT_IDENTICAL ? IS_TRUE : IS_FALSE)
73827393
}
73837394
} else if (Z_MODE(op1_addr) == IS_CONST_ZVAL && Z_MODE(op2_addr) == IS_CONST_ZVAL) {
73847395
if (zend_is_identical(Z_ZV(op1_addr), Z_ZV(op2_addr))) {
@@ -7391,7 +7402,7 @@ static int zend_jit_identical(dasm_State **Dst, const zend_op *opline, uint32_t
73917402
| jmp =>identical_label
73927403
}
73937404
} else {
7394-
| SET_ZVAL_TYPE_INFO res_addr, (opline->opcode == ZEND_IS_IDENTICAL ? IS_TRUE : IS_FALSE)
7405+
| SET_ZVAL_TYPE_INFO res_addr, (opline->opcode != ZEND_IS_NOT_IDENTICAL ? IS_TRUE : IS_FALSE)
73957406
}
73967407
} else {
73977408
if (smart_branch_opcode) {
@@ -7403,7 +7414,7 @@ static int zend_jit_identical(dasm_State **Dst, const zend_op *opline, uint32_t
74037414
| jmp =>not_identical_label
74047415
}
74057416
} else {
7406-
| SET_ZVAL_TYPE_INFO res_addr, (opline->opcode == ZEND_IS_IDENTICAL ? IS_FALSE : IS_TRUE)
7417+
| SET_ZVAL_TYPE_INFO res_addr, (opline->opcode != ZEND_IS_NOT_IDENTICAL ? IS_FALSE : IS_TRUE)
74077418
}
74087419
}
74097420
} else if (Z_MODE(op1_addr) == IS_CONST_ZVAL && Z_TYPE_P(Z_ZV(op1_addr)) <= IS_TRUE) {
@@ -7432,7 +7443,7 @@ static int zend_jit_identical(dasm_State **Dst, const zend_op *opline, uint32_t
74327443
| je >9
74337444
}
74347445
} else {
7435-
if (opline->opcode == ZEND_IS_IDENTICAL) {
7446+
if (opline->opcode != ZEND_IS_NOT_IDENTICAL) {
74367447
| sete al
74377448
} else {
74387449
| setne al
@@ -7481,7 +7492,7 @@ static int zend_jit_identical(dasm_State **Dst, const zend_op *opline, uint32_t
74817492
| je >9
74827493
}
74837494
} else {
7484-
if (opline->opcode == ZEND_IS_IDENTICAL) {
7495+
if (opline->opcode != ZEND_IS_NOT_IDENTICAL) {
74857496
| sete al
74867497
} else {
74877498
| setne al
@@ -7546,7 +7557,7 @@ static int zend_jit_identical(dasm_State **Dst, const zend_op *opline, uint32_t
75467557
}
75477558
} else {
75487559
| movzx eax, al
7549-
if (opline->opcode == ZEND_IS_IDENTICAL) {
7560+
if (opline->opcode != ZEND_IS_NOT_IDENTICAL) {
75507561
| lea eax, [eax + 2]
75517562
} else {
75527563
| neg eax

0 commit comments

Comments
 (0)