OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 // Class for intrinsifying functions. | 4 // Class for intrinsifying functions. |
5 | 5 |
6 #include "vm/assembler.h" | 6 #include "vm/assembler.h" |
7 #include "vm/intrinsifier.h" | 7 #include "vm/intrinsifier.h" |
8 #include "vm/flags.h" | 8 #include "vm/flags.h" |
9 #include "vm/object.h" | 9 #include "vm/object.h" |
10 #include "vm/symbols.h" | 10 #include "vm/symbols.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 if (!Build_##enum_name(graph)) return false; \ | 148 if (!Build_##enum_name(graph)) return false; \ |
149 break; | 149 break; |
150 | 150 |
151 GRAPH_INTRINSICS_LIST(EMIT_CASE); | 151 GRAPH_INTRINSICS_LIST(EMIT_CASE); |
152 default: | 152 default: |
153 return false; | 153 return false; |
154 #undef EMIT_CASE | 154 #undef EMIT_CASE |
155 } | 155 } |
156 | 156 |
157 if (FLAG_print_flow_graph && FlowGraphPrinter::ShouldPrint(function)) { | 157 if (FLAG_print_flow_graph && FlowGraphPrinter::ShouldPrint(function)) { |
158 ISL_Print("Intrinsic graph before\n"); | 158 THR_Print("Intrinsic graph before\n"); |
159 FlowGraphPrinter printer(*graph); | 159 FlowGraphPrinter printer(*graph); |
160 printer.PrintBlocks(); | 160 printer.PrintBlocks(); |
161 } | 161 } |
162 | 162 |
163 // Perform register allocation on the SSA graph. | 163 // Perform register allocation on the SSA graph. |
164 FlowGraphAllocator allocator(*graph, true); // Intrinsic mode. | 164 FlowGraphAllocator allocator(*graph, true); // Intrinsic mode. |
165 allocator.AllocateRegisters(); | 165 allocator.AllocateRegisters(); |
166 | 166 |
167 if (FLAG_print_flow_graph && FlowGraphPrinter::ShouldPrint(function)) { | 167 if (FLAG_print_flow_graph && FlowGraphPrinter::ShouldPrint(function)) { |
168 ISL_Print("Intrinsic graph after\n"); | 168 THR_Print("Intrinsic graph after\n"); |
169 FlowGraphPrinter printer(*graph); | 169 FlowGraphPrinter printer(*graph); |
170 printer.PrintBlocks(); | 170 printer.PrintBlocks(); |
171 } | 171 } |
172 EmitCodeFor(compiler, graph); | 172 EmitCodeFor(compiler, graph); |
173 return true; | 173 return true; |
174 } | 174 } |
175 | 175 |
176 | 176 |
177 void Intrinsifier::Intrinsify(const ParsedFunction& parsed_function, | 177 void Intrinsifier::Intrinsify(const ParsedFunction& parsed_function, |
178 FlowGraphCompiler* compiler) { | 178 FlowGraphCompiler* compiler) { |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 new Value(growable_array), | 682 new Value(growable_array), |
683 new Value(length), | 683 new Value(length), |
684 kNoStoreBarrier, | 684 kNoStoreBarrier, |
685 builder.TokenPos())); | 685 builder.TokenPos())); |
686 Definition* null_def = builder.AddNullDefinition(); | 686 Definition* null_def = builder.AddNullDefinition(); |
687 builder.AddIntrinsicReturn(new Value(null_def)); | 687 builder.AddIntrinsicReturn(new Value(null_def)); |
688 return true; | 688 return true; |
689 } | 689 } |
690 | 690 |
691 } // namespace dart | 691 } // namespace dart |
OLD | NEW |