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

Unified Diff: src/serialize.cc

Issue 9910029: MIPS: Fix NaN value inconsistency with snapshots (alternate implementation). (Closed)
Patch Set: Fix debug build, by removing use of HeapNumber::set_value() Created 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/serialize.cc
diff --git a/src/serialize.cc b/src/serialize.cc
index 01d5f1c7bcb034efd6a4f95c1094a4502a0001ed..0cc12528cd2dbecadc163f9a1d61a07b65089e8f 100644
--- a/src/serialize.cc
+++ b/src/serialize.cc
@@ -1444,6 +1444,21 @@ void Serializer::ObjectSerializer::Serialize() {
sink_->PutSection(space, "NewPageSpace");
}
+#ifdef V8_TARGET_ARCH_MIPS
+#define MIPS_QNAN_HI 0x7ff7ffff
+#define MIPS_QNAN_LO 0xffffffff
+ // Mips has a different encoding of qNaN than ia32, so any heap NaN built
+ // with simulator must be re-encoded for the snapshot. Performance hit not
+ // critical at mksnapshot/build time.
+ if (object_->IsNaN()) {
+ uint64_t mips_qnan_bits =
+ (static_cast<uint64_t>(MIPS_QNAN_HI) << 32) | MIPS_QNAN_LO;
+ Address value_ptr = (reinterpret_cast<byte*>(object_) +
+ HeapNumber::kValueOffset - kHeapObjectTag);
+ memcpy(value_ptr, &mips_qnan_bits, sizeof(mips_qnan_bits));
+ }
+#endif // V8_TARGET_ARCH_MIPS
+
// Serialize the map (first word of the object).
serializer_->SerializeObject(object_->map(), kPlain, kStartOfObject);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698