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

Unified Diff: runtime/vm/flow_graph_optimizer.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_optimizer.h ('k') | runtime/vm/flow_graph_type_propagator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_optimizer.cc
diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc
index 1ad25c8fdb3cb9a10db529c8bb9fdc8d1ff87633..fa5649ffc593681a88dd8072a9c0856f475ba8f7 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"
@@ -28,28 +27,6 @@
namespace dart {
-DEFINE_FLAG(int, getter_setter_ratio, 13,
- "Ratio of getter/setter usage used for double field unboxing heuristics");
-DEFINE_FLAG(bool, guess_icdata_cid, true,
- "Artificially create type feedback for arithmetic etc. operations"
- " by guessing the other unknown argument cid");
-DEFINE_FLAG(int, max_polymorphic_checks, 4,
- "Maximum number of polymorphic check, otherwise it is megamorphic.");
-DEFINE_FLAG(int, max_equality_polymorphic_checks, 32,
- "Maximum number of polymorphic checks in equality operator,"
- " otherwise use megamorphic dispatch.");
-DEFINE_FLAG(bool, merge_sin_cos, false, "Merge sin/cos into sincos");
-DEFINE_FLAG(bool, trace_optimization, false, "Print optimization details.");
-DEFINE_FLAG(bool, truncating_left_shift, true,
- "Optimize left shift to truncate if possible");
-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);
-
// Quick access to the current isolate and zone.
#define I (isolate())
#define Z (zone())
@@ -75,34 +52,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
@@ -218,29 +167,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) ||
@@ -2058,10 +1984,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;
}
@@ -2105,10 +2027,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;
}
@@ -2144,10 +2062,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;
}
@@ -2938,11 +2852,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;
}
@@ -3070,10 +2979,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)),
@@ -3156,10 +3061,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 =
« no previous file with comments | « runtime/vm/flow_graph_optimizer.h ('k') | runtime/vm/flow_graph_type_propagator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698