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

Unified Diff: src/hydrogen-instructions.cc

Issue 12918028: Canonicalize NaNs on store to Fast(Float|Double) arrays (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 9 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
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index 9b96cfe7ca6a1dcd19ef7394a001c60e6863b84c..c3d5b9dc01c57316b5447d931550732cc75fd42e 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -2590,6 +2590,10 @@ bool HLoadKeyed::UsesMustHandleHole() const {
return false;
}
+ if (IsExternalArrayElementsKind(elements_kind())) {
+ return false;
+ }
+
if (hole_mode() == ALLOW_RETURN_HOLE) return true;
if (IsFastDoubleElementsKind(elements_kind())) {
@@ -3037,10 +3041,18 @@ bool HStoreKeyed::NeedsCanonicalization() {
// If value is an integer or smi or comes from the result of a keyed load or
// constant then it is either be a non-hole value or in the case of a constant
// the hole is only being stored explicitly: no need for canonicalization.
- if (value()->IsLoadKeyed() || value()->IsConstant()) {
+ //
+ // The exception to that is keyed loads from external float or double arrays:
+ // these can load arbitrary representation of NaN
Jakob Kummerow 2013/03/28 10:17:38 nit: full stop at the end of the line, please.
+
+ if (value()->IsConstant()) {
return false;
}
+ if (value()->IsLoadKeyed()) {
+ return HLoadKeyed::cast(value())->can_load_hole_nan();
danno 2013/03/28 08:49:39 I am not sure you need a separate predicate for th
Dmitry Lomov (no reviews) 2013/03/28 10:01:27 I strongly disagree. We have enough hidden depende
danno 2013/03/28 10:07:16 Well, the name you have chose isn't correct, and i
Dmitry Lomov (no reviews) 2013/03/28 12:19:40 Alright so we have had a little offline discussion
+ }
+
if (value()->IsChange()) {
if (HChange::cast(value())->from().IsInteger32()) {
return false;

Powered by Google App Engine
This is Rietveld 408576698