Index: Source/platform/heap/SafePoint.h |
diff --git a/Source/platform/heap/SafePoint.h b/Source/platform/heap/SafePoint.h |
index 76713c4c9cf6fcf91b7bcb568bfadc520a6580ea..982cbe35e47db41e9bb7d1bd7621b8a4015ad88b 100644 |
--- a/Source/platform/heap/SafePoint.h |
+++ b/Source/platform/heap/SafePoint.h |
@@ -13,11 +13,13 @@ namespace blink { |
class SafePointScope final { |
WTF_MAKE_NONCOPYABLE(SafePointScope); |
public: |
- explicit SafePointScope(ThreadState::StackState stackState) |
- : m_state(ThreadState::current()) |
+ explicit SafePointScope(ThreadState::StackState stackState, ThreadState* state = ThreadState::current()) |
+ : m_state(state) |
{ |
- RELEASE_ASSERT(!m_state->isAtSafePoint()); |
- m_state->enterSafePoint(stackState, this); |
+ if (m_state) { |
+ RELEASE_ASSERT(!m_state->isAtSafePoint()); |
+ m_state->enterSafePoint(stackState, this); |
+ } |
} |
~SafePointScope() |