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

Unified Diff: runtime/vm/flow_graph_compiler_mips.cc

Issue 62443002: VM: Fix double comparisons using != and NaN in optimized code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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
Index: runtime/vm/flow_graph_compiler_mips.cc
===================================================================
--- runtime/vm/flow_graph_compiler_mips.cc (revision 29983)
+++ runtime/vm/flow_graph_compiler_mips.cc (working copy)
@@ -1710,11 +1710,12 @@
FpuRegister left,
FpuRegister right,
Register result) {
- Label done;
+ Label done, is_true;
+ Label* nan_label = (true_condition == NE) ? &is_true : &done;
__ Comment("DoubleCompareBool");
assembler()->LoadObject(result, Bool::False());
assembler()->cund(left, right);
- assembler()->bc1t(&done);
+ assembler()->bc1t(nan_label);
switch (true_condition) {
case EQ: assembler()->ceqd(left, right); break;
@@ -1735,6 +1736,7 @@
} else {
assembler()->bc1f(&done);
}
+ assembler()->Bind(&is_true);
assembler()->LoadObject(result, Bool::True());
assembler()->Bind(&done);
}

Powered by Google App Engine
This is Rietveld 408576698