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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 140233002: Fix issue 16103 (VM crash): incorrect merging of sin/cos. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 | « no previous file | tests/language/arithmetic_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_optimizer.cc
===================================================================
--- runtime/vm/flow_graph_optimizer.cc (revision 31855)
+++ runtime/vm/flow_graph_optimizer.cc (working copy)
@@ -421,14 +421,18 @@
ZoneGrowableArray<Value*>* args = new ZoneGrowableArray<Value*>(1);
args->Add(new Value(curr_instr->value()->definition()));
- // Replace with TruncDivMod.
- MergedMathInstr* div_mod = new MergedMathInstr(
+ // Replace with SinCos.
+ MergedMathInstr* sin_cos = new MergedMathInstr(
args,
curr_instr->DeoptimizationTarget(),
MergedMathInstr::kSinCos);
- curr_instr->ReplaceWith(div_mod, current_iterator());
- other_op->ReplaceUsesWith(div_mod);
+ curr_instr->ReplaceWith(sin_cos, current_iterator());
+ other_op->ReplaceUsesWith(sin_cos);
other_op->RemoveFromGraph();
+ // Only one merge possible. Because canonicalization happens later,
+ // more candidates are possible.
+ // TODO(srdjan): Allow merging of sin/cos into sincos.
+ break;
}
}
}
« no previous file with comments | « no previous file | tests/language/arithmetic_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698