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

Unified Diff: runtime/vm/flow_graph_inliner.cc

Issue 1149713002: With --noopt run unoptimized code through optimizer, more optimizations can be done later. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: m Created 5 years, 7 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.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 5448bd1f0cc84127a567633e35489fc7450ea16a..5e79772160bd5e5fcc734ec42903698306736512 100644
--- a/runtime/vm/flow_graph_inliner.cc
+++ b/runtime/vm/flow_graph_inliner.cc
@@ -269,9 +269,14 @@ class CallSites : public ValueObject {
GrowableArray<intptr_t> static_call_counts(num_static_calls);
for (intptr_t i = 0; i < num_static_calls; ++i) {
- const intptr_t aggregate_count =
- static_calls_[i + static_call_start_ix].
- call->ic_data()->AggregateCount();
+ intptr_t aggregate_count = 0;
+ if (static_calls_[i + static_call_start_ix].call->ic_data() == NULL) {
+ aggregate_count = 0;
+ } else {
+ aggregate_count =
+ static_calls_[i + static_call_start_ix].
+ call->ic_data()->AggregateCount();
+ }
static_call_counts.Add(aggregate_count);
if (aggregate_count > max_count) max_count = aggregate_count;
}
@@ -682,10 +687,12 @@ class CallSiteInliner : public ValueObject {
ParsedFunction* parsed_function;
{
CSTAT_TIMER_SCOPE(isolate(), graphinliner_parse_timer);
- const Error& error = Error::Handle(Z,
- Compiler::EnsureUnoptimizedCode(Thread::Current(), function));
- if (!error.IsNull()) {
- Exceptions::PropagateError(error);
+ if (!Compiler::always_optimize()) {
+ const Error& error = Error::Handle(Z,
+ Compiler::EnsureUnoptimizedCode(Thread::Current(), function));
+ if (!error.IsNull()) {
+ Exceptions::PropagateError(error);
+ }
}
parsed_function = GetParsedFunction(function, &in_cache);
}
@@ -770,6 +777,9 @@ class CallSiteInliner : public ValueObject {
CSTAT_TIMER_SCOPE(isolate(), graphinliner_opt_timer);
// TODO(zerny): Do more optimization passes on the callee graph.
FlowGraphOptimizer optimizer(callee_graph);
+ if (Compiler::always_optimize()) {
+ optimizer.PopulateWithICData();
+ }
optimizer.ApplyICData();
DEBUG_ASSERT(callee_graph->VerifyUseLists());
« no previous file with comments | « runtime/vm/flow_graph_compiler.cc ('k') | runtime/vm/flow_graph_optimizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698