| 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 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1132 // The default behavior is lazy sweeping. | 1132 // The default behavior is lazy sweeping. |
| 1133 scheduleIdleLazySweep(); | 1133 scheduleIdleLazySweep(); |
| 1134 } | 1134 } |
| 1135 } | 1135 } |
| 1136 | 1136 |
| 1137 #if defined(ADDRESS_SANITIZER) | 1137 #if defined(ADDRESS_SANITIZER) |
| 1138 void ThreadState::poisonAllHeaps() { | 1138 void ThreadState::poisonAllHeaps() { |
| 1139 // Poisoning all unmarked objects in the other arenas. | 1139 // Poisoning all unmarked objects in the other arenas. |
| 1140 for (int i = 1; i < BlinkGC::NumberOfArenas; i++) | 1140 for (int i = 1; i < BlinkGC::NumberOfArenas; i++) |
| 1141 m_arenas[i]->poisonArena(); | 1141 m_arenas[i]->poisonArena(); |
| 1142 // CrossThreadPersistents in unmarked objects may be accessed from other |
| 1143 // threads (e.g. in CrossThreadPersistentRegion::shouldTracePersistent) and |
| 1144 // that would be fine. |
| 1145 ProcessHeap::crossThreadPersistentRegion().unpoisonCrossThreadPersistents(); |
| 1142 } | 1146 } |
| 1143 | 1147 |
| 1144 void ThreadState::poisonEagerArena() { | 1148 void ThreadState::poisonEagerArena() { |
| 1145 m_arenas[BlinkGC::EagerSweepArenaIndex]->poisonArena(); | 1149 m_arenas[BlinkGC::EagerSweepArenaIndex]->poisonArena(); |
| 1150 // CrossThreadPersistents in unmarked objects may be accessed from other |
| 1151 // threads (e.g. in CrossThreadPersistentRegion::shouldTracePersistent) and |
| 1152 // that would be fine. |
| 1153 ProcessHeap::crossThreadPersistentRegion().unpoisonCrossThreadPersistents(); |
| 1146 } | 1154 } |
| 1147 #endif | 1155 #endif |
| 1148 | 1156 |
| 1149 void ThreadState::eagerSweep() { | 1157 void ThreadState::eagerSweep() { |
| 1150 #if defined(ADDRESS_SANITIZER) | 1158 #if defined(ADDRESS_SANITIZER) |
| 1151 poisonEagerArena(); | 1159 poisonEagerArena(); |
| 1152 #endif | 1160 #endif |
| 1153 ASSERT(checkThread()); | 1161 ASSERT(checkThread()); |
| 1154 // Some objects need to be finalized promptly and cannot be handled | 1162 // Some objects need to be finalized promptly and cannot be handled |
| 1155 // by lazy sweeping. Keep those in a designated heap and sweep it | 1163 // by lazy sweeping. Keep those in a designated heap and sweep it |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1812 collectGarbage(BlinkGC::NoHeapPointersOnStack, BlinkGC::GCWithSweep, | 1820 collectGarbage(BlinkGC::NoHeapPointersOnStack, BlinkGC::GCWithSweep, |
| 1813 BlinkGC::ForcedGC); | 1821 BlinkGC::ForcedGC); |
| 1814 size_t liveObjects = heap().heapStats().markedObjectSize(); | 1822 size_t liveObjects = heap().heapStats().markedObjectSize(); |
| 1815 if (liveObjects == previousLiveObjects) | 1823 if (liveObjects == previousLiveObjects) |
| 1816 break; | 1824 break; |
| 1817 previousLiveObjects = liveObjects; | 1825 previousLiveObjects = liveObjects; |
| 1818 } | 1826 } |
| 1819 } | 1827 } |
| 1820 | 1828 |
| 1821 } // namespace blink | 1829 } // namespace blink |
| OLD | NEW |