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

Unified Diff: src/heap/objects-visiting-inl.h

Issue 2032973002: Revert of Reland "[heap] Fine-grained JSArrayBuffer tracking" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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/objects-visiting.h ('k') | src/heap/scavenger.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/objects-visiting-inl.h
diff --git a/src/heap/objects-visiting-inl.h b/src/heap/objects-visiting-inl.h
index eeb99fc33b01e940a1462bdb2bf7a450105ef10c..c504988436f79f562eb73530db3ff4b30da489da 100644
--- a/src/heap/objects-visiting-inl.h
+++ b/src/heap/objects-visiting-inl.h
@@ -77,10 +77,7 @@
&FlexibleBodyVisitor<StaticVisitor, JSFunction::BodyDescriptorWeakCode,
int>::Visit);
- table_.Register(
- kVisitJSArrayBuffer,
- &FlexibleBodyVisitor<StaticVisitor, JSArrayBuffer::BodyDescriptor,
- int>::Visit);
+ table_.Register(kVisitJSArrayBuffer, &VisitJSArrayBuffer);
table_.Register(kVisitFreeSpace, &VisitFreeSpace);
@@ -101,6 +98,21 @@
table_.template RegisterSpecializations<StructVisitor, kVisitStruct,
kVisitStructGeneric>();
}
+
+
+template <typename StaticVisitor>
+int StaticNewSpaceVisitor<StaticVisitor>::VisitJSArrayBuffer(
+ Map* map, HeapObject* object) {
+ typedef FlexibleBodyVisitor<StaticVisitor, JSArrayBuffer::BodyDescriptor, int>
+ JSArrayBufferBodyVisitor;
+
+ if (!JSArrayBuffer::cast(object)->is_external()) {
+ Heap* heap = map->GetHeap();
+ heap->array_buffer_tracker()->MarkLive(JSArrayBuffer::cast(object));
+ }
+ return JSArrayBufferBodyVisitor::Visit(map, object);
+}
+
template <typename StaticVisitor>
int StaticNewSpaceVisitor<StaticVisitor>::VisitBytecodeArray(
@@ -173,10 +185,7 @@
table_.Register(kVisitJSFunction, &VisitJSFunction);
- table_.Register(
- kVisitJSArrayBuffer,
- &FlexibleBodyVisitor<StaticVisitor, JSArrayBuffer::BodyDescriptor,
- void>::Visit);
+ table_.Register(kVisitJSArrayBuffer, &VisitJSArrayBuffer);
// Registration for kVisitJSRegExp is done by StaticVisitor.
@@ -510,6 +519,24 @@
HeapObject* object) {
JSObjectVisitor::Visit(map, object);
}
+
+
+template <typename StaticVisitor>
+void StaticMarkingVisitor<StaticVisitor>::VisitJSArrayBuffer(
+ Map* map, HeapObject* object) {
+ Heap* heap = map->GetHeap();
+
+ typedef FlexibleBodyVisitor<StaticVisitor, JSArrayBuffer::BodyDescriptor,
+ void> JSArrayBufferBodyVisitor;
+
+ JSArrayBufferBodyVisitor::Visit(map, object);
+
+ if (!JSArrayBuffer::cast(object)->is_external() &&
+ !heap->InNewSpace(object)) {
+ heap->array_buffer_tracker()->MarkLive(JSArrayBuffer::cast(object));
+ }
+}
+
template <typename StaticVisitor>
void StaticMarkingVisitor<StaticVisitor>::VisitBytecodeArray(
« no previous file with comments | « src/heap/objects-visiting.h ('k') | src/heap/scavenger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698