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

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

Issue 351253002: [oilpan]: Don't sweep while in safepoint. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 ASSERT(!state->isSweepInProgress()); 191 ASSERT(!state->isSweepInProgress());
192 if (!acquireLoad(&m_canResume)) { 192 if (!acquireLoad(&m_canResume)) {
193 // If we are leaving the safepoint from a SafePointAwareMutexLocker 193 // If we are leaving the safepoint from a SafePointAwareMutexLocker
194 // call out to release the lock before going to sleep. This enables the 194 // call out to release the lock before going to sleep. This enables the
195 // lock to be acquired in the sweep phase, e.g. during weak processi ng 195 // lock to be acquired in the sweep phase, e.g. during weak processi ng
196 // or finalization. The SafePointAwareLocker will reenter the safepo int 196 // or finalization. The SafePointAwareLocker will reenter the safepo int
197 // and reacquire the lock after leaving this safepoint. 197 // and reacquire the lock after leaving this safepoint.
198 if (locker) 198 if (locker)
199 locker->reset(); 199 locker->reset();
200 pushAllRegisters(this, state, parkAfterPushRegisters); 200 pushAllRegisters(this, state, parkAfterPushRegisters);
201 state->performPendingSweep(); 201 state->setSweepRequested();
haraken 2014/06/26 13:52:11 Do we need to call this? I guess setSweepRequeste
Mads Ager (chromium) 2014/06/26 13:52:40 I don't think we need to actually set sweep reques
wibling-chromium 2014/06/27 10:07:48 No, that is actually wrong. We risk sweeping when
wibling-chromium 2014/06/27 10:07:48 Done.
202 } 202 }
203 } 203 }
204 204
205 void enterSafePoint(ThreadState* state) 205 void enterSafePoint(ThreadState* state)
206 { 206 {
207 ASSERT(!state->isSweepInProgress()); 207 ASSERT(!state->isSweepInProgress());
208 pushAllRegisters(this, state, enterSafePointAfterPushRegisters); 208 pushAllRegisters(this, state, enterSafePointAfterPushRegisters);
209 } 209 }
210 210
211 void leaveSafePoint(ThreadState* state, SafePointAwareMutexLocker* locker = 0) 211 void leaveSafePoint(ThreadState* state, SafePointAwareMutexLocker* locker = 0)
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
751 void ThreadState::safePoint(StackState stackState) 751 void ThreadState::safePoint(StackState stackState)
752 { 752 {
753 checkThread(); 753 checkThread();
754 performPendingGC(stackState); 754 performPendingGC(stackState);
755 ASSERT(!m_atSafePoint); 755 ASSERT(!m_atSafePoint);
756 m_stackState = stackState; 756 m_stackState = stackState;
757 m_atSafePoint = true; 757 m_atSafePoint = true;
758 s_safePointBarrier->checkAndPark(this); 758 s_safePointBarrier->checkAndPark(this);
759 m_atSafePoint = false; 759 m_atSafePoint = false;
760 m_stackState = HeapPointersOnStack; 760 m_stackState = HeapPointersOnStack;
761 performPendingSweep();
761 } 762 }
762 763
763 #ifdef ADDRESS_SANITIZER 764 #ifdef ADDRESS_SANITIZER
764 // When we are running under AddressSanitizer with detect_stack_use_after_return =1 765 // When we are running under AddressSanitizer with detect_stack_use_after_return =1
765 // then stack marker obtained from SafePointScope will point into a fake stack. 766 // then stack marker obtained from SafePointScope will point into a fake stack.
766 // Detect this case by checking if it falls in between current stack frame 767 // Detect this case by checking if it falls in between current stack frame
767 // and stack start and use an arbitrary high enough value for it. 768 // and stack start and use an arbitrary high enough value for it.
768 // Don't adjust stack marker in any other case to match behavior of code running 769 // Don't adjust stack marker in any other case to match behavior of code running
769 // without AddressSanitizer. 770 // without AddressSanitizer.
770 NO_SANITIZE_ADDRESS static void* adjustScopeMarkerForAdressSanitizer(void* scope Marker) 771 NO_SANITIZE_ADDRESS static void* adjustScopeMarkerForAdressSanitizer(void* scope Marker)
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
915 threadAttachMutex().unlock(); 916 threadAttachMutex().unlock();
916 return gcInfo; 917 return gcInfo;
917 } 918 }
918 } 919 }
919 if (needLockForIteration) 920 if (needLockForIteration)
920 threadAttachMutex().unlock(); 921 threadAttachMutex().unlock();
921 return 0; 922 return 0;
922 } 923 }
923 #endif 924 #endif
924 } 925 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698