Reviewers: Mads Ager,

Description:
Added idle notification to the API.
The implementation is still empty.


Please review this at http://codereview.chromium.org/165445

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
   M     include/v8.h
   M     src/api.cc
   M     src/v8.h
   M     src/v8.cc


Index: include/v8.h
===================================================================
--- include/v8.h        (revision 2673)
+++ include/v8.h        (working copy)
@@ -2201,6 +2201,14 @@
     */
    static bool Dispose();

+
+  /**
+   * Optional notification that the embedder is idle.
+   * V8 uses the notification to reduce memory footprint.
+   * \param is_high_priority tells whether the embedder is high priority.
+   */
+  static void IdleNotification(bool is_high_priority);
+
   private:
    V8();

Index: src/api.cc
===================================================================
--- src/api.cc  (revision 2673)
+++ src/api.cc  (working copy)
@@ -2558,6 +2558,10 @@
  }


+void  v8::V8::IdleNotification(bool is_high_priority) {
+  i::V8::IdleNotification(is_high_priority);
+}
+
  const char* v8::V8::GetVersion() {
    static v8::internal::EmbeddedVector<char, 128> buffer;
    v8::internal::Version::GetString(buffer);
Index: src/v8.h
===================================================================
--- src/v8.h    (revision 2673)
+++ src/v8.h    (working copy)
@@ -99,6 +99,9 @@
    static uint32_t Random();
    static Smi* RandomPositiveSmi();

+  // Idle notification directly from the API.
+  static void IdleNotification(bool is_high_priority);
+
   private:
    // True if engine is currently running
    static bool is_running_;
Index: src/v8.cc
===================================================================
--- src/v8.cc   (revision 2673)
+++ src/v8.cc   (working copy)
@@ -156,7 +156,11 @@
    return (hi << 16) + (lo & 0xFFFF);
  }

+void V8::IdleNotification(bool is_high_priority) {
+  // todo(bak): Reduce memory footprint.
+}

+
  Smi* V8::RandomPositiveSmi() {
    uint32_t random = Random();
    ASSERT(IsPowerOf2(Smi::kMaxValue + 1));



--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to