Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 26ebfa8a6775163c01e75c00d54e728fc950ecdf..4da05947b241b83a34db8a09bc2729f390027d3e 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() { |
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
+ isolate->RequestMemoryPressureInterrupt(); |
+} |
void Isolate::RequestGarbageCollectionForTesting(GarbageCollectionType type) { |
CHECK(i::FLAG_expose_gc); |
@@ -7577,6 +7581,18 @@ void Isolate::LowMemoryNotification() { |
} |
} |
+void Isolate::GCNotificationBasedOnMemoryPressureInterrupt() { |
+ i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
+ { |
+ i::HistogramTimerScope idle_notification_scope( |
+ isolate->counters()->gc_low_memory_notification()); |
+ if (isolate->stack_guard()->NeedMemoryPressureGC()) { |
+ TRACE_EVENT0("v8", "V8.GCLowMemoryNotification"); |
+ isolate->heap()->CollectAllAvailableGarbage("low memory notification"); |
+ isolate->stack_guard()->MemoryPressureGCDone(); |
+ } |
+ } |
+} |
int Isolate::ContextDisposedNotification(bool dependant_context) { |
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |