OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
7 | 7 |
8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 | 9 |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 __ b(result ? labels.true_label : labels.false_label, EQ); | 675 __ b(result ? labels.true_label : labels.false_label, EQ); |
676 __ LoadClassId(cid_reg, val_reg); | 676 __ LoadClassId(cid_reg, val_reg); |
677 | 677 |
678 for (intptr_t i = 2; i < data.length(); i += 2) { | 678 for (intptr_t i = 2; i < data.length(); i += 2) { |
679 const intptr_t test_cid = data[i]; | 679 const intptr_t test_cid = data[i]; |
680 ASSERT(test_cid != kSmiCid); | 680 ASSERT(test_cid != kSmiCid); |
681 result = data[i + 1] == true_result; | 681 result = data[i + 1] == true_result; |
682 __ CompareImmediate(cid_reg, test_cid); | 682 __ CompareImmediate(cid_reg, test_cid); |
683 __ b(result ? labels.true_label : labels.false_label, EQ); | 683 __ b(result ? labels.true_label : labels.false_label, EQ); |
684 } | 684 } |
685 // No match found, deoptimize or false. | 685 // No match found, deoptimize or default action. |
686 if (deopt == NULL) { | 686 if (deopt == NULL) { |
| 687 // If the cid is not in the list, jump to the opposite label from the cids |
| 688 // that are in the list. These must be all the same (see asserts in the |
| 689 // constructor). |
687 Label* target = result ? labels.false_label : labels.true_label; | 690 Label* target = result ? labels.false_label : labels.true_label; |
688 if (target != labels.fall_through) { | 691 if (target != labels.fall_through) { |
689 __ b(target); | 692 __ b(target); |
690 } | 693 } |
691 } else { | 694 } else { |
692 __ b(deopt); | 695 __ b(deopt); |
693 } | 696 } |
694 // Dummy result as the last instruction is a jump, any conditional | 697 // Dummy result as the last instruction is a jump, any conditional |
695 // branch using the result will therefore be skipped. | 698 // branch using the result will therefore be skipped. |
696 return EQ; | 699 return EQ; |
(...skipping 5380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6077 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(), | 6080 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(), |
6078 kGrowRegExpStackRuntimeEntry, 1, locs()); | 6081 kGrowRegExpStackRuntimeEntry, 1, locs()); |
6079 __ Drop(1); | 6082 __ Drop(1); |
6080 __ Pop(result); | 6083 __ Pop(result); |
6081 } | 6084 } |
6082 | 6085 |
6083 | 6086 |
6084 } // namespace dart | 6087 } // namespace dart |
6085 | 6088 |
6086 #endif // defined TARGET_ARCH_ARM64 | 6089 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |