| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 void VisitClosureCall(ClosureCallInstr* call) { | 143 void VisitClosureCall(ClosureCallInstr* call) { |
| 144 closure_calls_.Add(call); | 144 closure_calls_.Add(call); |
| 145 } | 145 } |
| 146 | 146 |
| 147 void VisitPolymorphicInstanceCall(PolymorphicInstanceCallInstr* call) { | 147 void VisitPolymorphicInstanceCall(PolymorphicInstanceCallInstr* call) { |
| 148 instance_calls_.Add(call); | 148 instance_calls_.Add(call); |
| 149 } | 149 } |
| 150 | 150 |
| 151 void VisitStaticCall(StaticCallInstr* call) { | 151 void VisitStaticCall(StaticCallInstr* call) { |
| 152 if (call->function().is_inlinable()) static_calls_.Add(call); | 152 if (call->function().IsInlineable()) static_calls_.Add(call); |
| 153 } | 153 } |
| 154 | 154 |
| 155 private: | 155 private: |
| 156 GrowableArray<StaticCallInstr*> static_calls_; | 156 GrowableArray<StaticCallInstr*> static_calls_; |
| 157 GrowableArray<ClosureCallInstr*> closure_calls_; | 157 GrowableArray<ClosureCallInstr*> closure_calls_; |
| 158 GrowableArray<PolymorphicInstanceCallInstr*> instance_calls_; | 158 GrowableArray<PolymorphicInstanceCallInstr*> instance_calls_; |
| 159 | 159 |
| 160 DISALLOW_COPY_AND_ASSIGN(CallSites); | 160 DISALLOW_COPY_AND_ASSIGN(CallSites); |
| 161 }; | 161 }; |
| 162 | 162 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 | 212 |
| 213 private: | 213 private: |
| 214 bool TryInlining(const Function& function, | 214 bool TryInlining(const Function& function, |
| 215 GrowableArray<Value*>* arguments, | 215 GrowableArray<Value*>* arguments, |
| 216 Definition* call) { | 216 Definition* call) { |
| 217 TRACE_INLINING(OS::Print(" => %s (deopt count %d)\n", | 217 TRACE_INLINING(OS::Print(" => %s (deopt count %d)\n", |
| 218 function.ToCString(), | 218 function.ToCString(), |
| 219 function.deoptimization_counter())); | 219 function.deoptimization_counter())); |
| 220 | 220 |
| 221 // Abort if the inlinable bit on the function is low. | 221 // Abort if the inlinable bit on the function is low. |
| 222 if (!function.is_inlinable()) { | 222 if (!function.IsInlineable()) { |
| 223 TRACE_INLINING(OS::Print(" Bailout: not inlinable\n")); | 223 TRACE_INLINING(OS::Print(" Bailout: not inlinable\n")); |
| 224 return false; | 224 return false; |
| 225 } | 225 } |
| 226 | 226 |
| 227 // Abort if the callee has optional parameters. | 227 // Abort if the callee has optional parameters. |
| 228 if (function.HasOptionalParameters()) { | 228 if (function.HasOptionalParameters()) { |
| 229 TRACE_INLINING(OS::Print(" Bailout: optional parameters\n")); | 229 TRACE_INLINING(OS::Print(" Bailout: optional parameters\n")); |
| 230 return false; | 230 return false; |
| 231 } | 231 } |
| 232 | 232 |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 OS::Print("After Inlining of %s\n", flow_graph_-> | 505 OS::Print("After Inlining of %s\n", flow_graph_-> |
| 506 parsed_function().function().ToFullyQualifiedCString()); | 506 parsed_function().function().ToFullyQualifiedCString()); |
| 507 FlowGraphPrinter printer(*flow_graph_); | 507 FlowGraphPrinter printer(*flow_graph_); |
| 508 printer.PrintBlocks(); | 508 printer.PrintBlocks(); |
| 509 } | 509 } |
| 510 } | 510 } |
| 511 } | 511 } |
| 512 } | 512 } |
| 513 | 513 |
| 514 } // namespace dart | 514 } // namespace dart |
| OLD | NEW |