| 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 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 { | 663 { |
| 664 return judgeGCThreshold(1024 * 1024, 1.5 * (1 - estimatedRemovalRatio)); | 664 return judgeGCThreshold(1024 * 1024, 1.5 * (1 - estimatedRemovalRatio)); |
| 665 } | 665 } |
| 666 | 666 |
| 667 bool ThreadState::shouldForceConservativeGC() | 667 bool ThreadState::shouldForceConservativeGC() |
| 668 { | 668 { |
| 669 // TODO(haraken): 400% is too large. Lower the heap growing factor. | 669 // TODO(haraken): 400% is too large. Lower the heap growing factor. |
| 670 return judgeGCThreshold(32 * 1024 * 1024, 5.0); | 670 return judgeGCThreshold(32 * 1024 * 1024, 5.0); |
| 671 } | 671 } |
| 672 | 672 |
| 673 void ThreadState::scheduleV8FollowupGCIfNeeded() | 673 void ThreadState::scheduleV8FollowupGCIfNeeded(bool shouldScheduleIdleGC) |
| 674 { | 674 { |
| 675 ASSERT(checkThread()); | 675 ASSERT(checkThread()); |
| 676 Heap::reportMemoryUsageForTracing(); | 676 Heap::reportMemoryUsageForTracing(); |
| 677 | 677 |
| 678 if (isGCForbidden()) | 678 if (isGCForbidden()) |
| 679 return; | 679 return; |
| 680 | 680 |
| 681 if (isSweepingInProgress()) | 681 if (isSweepingInProgress()) |
| 682 return; | 682 return; |
| 683 ASSERT(!sweepForbidden()); | 683 ASSERT(!sweepForbidden()); |
| 684 | 684 |
| 685 if (shouldScheduleV8FollowupGC()) | 685 if (shouldScheduleV8FollowupGC()) |
| 686 schedulePreciseGC(); | 686 schedulePreciseGC(); |
| 687 else if (shouldScheduleIdleGC) |
| 688 scheduleIdleGC(); |
| 687 } | 689 } |
| 688 | 690 |
| 689 void ThreadState::schedulePageNavigationGCIfNeeded(float estimatedRemovalRatio) | 691 void ThreadState::schedulePageNavigationGCIfNeeded(float estimatedRemovalRatio) |
| 690 { | 692 { |
| 691 ASSERT(checkThread()); | 693 ASSERT(checkThread()); |
| 692 Heap::reportMemoryUsageForTracing(); | 694 Heap::reportMemoryUsageForTracing(); |
| 693 | 695 |
| 694 if (isGCForbidden()) | 696 if (isGCForbidden()) |
| 695 return; | 697 return; |
| 696 | 698 |
| (...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1607 json->beginArray(it->key.ascii().data()); | 1609 json->beginArray(it->key.ascii().data()); |
| 1608 for (size_t age = 0; age <= maxHeapObjectAge; ++age) | 1610 for (size_t age = 0; age <= maxHeapObjectAge; ++age) |
| 1609 json->pushInteger(it->value.ages[age]); | 1611 json->pushInteger(it->value.ages[age]); |
| 1610 json->endArray(); | 1612 json->endArray(); |
| 1611 } | 1613 } |
| 1612 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink_gc"), s
tatsName, this, json.release()); | 1614 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(TRACE_DISABLED_BY_DEFAULT("blink_gc"), s
tatsName, this, json.release()); |
| 1613 } | 1615 } |
| 1614 #endif | 1616 #endif |
| 1615 | 1617 |
| 1616 } // namespace blink | 1618 } // namespace blink |
| OLD | NEW |