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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 2640993003: VM: [Cleanup] Delete legacy code associated with BranchInstr. (Closed)
Patch Set: Done Created 3 years, 11 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_builder.h ('k') | runtime/vm/flow_graph_type_propagator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index 265c3088f86794e090dc8e8031afc7559b43efc2..bf135624fb07337f4a2ea3895866d0e4c4fa2d95 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -991,23 +991,8 @@ void TestGraphVisitor::ReturnValue(Value* value) {
}
-void TestGraphVisitor::MergeBranchWithComparison(ComparisonInstr* comp) {
- BranchInstr* branch;
- if (Token::IsStrictEqualityOperator(comp->kind())) {
- ASSERT(comp->IsStrictCompare());
- branch = new (Z) BranchInstr(comp);
- } else if (Token::IsEqualityOperator(comp->kind()) &&
- (comp->left()->BindsToConstantNull() ||
- comp->right()->BindsToConstantNull())) {
- branch = new (Z) BranchInstr(new (Z) StrictCompareInstr(
- comp->token_pos(),
- (comp->kind() == Token::kEQ) ? Token::kEQ_STRICT : Token::kNE_STRICT,
- comp->left(), comp->right(),
- false)); // No number check.
- } else {
- branch = new (Z) BranchInstr(comp);
- branch->set_is_checked(Isolate::Current()->type_checks());
- }
+void TestGraphVisitor::MergeBranchWithStrictCompare(StrictCompareInstr* comp) {
+ BranchInstr* branch = new (Z) BranchInstr(comp);
AddInstruction(branch);
CloseFragment();
true_successor_addresses_.Add(branch->true_successor_address());
@@ -1030,9 +1015,9 @@ void TestGraphVisitor::MergeBranchWithNegate(BooleanNegateInstr* neg) {
void TestGraphVisitor::ReturnDefinition(Definition* definition) {
- ComparisonInstr* comp = definition->AsComparison();
+ StrictCompareInstr* comp = definition->AsStrictCompare();
if (comp != NULL) {
- MergeBranchWithComparison(comp);
+ MergeBranchWithStrictCompare(comp);
return;
}
if (!Isolate::Current()->type_checks()) {
« no previous file with comments | « runtime/vm/flow_graph_builder.h ('k') | runtime/vm/flow_graph_type_propagator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698