| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 | 262 |
| 263 // The function |getRetainerInfos| processing all handles on the blink heap, | 263 // The function |getRetainerInfos| processing all handles on the blink heap, |
| 264 // logically grouping together DOM trees (attached and detached) and pending | 264 // logically grouping together DOM trees (attached and detached) and pending |
| 265 // activities, while at the same time finding parent to child relationships | 265 // activities, while at the same time finding parent to child relationships |
| 266 // for non-Node wrappers. Since we are processing *all* handles there is no | 266 // for non-Node wrappers. Since we are processing *all* handles there is no |
| 267 // way we miss out on a handle. V8 will figure out the liveness information | 267 // way we miss out on a handle. V8 will figure out the liveness information |
| 268 // for the provided information itself. | 268 // for the provided information itself. |
| 269 v8::HeapProfiler::RetainerInfos V8GCController::getRetainerInfos( | 269 v8::HeapProfiler::RetainerInfos V8GCController::getRetainerInfos( |
| 270 v8::Isolate* isolate) { | 270 v8::Isolate* isolate) { |
| 271 V8PerIsolateData::TemporaryScriptWrappableVisitorScope scope( | 271 V8PerIsolateData::TemporaryScriptWrappableVisitorScope scope( |
| 272 isolate, std::unique_ptr<HeapSnaphotWrapperVisitor>( | 272 isolate, |
| 273 new HeapSnaphotWrapperVisitor(isolate))); | 273 std::unique_ptr<HeapSnaphotWrapperVisitor>( |
| 274 new HeapSnaphotWrapperVisitor(isolate))); |
| 274 | 275 |
| 275 HeapSnaphotWrapperVisitor* tracer = | 276 HeapSnaphotWrapperVisitor* tracer = |
| 276 reinterpret_cast<HeapSnaphotWrapperVisitor*>(scope.currentVisitor()); | 277 reinterpret_cast<HeapSnaphotWrapperVisitor*>(scope.currentVisitor()); |
| 277 tracer->collectV8Roots(); | 278 tracer->collectV8Roots(); |
| 278 tracer->traceV8Roots(); | 279 tracer->traceV8Roots(); |
| 279 tracer->tracePendingActivities(); | 280 tracer->tracePendingActivities(); |
| 280 return v8::HeapProfiler::RetainerInfos{tracer->groups(), tracer->edges()}; | 281 return v8::HeapProfiler::RetainerInfos{tracer->groups(), tracer->edges()}; |
| 281 } | 282 } |
| 282 | 283 |
| 283 static unsigned long long usedHeapSize(v8::Isolate* isolate) { | 284 static unsigned long long usedHeapSize(v8::Isolate* isolate) { |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 double startTime = WTF::currentTimeMS(); | 548 double startTime = WTF::currentTimeMS(); |
| 548 v8::HandleScope scope(isolate); | 549 v8::HandleScope scope(isolate); |
| 549 PendingActivityVisitor visitor(isolate, executionContext); | 550 PendingActivityVisitor visitor(isolate, executionContext); |
| 550 toIsolate(executionContext)->VisitHandlesWithClassIds(&visitor); | 551 toIsolate(executionContext)->VisitHandlesWithClassIds(&visitor); |
| 551 scanPendingActivityHistogram.count( | 552 scanPendingActivityHistogram.count( |
| 552 static_cast<int>(WTF::currentTimeMS() - startTime)); | 553 static_cast<int>(WTF::currentTimeMS() - startTime)); |
| 553 return visitor.pendingActivityFound(); | 554 return visitor.pendingActivityFound(); |
| 554 } | 555 } |
| 555 | 556 |
| 556 } // namespace blink | 557 } // namespace blink |
| OLD | NEW |