Index: runtime/vm/flow_graph_optimizer.cc |
diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc |
index 85c18ab0355e8ec4017aedc933d4b7908254d539..c5a0e866cae1bbc97a69293fdfad335d6dbc9e70 100644 |
--- a/runtime/vm/flow_graph_optimizer.cc |
+++ b/runtime/vm/flow_graph_optimizer.cc |
@@ -20,7 +20,6 @@ |
#include "vm/intermediate_language.h" |
#include "vm/object_store.h" |
#include "vm/parser.h" |
-#include "vm/precompiler.h" |
#include "vm/resolver.h" |
#include "vm/scopes.h" |
#include "vm/stack_frame.h" |
@@ -45,7 +44,6 @@ DEFINE_FLAG(bool, truncating_left_shift, true, |
DEFINE_FLAG(bool, use_cha_deopt, true, |
"Use class hierarchy analysis even if it can cause deoptimization."); |
-DECLARE_FLAG(bool, precompilation); |
DECLARE_FLAG(bool, polymorphic_with_deopt); |
DECLARE_FLAG(bool, trace_cha); |
DECLARE_FLAG(bool, trace_field_guards); |
@@ -75,34 +73,6 @@ void FlowGraphOptimizer::ApplyICData() { |
} |
-void FlowGraphOptimizer::PopulateWithICData() { |
- ASSERT(current_iterator_ == NULL); |
- for (BlockIterator block_it = flow_graph_->reverse_postorder_iterator(); |
- !block_it.Done(); |
- block_it.Advance()) { |
- ForwardInstructionIterator it(block_it.Current()); |
- for (; !it.Done(); it.Advance()) { |
- Instruction* instr = it.Current(); |
- if (instr->IsInstanceCall()) { |
- InstanceCallInstr* call = instr->AsInstanceCall(); |
- if (!call->HasICData()) { |
- const Array& arguments_descriptor = |
- Array::Handle(zone(), |
- ArgumentsDescriptor::New(call->ArgumentCount(), |
- call->argument_names())); |
- const ICData& ic_data = ICData::ZoneHandle(zone(), ICData::New( |
- function(), call->function_name(), |
- arguments_descriptor, call->deopt_id(), |
- call->checked_argument_count())); |
- call->set_ic_data(&ic_data); |
- } |
- } |
- } |
- current_iterator_ = NULL; |
- } |
-} |
- |
- |
// Optimize instance calls using cid. This is called after optimizer |
// converted instance calls to instructions. Any remaining |
// instance calls are either megamorphic calls, cannot be optimized or |
@@ -217,29 +187,6 @@ bool FlowGraphOptimizer::TryCreateICData(InstanceCallInstr* call) { |
return true; |
} |
-#ifdef DART_PRECOMPILER |
- if (FLAG_precompilation && |
- (isolate()->object_store()->unique_dynamic_targets() != Array::null())) { |
- // Check if the target is unique. |
- Function& target_function = Function::Handle(Z); |
- Precompiler::GetUniqueDynamicTarget( |
- isolate(), call->function_name(), &target_function); |
- // Calls with named arguments must be resolved/checked at runtime. |
- String& error_message = String::Handle(Z); |
- if (!target_function.IsNull() && |
- !target_function.HasOptionalNamedParameters() && |
- target_function.AreValidArgumentCounts(call->ArgumentCount(), 0, |
- &error_message)) { |
- const intptr_t cid = Class::Handle(Z, target_function.Owner()).id(); |
- const ICData& ic_data = ICData::ZoneHandle(Z, |
- ICData::NewFrom(*call->ic_data(), 1)); |
- ic_data.AddReceiverCheck(cid, target_function); |
- call->set_ic_data(&ic_data); |
- return true; |
- } |
- } |
-#endif |
- |
// Check if getter or setter in function's class and class is currently leaf. |
if (FLAG_guess_icdata_cid && |
((call->token_kind() == Token::kGET) || |
@@ -2056,10 +2003,6 @@ bool FlowGraphOptimizer::TryInlineInstanceMethod(InstanceCallInstr* call) { |
bool FlowGraphOptimizer::TryInlineFloat32x4Constructor( |
StaticCallInstr* call, |
MethodRecognizer::Kind recognized_kind) { |
- if (FLAG_precompilation) { |
- // Cannot handle unboxed instructions. |
- return false; |
- } |
if (!ShouldInlineSimd()) { |
return false; |
} |
@@ -2103,10 +2046,6 @@ bool FlowGraphOptimizer::TryInlineFloat32x4Constructor( |
bool FlowGraphOptimizer::TryInlineFloat64x2Constructor( |
StaticCallInstr* call, |
MethodRecognizer::Kind recognized_kind) { |
- if (FLAG_precompilation) { |
- // Cannot handle unboxed instructions. |
- return false; |
- } |
if (!ShouldInlineSimd()) { |
return false; |
} |
@@ -2142,10 +2081,6 @@ bool FlowGraphOptimizer::TryInlineFloat64x2Constructor( |
bool FlowGraphOptimizer::TryInlineInt32x4Constructor( |
StaticCallInstr* call, |
MethodRecognizer::Kind recognized_kind) { |
- if (FLAG_precompilation) { |
- // Cannot handle unboxed instructions. |
- return false; |
- } |
if (!ShouldInlineSimd()) { |
return false; |
} |
@@ -2936,11 +2871,6 @@ void FlowGraphOptimizer::InstanceCallNoopt(InstanceCallInstr* instr) { |
// Tries to optimize instance call by replacing it with a faster instruction |
// (e.g, binary op, field load, ..). |
void FlowGraphOptimizer::VisitInstanceCall(InstanceCallInstr* instr) { |
- if (FLAG_precompilation) { |
- InstanceCallNoopt(instr); |
- return; |
- } |
- |
if (!instr->HasICData() || (instr->ic_data()->NumberOfUsedChecks() == 0)) { |
return; |
} |
@@ -3068,10 +2998,6 @@ void FlowGraphOptimizer::VisitStaticCall(StaticCallInstr* call) { |
break; |
} |
if (unary_kind != MathUnaryInstr::kIllegal) { |
- if (FLAG_precompilation) { |
- // TODO(srdjan): Adapt MathUnaryInstr to allow tagged inputs as well. |
- return; |
- } |
MathUnaryInstr* math_unary = |
new(Z) MathUnaryInstr(unary_kind, |
new(Z) Value(call->ArgumentAt(0)), |
@@ -3154,10 +3080,6 @@ void FlowGraphOptimizer::VisitStaticCall(StaticCallInstr* call) { |
case MethodRecognizer::kMathAcos: |
case MethodRecognizer::kMathAtan: |
case MethodRecognizer::kMathAtan2: { |
- if (FLAG_precompilation) { |
- // No UnboxDouble instructons allowed. |
- return; |
- } |
// InvokeMathCFunctionInstr requires unboxed doubles. UnboxDouble |
// instructions contain type checks and conversions to double. |
ZoneGrowableArray<Value*>* args = |