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

Unified Diff: src/objects.h

Issue 1327403002: [objects] do not visit ArrayBuffer's backing store (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: visit all fields in array buffer, reorder fields for simplicity Created 5 years, 3 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
« no previous file with comments | « src/heap/store-buffer.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index f547c8388cf9df637a2436ba64c4bd3342cbef7a..3aa6b03a0d4efffe2b85a4f754973a3b3f02244a 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -9663,9 +9663,14 @@ class JSArrayBuffer: public JSObject {
DECLARE_PRINTER(JSArrayBuffer)
DECLARE_VERIFIER(JSArrayBuffer)
- static const int kBackingStoreOffset = JSObject::kHeaderSize;
- static const int kByteLengthOffset = kBackingStoreOffset + kPointerSize;
- static const int kBitFieldSlot = kByteLengthOffset + kPointerSize;
+ static const int kByteLengthOffset = JSObject::kHeaderSize;
+
+ // NOTE: GC will visit objects fields:
+ // 1. From JSObject::BodyDescriptor::kStartOffset to kByteLengthOffset +
+ // kPointerSize
+ // 2. From start of the internal fields and up to the end of them
+ static const int kBackingStoreOffset = kByteLengthOffset + kPointerSize;
+ static const int kBitFieldSlot = kBackingStoreOffset + kPointerSize;
#if V8_TARGET_LITTLE_ENDIAN || !V8_HOST_ARCH_64_BIT
static const int kBitFieldOffset = kBitFieldSlot;
#else
@@ -9676,6 +9681,12 @@ class JSArrayBuffer: public JSObject {
static const int kSizeWithInternalFields =
kSize + v8::ArrayBuffer::kInternalFieldCount * kPointerSize;
+ template <typename StaticVisitor>
+ static inline void JSArrayBufferIterateBody(Heap* heap, HeapObject* obj);
+
+ static inline void JSArrayBufferIterateBody(HeapObject* obj,
+ ObjectVisitor* v);
+
class IsExternal : public BitField<bool, 1, 1> {};
class IsNeuterable : public BitField<bool, 2, 1> {};
class WasNeutered : public BitField<bool, 3, 1> {};
« no previous file with comments | « src/heap/store-buffer.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698