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

Unified Diff: include/v8.h

Issue 412163003: Move gc notifications from V8 to Isolate and make idle hint mandatory (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 5 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 46d4fc96d3ba1304a9f71f24419d0c520044fe8d..6d656430bc17303ec99f3b86e0687b4f99d72471 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -4459,6 +4459,34 @@ class V8_EXPORT Isolate {
void SetCreateHistogramFunction(CreateHistogramCallback);
void SetAddHistogramSampleFunction(AddHistogramSampleCallback);
+ /**
+ * Optional notification that the embedder is idle.
+ * V8 uses the notification to reduce memory footprint.
+ * This call can be used repeatedly if the embedder remains idle.
+ * Returns true if the embedder should stop calling IdleNotification
+ * until real work has been done. This indicates that V8 has done
+ * as much cleanup as it will be able to do.
+ *
+ * The idle_time_in_ms argument specifies the time V8 has to do reduce
+ * the memory footprint. There is no guarantee that the actual work will be
+ * done within the time limit.
+ */
+ bool IdleNotification(int idle_time_in_ms);
+
+ /**
+ * Optional notification that the system is running low on memory.
+ * V8 uses these notifications to attempt to free memory.
+ */
+ void LowMemoryNotification();
+
+ /**
+ * Optional notification that a context has been disposed. V8 uses
+ * these notifications to guide the GC heuristic. Returns the number
+ * of context disposals - including this one - since the last time
+ * V8 had a chance to clean up.
+ */
+ int ContextDisposedNotification();
+
private:
template<class K, class V, class Traits> friend class PersistentValueMap;
@@ -4969,12 +4997,16 @@ class V8_EXPORT V8 {
* The hint argument specifies the amount of work to be done in the function
* on scale from 1 to 1000. There is no guarantee that the actual work will
* match the hint.
+ *
+ * Deprecated, please use Isolate::IdleNotification.
*/
static bool IdleNotification(int hint = 1000);
/**
* Optional notification that the system is running low on memory.
* V8 uses these notifications to attempt to free memory.
+ *
+ * Deprecated, please use Isolate::LowMemoryNotification.
*/
static void LowMemoryNotification();
@@ -4983,6 +5015,8 @@ class V8_EXPORT V8 {
* these notifications to guide the GC heuristic. Returns the number
* of context disposals - including this one - since the last time
* V8 had a chance to clean up.
+ *
+ * Deprecated, please use Isolate::ContextDisposedNotification.
*/
static int ContextDisposedNotification();
« 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