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

Unified Diff: runtime/vm/thread.cc

Issue 1562853003: 1. Add code to grow the heap instead of collecting garbage in Heap::AllocateOld when allocation is … (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address-code-review-comments Created 4 years, 11 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/thread.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread.cc
diff --git a/runtime/vm/thread.cc b/runtime/vm/thread.cc
index 2357ce6d0c7e0e4646c0ded5ece5ada5a2aca8fb..c220913101ce0ce6c7ca9523598c376ba17a73a2 100644
--- a/runtime/vm/thread.cc
+++ b/runtime/vm/thread.cc
@@ -295,6 +295,16 @@ bool Thread::IsMutatorThread() const {
}
+bool Thread::CanCollectGarbage() const {
+ // We have non mutator threads grow the heap instead of triggering
+ // a garbage collection when they are at a safepoint (e.g: background
+ // compiler thread finalizing and installing code at a safepoint).
+ // Note: This code will change once the new Safepoint logic is in place.
+ return (IsMutatorThread() ||
+ (isolate_ != NULL && !isolate_->thread_registry()->AtSafepoint()));
+}
+
+
bool Thread::IsExecutingDartCode() const {
return (top_exit_frame_info() == 0) &&
(vm_tag() == VMTag::kDartTagId);
« no previous file with comments | « runtime/vm/thread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698