Index: src/objects-inl.h |
=================================================================== |
--- src/objects-inl.h (revision 3405) |
+++ src/objects-inl.h (working copy) |
@@ -704,13 +704,15 @@ |
#define FIELD_ADDR(p, offset) \ |
(reinterpret_cast<byte*>(p) + offset - kHeapObjectTag) |
+#define FIELD_ADDR_ALIGNED_8(p, offset) \ |
+ (reinterpret_cast<byte*>((reinterpret_cast<intptr_t>(p) + offset - kHeapObjectTag + 4) & -8)) |
+ |
#define READ_FIELD(p, offset) \ |
(*reinterpret_cast<Object**>(FIELD_ADDR(p, offset))) |
#define WRITE_FIELD(p, offset, value) \ |
(*reinterpret_cast<Object**>(FIELD_ADDR(p, offset)) = value) |
- |
#define WRITE_BARRIER(object, offset) \ |
Heap::RecordWrite(object->address(), offset); |
@@ -725,11 +727,11 @@ |
!Heap::InNewSpace(READ_FIELD(object, offset))); \ |
} |
-#define READ_DOUBLE_FIELD(p, offset) \ |
- (*reinterpret_cast<double*>(FIELD_ADDR(p, offset))) |
+#define READ_HEAP_NUMBER_FIELD(p, offset) \ |
+ (*reinterpret_cast<double*>(FIELD_ADDR_ALIGNED_8(p, offset))) |
-#define WRITE_DOUBLE_FIELD(p, offset, value) \ |
- (*reinterpret_cast<double*>(FIELD_ADDR(p, offset)) = value) |
+#define WRITE_HEAP_NUMBER_FIELD(p, offset, value) \ |
+ (*reinterpret_cast<double*>(FIELD_ADDR_ALIGNED_8(p, offset)) = value) |
#define READ_INT_FIELD(p, offset) \ |
(*reinterpret_cast<int*>(FIELD_ADDR(p, offset))) |
@@ -1099,12 +1101,12 @@ |
double HeapNumber::value() { |
- return READ_DOUBLE_FIELD(this, kValueOffset); |
+ return READ_HEAP_NUMBER_FIELD(this, kValueMinimumOffset); |
} |
void HeapNumber::set_value(double value) { |
- WRITE_DOUBLE_FIELD(this, kValueOffset, value); |
+ WRITE_HEAP_NUMBER_FIELD(this, kValueMinimumOffset, value); |
} |
@@ -3020,12 +3022,13 @@ |
#undef FIELD_ADDR |
#undef READ_FIELD |
#undef WRITE_FIELD |
+#undef FIELD_ADDR_ALIGNED_8 |
#undef WRITE_BARRIER |
#undef CONDITIONAL_WRITE_BARRIER |
#undef READ_MEMADDR_FIELD |
#undef WRITE_MEMADDR_FIELD |
-#undef READ_DOUBLE_FIELD |
-#undef WRITE_DOUBLE_FIELD |
+#undef READ_HEAP_NUMBER_FIELD |
+#undef WRITE_HEAP_NUMBER_FIELD |
#undef READ_INT_FIELD |
#undef WRITE_INT_FIELD |
#undef READ_SHORT_FIELD |