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

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

Issue 1177293003: Reland "Keep track of array buffers in new space separately" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 5 years, 6 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 7494330263ea37c0ec0eb32fba3f1b3a19ceaff2..9a4e88d9c4c8be444253f82aea323b241242febd 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -3041,6 +3041,10 @@ bool MarkCompactCollector::TryPromoteObject(HeapObject* object,
AllocationResult allocation = old_space->AllocateRaw(object_size, alignment);
if (allocation.To(&target)) {
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()->IncrementPromotedObjectsSize(object_size);
return true;
}
@@ -4367,7 +4371,6 @@ void MarkCompactCollector::SweepSpaces() {
#ifdef DEBUG
state_ = SWEEP_SPACES;
#endif
- heap()->FreeDeadArrayBuffers();
MoveEvacuationCandidatesToEndOfPagesList();
@@ -4395,6 +4398,8 @@ void MarkCompactCollector::SweepSpaces() {
EvacuateNewSpaceAndCandidates();
+ heap()->FreeDeadArrayBuffers(false);
+
// ClearNonLiveReferences depends on precise sweeping of map space to
// detect whether unmarked map became dead in this collection or in one
// of the previous ones.
« 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