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

Unified Diff: src/heap/mark-compact.cc

Issue 1324023007: [heap] introduce ArrayBufferTracker (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: destructor 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/heap.cc ('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/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index b66dd5530389a4de2ef1b06c8f9ba38e965c5ca9..cbe0e3cac23bb7e783ee5493ab099616646cf4af 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -14,6 +14,7 @@
#include "src/frames-inl.h"
#include "src/gdb-jit.h"
#include "src/global-handles.h"
+#include "src/heap/array-buffer-tracker.h"
#include "src/heap/gc-tracer.h"
#include "src/heap/incremental-marking.h"
#include "src/heap/mark-compact-inl.h"
@@ -1871,8 +1872,7 @@ int MarkCompactCollector::DiscoverAndEvacuateBlackObjectsOnPage(
MigrateObject(HeapObject::cast(target), object, size, NEW_SPACE);
if (V8_UNLIKELY(target->IsJSArrayBuffer())) {
- heap()->RegisterLiveArrayBuffer(
- true, JSArrayBuffer::cast(target)->backing_store());
+ heap()->array_buffer_tracker()->MarkLive(JSArrayBuffer::cast(target));
}
heap()->IncrementSemiSpaceCopiedObjectSize(size);
}
@@ -3098,7 +3098,7 @@ bool MarkCompactCollector::TryPromoteObject(HeapObject* object,
MigrateObject(target, object, object_size, old_space->identity());
// If we end up needing more special cases, we should factor this out.
if (V8_UNLIKELY(target->IsJSArrayBuffer())) {
- heap()->PromoteArrayBuffer(target);
+ heap()->array_buffer_tracker()->Promote(JSArrayBuffer::cast(target));
}
heap()->IncrementPromotedObjectsSize(object_size);
return true;
@@ -4443,7 +4443,7 @@ void MarkCompactCollector::SweepSpaces() {
// EvacuateNewSpaceAndCandidates iterates over new space objects and for
// ArrayBuffers either re-registers them as live or promotes them. This is
// needed to properly free them.
- heap()->FreeDeadArrayBuffers(false);
+ heap()->array_buffer_tracker()->FreeDead(false);
// Clear the marking state of live large objects.
heap_->lo_space()->ClearMarkingStateOfLiveObjects();
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/objects-visiting-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698