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

Unified Diff: runtime/vm/heap.cc

Issue 3001343002: Remove GC prologue and epilogue callbacks. (Closed)
Patch Set: Created 3 years, 4 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 | « runtime/vm/heap.h ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/heap.cc
diff --git a/runtime/vm/heap.cc b/runtime/vm/heap.cc
index 7f0472ca2bfcdae09f67dceedf703ca0d9498786..6824b70a81134adcac601c0a6d06b1f974ff95e6 100644
--- a/runtime/vm/heap.cc
+++ b/runtime/vm/heap.cc
@@ -425,16 +425,14 @@ void Heap::EvacuateNewSpace(Thread* thread, GCReason reason) {
}
void Heap::CollectNewSpaceGarbage(Thread* thread,
- ApiCallbacks api_callbacks,
GCReason reason) {
ASSERT((reason == kNewSpace) || (reason == kFull));
if (BeginNewSpaceGC(thread)) {
- bool invoke_api_callbacks = (api_callbacks == kInvokeApiCallbacks);
RecordBeforeGC(kNew, reason);
VMTagScope tagScope(thread, VMTag::kGCNewSpaceTagId);
TIMELINE_FUNCTION_GC_DURATION(thread, "CollectNewGeneration");
NOT_IN_PRODUCT(UpdateClassHeapStatsBeforeGC(kNew));
- new_space_.Scavenge(invoke_api_callbacks);
+ new_space_.Scavenge();
NOT_IN_PRODUCT(isolate()->class_table()->UpdatePromoted());
RecordAfterGC(kNew);
PrintStats();
@@ -442,22 +440,20 @@ void Heap::CollectNewSpaceGarbage(Thread* thread,
EndNewSpaceGC();
if ((reason == kNewSpace) && old_space_.NeedsGarbageCollection()) {
// Old collections should call the API callbacks.
- CollectOldSpaceGarbage(thread, kInvokeApiCallbacks, kPromotion);
+ CollectOldSpaceGarbage(thread, kPromotion);
}
}
}
void Heap::CollectOldSpaceGarbage(Thread* thread,
- ApiCallbacks api_callbacks,
GCReason reason) {
ASSERT((reason != kNewSpace));
if (BeginOldSpaceGC(thread)) {
- bool invoke_api_callbacks = (api_callbacks == kInvokeApiCallbacks);
RecordBeforeGC(kOld, reason);
VMTagScope tagScope(thread, VMTag::kGCOldSpaceTagId);
TIMELINE_FUNCTION_GC_DURATION(thread, "CollectOldGeneration");
NOT_IN_PRODUCT(UpdateClassHeapStatsBeforeGC(kOld));
- old_space_.MarkSweep(invoke_api_callbacks);
+ old_space_.MarkSweep();
RecordAfterGC(kOld);
PrintStats();
NOT_IN_PRODUCT(PrintStatsToTimeline(&tds));
@@ -469,17 +465,16 @@ void Heap::CollectOldSpaceGarbage(Thread* thread,
}
void Heap::CollectGarbage(Space space,
- ApiCallbacks api_callbacks,
GCReason reason) {
Thread* thread = Thread::Current();
switch (space) {
case kNew: {
- CollectNewSpaceGarbage(thread, api_callbacks, reason);
+ CollectNewSpaceGarbage(thread, reason);
break;
}
case kOld:
case kCode: {
- CollectOldSpaceGarbage(thread, api_callbacks, reason);
+ CollectOldSpaceGarbage(thread, reason);
break;
}
default:
@@ -490,10 +485,10 @@ void Heap::CollectGarbage(Space space,
void Heap::CollectGarbage(Space space) {
Thread* thread = Thread::Current();
if (space == kOld) {
- CollectOldSpaceGarbage(thread, kInvokeApiCallbacks, kOldSpace);
+ CollectOldSpaceGarbage(thread, kOldSpace);
} else {
ASSERT(space == kNew);
- CollectNewSpaceGarbage(thread, kInvokeApiCallbacks, kNewSpace);
+ CollectNewSpaceGarbage(thread, kNewSpace);
}
}
@@ -503,7 +498,7 @@ void Heap::CollectAllGarbage() {
// New space is evacuated so this GC will collect all dead objects
// kept alive by a cross-generational pointer.
EvacuateNewSpace(thread, kFull);
- CollectOldSpaceGarbage(thread, kInvokeApiCallbacks, kFull);
+ CollectOldSpaceGarbage(thread, kFull);
}
void Heap::WaitForSweeperTasks(Thread* thread) {
« no previous file with comments | « runtime/vm/heap.h ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698