| Index: third_party/WebKit/Source/platform/heap/MarkingVisitor.h
|
| diff --git a/third_party/WebKit/Source/platform/heap/MarkingVisitor.h b/third_party/WebKit/Source/platform/heap/MarkingVisitor.h
|
| index deeac44cef50de0731bb46c47e9c9727830efb51..900f298f47d530f1293f2ec312bd94b73c1511ad 100644
|
| --- a/third_party/WebKit/Source/platform/heap/MarkingVisitor.h
|
| +++ b/third_party/WebKit/Source/platform/heap/MarkingVisitor.h
|
| @@ -9,11 +9,11 @@
|
|
|
| namespace blink {
|
|
|
| -template <Visitor::MarkingMode Mode>
|
| -class MarkingVisitor final : public Visitor, public MarkingVisitorImpl<MarkingVisitor<Mode>> {
|
| +template <Visitor::MarkingMode Mode, bool PerThreadHeapEnabled>
|
| +class MarkingVisitor final : public Visitor, public MarkingVisitorImpl<MarkingVisitor<Mode, PerThreadHeapEnabled>, PerThreadHeapEnabled> {
|
| public:
|
| - using Impl = MarkingVisitorImpl<MarkingVisitor<Mode>>;
|
| - friend class MarkingVisitorImpl<MarkingVisitor<Mode>>;
|
| + using Impl = MarkingVisitorImpl<MarkingVisitor<Mode, PerThreadHeapEnabled>, PerThreadHeapEnabled>;
|
| + friend class MarkingVisitorImpl<MarkingVisitor<Mode, PerThreadHeapEnabled>, PerThreadHeapEnabled>;
|
|
|
| explicit MarkingVisitor(ThreadState* state)
|
| : Visitor(state, Mode)
|
| @@ -65,15 +65,22 @@ protected:
|
|
|
| inline bool shouldMarkObject(const void* objectPointer)
|
| {
|
| - if (Mode != ThreadLocalMarking)
|
| - return true;
|
| -
|
| - BasePage* page = pageFromObject(objectPointer);
|
| - ASSERT(!page->orphaned());
|
| - // When doing a thread local GC, the marker checks if
|
| - // the object resides in another thread's heap. If it
|
| - // does, the object should not be marked & traced.
|
| - return page->terminating();
|
| + if (Mode == ThreadTerminationMarking) {
|
| + BasePage* page = pageFromObject(objectPointer);
|
| + ASSERT(!page->orphaned());
|
| + // When doing a thread local GC, the marker checks if
|
| + // the object resides in another thread's heap. If it
|
| + // does, the object should not be marked & traced.
|
| + return page->terminating();
|
| + }
|
| +#if ENABLE(ASSERT)
|
| + if (Mode == ThreadLocalMarking) {
|
| + BasePage* page = pageFromObject(objectPointer);
|
| + ASSERT(!page->orphaned());
|
| + ASSERT(&page->arena()->getThreadState()->heap() == &Visitor::heap());
|
| + }
|
| +#endif
|
| + return true;
|
| }
|
| };
|
|
|
|
|