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

Unified Diff: runtime/vm/heap.cc

Issue 9655011: Implement prologue weak persistent handles. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: final revision Created 8 years, 9 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 07e5b1cb333d0a2844ae7c0966a8e4b4262816b2..d7ac7ec1cebc6aaa675ce40d62dc088dabd9bc82 100644
--- a/runtime/vm/heap.cc
+++ b/runtime/vm/heap.cc
@@ -129,17 +129,18 @@ void Heap::IterateCodePointers(ObjectPointerVisitor* visitor) {
}
-void Heap::CollectGarbage(Space space) {
+void Heap::CollectGarbage(Space space, ApiCallbacks api_callbacks) {
+ bool invoke_api_callbacks = (api_callbacks == kInvokeApiCallbacks);
switch (space) {
case kNew:
- new_space_->Scavenge();
+ new_space_->Scavenge(invoke_api_callbacks);
break;
case kOld:
- old_space_->MarkSweep();
+ old_space_->MarkSweep(invoke_api_callbacks);
break;
case kExecutable:
UNIMPLEMENTED();
- code_space_->MarkSweep();
+ code_space_->MarkSweep(invoke_api_callbacks);
break;
default:
UNREACHABLE();
@@ -147,11 +148,22 @@ void Heap::CollectGarbage(Space space) {
}
+void Heap::CollectGarbage(Space space) {
+ ApiCallbacks api_callbacks;
+ if (space == kNew || space == kExecutable) {
+ api_callbacks = kIgnoreApiCallbacks;
+ } else {
+ api_callbacks = kInvokeApiCallbacks;
+ }
+ CollectGarbage(space, api_callbacks);
+}
+
+
void Heap::CollectAllGarbage() {
- new_space_->Scavenge();
- old_space_->MarkSweep();
+ new_space_->Scavenge(kInvokeApiCallbacks);
+ old_space_->MarkSweep(kInvokeApiCallbacks);
// TODO(iposva): Merge old and code space.
- // code_space_->MarkSweep();
+ // code_space_->MarkSweep(kInvokeApiCallbacks);
}
« 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