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

Unified Diff: runtime/vm/compiler.cc

Issue 10378099: Fix IC data insertion: do it before the graph is built. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/compiler.cc
===================================================================
--- runtime/vm/compiler.cc (revision 7525)
+++ runtime/vm/compiler.cc (working copy)
@@ -164,23 +164,13 @@
TimerScope timer(FLAG_compiler_stats,
&CompilerStats::graphbuilder_timer,
isolate);
- CompilerStats::graphbuilder_timer.Start();
- FlowGraphBuilder graph_builder(parsed_function);
- graph_builder.BuildGraph(optimized);
-
- // The non-optimizing compiler compiles blocks in reverse postorder,
- // because it is a 'natural' order for the human reader of the
- // generated code.
- intptr_t length = graph_builder.postorder_block_entries().length();
- for (intptr_t i = length - 1; i >= 0; --i) {
- block_order.Add(graph_builder.postorder_block_entries()[i]);
- }
-
if (optimized) {
// Transition to optimized code only from unoptimized code ...
// for now.
ASSERT(parsed_function.function().HasCode());
ASSERT(!parsed_function.function().HasOptimizedCode());
+ // Extract type feedback before the graph is built, as the graph
+ // builder uses it to attach it to nodes.
// Do not use type feedback to optimize a function that was
// deoptimized too often.
if (parsed_function.function().deoptimization_counter() <
@@ -191,6 +181,16 @@
ExtractTypeFeedbackArray(unoptimized_code));
}
}
+ FlowGraphBuilder graph_builder(parsed_function);
+ graph_builder.BuildGraph(optimized);
+
+ // The non-optimizing compiler compiles blocks in reverse postorder,
+ // because it is a 'natural' order for the human reader of the
+ // generated code.
+ intptr_t length = graph_builder.postorder_block_entries().length();
+ for (intptr_t i = length - 1; i >= 0; --i) {
+ block_order.Add(graph_builder.postorder_block_entries()[i]);
+ }
}
Assembler assembler;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698