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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 10832411: Remove support for non-ssa optimizing code generation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: disable optimizations on bailout Created 8 years, 4 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/intermediate_language.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 6bc50c7127162db8a6ba7524f349b77da8eb8d31..f1980ffa9e09a7a63484ac104c627d00cc4078da 100644
--- a/runtime/vm/flow_graph_optimizer.cc
+++ b/runtime/vm/flow_graph_optimizer.cc
@@ -366,33 +366,23 @@ bool FlowGraphOptimizer::TryInlineInstanceGetter(BindInstr* instr,
ASSERT(!field.IsNull());
LoadInstanceFieldComp* load;
- if (!use_ssa_) {
- load = new LoadInstanceFieldComp(field,
- comp->ArgumentAt(0)->value(),
- comp,
- true); // Can deoptimize.
- // TODO(fschneider): Remove the boolean parameter can_deoptimize once
- // the non-SSA optimizer is removed.
- load->set_ic_data(comp->ic_data());
- } else {
- // TODO(fschneider): Avoid generating redundant checks by checking the
- // result-cid of the value.
- CheckClassComp* check =
- new CheckClassComp(comp->ArgumentAt(0)->value(), comp);
- const ICData& unary_checks =
- ICData::ZoneHandle(comp->ic_data()->AsUnaryClassChecks());
- check->set_ic_data(&unary_checks);
- BindInstr* check_instr = new BindInstr(BindInstr::kUnused, check);
- ASSERT(instr->env() != NULL); // Always the case with SSA.
- // Attach the original environment to the check instruction.
- check_instr->set_env(instr->env());
- instr->set_env(NULL);
- check_instr->InsertBefore(instr);
- load = new LoadInstanceFieldComp(field,
- comp->ArgumentAt(0)->value(),
- NULL,
- false); // Can not deoptimize.
- }
+ // TODO(fschneider): Avoid generating redundant checks by checking the
+ // result-cid of the value.
+ CheckClassComp* check =
+ new CheckClassComp(comp->ArgumentAt(0)->value(), comp);
+ const ICData& unary_checks =
+ ICData::ZoneHandle(comp->ic_data()->AsUnaryClassChecks());
+ check->set_ic_data(&unary_checks);
+ BindInstr* check_instr = new BindInstr(BindInstr::kUnused, check);
+ ASSERT(instr->env() != NULL); // Always the case with SSA.
+ // Attach the original environment to the check instruction.
+ check_instr->set_env(instr->env());
+ instr->set_env(NULL);
+ check_instr->InsertBefore(instr);
+ load = new LoadInstanceFieldComp(field,
+ comp->ArgumentAt(0)->value(),
+ NULL,
+ false); // Can not deoptimize.
instr->set_computation(load);
RemovePushArguments(comp);
return true;
@@ -658,21 +648,21 @@ void FlowGraphTypePropagator::VisitAssertAssignable(AssertAssignableComp* comp,
comp->value()->CompileTypeIsMoreSpecificThan(comp->dst_type())) {
// TODO(regis): Remove is_eliminated_ field and support.
comp->eliminate();
- if (is_ssa_) {
- UseVal* use = comp->value()->AsUse();
- ASSERT(use != NULL);
- Definition* result = use->definition();
- ASSERT(result != NULL);
- // Replace uses and remove the current instructions via the iterator.
- instr->ReplaceUsesWith(result);
- ASSERT(current_iterator()->Current() == instr);
- current_iterator()->RemoveCurrentFromGraph();
- if (FLAG_trace_optimization) {
- OS::Print("Replacing v%d with v%d\n",
- instr->ssa_temp_index(),
- result->ssa_temp_index());
- }
+
+ UseVal* use = comp->value()->AsUse();
+ ASSERT(use != NULL);
+ Definition* result = use->definition();
+ ASSERT(result != NULL);
+ // Replace uses and remove the current instructions via the iterator.
+ instr->ReplaceUsesWith(result);
+ ASSERT(current_iterator()->Current() == instr);
+ current_iterator()->RemoveCurrentFromGraph();
+ if (FLAG_trace_optimization) {
+ OS::Print("Replacing v%d with v%d\n",
+ instr->ssa_temp_index(),
+ result->ssa_temp_index());
}
+
if (FLAG_trace_type_check_elimination) {
FlowGraphPrinter::PrintTypeCheck(parsed_function(),
comp->token_pos(),
@@ -701,21 +691,21 @@ void FlowGraphTypePropagator::VisitAssertBoolean(AssertBooleanComp* comp,
Type::Handle(Type::BoolInterface()))) {
// TODO(regis): Remove is_eliminated_ field and support.
comp->eliminate();
- if (is_ssa_) {
- UseVal* use = comp->value()->AsUse();
- ASSERT(use != NULL);
- Definition* result = use->definition();
- ASSERT(result != NULL);
- // Replace uses and remove the current instructions via the iterator.
- instr->ReplaceUsesWith(result);
- ASSERT(current_iterator()->Current() == instr);
- current_iterator()->RemoveCurrentFromGraph();
- if (FLAG_trace_optimization) {
- OS::Print("Replacing v%d with v%d\n",
- instr->ssa_temp_index(),
- result->ssa_temp_index());
- }
+
+ UseVal* use = comp->value()->AsUse();
+ ASSERT(use != NULL);
+ Definition* result = use->definition();
+ ASSERT(result != NULL);
+ // Replace uses and remove the current instructions via the iterator.
+ instr->ReplaceUsesWith(result);
+ ASSERT(current_iterator()->Current() == instr);
+ current_iterator()->RemoveCurrentFromGraph();
+ if (FLAG_trace_optimization) {
+ OS::Print("Replacing v%d with v%d\n",
+ instr->ssa_temp_index(),
+ result->ssa_temp_index());
}
+
if (FLAG_trace_type_check_elimination) {
const String& name = String::Handle(Symbols::New("boolean expression"));
FlowGraphPrinter::PrintTypeCheck(parsed_function(),
@@ -743,21 +733,20 @@ void FlowGraphTypePropagator::VisitInstanceOf(InstanceOfComp* comp,
comp->value()->BindsToConstant() &&
!comp->value()->BindsToConstantNull() &&
comp->value()->CompileTypeIsMoreSpecificThan(comp->type())) {
- if (is_ssa_) {
- UseVal* use = comp->value()->AsUse();
- ASSERT(use != NULL);
- Definition* result = use->definition();
- ASSERT(result != NULL);
- // Replace uses and remove the current instructions via the iterator.
- instr->ReplaceUsesWith(result);
- ASSERT(current_iterator()->Current() == instr);
- current_iterator()->RemoveCurrentFromGraph();
- if (FLAG_trace_optimization) {
- OS::Print("Replacing v%d with v%d\n",
- instr->ssa_temp_index(),
- result->ssa_temp_index());
- }
+ UseVal* use = comp->value()->AsUse();
+ ASSERT(use != NULL);
+ Definition* result = use->definition();
+ ASSERT(result != NULL);
+ // Replace uses and remove the current instructions via the iterator.
+ instr->ReplaceUsesWith(result);
+ ASSERT(current_iterator()->Current() == instr);
+ current_iterator()->RemoveCurrentFromGraph();
+ if (FLAG_trace_optimization) {
+ OS::Print("Replacing v%d with v%d\n",
+ instr->ssa_temp_index(),
+ result->ssa_temp_index());
}
+
if (FLAG_trace_type_check_elimination) {
const String& name = String::Handle(Symbols::New("InstanceOf"));
FlowGraphPrinter::PrintTypeCheck(parsed_function(),
« no previous file with comments | « runtime/vm/flow_graph_optimizer.h ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698