| OLD | NEW |
| 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 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 } | 672 } |
| 673 | 673 |
| 674 void ThreadState::performIdleGC(double deadlineSeconds) | 674 void ThreadState::performIdleGC(double deadlineSeconds) |
| 675 { | 675 { |
| 676 ASSERT(isMainThread()); | 676 ASSERT(isMainThread()); |
| 677 | 677 |
| 678 if (gcState() != IdleGCScheduled) | 678 if (gcState() != IdleGCScheduled) |
| 679 return; | 679 return; |
| 680 | 680 |
| 681 double idleDeltaInSeconds = deadlineSeconds - Platform::current()->monotonic
allyIncreasingTime(); | 681 double idleDeltaInSeconds = deadlineSeconds - Platform::current()->monotonic
allyIncreasingTime(); |
| 682 TRACE_EVENT2("blink_gc", "ThreadState::performIdleGC", "idleDeltaInSeconds",
idleDeltaInSeconds, "estimatedMarkingTime", Heap::estimatedMarkingTime()); |
| 682 if (idleDeltaInSeconds <= Heap::estimatedMarkingTime() && !Platform::current
()->currentThread()->scheduler()->canExceedIdleDeadlineIfRequired()) { | 683 if (idleDeltaInSeconds <= Heap::estimatedMarkingTime() && !Platform::current
()->currentThread()->scheduler()->canExceedIdleDeadlineIfRequired()) { |
| 683 // If marking is estimated to take longer than the deadline and we can't | 684 // If marking is estimated to take longer than the deadline and we can't |
| 684 // exceed the deadline, then reschedule for the next idle period. | 685 // exceed the deadline, then reschedule for the next idle period. |
| 685 scheduleIdleGC(); | 686 scheduleIdleGC(); |
| 686 return; | 687 return; |
| 687 } | 688 } |
| 688 | 689 |
| 689 Heap::collectGarbage(NoHeapPointersOnStack, GCWithoutSweep, Heap::IdleGC); | 690 Heap::collectGarbage(NoHeapPointersOnStack, GCWithoutSweep, Heap::IdleGC); |
| 690 } | 691 } |
| 691 | 692 |
| (...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1468 json->beginArray(it->key.ascii().data()); | 1469 json->beginArray(it->key.ascii().data()); |
| 1469 for (size_t age = 0; age <= maxHeapObjectAge; ++age) | 1470 for (size_t age = 0; age <= maxHeapObjectAge; ++age) |
| 1470 json->pushInteger(it->value.ages[age]); | 1471 json->pushInteger(it->value.ages[age]); |
| 1471 json->endArray(); | 1472 json->endArray(); |
| 1472 } | 1473 } |
| 1473 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink_gc"), s
tatsName, this, json.release()); | 1474 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink_gc"), s
tatsName, this, json.release()); |
| 1474 } | 1475 } |
| 1475 #endif | 1476 #endif |
| 1476 | 1477 |
| 1477 } // namespace blink | 1478 } // namespace blink |
| OLD | NEW |