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

Unified Diff: src/objects-inl.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/objects.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 9ddaa81af44ba1df971ae679a90d5c3a50d60f89..a5c21340759327e100da1da9528bb306aa5c7b67 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -1505,6 +1505,8 @@ HeapObjectContents HeapObject::ContentType() {
} else if (type >= FIRST_FIXED_TYPED_ARRAY_TYPE &&
type <= LAST_FIXED_TYPED_ARRAY_TYPE) {
return HeapObjectContents::kMixedValues;
+ } else if (type == JS_ARRAY_BUFFER_TYPE) {
+ return HeapObjectContents::kMixedValues;
} else if (type <= LAST_DATA_TYPE) {
// TODO(jochen): Why do we claim that Code and Map contain only raw values?
return HeapObjectContents::kRawValues;
@@ -6586,6 +6588,32 @@ void JSArrayBuffer::set_is_shared(bool value) {
}
+// static
+template <typename StaticVisitor>
+void JSArrayBuffer::JSArrayBufferIterateBody(Heap* heap, HeapObject* obj) {
+ StaticVisitor::VisitPointers(
+ heap, obj,
+ HeapObject::RawField(obj, JSArrayBuffer::BodyDescriptor::kStartOffset),
+ HeapObject::RawField(obj,
+ JSArrayBuffer::kByteLengthOffset + kPointerSize));
+ StaticVisitor::VisitPointers(
+ heap, obj, HeapObject::RawField(obj, JSArrayBuffer::kSize),
+ HeapObject::RawField(obj, JSArrayBuffer::kSizeWithInternalFields));
+}
+
+
+void JSArrayBuffer::JSArrayBufferIterateBody(HeapObject* obj,
+ ObjectVisitor* v) {
+ v->VisitPointers(
+ HeapObject::RawField(obj, JSArrayBuffer::BodyDescriptor::kStartOffset),
+ HeapObject::RawField(obj,
+ JSArrayBuffer::kByteLengthOffset + kPointerSize));
+ v->VisitPointers(
+ HeapObject::RawField(obj, JSArrayBuffer::kSize),
+ HeapObject::RawField(obj, JSArrayBuffer::kSizeWithInternalFields));
+}
+
+
Object* JSArrayBufferView::byte_offset() const {
if (WasNeutered()) return Smi::FromInt(0);
return Object::cast(READ_FIELD(this, kByteOffsetOffset));
« no previous file with comments | « src/objects.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698