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

Unified Diff: src/heap/objects-visiting.cc

Issue 1115043005: Revert of Remove the weak list of array buffers (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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/objects-visiting-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/objects-visiting.cc
diff --git a/src/heap/objects-visiting.cc b/src/heap/objects-visiting.cc
index de2cfddb28438137df3641c14c85e48818a9bfef..8c2f198754525390688fe114b61c3daebb229f1d 100644
--- a/src/heap/objects-visiting.cc
+++ b/src/heap/objects-visiting.cc
@@ -191,7 +191,8 @@
template <class T>
-Object* VisitWeakList(Heap* heap, Object* list, WeakObjectRetainer* retainer) {
+Object* VisitWeakList(Heap* heap, Object* list, WeakObjectRetainer* retainer,
+ bool stop_after_young, Object** list_tail) {
Object* undefined = heap->undefined_value();
Object* head = undefined;
T* tail = NULL;
@@ -234,7 +235,10 @@
}
// Terminate the list if there is one or more elements.
- if (tail != NULL) WeakListVisitor<T>::SetWeakNext(tail, undefined);
+ if (tail != NULL) {
+ WeakListVisitor<T>::SetWeakNext(tail, undefined);
+ if (list_tail) *list_tail = tail;
+ }
return head;
}
@@ -316,7 +320,8 @@
static void DoWeakList(Heap* heap, Context* context,
WeakObjectRetainer* retainer, int index) {
// Visit the weak list, removing dead intermediate elements.
- Object* list_head = VisitWeakList<T>(heap, context->get(index), retainer);
+ Object* list_head =
+ VisitWeakList<T>(heap, context->get(index), retainer, false, NULL);
// Update the list head.
context->set(index, list_head, UPDATE_WRITE_BARRIER);
@@ -340,6 +345,26 @@
template <>
+struct WeakListVisitor<JSArrayBuffer> {
+ static void SetWeakNext(JSArrayBuffer* obj, Object* next) {
+ obj->set_weak_next(next);
+ }
+
+ static Object* WeakNext(JSArrayBuffer* obj) { return obj->weak_next(); }
+
+ static int WeakNextOffset() { return JSArrayBuffer::kWeakNextOffset; }
+
+ static void VisitLiveObject(Heap* heap, JSArrayBuffer* array_buffer,
+ WeakObjectRetainer* retainer) {
+ }
+
+ static void VisitPhantomObject(Heap* heap, JSArrayBuffer* phantom) {
+ Runtime::FreeArrayBuffer(heap->isolate(), phantom);
+ }
+};
+
+
+template <>
struct WeakListVisitor<AllocationSite> {
static void SetWeakNext(AllocationSite* obj, Object* next) {
obj->set_weak_next(next);
@@ -356,9 +381,19 @@
template Object* VisitWeakList<Context>(Heap* heap, Object* list,
- WeakObjectRetainer* retainer);
+ WeakObjectRetainer* retainer,
+ bool stop_after_young,
+ Object** list_tail);
+
+
+template Object* VisitWeakList<JSArrayBuffer>(Heap* heap, Object* list,
+ WeakObjectRetainer* retainer,
+ bool stop_after_young,
+ Object** list_tail);
template Object* VisitWeakList<AllocationSite>(Heap* heap, Object* list,
- WeakObjectRetainer* retainer);
+ WeakObjectRetainer* retainer,
+ bool stop_after_young,
+ Object** list_tail);
}
} // namespace v8::internal
« no previous file with comments | « src/heap/objects-visiting.h ('k') | src/heap/objects-visiting-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698