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/compiler.h" | 7 #include "vm/compiler.h" |
8 #include "vm/flags.h" | 8 #include "vm/flags.h" |
9 #include "vm/flow_graph.h" | 9 #include "vm/flow_graph.h" |
10 #include "vm/flow_graph_compiler.h" | 10 #include "vm/flow_graph_compiler.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 case MethodRecognizer::k##enum_name: \ | 149 case MethodRecognizer::k##enum_name: \ |
150 if (!Build_##enum_name(graph)) return false; \ | 150 if (!Build_##enum_name(graph)) return false; \ |
151 break; | 151 break; |
152 | 152 |
153 GRAPH_INTRINSICS_LIST(EMIT_CASE); | 153 GRAPH_INTRINSICS_LIST(EMIT_CASE); |
154 default: | 154 default: |
155 return false; | 155 return false; |
156 #undef EMIT_CASE | 156 #undef EMIT_CASE |
157 } | 157 } |
158 | 158 |
159 if (FLAG_print_flow_graph && FlowGraphPrinter::ShouldPrint(function)) { | 159 if (FLAG_support_il_printer && |
| 160 FLAG_print_flow_graph && FlowGraphPrinter::ShouldPrint(function)) { |
160 THR_Print("Intrinsic graph before\n"); | 161 THR_Print("Intrinsic graph before\n"); |
161 FlowGraphPrinter printer(*graph); | 162 FlowGraphPrinter printer(*graph); |
162 printer.PrintBlocks(); | 163 printer.PrintBlocks(); |
163 } | 164 } |
164 | 165 |
165 // Perform register allocation on the SSA graph. | 166 // Perform register allocation on the SSA graph. |
166 FlowGraphAllocator allocator(*graph, true); // Intrinsic mode. | 167 FlowGraphAllocator allocator(*graph, true); // Intrinsic mode. |
167 allocator.AllocateRegisters(); | 168 allocator.AllocateRegisters(); |
168 | 169 |
169 if (FLAG_print_flow_graph && FlowGraphPrinter::ShouldPrint(function)) { | 170 if (FLAG_support_il_printer && |
| 171 FLAG_print_flow_graph && FlowGraphPrinter::ShouldPrint(function)) { |
170 THR_Print("Intrinsic graph after\n"); | 172 THR_Print("Intrinsic graph after\n"); |
171 FlowGraphPrinter printer(*graph); | 173 FlowGraphPrinter printer(*graph); |
172 printer.PrintBlocks(); | 174 printer.PrintBlocks(); |
173 } | 175 } |
174 EmitCodeFor(compiler, graph); | 176 EmitCodeFor(compiler, graph); |
175 return true; | 177 return true; |
176 } | 178 } |
177 | 179 |
178 | 180 |
179 void Intrinsifier::Intrinsify(const ParsedFunction& parsed_function, | 181 void Intrinsifier::Intrinsify(const ParsedFunction& parsed_function, |
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
881 new UnaryDoubleOpInstr(Token::kNEGATE, | 883 new UnaryDoubleOpInstr(Token::kNEGATE, |
882 new Value(unboxed_value), | 884 new Value(unboxed_value), |
883 Thread::kNoDeoptId)); | 885 Thread::kNoDeoptId)); |
884 Definition* result = builder.AddDefinition( | 886 Definition* result = builder.AddDefinition( |
885 BoxInstr::Create(kUnboxedDouble, new Value(unboxed_result))); | 887 BoxInstr::Create(kUnboxedDouble, new Value(unboxed_result))); |
886 builder.AddIntrinsicReturn(new Value(result)); | 888 builder.AddIntrinsicReturn(new Value(result)); |
887 return true; | 889 return true; |
888 } | 890 } |
889 | 891 |
890 } // namespace dart | 892 } // namespace dart |
OLD | NEW |