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

Unified Diff: src/mips/assembler-mips.cc

Issue 10093007: MIPS: Do the qNaN fixup at de-serialization time. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 8 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
« src/isolate.cc ('K') | « src/isolate.cc ('k') | src/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/assembler-mips.cc
diff --git a/src/mips/assembler-mips.cc b/src/mips/assembler-mips.cc
index cc82097ec268d151dca543013b54ce79d268366b..f347fdc5761f98f831f887e644aa3dbcde5b596b 100644
--- a/src/mips/assembler-mips.cc
+++ b/src/mips/assembler-mips.cc
@@ -2137,19 +2137,12 @@ Address Assembler::target_address_at(Address pc) {
}
-#define MIPS_QNAN_HI 0x7ff7ffff
-#define MIPS_QNAN_LO 0xffffffff
-
-
+// MIPS and ia32 use opposite encoding for qNaN and sNaN, such that ia32
+// qNaN is a MIPS sNaN, and ia32 sNaN is MIPS qNaN. If running from a heap
+// snapshot generated on ia32, the resulting MIPS sNaN must be quieted.
+// OS::nan_value() returns a qNaN.
void Assembler::QuietNaN(HeapObject* object) {
- // 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. We can't use set_value because that
- // will put the NaN in an fp register, which changes the bits.
- uint64_t mips_qnan_bits =
- (static_cast<uint64_t>(MIPS_QNAN_HI) << 32) | MIPS_QNAN_LO;
- Address value_ptr = object->address() + HeapNumber::kValueOffset;
- memcpy(value_ptr, &mips_qnan_bits, sizeof(mips_qnan_bits));
+ HeapNumber::cast(object)->set_value(OS::nan_value());
}
« src/isolate.cc ('K') | « src/isolate.cc ('k') | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698