Chromium Code Reviews| 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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 380 // low memory notifications. | 380 // low memory notifications. |
| 381 if (flags & v8::kGCCallbackFlagCollectAllAvailableGarbage) { | 381 if (flags & v8::kGCCallbackFlagCollectAllAvailableGarbage) { |
| 382 // This single GC is not enough. See the above comment. | 382 // This single GC is not enough. See the above comment. |
| 383 ThreadHeap::collectGarbage(BlinkGC::HeapPointersOnStack, BlinkGC::GC WithSweep, BlinkGC::ForcedGC); | 383 ThreadHeap::collectGarbage(BlinkGC::HeapPointersOnStack, BlinkGC::GC WithSweep, BlinkGC::ForcedGC); |
| 384 | 384 |
| 385 // The conservative GC might have left floating garbage. Schedule | 385 // The conservative GC might have left floating garbage. Schedule |
| 386 // precise GC to ensure that we collect all available garbage. | 386 // precise GC to ensure that we collect all available garbage. |
| 387 if (ThreadState::current()) | 387 if (ThreadState::current()) |
| 388 ThreadState::current()->schedulePreciseGC(); | 388 ThreadState::current()->schedulePreciseGC(); |
| 389 } | 389 } |
| 390 | |
| 391 if (flags & v8::kGCCallbackFlagCollectAllExternalMemory) | |
|
haraken
2016/08/12 07:08:48
Do you think it's worth distinguishing kGCCallback
keishi
2016/08/15 10:30:44
I'm not sure. I was thinking of maybe calling Memo
| |
| 392 ThreadHeap::collectGarbage(BlinkGC::HeapPointersOnStack, BlinkGC::GC WithSweep, BlinkGC::ForcedGC); | |
| 390 } | 393 } |
| 391 | 394 |
| 392 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Update Counters", TRACE_EVENT_SCOPE_THREAD, "data", InspectorUpdateCountersEvent::data( )); | 395 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Update Counters", TRACE_EVENT_SCOPE_THREAD, "data", InspectorUpdateCountersEvent::data( )); |
| 393 } | 396 } |
| 394 | 397 |
| 395 void V8GCController::collectGarbage(v8::Isolate* isolate) | 398 void V8GCController::collectGarbage(v8::Isolate* isolate) |
| 396 { | 399 { |
| 397 v8::HandleScope handleScope(isolate); | 400 v8::HandleScope handleScope(isolate); |
| 398 RefPtr<ScriptState> scriptState = ScriptState::create(v8::Context::New(isola te), DOMWrapperWorld::create(isolate)); | 401 RefPtr<ScriptState> scriptState = ScriptState::create(v8::Context::New(isola te), DOMWrapperWorld::create(isolate)); |
| 399 ScriptState::Scope scope(scriptState.get()); | 402 ScriptState::Scope scope(scriptState.get()); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 491 DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, scanPendingActivityHis togram, new CustomCountHistogram("Blink.ScanPendingActivityDuration", 1, 1000, 5 0)); | 494 DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, scanPendingActivityHis togram, new CustomCountHistogram("Blink.ScanPendingActivityDuration", 1, 1000, 5 0)); |
| 492 double startTime = WTF::currentTimeMS(); | 495 double startTime = WTF::currentTimeMS(); |
| 493 v8::HandleScope scope(isolate); | 496 v8::HandleScope scope(isolate); |
| 494 PendingActivityVisitor visitor(isolate, executionContext); | 497 PendingActivityVisitor visitor(isolate, executionContext); |
| 495 toIsolate(executionContext)->VisitHandlesWithClassIds(&visitor); | 498 toIsolate(executionContext)->VisitHandlesWithClassIds(&visitor); |
| 496 scanPendingActivityHistogram.count(static_cast<int>(WTF::currentTimeMS() - s tartTime)); | 499 scanPendingActivityHistogram.count(static_cast<int>(WTF::currentTimeMS() - s tartTime)); |
| 497 return visitor.pendingActivityFound(); | 500 return visitor.pendingActivityFound(); |
| 498 } | 501 } |
| 499 | 502 |
| 500 } // namespace blink | 503 } // namespace blink |
| OLD | NEW |