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

Unified Diff: runtime/vm/flow_graph_inliner.cc

Issue 1714743002: VM: Separate precompilation-specific code, make flags const. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fix build after merge Created 4 years, 10 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 6046a8bffd13f2ce6984b1352c8fa5335fdd5090..9956af3863d1a068be753e83ecc20514f57a2db7 100644
--- a/runtime/vm/flow_graph_inliner.cc
+++ b/runtime/vm/flow_graph_inliner.cc
@@ -4,6 +4,7 @@
#include "vm/flow_graph_inliner.h"
+#include "vm/aot_optimizer.h"
#include "vm/block_scheduler.h"
#include "vm/branch_optimizer.h"
#include "vm/compiler.h"
@@ -61,7 +62,6 @@ DEFINE_FLAG(bool, enable_inlining_annotations, false,
DECLARE_FLAG(bool, compiler_stats);
DECLARE_FLAG(int, max_deoptimization_counter_threshold);
-DECLARE_FLAG(bool, polymorphic_with_deopt);
DECLARE_FLAG(bool, precompilation);
DECLARE_FLAG(bool, print_flow_graph);
DECLARE_FLAG(bool, print_flow_graph_optimized);
@@ -790,10 +790,10 @@ class CallSiteInliner : public ValueObject {
CSTAT_TIMER_SCOPE(thread(), graphinliner_opt_timer);
// TODO(fschneider): Improve suppression of speculative inlining.
// Deopt-ids overlap between caller and callee.
- FlowGraphOptimizer optimizer(callee_graph,
- inliner_->use_speculative_inlining_,
- inliner_->inlining_black_list_);
if (FLAG_precompilation) {
+ AotOptimizer optimizer(callee_graph,
+ inliner_->use_speculative_inlining_,
+ inliner_->inlining_black_list_);
optimizer.PopulateWithICData();
optimizer.ApplyClassIds();
@@ -801,14 +801,26 @@ class CallSiteInliner : public ValueObject {
FlowGraphTypePropagator::Propagate(callee_graph);
DEBUG_ASSERT(callee_graph->VerifyUseLists());
- }
- optimizer.ApplyICData();
- DEBUG_ASSERT(callee_graph->VerifyUseLists());
- // Optimize (a << b) & c patterns, merge instructions. Must occur
- // before 'SelectRepresentations' which inserts conversion nodes.
- optimizer.TryOptimizePatterns();
- DEBUG_ASSERT(callee_graph->VerifyUseLists());
+ optimizer.ApplyICData();
+ DEBUG_ASSERT(callee_graph->VerifyUseLists());
+
+ // Optimize (a << b) & c patterns, merge instructions. Must occur
+ // before 'SelectRepresentations' which inserts conversion nodes.
+ optimizer.TryOptimizePatterns();
+ DEBUG_ASSERT(callee_graph->VerifyUseLists());
+ } else {
+ FlowGraphOptimizer optimizer(callee_graph,
+ inliner_->use_speculative_inlining_,
+ inliner_->inlining_black_list_);
+ optimizer.ApplyICData();
+ DEBUG_ASSERT(callee_graph->VerifyUseLists());
+
+ // Optimize (a << b) & c patterns, merge instructions. Must occur
+ // before 'SelectRepresentations' which inserts conversion nodes.
+ optimizer.TryOptimizePatterns();
+ DEBUG_ASSERT(callee_graph->VerifyUseLists());
+ }
}
if (FLAG_support_il_printer && FLAG_trace_inlining &&
@@ -1508,9 +1520,6 @@ static Instruction* AppendInstruction(Instruction* first,
bool PolymorphicInliner::TryInlineRecognizedMethod(intptr_t receiver_cid,
const Function& target) {
- FlowGraphOptimizer optimizer(owner_->caller_graph(),
- false, // Speculative inlining not applicable.
- NULL);
TargetEntryInstr* entry;
Definition* last;
// Replace the receiver argument with a redefinition to prevent code from
« 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