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

Unified Diff: runtime/vm/zone.cc

Issue 2771013002: Add more safe points in compiler (Closed)
Patch Set: Add a safe point in the zone allocator Created 3 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
« runtime/vm/pages.h ('K') | « runtime/vm/scavenger.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/zone.cc
diff --git a/runtime/vm/zone.cc b/runtime/vm/zone.cc
index 8b3cdac905faf210905786168a660c3c15e65329..46288e9876ded6b7baeb66c3b640ec6956b2734d 100644
--- a/runtime/vm/zone.cc
+++ b/runtime/vm/zone.cc
@@ -77,8 +77,11 @@ Zone::Segment* Zone::Segment::New(intptr_t size, Zone::Segment* next) {
result->next_ = next;
result->size_ = size;
Thread* current = Thread::Current();
+
if (current != NULL) {
current->IncrementMemoryUsage(size);
+ // In case the other thread is waiting to do a scavenge.
+ current->CheckForSafepoint();
siva 2017/03/23 18:05:01 Why is this check needed here? We may run into iss
erikcorry 2017/03/27 10:23:28 Good catch. This one was great for keeping down t
} else if (ApiNativeScope::Current() != NULL) {
// If there is no current thread, we might be inside of a native scope.
ApiNativeScope::IncrementNativeScopeMemoryUsage(size);
« runtime/vm/pages.h ('K') | « runtime/vm/scavenger.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698