Index: src/objects.h |
diff --git a/src/objects.h b/src/objects.h |
index 9f21211b84e1dcb7a840299c569cdd3cac13dce4..086c005b96ee6e137f48715a6cf254a591568ba9 100644 |
--- a/src/objects.h |
+++ b/src/objects.h |
@@ -296,12 +296,12 @@ enum PropertyNormalizationMode { |
// Since string types are not consecutive, this macro is used to |
// iterate over them. |
#define STRING_TYPE_LIST(V) \ |
- V(SHORT_SYMBOL_TYPE, SeqTwoByteString::kHeaderSize, short_symbol) \ |
- V(MEDIUM_SYMBOL_TYPE, SeqTwoByteString::kHeaderSize, medium_symbol) \ |
- V(LONG_SYMBOL_TYPE, SeqTwoByteString::kHeaderSize, long_symbol) \ |
- V(SHORT_ASCII_SYMBOL_TYPE, SeqAsciiString::kHeaderSize, short_ascii_symbol) \ |
- V(MEDIUM_ASCII_SYMBOL_TYPE, SeqAsciiString::kHeaderSize, medium_ascii_symbol)\ |
- V(LONG_ASCII_SYMBOL_TYPE, SeqAsciiString::kHeaderSize, long_ascii_symbol) \ |
+ V(SHORT_SYMBOL_TYPE, SeqTwoByteString::kAlignedSize, short_symbol) \ |
+ V(MEDIUM_SYMBOL_TYPE, SeqTwoByteString::kAlignedSize, medium_symbol) \ |
+ V(LONG_SYMBOL_TYPE, SeqTwoByteString::kAlignedSize, long_symbol) \ |
+ V(SHORT_ASCII_SYMBOL_TYPE, SeqAsciiString::kAlignedSize, short_ascii_symbol) \ |
+ V(MEDIUM_ASCII_SYMBOL_TYPE, SeqAsciiString::kAlignedSize, medium_ascii_symbol)\ |
+ V(LONG_ASCII_SYMBOL_TYPE, SeqAsciiString::kAlignedSize, long_ascii_symbol) \ |
V(SHORT_CONS_SYMBOL_TYPE, ConsString::kSize, short_cons_symbol) \ |
V(MEDIUM_CONS_SYMBOL_TYPE, ConsString::kSize, medium_cons_symbol) \ |
V(LONG_CONS_SYMBOL_TYPE, ConsString::kSize, long_cons_symbol) \ |
@@ -338,12 +338,12 @@ enum PropertyNormalizationMode { |
V(LONG_EXTERNAL_ASCII_SYMBOL_TYPE, \ |
ExternalAsciiString::kSize, \ |
long_external_ascii_symbol) \ |
- V(SHORT_STRING_TYPE, SeqTwoByteString::kHeaderSize, short_string) \ |
- V(MEDIUM_STRING_TYPE, SeqTwoByteString::kHeaderSize, medium_string) \ |
- V(LONG_STRING_TYPE, SeqTwoByteString::kHeaderSize, long_string) \ |
- V(SHORT_ASCII_STRING_TYPE, SeqAsciiString::kHeaderSize, short_ascii_string) \ |
- V(MEDIUM_ASCII_STRING_TYPE, SeqAsciiString::kHeaderSize, medium_ascii_string)\ |
- V(LONG_ASCII_STRING_TYPE, SeqAsciiString::kHeaderSize, long_ascii_string) \ |
+ V(SHORT_STRING_TYPE, SeqTwoByteString::kAlignedSize, short_string) \ |
+ V(MEDIUM_STRING_TYPE, SeqTwoByteString::kAlignedSize, medium_string) \ |
+ V(LONG_STRING_TYPE, SeqTwoByteString::kAlignedSize, long_string) \ |
+ V(SHORT_ASCII_STRING_TYPE, SeqAsciiString::kAlignedSize, short_ascii_string) \ |
+ V(MEDIUM_ASCII_STRING_TYPE, SeqAsciiString::kAlignedSize, medium_ascii_string)\ |
+ V(LONG_ASCII_STRING_TYPE, SeqAsciiString::kAlignedSize, long_ascii_string) \ |
V(SHORT_CONS_STRING_TYPE, ConsString::kSize, short_cons_string) \ |
V(MEDIUM_CONS_STRING_TYPE, ConsString::kSize, medium_cons_string) \ |
V(LONG_CONS_STRING_TYPE, ConsString::kSize, long_cons_string) \ |
@@ -1553,6 +1553,7 @@ class Array: public HeapObject { |
// Layout descriptor. |
static const int kLengthOffset = HeapObject::kHeaderSize; |
static const int kHeaderSize = kLengthOffset + kIntSize; |
+ static const int kAlignedSize = POINTER_SIZE_ALIGN(kHeaderSize); |
private: |
DISALLOW_IMPLICIT_CONSTRUCTORS(Array); |
@@ -3373,6 +3374,7 @@ class String: public HeapObject { |
// Layout description. |
static const int kLengthOffset = HeapObject::kHeaderSize; |
static const int kSize = kLengthOffset + kIntSize; |
+ // Notice: kSize is not pointer-size aligned if pointers are 64-bit. |
// Limits on sizes of different types of strings. |
static const int kMaxShortStringSize = 63; |
@@ -3526,6 +3528,7 @@ class SeqAsciiString: public SeqString { |
// Layout description. |
static const int kHeaderSize = String::kSize; |
+ static const int kAlignedSize = POINTER_SIZE_ALIGN(kHeaderSize); |
// Support for StringInputBuffer. |
inline void SeqAsciiStringReadBlockIntoBuffer(ReadBlockBuffer* buffer, |
@@ -3571,6 +3574,7 @@ class SeqTwoByteString: public SeqString { |
// Layout description. |
static const int kHeaderSize = String::kSize; |
+ static const int kAlignedSize = POINTER_SIZE_ALIGN(kHeaderSize); |
// Support for StringInputBuffer. |
inline void SeqTwoByteStringReadBlockIntoBuffer(ReadBlockBuffer* buffer, |