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

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: split out 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
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index b66dd5530389a4de2ef1b06c8f9ba38e965c5ca9..9bbb98bcfc02fd36afe1a766b579691c74608b8c 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -1871,8 +1871,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 +3097,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 +4442,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();

Powered by Google App Engine
This is Rietveld 408576698