Chromium Code Reviews| 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)); |