Title: [94322] trunk/Source/WebCore
Revision
94322
Author
[email protected]
Date
2011-09-01 11:39:51 -0700 (Thu, 01 Sep 2011)

Log Message

Web Inspector: [Chromium] Perform a more effective JS GC
https://bugs.webkit.org/show_bug.cgi?id=67304

Reviewed by Pavel Feldman.

* bindings/v8/ScriptProfiler.cpp:
(WebCore::ScriptProfiler::collectGarbage):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (94321 => 94322)


--- trunk/Source/WebCore/ChangeLog	2011-09-01 18:39:12 UTC (rev 94321)
+++ trunk/Source/WebCore/ChangeLog	2011-09-01 18:39:51 UTC (rev 94322)
@@ -1,3 +1,13 @@
+2011-08-31  Mikhail Naganov  <[email protected]>
+
+        Web Inspector: [Chromium] Perform a more effective JS GC
+        https://bugs.webkit.org/show_bug.cgi?id=67304
+
+        Reviewed by Pavel Feldman.
+
+        * bindings/v8/ScriptProfiler.cpp:
+        (WebCore::ScriptProfiler::collectGarbage):
+
 2011-09-01  Sam Weinig  <[email protected]>
 
         WebGLContextEvent should have its own JS wrapper

Modified: trunk/Source/WebCore/bindings/v8/ScriptProfiler.cpp (94321 => 94322)


--- trunk/Source/WebCore/bindings/v8/ScriptProfiler.cpp	2011-09-01 18:39:12 UTC (rev 94321)
+++ trunk/Source/WebCore/bindings/v8/ScriptProfiler.cpp	2011-09-01 18:39:51 UTC (rev 94322)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Google Inc. All rights reserved.
+ * Copyright (c) 2011, Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -58,10 +58,11 @@
 
 void ScriptProfiler::collectGarbage()
 {
-    // NOTE : There is currently no direct way to collect memory from the v8 C++ API
-    // but notifying low-memory forces a mark-compact, which is exactly what we want
-    // in this case.
-    v8::V8::LowMemoryNotification();
+    // Repeatedly call the V8 idle notification until it returns true ("nothing
+    // more to free"). Note that it makes more sense to do this than to implement
+    // a new "delete everything" pass because object references make it difficult
+    // to free everything possible in just one pass.
+    while (!v8::V8::IdleNotification()) { }
 }
 
 namespace {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to