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

Unified Diff: src/objects-debug.cc

Issue 912833003: Make SNaN verification universal for all arches. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix names. Created 5 years, 10 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 | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-debug.cc
diff --git a/src/objects-debug.cc b/src/objects-debug.cc
index 4e7cf8f1dfb20faf28f30c3d9e861cf57fe773ba..059406e3dc21193be8ae9d5ba7be6d75d9ab5564 100644
--- a/src/objects-debug.cc
+++ b/src/objects-debug.cc
@@ -390,8 +390,12 @@ void FixedDoubleArray::FixedDoubleArrayVerify() {
for (int i = 0; i < length(); i++) {
if (!is_the_hole(i)) {
uint64_t value = get_representation(i);
- CHECK((value & V8_UINT64_C(0x7FF8000000000000)) !=
- V8_UINT64_C(0x7FF0000000000000) ||
+ uint64_t unexpected =
+ bit_cast<uint64_t>(std::numeric_limits<double>::quiet_NaN()) &
+ V8_UINT64_C(0x7FF8000000000000);
+ // Create implementation specific sNaN by inverting relevant bit.
+ unexpected ^= V8_UINT64_C(0x0008000000000000);
+ CHECK((value & V8_UINT64_C(0x7FF8000000000000)) != unexpected ||
(value & V8_UINT64_C(0x0007FFFFFFFFFFFF)) == V8_UINT64_C(0));
}
}
« no previous file with comments | « no previous file | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698