OLD | NEW |
---|---|
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 1833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1844 friend class MarkingVisitorImpl<MarkingVisitor<Mode>>; | 1844 friend class MarkingVisitorImpl<MarkingVisitor<Mode>>; |
1845 | 1845 |
1846 #if ENABLE(GC_PROFILE_MARKING) | 1846 #if ENABLE(GC_PROFILE_MARKING) |
1847 using LiveObjectSet = HashSet<uintptr_t>; | 1847 using LiveObjectSet = HashSet<uintptr_t>; |
1848 using LiveObjectMap = HashMap<String, LiveObjectSet>; | 1848 using LiveObjectMap = HashMap<String, LiveObjectSet>; |
1849 using ObjectGraph = HashMap<uintptr_t, std::pair<uintptr_t, String>>; | 1849 using ObjectGraph = HashMap<uintptr_t, std::pair<uintptr_t, String>>; |
1850 #endif | 1850 #endif |
1851 | 1851 |
1852 MarkingVisitor() | 1852 MarkingVisitor() |
1853 : Visitor(Mode == GlobalMarking ? Visitor::GlobalMarkingVisitorType : Vi sitor::GenericVisitorType) | 1853 : Visitor(Mode == GlobalMarking ? Visitor::GlobalMarkingVisitorType : Vi sitor::GenericVisitorType) |
1854 #if ENABLE(ASSERT) | |
1855 , m_allowTraceForHashTableWeakProcessing(false) | |
1856 #endif | |
1854 { | 1857 { |
1855 } | 1858 } |
1856 | 1859 |
1857 virtual void markHeader(HeapObjectHeader* header, TraceCallback callback) ov erride | 1860 virtual void markHeader(HeapObjectHeader* header, TraceCallback callback) ov erride |
1858 { | 1861 { |
1859 Impl::visitHeader(header, header->payload(), callback); | 1862 Impl::visitHeader(header, header->payload(), callback); |
1860 } | 1863 } |
1861 | 1864 |
1862 virtual void mark(const void* objectPointer, TraceCallback callback) overrid e | 1865 virtual void mark(const void* objectPointer, TraceCallback callback) overrid e |
1863 { | 1866 { |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2016 if (Mode != ThreadLocalMarking) | 2019 if (Mode != ThreadLocalMarking) |
2017 return true; | 2020 return true; |
2018 | 2021 |
2019 BaseHeapPage* page = pageFromObject(objectPointer); | 2022 BaseHeapPage* page = pageFromObject(objectPointer); |
2020 ASSERT(!page->orphaned()); | 2023 ASSERT(!page->orphaned()); |
2021 // When doing a thread local GC, the marker checks if | 2024 // When doing a thread local GC, the marker checks if |
2022 // the object resides in another thread's heap. If it | 2025 // the object resides in another thread's heap. If it |
2023 // does, the object should not be marked & traced. | 2026 // does, the object should not be marked & traced. |
2024 return page->terminating(); | 2027 return page->terminating(); |
2025 } | 2028 } |
2029 | |
2030 #if ENABLE(ASSERT) | |
2031 virtual void checkIsMarkingAllowed() override | |
haraken
2015/01/13 07:55:53
It sounds inconsistent to have check"IsMarking"All
kouhei (in TOK)
2015/01/14 02:10:05
Done.
| |
2032 { | |
2033 ASSERT(ThreadState::current()->isInGC() || m_allowTraceForHashTableWeakP rocessing); | |
2034 } | |
2035 | |
2036 virtual void setAllowTraceForHashTableWeakProcessing(bool allow) override | |
2037 { | |
2038 m_allowTraceForHashTableWeakProcessing = true; | |
haraken
2015/01/13 07:55:53
Shouldn't this be '= allow' ?
kouhei (in TOK)
2015/01/14 02:10:05
Done.
| |
2039 } | |
2040 | |
2041 bool m_allowTraceForHashTableWeakProcessing; | |
2042 #endif | |
2026 }; | 2043 }; |
2027 | 2044 |
2028 void Heap::init() | 2045 void Heap::init() |
2029 { | 2046 { |
2030 ThreadState::init(); | 2047 ThreadState::init(); |
2031 s_markingStack = new CallbackStack(); | 2048 s_markingStack = new CallbackStack(); |
2032 s_postMarkingCallbackStack = new CallbackStack(); | 2049 s_postMarkingCallbackStack = new CallbackStack(); |
2033 s_weakCallbackStack = new CallbackStack(); | 2050 s_weakCallbackStack = new CallbackStack(); |
2034 s_ephemeronStack = new CallbackStack(); | 2051 s_ephemeronStack = new CallbackStack(); |
2035 s_heapDoesNotContainCache = new HeapDoesNotContainCache(); | 2052 s_heapDoesNotContainCache = new HeapDoesNotContainCache(); |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2686 bool Heap::s_shutdownCalled = false; | 2703 bool Heap::s_shutdownCalled = false; |
2687 bool Heap::s_lastGCWasConservative = false; | 2704 bool Heap::s_lastGCWasConservative = false; |
2688 FreePagePool* Heap::s_freePagePool; | 2705 FreePagePool* Heap::s_freePagePool; |
2689 OrphanedPagePool* Heap::s_orphanedPagePool; | 2706 OrphanedPagePool* Heap::s_orphanedPagePool; |
2690 Heap::RegionTree* Heap::s_regionTree = nullptr; | 2707 Heap::RegionTree* Heap::s_regionTree = nullptr; |
2691 size_t Heap::s_allocatedObjectSize = 0; | 2708 size_t Heap::s_allocatedObjectSize = 0; |
2692 size_t Heap::s_allocatedSpace = 0; | 2709 size_t Heap::s_allocatedSpace = 0; |
2693 size_t Heap::s_markedObjectSize = 0; | 2710 size_t Heap::s_markedObjectSize = 0; |
2694 | 2711 |
2695 } // namespace blink | 2712 } // namespace blink |
OLD | NEW |