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

Unified Diff: src/api.cc

Issue 2682033002: React immediately to memory pressure on foreground threads (Closed)
Patch Set: updates Created 3 years, 10 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/execution.h » ('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 07b967f2b8cf3bf37e093d1e3724b142d50663ad..2501544f3cd3ee13e1630922a62dd9a9cd811bb9 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -8555,10 +8555,14 @@ void Isolate::IsolateInBackgroundNotification() {
void Isolate::MemoryPressureNotification(MemoryPressureLevel level) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
- isolate->heap()->MemoryPressureNotification(level, Locker::IsLocked(this));
+ bool on_isolate_thread =
+ v8::Locker::IsActive()
+ ? isolate->thread_manager()->IsLockedByCurrentThread()
+ : i::ThreadId::Current().Equals(isolate->thread_id());
+ isolate->heap()->MemoryPressureNotification(level, on_isolate_thread);
isolate->allocator()->MemoryPressureNotification(level);
- isolate->compiler_dispatcher()->MemoryPressureNotification(
- level, Locker::IsLocked(this));
+ isolate->compiler_dispatcher()->MemoryPressureNotification(level,
+ on_isolate_thread);
}
void Isolate::SetRAILMode(RAILMode rail_mode) {
« no previous file with comments | « no previous file | src/execution.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698