| Index: Source/heap/ThreadState.cpp
|
| diff --git a/Source/heap/ThreadState.cpp b/Source/heap/ThreadState.cpp
|
| index e955142c39f0b452b580234323b5db17d523d097..a1fcd110cc0dad1b9d5aeca802a67754ea360c98 100644
|
| --- a/Source/heap/ThreadState.cpp
|
| +++ b/Source/heap/ThreadState.cpp
|
| @@ -310,8 +310,16 @@ void ThreadState::visitRoots(Visitor* visitor)
|
| NO_SANITIZE_ADDRESS
|
| void ThreadState::visitStack(Visitor* visitor)
|
| {
|
| - Address* end = reinterpret_cast<Address*>(m_startOfStack);
|
| - for (Address* current = reinterpret_cast<Address*>(m_endOfStack); current < end; ++current) {
|
| + Address* start = reinterpret_cast<Address*>(m_startOfStack);
|
| + // If there is a safepoint scope marker we should stop the stack
|
| + // scanning there to not touch active parts of the stack. Anything
|
| + // interesting beyond that point is in the safepoint stack copy.
|
| + // If there is no scope marker the thread is blocked and we should
|
| + // scan all the way to the recorded end stack pointer.
|
| + Address* end = reinterpret_cast<Address*>(m_endOfStack);
|
| + Address* safePointScopeMarker = reinterpret_cast<Address*>(m_safePointScopeMarker);
|
| + Address* current = safePointScopeMarker ? safePointScopeMarker : end;
|
| + for (; current < start; ++current) {
|
| Heap::checkAndMarkPointer(visitor, *current);
|
| }
|
|
|
|
|