OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/code-assembler.h" | 5 #include "src/compiler/code-assembler.h" |
6 | 6 |
7 #include <ostream> | 7 #include <ostream> |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
862 | 862 |
863 void CodeAssembler::Branch(Node* condition, CodeAssembler::Label* true_label, | 863 void CodeAssembler::Branch(Node* condition, CodeAssembler::Label* true_label, |
864 CodeAssembler::Label* false_label) { | 864 CodeAssembler::Label* false_label) { |
865 true_label->MergeVariables(); | 865 true_label->MergeVariables(); |
866 false_label->MergeVariables(); | 866 false_label->MergeVariables(); |
867 return raw_assembler_->Branch(condition, true_label->label_, | 867 return raw_assembler_->Branch(condition, true_label->label_, |
868 false_label->label_); | 868 false_label->label_); |
869 } | 869 } |
870 | 870 |
871 void CodeAssembler::Switch(Node* index, Label* default_label, | 871 void CodeAssembler::Switch(Node* index, Label* default_label, |
872 const int32_t* case_values, Label** case_labels, | 872 int32_t* case_values, Label** case_labels, |
873 size_t case_count) { | 873 size_t case_count) { |
874 RawMachineLabel** labels = | 874 RawMachineLabel** labels = |
875 new (zone()->New(sizeof(RawMachineLabel*) * case_count)) | 875 new (zone()->New(sizeof(RawMachineLabel*) * case_count)) |
876 RawMachineLabel*[case_count]; | 876 RawMachineLabel*[case_count]; |
877 for (size_t i = 0; i < case_count; ++i) { | 877 for (size_t i = 0; i < case_count; ++i) { |
878 labels[i] = case_labels[i]->label_; | 878 labels[i] = case_labels[i]->label_; |
879 case_labels[i]->MergeVariables(); | 879 case_labels[i]->MergeVariables(); |
880 default_label->MergeVariables(); | 880 default_label->MergeVariables(); |
881 } | 881 } |
882 return raw_assembler_->Switch(index, default_label->label_, case_values, | 882 return raw_assembler_->Switch(index, default_label->label_, case_values, |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1058 } | 1058 } |
1059 } | 1059 } |
1060 } | 1060 } |
1061 | 1061 |
1062 bound_ = true; | 1062 bound_ = true; |
1063 } | 1063 } |
1064 | 1064 |
1065 } // namespace compiler | 1065 } // namespace compiler |
1066 } // namespace internal | 1066 } // namespace internal |
1067 } // namespace v8 | 1067 } // namespace v8 |
OLD | NEW |