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

Unified Diff: include/v8.h

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
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 62319203f418c4522b103b3d54ced4e43f09971b..bfabad156c628e0413bb4b709e9e2084190d44a9 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -5554,6 +5554,8 @@ class V8_EXPORT Isolate {
kUseCounterFeatureCount // This enum value must be last.
};
+ enum MemoryPressureLevel { kNone, kModerate, kCritical };
jochen (gone - plz use gerrit) 2016/03/15 20:57:18 this should be an enum class
+
typedef void (*UseCounterCallback)(Isolate* isolate,
UseCounterFeature feature);
@@ -5875,6 +5877,12 @@ class V8_EXPORT Isolate {
void RequestInterrupt(InterruptCallback callback, void* data);
/**
+ * Request V8 to interrupt long running JavaScript code and do GC,
+ * when system memory is pressured.
+ */
+ void RequestMemoryPressureInterrupt(MemoryPressureLevel level);
jochen (gone - plz use gerrit) 2016/03/15 20:57:18 this should be NotifyMemoryPressure(MemoryPressure
+
+ /**
* Request garbage collection in this Isolate. It is only valid to call this
* function if --expose_gc was specified.
*
@@ -6185,6 +6193,12 @@ class V8_EXPORT Isolate {
*/
void VisitWeakHandles(PersistentHandleVisitor* visitor);
+ /**
+ * This method can handle memory pressure interrupt, no matter v8 is busy or
+ * idle.
+ */
+ void HandleMemoryPressureInterrupt();
jochen (gone - plz use gerrit) 2016/03/15 20:57:18 please remove this.
+
private:
template <class K, class V, class Traits>
friend class PersistentValueMapBase;
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698