[v8] add isolate parameter to heap statistics calls
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Mar 2013 21:02:07 +0000 (21:02 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Mar 2013 21:02:07 +0000 (21:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=111308

Patch by Dan Carney <dcarney@google.com> on 2013-03-04
Reviewed by Jochen Eisinger.

No new tests.

* bindings/v8/ScriptGCEvent.cpp:
(WebCore::ScriptGCEvent::getHeapSize):
(WebCore::ScriptGCEvent::getUsedHeapSize):
* bindings/v8/V8AdaptorFunction.cpp:
(WebCore::V8AdaptorFunction::getTemplate):
* bindings/v8/V8GCController.cpp:
(WebCore::V8GCController::checkMemoryUsage):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@144661 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/bindings/v8/ScriptGCEvent.cpp
Source/WebCore/bindings/v8/V8AdaptorFunction.cpp
Source/WebCore/bindings/v8/V8GCController.cpp

index a6a3827..bfe0854 100644 (file)
@@ -1,3 +1,20 @@
+2013-03-04  Dan Carney  <dcarney@google.com>
+
+        [v8] add isolate parameter to heap statistics calls
+        https://bugs.webkit.org/show_bug.cgi?id=111308
+
+        Reviewed by Jochen Eisinger.
+
+        No new tests.
+
+        * bindings/v8/ScriptGCEvent.cpp:
+        (WebCore::ScriptGCEvent::getHeapSize):
+        (WebCore::ScriptGCEvent::getUsedHeapSize):
+        * bindings/v8/V8AdaptorFunction.cpp:
+        (WebCore::V8AdaptorFunction::getTemplate):
+        * bindings/v8/V8GCController.cpp:
+        (WebCore::V8GCController::checkMemoryUsage):
+
 2013-03-04  Jochen Eisinger  <jochen@chromium.org>
 
         [chromium] remove deprecated hyphenation methods from Platform
index 72309e7..7f182e7 100644 (file)
@@ -74,7 +74,7 @@ void ScriptGCEvent::removeEventListener(ScriptGCEventListener* eventListener)
 void ScriptGCEvent::getHeapSize(HeapInfo& info)
 {
     v8::HeapStatistics heapStatistics;
-    v8::V8::GetHeapStatistics(&heapStatistics);
+    v8::Isolate::GetCurrent()->GetHeapStatistics(&heapStatistics);
     info.usedJSHeapSize = heapStatistics.used_heap_size();
     info.totalJSHeapSize = heapStatistics.total_physical_size();
     info.jsHeapSizeLimit = heapStatistics.heap_size_limit();
@@ -83,7 +83,7 @@ void ScriptGCEvent::getHeapSize(HeapInfo& info)
 size_t ScriptGCEvent::getUsedHeapSize()
 {
     v8::HeapStatistics heapStatistics;
-    v8::V8::GetHeapStatistics(&heapStatistics);
+    v8::Isolate::GetCurrent()->GetHeapStatistics(&heapStatistics);
     return heapStatistics.used_heap_size();
 }
 
index c72c713..041f529 100644 (file)
@@ -48,7 +48,7 @@ v8::Persistent<v8::FunctionTemplate> V8AdaptorFunction::getTemplate(v8::Isolate*
     if (result != data->rawTemplateMap().end())
         return result->value;
     // The lifetime is of newTemplate is delegated to the TemplateMap thus this won't be leaked.
-    v8::Persistent<v8::FunctionTemplate> newTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New());
+    v8::Persistent<v8::FunctionTemplate> newTemplate = v8::Persistent<v8::FunctionTemplate>::New(isolate, v8::FunctionTemplate::New());
     data->rawTemplateMap().add(&info, configureTemplate(newTemplate));
     return newTemplate;
 }
index 7e6c4bb..fd01a9e 100644 (file)
@@ -439,7 +439,7 @@ void V8GCController::checkMemoryUsage()
         // Memory usage is large and doubled since the last GC.
         // Check if we need to send low memory notification.
         v8::HeapStatistics heapStatistics;
-        v8::V8::GetHeapStatistics(&heapStatistics);
+        v8::Isolate::GetCurrent()->GetHeapStatistics(&heapStatistics);
         int heapSizeMB = heapStatistics.total_heap_size() >> 20;
         // Do not send low memory notification if V8 heap size is more than 7/8
         // of total memory usage. Let V8 to schedule GC itself in this case.