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

Side by Side Diff: Source/platform/heap/ThreadState.cpp

Issue 971283002: Add canExceedIdleDeadlineIfRequired function to Scheduler and use it in Oilpan (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/platform/scheduler/Scheduler.h » ('j') | 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 void ThreadState::performIdleGC(double deadlineSeconds) 722 void ThreadState::performIdleGC(double deadlineSeconds)
723 { 723 {
724 ASSERT(isMainThread()); 724 ASSERT(isMainThread());
725 725
726 m_hasPendingIdleTask = false; 726 m_hasPendingIdleTask = false;
727 727
728 if (gcState() != IdleGCScheduled) 728 if (gcState() != IdleGCScheduled)
729 return; 729 return;
730 730
731 double idleDeltaInSeconds = deadlineSeconds - Platform::current()->monotonic allyIncreasingTime(); 731 double idleDeltaInSeconds = deadlineSeconds - Platform::current()->monotonic allyIncreasingTime();
732 if (idleDeltaInSeconds <= Heap::estimatedMarkingTime()) { 732 if (idleDeltaInSeconds <= Heap::estimatedMarkingTime() && !Scheduler::shared ()->isMaximumIdleDeadline(deadlineSeconds)) {
haraken 2015/03/03 15:10:39 Shall we add a comment on what this branch is doin
rmcilroy 2015/03/17 10:33:30 Done.
733 scheduleIdleGC(); 733 scheduleIdleGC();
734 return; 734 return;
735 } 735 }
736 736
737 // FIXME: Make this precise once idle task is guaranteed to be not in nested loop. 737 // FIXME: Make this precise once idle task is guaranteed to be not in nested loop.
haraken 2015/03/03 15:10:39 Ross, Sami: Not related to this CL, is this FIXME
rmcilroy 2015/03/03 15:20:01 I'm working on this right now - I'll let you know
rmcilroy 2015/03/03 19:39:08 CL is up at https://codereview.chromium.org/976723
738 Heap::collectGarbage(HeapPointersOnStack, GCWithoutSweep); 738 Heap::collectGarbage(HeapPointersOnStack, GCWithoutSweep);
739 } 739 }
740 740
741 void ThreadState::scheduleIdleGC() 741 void ThreadState::scheduleIdleGC()
742 { 742 {
743 if (!isMainThread()) 743 if (!isMainThread())
744 return; 744 return;
745 745
746 if (isSweepingInProgress()) { 746 if (isSweepingInProgress()) {
747 setGCState(SweepingAndIdleGCScheduled); 747 setGCState(SweepingAndIdleGCScheduled);
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
1280 json->beginArray(it->key.ascii().data()); 1280 json->beginArray(it->key.ascii().data());
1281 for (size_t age = 0; age <= maxHeapObjectAge; ++age) 1281 for (size_t age = 0; age <= maxHeapObjectAge; ++age)
1282 json->pushInteger(it->value.ages[age]); 1282 json->pushInteger(it->value.ages[age]);
1283 json->endArray(); 1283 json->endArray();
1284 } 1284 }
1285 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink_gc"), s tatsName, this, json.release()); 1285 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink_gc"), s tatsName, this, json.release());
1286 } 1286 }
1287 #endif 1287 #endif
1288 1288
1289 } // namespace blink 1289 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/platform/scheduler/Scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698