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

Unified Diff: src/objects-inl.h

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/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 43db240fd9c3d71538411c63fd468d741aaea534..2bfdedd87f4398938b5e71f9ce8faaba69fd1737 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -2289,19 +2289,12 @@ void FixedArray::set(int index, Object* value) {
inline bool FixedDoubleArray::is_the_hole_nan(double value) {
- return bit_cast<uint64_t, double>(value) == kHoleNanInt64;
+ return bit_cast<uint64_t>(value) == kHoleNanInt64;
}
inline double FixedDoubleArray::hole_nan_as_double() {
- return bit_cast<double, uint64_t>(kHoleNanInt64);
-}
-
-
-inline double FixedDoubleArray::canonical_not_the_hole_nan_as_double() {
- DCHECK(bit_cast<uint64_t>(base::OS::nan_value()) != kHoleNanInt64);
- DCHECK((bit_cast<uint64_t>(base::OS::nan_value()) >> 32) != kHoleNanUpper32);
- return base::OS::nan_value();
+ return bit_cast<double>(kHoleNanInt64);
}
@@ -2336,7 +2329,9 @@ void FixedDoubleArray::set(int index, double value) {
DCHECK(map() != GetHeap()->fixed_cow_array_map() &&
map() != GetHeap()->fixed_array_map());
int offset = kHeaderSize + index * kDoubleSize;
- if (std::isnan(value)) value = canonical_not_the_hole_nan_as_double();
+ if (std::isnan(value)) {
+ value = std::numeric_limits<double>::quiet_NaN();
+ }
WRITE_DOUBLE_FIELD(this, offset, value);
}

Powered by Google App Engine
This is Rietveld 408576698