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

Unified Diff: src/heap/heap.cc

Issue 1964023002: [heap] Fine-grained JSArrayBuffer tracking (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix tests, harden expectations, more comments 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
« include/v8.h ('K') | « src/heap/heap.h ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index afdc7bb4cd397d69625ecdca09c295a668e0a6ae..954a873dd42e8837a890bb1373cf95ce3aa03479 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -387,7 +387,7 @@ void Heap::PrintShortHeapStatistics() {
this->CommittedMemory() / KB);
PrintIsolate(
isolate_, "External memory reported: %6" V8PRIdPTR " KB\n",
- static_cast<intptr_t>(amount_of_external_allocated_memory_ / KB));
+ static_cast<intptr_t>(amount_of_external_allocated_memory_.Value() / KB));
PrintIsolate(isolate_, "Total time spent in GC : %.1f ms\n",
total_gc_time_ms_);
}
@@ -1341,7 +1341,7 @@ bool Heap::PerformGarbageCollection(
if (collector == MARK_COMPACTOR) {
// Register the amount of external allocated memory.
amount_of_external_allocated_memory_at_last_global_gc_ =
- amount_of_external_allocated_memory_;
+ amount_of_external_allocated_memory_.Value();
SetOldGenerationAllocationLimit(old_gen_size, gc_speed, mutator_speed);
} else if (HasLowYoungGenerationAllocationRate() &&
old_generation_size_configured_) {
@@ -1626,8 +1626,6 @@ void Heap::Scavenge() {
scavenge_collector_->SelectScavengingVisitorsTable();
- array_buffer_tracker()->PrepareDiscoveryInNewSpace();
-
// Flip the semispaces. After flipping, to space is empty, from space has
// live objects.
new_space_.Flip();
@@ -1734,7 +1732,7 @@ void Heap::Scavenge() {
// Set age mark.
new_space_.set_age_mark(new_space_.top());
- array_buffer_tracker()->FreeDead(true);
+ array_buffer_tracker()->FreeDeadInNewSpace();
// Update how much has survived scavenge.
IncrementYoungSurvivorsCounter(static_cast<int>(
@@ -2014,7 +2012,9 @@ HeapObject* Heap::DoubleAlignForDeserialization(HeapObject* object, int size) {
void Heap::RegisterNewArrayBuffer(JSArrayBuffer* buffer) {
- return array_buffer_tracker()->RegisterNew(buffer);
+ const bool track_live =
+ Page::FromAddress(buffer->address())->IsFlagSet(Page::BLACK_PAGE);
+ return array_buffer_tracker()->RegisterNew(buffer, track_live);
}
@@ -5010,10 +5010,10 @@ intptr_t Heap::PromotedSpaceSizeOfObjects() {
int64_t Heap::PromotedExternalMemorySize() {
- if (amount_of_external_allocated_memory_ <=
+ if (amount_of_external_allocated_memory_.Value() <=
amount_of_external_allocated_memory_at_last_global_gc_)
return 0;
- return amount_of_external_allocated_memory_ -
+ return amount_of_external_allocated_memory_.Value() -
amount_of_external_allocated_memory_at_last_global_gc_;
}
« include/v8.h ('K') | « src/heap/heap.h ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698