@@ -8635,51 +8635,47 @@ static int zend_jit_bool_jmpznz(dasm_State **Dst, const zend_op *opline, uint32_
8635
8635
if (set_bool) {
8636
8636
if (exit_addr) {
8637
8637
if (branch_opcode == ZEND_JMPNZ || branch_opcode == ZEND_JMPNZ_EX) {
8638
- | jp >1
8639
8638
| SET_ZVAL_TYPE_INFO res_addr, IS_TRUE
8639
+ | jp &exit_addr
8640
8640
| jne &exit_addr
8641
- |1:
8642
8641
| SET_ZVAL_TYPE_INFO res_addr, IS_FALSE
8643
8642
} else {
8644
- | SET_ZVAL_TYPE_INFO res_addr, IS_FALSE
8645
8643
| jp >1
8644
+ | SET_ZVAL_TYPE_INFO res_addr, IS_FALSE
8646
8645
| je &exit_addr
8647
8646
|1:
8648
8647
| SET_ZVAL_TYPE_INFO res_addr, IS_TRUE
8649
8648
}
8650
- } else if (false_label != (uint32_t)-1) { // JMPZ_EX
8649
+ } else if (false_label != (uint32_t)-1) { // JMPZ_EX (p=>true, z=>false, false=>jmp)
8650
+ | jp >1
8651
8651
| SET_ZVAL_TYPE_INFO res_addr, IS_FALSE
8652
- | jp >1
8653
- | je => false_label
8654
- | SET_ZVAL_TYPE_INFO res_addr, IS_TRUE
8652
+ | je => false_label
8655
8653
|1:
8656
- } else if (true_label != (uint32_t)-1) { // JMPNZ_EX
8657
- | jp >1
8658
8654
| SET_ZVAL_TYPE_INFO res_addr, IS_TRUE
8659
- | jne => true_label
8660
- |1:
8655
+ } else if (true_label != (uint32_t)-1) { // JMPNZ_EX (p=>true, z=>false, true=>jmp)
8656
+ | SET_ZVAL_TYPE_INFO res_addr, IS_TRUE
8657
+ | jp => true_label
8658
+ | jne => true_label
8661
8659
| SET_ZVAL_TYPE_INFO res_addr, IS_FALSE
8662
- } else if (set_bool_not) { // BOOL_NOT
8660
+ } else if (set_bool_not) { // BOOL_NOT (p=>false, z=>true)
8661
+ | mov eax, IS_FALSE
8663
8662
| jp >1
8663
+ | jne >1
8664
8664
| mov eax, IS_TRUE
8665
- | je >2
8666
8665
|1:
8667
- | mov eax, IS_FALSE
8668
- |2:
8669
8666
| SET_ZVAL_TYPE_INFO res_addr, eax
8670
- } else { // BOOL
8671
- | jp >1
8667
+ } else { // BOOL (p=>true, z=>false)
8672
8668
| mov eax, IS_TRUE
8673
- | jne >2
8674
- |1:
8669
+ | jp >1
8670
+ | jne >1
8675
8671
| mov eax, IS_FALSE
8676
- |2 :
8672
+ |1 :
8677
8673
| SET_ZVAL_TYPE_INFO res_addr, eax
8678
8674
}
8679
8675
} else {
8680
8676
if (exit_addr) {
8681
8677
if (branch_opcode == ZEND_JMPNZ || branch_opcode == ZEND_JMPNZ_EX) {
8682
- | jp >1
8678
+ | jp &exit_addr
8683
8679
| jne &exit_addr
8684
8680
|1:
8685
8681
} else {
@@ -8689,20 +8685,17 @@ static int zend_jit_bool_jmpznz(dasm_State **Dst, const zend_op *opline, uint32_
8689
8685
}
8690
8686
} else {
8691
8687
ZEND_ASSERT(true_label != (uint32_t)-1 || false_label != (uint32_t)-1);
8692
- if (false_label != (uint32_t)-1) {
8693
- | jp =>false_label
8694
- } else {
8695
- | jp >1
8696
- }
8697
- if (true_label != (uint32_t)-1) {
8698
- | jne =>true_label
8699
- if (false_label != (uint32_t)-1) {
8700
- | jmp =>false_label
8688
+ if (false_label != (uint32_t)-1 ) {
8689
+ | jp >1
8690
+ | je => false_label
8691
+ |1:
8692
+ if (true_label != (uint32_t)-1) {
8693
+ | jmp =>true_label
8701
8694
}
8702
8695
} else {
8703
- | je =>false_label
8696
+ | jp => true_label
8697
+ | jne => true_label
8704
8698
}
8705
- |1:
8706
8699
}
8707
8700
}
8708
8701
} else if (op1_info & (MAY_BE_ANY - (MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG))) {
0 commit comments