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 2772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2783 *allocatedSpaceSize = 0; | 2783 *allocatedSpaceSize = 0; |
2784 ASSERT(ThreadState::isAnyThreadInGC()); | 2784 ASSERT(ThreadState::isAnyThreadInGC()); |
2785 ThreadState::AttachedThreadStateSet& threads = ThreadState::attachedThreads(
); | 2785 ThreadState::AttachedThreadStateSet& threads = ThreadState::attachedThreads(
); |
2786 typedef ThreadState::AttachedThreadStateSet::iterator ThreadStateIterator; | 2786 typedef ThreadState::AttachedThreadStateSet::iterator ThreadStateIterator; |
2787 for (ThreadStateIterator it = threads.begin(), end = threads.end(); it != en
d; ++it) { | 2787 for (ThreadStateIterator it = threads.begin(), end = threads.end(); it != en
d; ++it) { |
2788 *objectSpaceSize += (*it)->stats().totalObjectSpace(); | 2788 *objectSpaceSize += (*it)->stats().totalObjectSpace(); |
2789 *allocatedSpaceSize += (*it)->stats().totalAllocatedSpace(); | 2789 *allocatedSpaceSize += (*it)->stats().totalAllocatedSpace(); |
2790 } | 2790 } |
2791 } | 2791 } |
2792 | 2792 |
2793 void Heap::getStats(HeapStats* stats) | |
2794 { | |
2795 stats->clear(); | |
2796 ASSERT(ThreadState::isAnyThreadInGC()); | |
2797 ThreadState::AttachedThreadStateSet& threads = ThreadState::attachedThreads(
); | |
2798 typedef ThreadState::AttachedThreadStateSet::iterator ThreadStateIterator; | |
2799 for (ThreadStateIterator it = threads.begin(), end = threads.end(); it != en
d; ++it) { | |
2800 HeapStats temp; | |
2801 (*it)->getStats(temp); | |
2802 stats->add(&temp); | |
2803 } | |
2804 } | |
2805 | |
2806 void Heap::getStatsForTesting(HeapStats* stats) | 2793 void Heap::getStatsForTesting(HeapStats* stats) |
2807 { | 2794 { |
2808 stats->clear(); | 2795 stats->clear(); |
2809 ASSERT(ThreadState::isAnyThreadInGC()); | 2796 ASSERT(ThreadState::isAnyThreadInGC()); |
2810 makeConsistentForSweeping(); | 2797 makeConsistentForSweeping(); |
2811 ThreadState::AttachedThreadStateSet& threads = ThreadState::attachedThreads(
); | 2798 ThreadState::AttachedThreadStateSet& threads = ThreadState::attachedThreads(
); |
2812 typedef ThreadState::AttachedThreadStateSet::iterator ThreadStateIterator; | 2799 typedef ThreadState::AttachedThreadStateSet::iterator ThreadStateIterator; |
2813 for (ThreadStateIterator it = threads.begin(), end = threads.end(); it != en
d; ++it) { | 2800 for (ThreadStateIterator it = threads.begin(), end = threads.end(); it != en
d; ++it) { |
2814 HeapStats temp; | 2801 HeapStats temp; |
2815 (*it)->getStatsForTesting(temp); | 2802 (*it)->getStatsForTesting(temp); |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2968 CallbackStack* Heap::s_weakCallbackStack; | 2955 CallbackStack* Heap::s_weakCallbackStack; |
2969 CallbackStack* Heap::s_ephemeronStack; | 2956 CallbackStack* Heap::s_ephemeronStack; |
2970 HeapDoesNotContainCache* Heap::s_heapDoesNotContainCache; | 2957 HeapDoesNotContainCache* Heap::s_heapDoesNotContainCache; |
2971 bool Heap::s_shutdownCalled = false; | 2958 bool Heap::s_shutdownCalled = false; |
2972 bool Heap::s_lastGCWasConservative = false; | 2959 bool Heap::s_lastGCWasConservative = false; |
2973 FreePagePool* Heap::s_freePagePool; | 2960 FreePagePool* Heap::s_freePagePool; |
2974 OrphanedPagePool* Heap::s_orphanedPagePool; | 2961 OrphanedPagePool* Heap::s_orphanedPagePool; |
2975 Heap::RegionTree* Heap::s_regionTree = 0; | 2962 Heap::RegionTree* Heap::s_regionTree = 0; |
2976 | 2963 |
2977 } // namespace blink | 2964 } // namespace blink |
OLD | NEW |