@@ -8616,51 +8616,47 @@ static int zend_jit_bool_jmpznz(dasm_State **Dst, const zend_op *opline, uint32_
8616
8616
if (set_bool) {
8617
8617
if (exit_addr) {
8618
8618
if (branch_opcode == ZEND_JMPNZ || branch_opcode == ZEND_JMPNZ_EX) {
8619
- | jp >1
8620
8619
| SET_ZVAL_TYPE_INFO res_addr, IS_TRUE
8620
+ | jp &exit_addr
8621
8621
| jne &exit_addr
8622
- |1:
8623
8622
| SET_ZVAL_TYPE_INFO res_addr, IS_FALSE
8624
8623
} else {
8625
- | SET_ZVAL_TYPE_INFO res_addr, IS_FALSE
8626
8624
| jp >1
8625
+ | SET_ZVAL_TYPE_INFO res_addr, IS_FALSE
8627
8626
| je &exit_addr
8628
8627
|1:
8629
8628
| SET_ZVAL_TYPE_INFO res_addr, IS_TRUE
8630
8629
}
8631
- } else if (false_label != (uint32_t)-1) { // JMPZ_EX
8630
+ } else if (false_label != (uint32_t)-1) { // JMPZ_EX (p=>true, z=>false, false=>jmp)
8631
+ | jp >1
8632
8632
| SET_ZVAL_TYPE_INFO res_addr, IS_FALSE
8633
- | jp >1
8634
- | je => false_label
8635
- | SET_ZVAL_TYPE_INFO res_addr, IS_TRUE
8633
+ | je => false_label
8636
8634
|1:
8637
- } else if (true_label != (uint32_t)-1) { // JMPNZ_EX
8638
- | jp >1
8639
8635
| SET_ZVAL_TYPE_INFO res_addr, IS_TRUE
8640
- | jne => true_label
8641
- |1:
8636
+ } else if (true_label != (uint32_t)-1) { // JMPNZ_EX (p=>true, z=>false, true=>jmp)
8637
+ | SET_ZVAL_TYPE_INFO res_addr, IS_TRUE
8638
+ | jp => true_label
8639
+ | jne => true_label
8642
8640
| SET_ZVAL_TYPE_INFO res_addr, IS_FALSE
8643
- } else if (set_bool_not) { // BOOL_NOT
8641
+ } else if (set_bool_not) { // BOOL_NOT (p=>false, z=>true)
8642
+ | mov eax, IS_FALSE
8644
8643
| jp >1
8644
+ | jne >1
8645
8645
| mov eax, IS_TRUE
8646
- | je >2
8647
8646
|1:
8648
- | mov eax, IS_FALSE
8649
- |2:
8650
8647
| SET_ZVAL_TYPE_INFO res_addr, eax
8651
- } else { // BOOL
8652
- | jp >1
8648
+ } else { // BOOL (p=>true, z=>false)
8653
8649
| mov eax, IS_TRUE
8654
- | jne >2
8655
- |1:
8650
+ | jp >1
8651
+ | jne >1
8656
8652
| mov eax, IS_FALSE
8657
- |2 :
8653
+ |1 :
8658
8654
| SET_ZVAL_TYPE_INFO res_addr, eax
8659
8655
}
8660
8656
} else {
8661
8657
if (exit_addr) {
8662
8658
if (branch_opcode == ZEND_JMPNZ || branch_opcode == ZEND_JMPNZ_EX) {
8663
- | jp >1
8659
+ | jp &exit_addr
8664
8660
| jne &exit_addr
8665
8661
|1:
8666
8662
} else {
@@ -8670,20 +8666,17 @@ static int zend_jit_bool_jmpznz(dasm_State **Dst, const zend_op *opline, uint32_
8670
8666
}
8671
8667
} else {
8672
8668
ZEND_ASSERT(true_label != (uint32_t)-1 || false_label != (uint32_t)-1);
8673
- if (false_label != (uint32_t)-1) {
8674
- | jp =>false_label
8675
- } else {
8676
- | jp >1
8677
- }
8678
- if (true_label != (uint32_t)-1) {
8679
- | jne =>true_label
8680
- if (false_label != (uint32_t)-1) {
8681
- | jmp =>false_label
8669
+ if (false_label != (uint32_t)-1 ) {
8670
+ | jp >1
8671
+ | je => false_label
8672
+ |1:
8673
+ if (true_label != (uint32_t)-1) {
8674
+ | jmp =>true_label
8682
8675
}
8683
8676
} else {
8684
- | je =>false_label
8677
+ | jp => true_label
8678
+ | jne => true_label
8685
8679
}
8686
- |1:
8687
8680
}
8688
8681
}
8689
8682
} else if (op1_info & (MAY_BE_ANY - (MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG))) {
0 commit comments