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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp

Issue 1944363002: Use a new type of weak phantom handle for ScriptWrappable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unindent Created 4 years, 7 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 | « third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp b/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp
index 70a0efcae5fb2130c03c28d68a31aadf140f9c04..c4c2922bc95a1d1438a2f3fd0baee667fe35c65a 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8GCController.cpp
@@ -315,8 +315,21 @@ void V8GCController::gcPrologue(v8::Isolate* isolate, v8::GCType type, v8::GCCal
}
}
+namespace {
+
+void UpdateCollectedPhantomHandles(v8::Isolate* isolate)
+{
+ ThreadHeapStats& heapStats = ThreadState::current()->heap().heapStats();
+ size_t count = isolate->NumberOfPhantomHandleResetsSinceLastCall();
+ heapStats.decreaseWrapperCount(count);
dominicc (has gone to gerrit) 2016/05/11 03:38:30 Does this mean that phantom handles should *only*
haraken 2016/05/11 03:48:38 Not really. heapStats.decreaseWrapperCount is just
+ heapStats.increaseCollectedWrapperCount(count);
+}
+
+} // namespace
+
void V8GCController::gcEpilogue(v8::Isolate* isolate, v8::GCType type, v8::GCCallbackFlags flags)
{
+ UpdateCollectedPhantomHandles(isolate);
switch (type) {
case v8::kGCTypeScavenge:
TRACE_EVENT_END1("devtools.timeline,v8", "MinorGC", "usedHeapSizeAfter", usedHeapSize(isolate));
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ScriptWrappable.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698