Index: Source/platform/heap/SafePoint.h |
diff --git a/Source/platform/heap/SafePoint.h b/Source/platform/heap/SafePoint.h |
index 76713c4c9cf6fcf91b7bcb568bfadc520a6580ea..7222fe4e58fabc882aa263bf8d835b8b6c258c40 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()) |
+ SafePointScope(ThreadState::StackState stackState, ThreadState* state = ThreadState::current()) |
haraken
2015/05/31 00:13:20
This looks a bit messy though -- sometimes take an
sof
2015/05/31 10:28:09
If you explicitly supply no ThreadState, it just b
|
+ : 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() |