Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Unified Diff: runtime/vm/flow_graph_inliner.cc

Issue 10917085: Revert "Remove classes Computation and BindInstr." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/flow_graph_optimizer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_inliner.cc
diff --git a/runtime/vm/flow_graph_inliner.cc b/runtime/vm/flow_graph_inliner.cc
index 6d3154b47fd60a70fd8664bf64cdf15bfca4f892..be231d6c1fc7aaa12f47d7f9594a1916b5ee940d 100644
--- a/runtime/vm/flow_graph_inliner.cc
+++ b/runtime/vm/flow_graph_inliner.cc
@@ -28,9 +28,8 @@ class CallSiteInliner : public FlowGraphVisitor {
void TryInlining(const Function& function,
GrowableArray<Value*>* arguments,
- StaticCallInstr* call) {
- // TODO(zerny): Generalize to all calls.
-
+ StaticCallComp* comp, // TODO(zerny): Generalize to calls.
+ BindInstr* instr) {
// Abort if the callee has named parameters.
if (function.num_optional_parameters() > 0) {
if (FLAG_trace_inlining) {
@@ -98,7 +97,7 @@ class CallSiteInliner : public FlowGraphVisitor {
// TODO(zerny): If effort is less than threshold then inline recursively.
// Plug result in the caller graph.
- caller_graph_->InlineCall(call, callee_graph);
+ caller_graph_->InlineCall(instr, comp, callee_graph);
next_ssa_temp_index_ = caller_graph_->max_virtual_register_number();
// Replace all the formal parameters with the actuals.
@@ -131,13 +130,17 @@ class CallSiteInliner : public FlowGraphVisitor {
}
}
- void VisitStaticCall(StaticCallInstr* instr) {
+ void VisitBind(BindInstr* instr) {
+ instr->computation()->Accept(this, instr);
+ }
+
+ void VisitStaticCall(StaticCallComp* comp, BindInstr* instr) {
if (FLAG_trace_inlining) OS::Print("Static call\n");
- GrowableArray<Value*> arguments(instr->ArgumentCount());
- for (int i = 0; i < instr->ArgumentCount(); ++i) {
- arguments.Add(instr->ArgumentAt(i)->value());
+ GrowableArray<Value*> arguments(comp->ArgumentCount());
+ for (int i = 0; i < comp->ArgumentCount(); ++i) {
+ arguments.Add(comp->ArgumentAt(i)->value());
}
- TryInlining(instr->function(), &arguments, instr);
+ TryInlining(comp->function(), &arguments, comp, instr);
}
bool preformed_inlining() const { return inlined_; }
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/flow_graph_optimizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698