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

Unified Diff: src/hydrogen-instructions.cc

Issue 863633002: Use signaling NaN for holes in fixed double arrays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Next bunch of fixes Created 5 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
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index 287fc56399229f262db4d21f8011cd4dca35f7f4..a1a60b370e1f7f46d9fc1a62150add4faa402ba9 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -4040,31 +4040,19 @@ bool HStoreKeyed::TryIncreaseBaseOffset(uint32_t increase_by_value) {
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.
- //
- // 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()) {
- return IsExternalFloatOrDoubleElementsKind(
- HLoadKeyed::cast(value())->elements_kind());
- }
-
- if (value()->IsChange()) {
- if (HChange::cast(value())->from().IsSmiOrInteger32()) {
- return false;
+ switch (value()->opcode()) {
+ case kLoadKeyed: {
+ ElementsKind load_kind = HLoadKeyed::cast(value())->elements_kind();
+ return IsExternalFloatOrDoubleElementsKind(load_kind) ||
+ IsFixedFloatElementsKind(load_kind);
}
- if (HChange::cast(value())->value()->type().IsSmi()) {
- return false;
+ case kChange: {
+ Representation from = HChange::cast(value())->from();
+ return from.IsTagged() || from.IsHeapObject();
}
+ default:
+ return false;
}
- return true;
}

Powered by Google App Engine
This is Rietveld 408576698