Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Side by Side Diff: Source/platform/heap/MarkingVisitorImpl.h

Issue 1166623002: Oilpan: Remove a visitor parameter from isHeapObjectAlive (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/platform/heap/MarkingVisitor.h ('k') | Source/platform/heap/ThreadState.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MarkingVisitorImpl_h 5 #ifndef MarkingVisitorImpl_h
6 #define MarkingVisitorImpl_h 6 #define MarkingVisitorImpl_h
7 7
8 #include "platform/heap/Heap.h" 8 #include "platform/heap/Heap.h"
9 #include "platform/heap/ThreadState.h" 9 #include "platform/heap/ThreadState.h"
10 #include "platform/heap/Visitor.h" 10 #include "platform/heap/Visitor.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 Heap::registerWeakTable(const_cast<void*>(closure), iterationCallback, i terationDoneCallback); 75 Heap::registerWeakTable(const_cast<void*>(closure), iterationCallback, i terationDoneCallback);
76 } 76 }
77 77
78 #if ENABLE(ASSERT) 78 #if ENABLE(ASSERT)
79 inline bool weakTableRegistered(const void* closure) 79 inline bool weakTableRegistered(const void* closure)
80 { 80 {
81 return Heap::weakTableRegistered(closure); 81 return Heap::weakTableRegistered(closure);
82 } 82 }
83 #endif 83 #endif
84 84
85 inline bool isMarked(const void* objectPointer)
86 {
87 return HeapObjectHeader::fromPayload(objectPointer)->isMarked();
88 }
89
90 inline bool ensureMarked(const void* objectPointer) 85 inline bool ensureMarked(const void* objectPointer)
91 { 86 {
92 if (!objectPointer) 87 if (!objectPointer)
93 return false; 88 return false;
94 if (!toDerived()->shouldMarkObject(objectPointer)) 89 if (!toDerived()->shouldMarkObject(objectPointer))
95 return false; 90 return false;
96 #if ENABLE(ASSERT) 91 #if ENABLE(ASSERT)
97 if (isMarked(objectPointer)) 92 if (HeapObjectHeader::fromPayload(objectPointer)->isMarked())
98 return false; 93 return false;
99 94
100 toDerived()->markNoTracing(objectPointer); 95 toDerived()->markNoTracing(objectPointer);
101 #else 96 #else
102 // Inline what the above markNoTracing() call expands to, 97 // Inline what the above markNoTracing() call expands to,
103 // so as to make sure that we do get all the benefits. 98 // so as to make sure that we do get all the benefits.
104 HeapObjectHeader* header = HeapObjectHeader::fromPayload(objectPointer); 99 HeapObjectHeader* header = HeapObjectHeader::fromPayload(objectPointer);
105 if (header->isMarked()) 100 if (header->isMarked())
106 return false; 101 return false;
107 header->mark(); 102 header->mark();
(...skipping 15 matching lines...) Expand all
123 private: 118 private:
124 static void markNoTracingCallback(Visitor* visitor, void* object) 119 static void markNoTracingCallback(Visitor* visitor, void* object)
125 { 120 {
126 visitor->markNoTracing(object); 121 visitor->markNoTracing(object);
127 } 122 }
128 }; 123 };
129 124
130 } // namespace blink 125 } // namespace blink
131 126
132 #endif 127 #endif
OLDNEW
« no previous file with comments | « Source/platform/heap/MarkingVisitor.h ('k') | Source/platform/heap/ThreadState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698