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

Side by Side Diff: runtime/vm/flow_graph_inliner.cc

Issue 11360116: Pass closure object as first implicit argument to closure functions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 for (intptr_t i = 0; i < calls.length(); ++i) { 620 for (intptr_t i = 0; i < calls.length(); ++i) {
621 ClosureCallInstr* call = calls[i]; 621 ClosureCallInstr* call = calls[i];
622 // Find the closure of the callee. 622 // Find the closure of the callee.
623 ASSERT(call->ArgumentCount() > 0); 623 ASSERT(call->ArgumentCount() > 0);
624 const CreateClosureInstr* closure = 624 const CreateClosureInstr* closure =
625 call->ArgumentAt(0)->value()->definition()->AsCreateClosure(); 625 call->ArgumentAt(0)->value()->definition()->AsCreateClosure();
626 if (closure == NULL) { 626 if (closure == NULL) {
627 TRACE_INLINING(OS::Print(" Bailout: non-closure operator\n")); 627 TRACE_INLINING(OS::Print(" Bailout: non-closure operator\n"));
628 continue; 628 continue;
629 } 629 }
630 GrowableArray<Value*> arguments(call->ArgumentCount() - 1); 630 GrowableArray<Value*> arguments(call->ArgumentCount());
631 for (int i = 1; i < call->ArgumentCount(); ++i) { 631 for (int i = 0; i < call->ArgumentCount(); ++i) {
632 arguments.Add(call->ArgumentAt(i)->value()); 632 arguments.Add(call->ArgumentAt(i)->value());
633 } 633 }
634 TryInlining(closure->function(), 634 TryInlining(closure->function(),
635 call->argument_names(), 635 call->argument_names(),
636 &arguments, 636 &arguments,
637 call); 637 call);
638 } 638 }
639 } 639 }
640 640
641 void InlineInstanceCalls() { 641 void InlineInstanceCalls() {
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 OS::Print("After Inlining of %s\n", flow_graph_-> 800 OS::Print("After Inlining of %s\n", flow_graph_->
801 parsed_function().function().ToFullyQualifiedCString()); 801 parsed_function().function().ToFullyQualifiedCString());
802 FlowGraphPrinter printer(*flow_graph_); 802 FlowGraphPrinter printer(*flow_graph_);
803 printer.PrintBlocks(); 803 printer.PrintBlocks();
804 } 804 }
805 } 805 }
806 } 806 }
807 } 807 }
808 808
809 } // namespace dart 809 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_x64.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698