Chromium Code Reviews| 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 |
| } |