| 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 | 4 |
| 5 #include "vm/flow_graph_inliner.h" | 5 #include "vm/flow_graph_inliner.h" |
| 6 | 6 |
| 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_builder.h" | 10 #include "vm/flow_graph_builder.h" |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 } | 177 } |
| 178 GrowableArray<Value*> arguments(call->ArgumentCount() - 1); | 178 GrowableArray<Value*> arguments(call->ArgumentCount() - 1); |
| 179 for (int i = 1; i < call->ArgumentCount(); ++i) { | 179 for (int i = 1; i < call->ArgumentCount(); ++i) { |
| 180 arguments.Add(call->ArgumentAt(i)->value()); | 180 arguments.Add(call->ArgumentAt(i)->value()); |
| 181 } | 181 } |
| 182 TryInlining(closure->function(), &arguments, call); | 182 TryInlining(closure->function(), &arguments, call); |
| 183 } | 183 } |
| 184 | 184 |
| 185 void VisitPolymorphicInstanceCall(PolymorphicInstanceCallInstr* instr) { | 185 void VisitPolymorphicInstanceCall(PolymorphicInstanceCallInstr* instr) { |
| 186 TRACE_INLINING(OS::Print(" PolymorphicInstanceCall\n")); | 186 TRACE_INLINING(OS::Print(" PolymorphicInstanceCall\n")); |
| 187 const ICData& ic_data = instr->ic_data(); |
| 188 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(0)); |
| 187 if (instr->with_checks()) { | 189 if (instr->with_checks()) { |
| 188 TRACE_INLINING(OS::Print(" Bailout: checks\n")); | 190 TRACE_INLINING(OS::Print(" Bailout: %"Pd" checks target '%s'\n", |
| 191 ic_data.NumberOfChecks(), |
| 192 target.ToCString())); |
| 189 return; | 193 return; |
| 190 } | 194 } |
| 191 const ICData& ic_data = instr->ic_data(); | |
| 192 const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(0)); | |
| 193 | 195 |
| 194 GrowableArray<Value*> arguments(instr->ArgumentCount()); | 196 GrowableArray<Value*> arguments(instr->ArgumentCount()); |
| 195 for (int i = 0; i < instr->ArgumentCount(); ++i) { | 197 for (int i = 0; i < instr->ArgumentCount(); ++i) { |
| 196 arguments.Add(instr->ArgumentAt(i)->value()); | 198 arguments.Add(instr->ArgumentAt(i)->value()); |
| 197 } | 199 } |
| 198 | 200 |
| 199 TryInlining(target, &arguments, instr); | 201 TryInlining(target, &arguments, instr); |
| 200 } | 202 } |
| 201 | 203 |
| 202 void VisitStaticCall(StaticCallInstr* call) { | 204 void VisitStaticCall(StaticCallInstr* call) { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 if (FLAG_trace_inlining && FLAG_print_flow_graph) { | 245 if (FLAG_trace_inlining && FLAG_print_flow_graph) { |
| 244 OS::Print("After Inlining of %s\n", flow_graph_-> | 246 OS::Print("After Inlining of %s\n", flow_graph_-> |
| 245 parsed_function().function().ToFullyQualifiedCString()); | 247 parsed_function().function().ToFullyQualifiedCString()); |
| 246 FlowGraphPrinter printer(*flow_graph_); | 248 FlowGraphPrinter printer(*flow_graph_); |
| 247 printer.PrintBlocks(); | 249 printer.PrintBlocks(); |
| 248 } | 250 } |
| 249 } | 251 } |
| 250 } | 252 } |
| 251 | 253 |
| 252 } // namespace dart | 254 } // namespace dart |
| OLD | NEW |