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

Unified Diff: src/api.cc

Issue 1777883002: Add memory pressure interrupt for memory pressure notification Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: enable memory pressure level Created 4 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
« include/v8.h ('K') | « include/v8.h ('k') | 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 26ebfa8a6775163c01e75c00d54e728fc950ecdf..b35dd951a578965fc254491fb2a2b6b6e6122200 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -7153,6 +7153,10 @@ void Isolate::RequestInterrupt(InterruptCallback callback, void* data) {
isolate->RequestInterrupt(callback, data);
}
+void Isolate::RequestMemoryPressureInterrupt(MemoryPressureLevel level) {
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
+ isolate->RequestMemoryPressureInterrupt(level);
+}
void Isolate::RequestGarbageCollectionForTesting(GarbageCollectionType type) {
CHECK(i::FLAG_expose_gc);
@@ -7739,6 +7743,14 @@ void Isolate::VisitWeakHandles(PersistentHandleVisitor* visitor) {
&visitor_adapter);
}
+void Isolate::HandleMemoryPressureInterrupt() {
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
+ {
+ i::HistogramTimerScope idle_notification_scope(
+ isolate->counters()->gc_low_memory_notification());
+ isolate->stack_guard()->HandleMemoryPressureInterrupt();
+ }
+}
MicrotasksScope::MicrotasksScope(Isolate* isolate, MicrotasksScope::Type type)
: isolate_(reinterpret_cast<i::Isolate*>(isolate)),
« include/v8.h ('K') | « include/v8.h ('k') | src/execution.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698