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

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: CR feedback 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
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-2596.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index 9b96cfe7ca6a1dcd19ef7394a001c60e6863b84c..cff5070bbcf6b275886ed5512b5ec5602cc2d951 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())) {
@@ -2612,6 +2616,10 @@ bool HLoadKeyed::RequiresHoleCheck() const {
return false;
}
+ if (IsExternalArrayElementsKind(elements_kind())) {
+ return false;
+ }
+
return !UsesMustHandleHole();
}
@@ -3037,10 +3045,22 @@ 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.
+
+ if (value()->IsConstant()) {
return false;
}
+ if (value()->IsLoadKeyed()) {
+ ElementsKind load_elements_kind =
+ HLoadKeyed::cast(value())->elements_kind();
+
+ return load_elements_kind == EXTERNAL_FLOAT_ELEMENTS
danno 2013/03/28 12:30:40 Maybe add a predicate to elements-kind.h: IsExtern
+ || load_elements_kind == EXTERNAL_DOUBLE_ELEMENTS;
+ }
+
if (value()->IsChange()) {
if (HChange::cast(value())->from().IsInteger32()) {
return false;
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-2596.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698