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

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

Issue 2871743002: Oilpan: Schedule an idle garbage collection after receiving the kGCCallbackScheduleIdleGarbageColle… (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 (flags & v8::kGCCallbackFlagCollectAllExternalMemory)) { 434 (flags & v8::kGCCallbackFlagCollectAllExternalMemory)) {
435 // This single GC is not enough. See the above comment. 435 // This single GC is not enough. See the above comment.
436 current_thread_state->CollectGarbage(BlinkGC::kHeapPointersOnStack, 436 current_thread_state->CollectGarbage(BlinkGC::kHeapPointersOnStack,
437 BlinkGC::kGCWithSweep, 437 BlinkGC::kGCWithSweep,
438 BlinkGC::kForcedGC); 438 BlinkGC::kForcedGC);
439 439
440 // The conservative GC might have left floating garbage. Schedule 440 // The conservative GC might have left floating garbage. Schedule
441 // precise GC to ensure that we collect all available garbage. 441 // precise GC to ensure that we collect all available garbage.
442 current_thread_state->SchedulePreciseGC(); 442 current_thread_state->SchedulePreciseGC();
443 } 443 }
444
445 if (flags & v8::kGCCallbackScheduleIdleGarbageCollection) {
haraken 2017/05/08 23:56:23 Add a comment about what this is doing.
Hannes Payer (out of office) 2017/05/09 06:47:15 Done.
446 current_thread_state->ScheduleIdleGC();
447 }
444 } 448 }
445 449
446 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), 450 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"),
447 "UpdateCounters", TRACE_EVENT_SCOPE_THREAD, "data", 451 "UpdateCounters", TRACE_EVENT_SCOPE_THREAD, "data",
448 InspectorUpdateCountersEvent::Data()); 452 InspectorUpdateCountersEvent::Data());
449 } 453 }
450 454
451 void V8GCController::CollectGarbage(v8::Isolate* isolate, bool only_minor_gc) { 455 void V8GCController::CollectGarbage(v8::Isolate* isolate, bool only_minor_gc) {
452 v8::HandleScope handle_scope(isolate); 456 v8::HandleScope handle_scope(isolate);
453 RefPtr<ScriptState> script_state = ScriptState::Create( 457 RefPtr<ScriptState> script_state = ScriptState::Create(
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 double start_time = WTF::CurrentTimeMS(); 557 double start_time = WTF::CurrentTimeMS();
554 v8::HandleScope scope(isolate); 558 v8::HandleScope scope(isolate);
555 PendingActivityVisitor visitor(isolate, execution_context); 559 PendingActivityVisitor visitor(isolate, execution_context);
556 ToIsolate(execution_context)->VisitHandlesWithClassIds(&visitor); 560 ToIsolate(execution_context)->VisitHandlesWithClassIds(&visitor);
557 scan_pending_activity_histogram.Count( 561 scan_pending_activity_histogram.Count(
558 static_cast<int>(WTF::CurrentTimeMS() - start_time)); 562 static_cast<int>(WTF::CurrentTimeMS() - start_time));
559 return visitor.PendingActivityFound(); 563 return visitor.PendingActivityFound();
560 } 564 }
561 565
562 } // namespace blink 566 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698