Commit 42deb87f authored by jochen@chromium.org's avatar jochen@chromium.org

Update memory related v8 notifications API calls

The API calls are per Isolate, and therefore should be on the isolate.
Make it so.

BUG=397026
R=haraken@chromium.org

Review URL: https://codereview.chromium.org/422293004

git-svn-id: svn://svn.chromium.org/blink/trunk@179155 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 1555b228
......@@ -96,7 +96,7 @@ PassRefPtrWillBeRawPtr<ScriptProfile> ScriptProfiler::stop(const String& title)
void ScriptProfiler::collectGarbage()
{
v8::V8::LowMemoryNotification();
v8::Isolate::GetCurrent()->LowMemoryNotification();
}
ScriptValue ScriptProfiler::objectByHeapObjectId(unsigned id)
......
......@@ -31,6 +31,7 @@
#include "config.h"
#include "bindings/core/v8/V8GCForContextDispose.h"
#include "bindings/core/v8/V8PerIsolateData.h"
#include "wtf/StdLibExtras.h"
#include <v8.h>
......@@ -45,7 +46,7 @@ V8GCForContextDispose::V8GCForContextDispose()
void V8GCForContextDispose::notifyContextDisposed(bool isMainFrame)
{
m_didDisposeContextForMainFrame = m_didDisposeContextForMainFrame || isMainFrame;
v8::V8::ContextDisposedNotification();
V8PerIsolateData::mainThreadIsolate()->ContextDisposedNotification();
if (!m_pseudoIdleTimer.isActive())
m_pseudoIdleTimer.startOneShot(0.8, FROM_HERE);
}
......@@ -72,7 +73,7 @@ void V8GCForContextDispose::pseudoIdleTimerFired(Timer<V8GCForContextDispose>*)
const int longIdlePauseInMs = 1000;
const int shortIdlePauseInMs = 10;
int hint = m_didDisposeContextForMainFrame ? longIdlePauseInMs : shortIdlePauseInMs;
v8::V8::IdleNotification(hint);
V8PerIsolateData::mainThreadIsolate()->IdleNotification(hint);
m_didDisposeContextForMainFrame = false;
}
......
......@@ -84,7 +84,7 @@ public:
// Send a notification about current thread is going to be idle.
// Returns true if the embedder should stop calling idleNotification
// until real work has been done.
bool idleNotification() { return v8::V8::IdleNotification(); }
bool idleNotification() { return m_isolate->IdleNotification(1000); }
private:
class WorkerGlobalScopeExecutionState;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment