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

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
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 ProcessHeap::crossThreadPersistentRegion().unpoisonCrossThreadPersistents();
haraken 2016/10/17 07:32:40 Add a comment about why we do this.
keishi 2016/10/17 07:43:00 Done.
1142 } 1143 }
1143 1144
1144 void ThreadState::poisonEagerArena() { 1145 void ThreadState::poisonEagerArena() {
1145 m_arenas[BlinkGC::EagerSweepArenaIndex]->poisonArena(); 1146 m_arenas[BlinkGC::EagerSweepArenaIndex]->poisonArena();
1147 ProcessHeap::crossThreadPersistentRegion().unpoisonCrossThreadPersistents();
1146 } 1148 }
1147 #endif 1149 #endif
1148 1150
1149 void ThreadState::eagerSweep() { 1151 void ThreadState::eagerSweep() {
1150 #if defined(ADDRESS_SANITIZER) 1152 #if defined(ADDRESS_SANITIZER)
1151 poisonEagerArena(); 1153 poisonEagerArena();
1152 #endif 1154 #endif
1153 ASSERT(checkThread()); 1155 ASSERT(checkThread());
1154 // Some objects need to be finalized promptly and cannot be handled 1156 // Some objects need to be finalized promptly and cannot be handled
1155 // by lazy sweeping. Keep those in a designated heap and sweep it 1157 // 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, 1814 collectGarbage(BlinkGC::NoHeapPointersOnStack, BlinkGC::GCWithSweep,
1813 BlinkGC::ForcedGC); 1815 BlinkGC::ForcedGC);
1814 size_t liveObjects = heap().heapStats().markedObjectSize(); 1816 size_t liveObjects = heap().heapStats().markedObjectSize();
1815 if (liveObjects == previousLiveObjects) 1817 if (liveObjects == previousLiveObjects)
1816 break; 1818 break;
1817 previousLiveObjects = liveObjects; 1819 previousLiveObjects = liveObjects;
1818 } 1820 }
1819 } 1821 }
1820 1822
1821 } // namespace blink 1823 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698