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

Unified Diff: src/api.cc

Issue 2310143002: [heap] Introduce enum of garbage collection reasons. (Closed)
Patch Set: rebase Created 4 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 | « no previous file | src/debug/debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index b500ef41fb16036a63982b6c0f46c25f19f861ab..343c7ad5a522985b6b4abbae505e07b391d8f8d7 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -512,7 +512,8 @@ StartupData SnapshotCreator::CreateBlob(
// If we don't do this then we end up with a stray root pointing at the
// context even after we have disposed of the context.
- isolate->heap()->CollectAllAvailableGarbage("mksnapshot");
+ isolate->heap()->CollectAllAvailableGarbage(
+ i::GarbageCollectionReason::kSnapshotCreator);
isolate->heap()->CompactWeakFixedArrays();
i::DisallowHeapAllocation no_gc_from_here_on;
@@ -7477,8 +7478,7 @@ Local<Integer> v8::Integer::NewFromUnsigned(Isolate* isolate, uint32_t value) {
void Isolate::ReportExternalAllocationLimitReached() {
i::Heap* heap = reinterpret_cast<i::Isolate*>(this)->heap();
if (heap->gc_state() != i::Heap::NOT_IN_GC) return;
- heap->ReportExternalMemoryPressure(
- "external memory allocation limit reached.");
+ heap->ReportExternalMemoryPressure();
}
@@ -7638,13 +7638,13 @@ void Isolate::RequestGarbageCollectionForTesting(GarbageCollectionType type) {
CHECK(i::FLAG_expose_gc);
if (type == kMinorGarbageCollection) {
reinterpret_cast<i::Isolate*>(this)->heap()->CollectGarbage(
- i::NEW_SPACE, "Isolate::RequestGarbageCollection",
+ i::NEW_SPACE, i::GarbageCollectionReason::kTesting,
kGCCallbackFlagForced);
} else {
DCHECK_EQ(kFullGarbageCollection, type);
reinterpret_cast<i::Isolate*>(this)->heap()->CollectAllGarbage(
i::Heap::kAbortIncrementalMarkingMask,
- "Isolate::RequestGarbageCollection", kGCCallbackFlagForced);
+ i::GarbageCollectionReason::kTesting, kGCCallbackFlagForced);
}
}
@@ -8073,7 +8073,8 @@ void Isolate::LowMemoryNotification() {
i::HistogramTimerScope idle_notification_scope(
isolate->counters()->gc_low_memory_notification());
TRACE_EVENT0("v8", "V8.GCLowMemoryNotification");
- isolate->heap()->CollectAllAvailableGarbage("low memory notification");
+ isolate->heap()->CollectAllAvailableGarbage(
+ i::GarbageCollectionReason::kLowMemoryNotification);
}
}
« no previous file with comments | « no previous file | src/debug/debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698