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

Unified Diff: src/objects-inl.h

Issue 6709022: Re-establish mips basic infrastructure. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 9 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
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 01073ca7b08bd272520e1b1009d266a671411e7e..bf309236510961130625fec4d70327a3418bb26a 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -1190,12 +1190,36 @@ void HeapObject::ClearOverflow() {
double HeapNumber::value() {
+#ifndef V8_TARGET_ARCH_MIPS
return READ_DOUBLE_FIELD(this, kValueOffset);
+#else // V8_TARGET_ARCH_MIPS
Søren Thygesen Gjesse 2011/03/21 16:05:19 I think this should be put into the macro READ_DOU
Paul Lind 2011/03/23 01:55:43 The code has been moved to the READ_DOUBLE_FIELD m
+ // Prevent gcc from using load-double (mips ldc1) on (possibly)
+ // non-64-bit aligned HeapNumber::value.
+ union conversion {
+ double d;
+ uint32_t u[2];
+ } c;
+ c.u[0] = (*reinterpret_cast<uint32_t*>(FIELD_ADDR(this, kValueOffset)));
+ c.u[1] = (*reinterpret_cast<uint32_t*>(FIELD_ADDR(this, kValueOffset + 4)));
+ return c.d;
+#endif // V8_TARGET_ARCH_MIPS
}
void HeapNumber::set_value(double value) {
+#ifndef V8_TARGET_ARCH_MIPS
WRITE_DOUBLE_FIELD(this, kValueOffset, value);
+#else // V8_TARGET_ARCH_MIPS
Søren Thygesen Gjesse 2011/03/21 16:05:19 Ditto.
Paul Lind 2011/03/23 01:55:43 This one could have been implemented as pure macro
+ // Prevent gcc from using store-double (mips sdc1) on (possibly)
+ // non-64-bit aligned HeapNumber::value.
+ union conversion {
+ double d;
+ uint32_t u[2];
+ } c;
+ c.d = value;
+ (*reinterpret_cast<uint32_t*>(FIELD_ADDR(this, kValueOffset))) = c.u[0];
+ (*reinterpret_cast<uint32_t*>(FIELD_ADDR(this, kValueOffset + 4))) = c.u[1];
+#endif // V8_TARGET_ARCH_MIPS
}
« src/mips/disasm-mips.cc ('K') | « src/mips/virtual-frame-mips-inl.h ('k') | src/platform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698