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

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

Issue 15904010: Fix issue 3874: non-deterministic AST generation caused by exceptions being thrown during parsing (… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 976 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 if (target.raw() == non_inlined_variants_[i].target->raw()) { 987 if (target.raw() == non_inlined_variants_[i].target->raw()) {
988 return true; 988 return true;
989 } 989 }
990 } 990 }
991 991
992 return false; 992 return false;
993 } 993 }
994 994
995 995
996 bool PolymorphicInliner::TryInlining(const Function& target) { 996 bool PolymorphicInliner::TryInlining(const Function& target) {
997 if (!target.is_optimizable()) {
998 return false;
999 }
997 GrowableArray<Value*> arguments(call_->ArgumentCount()); 1000 GrowableArray<Value*> arguments(call_->ArgumentCount());
998 for (int i = 0; i < call_->ArgumentCount(); ++i) { 1001 for (int i = 0; i < call_->ArgumentCount(); ++i) {
999 arguments.Add(call_->PushArgumentAt(i)->value()); 1002 arguments.Add(call_->PushArgumentAt(i)->value());
1000 } 1003 }
1001 InlinedCallData call_data(call_, &arguments); 1004 InlinedCallData call_data(call_, &arguments);
1002 if (!owner_->TryInlining(target, 1005 if (!owner_->TryInlining(target,
1003 call_->instance_call()->argument_names(), 1006 call_->instance_call()->argument_names(),
1004 &call_data)) { 1007 &call_data)) {
1005 return false; 1008 return false;
1006 } 1009 }
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
1343 OS::Print("After Inlining of %s\n", flow_graph_-> 1346 OS::Print("After Inlining of %s\n", flow_graph_->
1344 parsed_function().function().ToFullyQualifiedCString()); 1347 parsed_function().function().ToFullyQualifiedCString());
1345 FlowGraphPrinter printer(*flow_graph_); 1348 FlowGraphPrinter printer(*flow_graph_);
1346 printer.PrintBlocks(); 1349 printer.PrintBlocks();
1347 } 1350 }
1348 } 1351 }
1349 } 1352 }
1350 } 1353 }
1351 1354
1352 } // namespace dart 1355 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/parser.cc » ('j') | runtime/vm/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698