Chromium Code Reviews| Index: src/objects.h |
| diff --git a/src/objects.h b/src/objects.h |
| index 11b231f1335b3bef0e4c4ca6c293627f12d33c65..6f2926190d8f8c152427eba6183475d7ae6013b6 100644 |
| --- a/src/objects.h |
| +++ b/src/objects.h |
| @@ -8784,6 +8784,12 @@ class JSArrayBuffer: public JSObject { |
| inline bool is_external(); |
| inline void set_is_external(bool value); |
| + // [weak_next]: linked list of array buffers. |
| + DECL_ACCESSORS(weak_next, Object) |
| + |
| + // [weak_first_array]: weak linked list of typed arrays. |
| + DECL_ACCESSORS(weak_first_array, Object) |
| + |
| // Casting. |
| static inline JSArrayBuffer* cast(Object* obj); |
| @@ -8794,7 +8800,11 @@ class JSArrayBuffer: public JSObject { |
| static const int kBackingStoreOffset = JSObject::kHeaderSize; |
| static const int kByteLengthOffset = kBackingStoreOffset + kPointerSize; |
| static const int kFlagOffset = kByteLengthOffset + kPointerSize; |
| - static const int kSize = kFlagOffset + kPointerSize; |
| + // It is important for GC visitor that weak_next and weak_first_array |
| + // layed out consequtively in memory |
| + static const int kWeakNextOffset = kFlagOffset + kPointerSize; |
| + static const int kWeakFirstArrayOffset = kWeakNextOffset + kPointerSize; |
| + static const int kSize = kWeakFirstArrayOffset + kPointerSize; |
| private: |
| // Bit position in a flag |
| @@ -8818,6 +8828,9 @@ class JSTypedArray: public JSObject { |
| // [length]: length of typed array in elements. |
| DECL_ACCESSORS(length, Object) |
| + // [next]: linked list of typed arrays over the same array buffer. |
|
Hannes Payer (out of office)
2013/06/06 09:33:35
should be called weak_next
Dmitry Lomov (no reviews)
2013/06/06 13:18:34
Done.
|
| + DECL_ACCESSORS(weak_next, Object) |
| + |
| // Casting. |
| static inline JSTypedArray* cast(Object* obj); |
| @@ -8832,7 +8845,8 @@ class JSTypedArray: public JSObject { |
| static const int kByteOffsetOffset = kBufferOffset + kPointerSize; |
| static const int kByteLengthOffset = kByteOffsetOffset + kPointerSize; |
| static const int kLengthOffset = kByteLengthOffset + kPointerSize; |
| - static const int kSize = kLengthOffset + kPointerSize; |
| + static const int kWeakNextOffset = kLengthOffset + kPointerSize; |
| + static const int kSize = kWeakNextOffset + kPointerSize; |
| private: |
| DISALLOW_IMPLICIT_CONSTRUCTORS(JSTypedArray); |