Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: third_party/WebKit/Source/platform/heap/ThreadState.cpp

Issue 2415363002: Unpoison CrossThreadPersistents (Closed)
Patch Set: fix Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/heap/PersistentNode.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/PersistentNode.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698