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

Unified Diff: runtime/vm/flow_graph_compiler_ia32.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_ia32.cc
===================================================================
--- runtime/vm/flow_graph_compiler_ia32.cc (revision 29983)
+++ runtime/vm/flow_graph_compiler_ia32.cc (working copy)
@@ -1624,7 +1624,9 @@
Register result) {
assembler()->comisd(left, right);
Label is_false, is_true, done;
- assembler()->j(PARITY_EVEN, &is_false, Assembler::kNearJump); // NaN false;
+ // x == NaN -> false, x != NaN -> true.
+ Label* nan_label = (true_condition == NOT_EQUAL) ? &is_true : &is_false;
+ assembler()->j(PARITY_EVEN, nan_label, Assembler::kNearJump);
assembler()->j(true_condition, &is_true, Assembler::kNearJump);
assembler()->Bind(&is_false);
assembler()->LoadObject(result, Bool::False());

Powered by Google App Engine
This is Rietveld 408576698