Chromium Code Reviews| 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 | 664 |
| 665 bool ThreadState::shouldSchedulePageNavigationGC(float estimatedRemovalRatio) | 665 bool ThreadState::shouldSchedulePageNavigationGC(float estimatedRemovalRatio) |
| 666 { | 666 { |
| 667 return judgeGCThreshold(1024 * 1024, 1.5 * (1 - estimatedRemovalRatio)); | 667 return judgeGCThreshold(1024 * 1024, 1.5 * (1 - estimatedRemovalRatio)); |
| 668 } | 668 } |
| 669 | 669 |
| 670 bool ThreadState::shouldForceConservativeGC() | 670 bool ThreadState::shouldForceConservativeGC() |
| 671 { | 671 { |
| 672 // TODO(haraken): 400% is too large. Lower the heap growing factor. | 672 // TODO(haraken): 400% is too large. Lower the heap growing factor. |
| 673 return judgeGCThreshold(32 * 1024 * 1024, 5.0); | 673 return judgeGCThreshold(32 * 1024 * 1024, 1.2); |
|
sof
2015/09/02 13:02:12
Change doesn't belong here (and not something you
| |
| 674 } | 674 } |
| 675 | 675 |
| 676 void ThreadState::scheduleV8FollowupGCIfNeeded() | 676 void ThreadState::scheduleV8FollowupGCIfNeeded() |
| 677 { | 677 { |
| 678 ASSERT(checkThread()); | 678 ASSERT(checkThread()); |
| 679 Heap::reportMemoryUsageForTracing(); | 679 Heap::reportMemoryUsageForTracing(); |
| 680 | 680 |
| 681 if (isGCForbidden()) | 681 if (isGCForbidden()) |
| 682 return; | 682 return; |
| 683 | 683 |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 919 | 919 |
| 920 #undef VERIFY_STATE_TRANSITION | 920 #undef VERIFY_STATE_TRANSITION |
| 921 | 921 |
| 922 ThreadState::GCState ThreadState::gcState() const | 922 ThreadState::GCState ThreadState::gcState() const |
| 923 { | 923 { |
| 924 return m_gcState; | 924 return m_gcState; |
| 925 } | 925 } |
| 926 | 926 |
| 927 void ThreadState::runScheduledGC(StackState stackState) | 927 void ThreadState::runScheduledGC(StackState stackState) |
| 928 { | 928 { |
| 929 Heap::reportMemoryUsageForTracing(); | |
|
sof
2015/09/02 13:02:12
Unrelated also?
| |
| 930 | |
| 929 ASSERT(checkThread()); | 931 ASSERT(checkThread()); |
| 930 if (stackState != NoHeapPointersOnStack) | 932 if (stackState != NoHeapPointersOnStack) |
| 931 return; | 933 return; |
| 932 | 934 |
| 933 // If a safe point is entered while initiating a GC, we clearly do | 935 // If a safe point is entered while initiating a GC, we clearly do |
| 934 // not want to do another as part that -- the safe point is only | 936 // not want to do another as part that -- the safe point is only |
| 935 // entered after checking if a scheduled GC ought to run first. | 937 // entered after checking if a scheduled GC ought to run first. |
| 936 // Prevent that from happening by marking GCs as forbidden while | 938 // Prevent that from happening by marking GCs as forbidden while |
| 937 // one is initiated and later running. | 939 // one is initiated and later running. |
| 938 if (isGCForbidden()) | 940 if (isGCForbidden()) |
| (...skipping 668 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 |