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

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

Issue 1157933002: Oilpan: introduce eager finalization. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Parameterize Heap::poisonHeap() over ObjectsToPoison 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/core/events/EventTarget.h ('k') | Source/platform/heap/Heap.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 GarbageCollected_h 5 #ifndef GarbageCollected_h
6 #define GarbageCollected_h 6 #define GarbageCollected_h
7 7
8 #include "platform/heap/ThreadState.h" 8 #include "platform/heap/ThreadState.h"
9 #include "wtf/Assertions.h" 9 #include "wtf/Assertions.h"
10 #include "wtf/ListHashSet.h" 10 #include "wtf/ListHashSet.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 // derived constructors have run, it will invoke the constructor 155 // derived constructors have run, it will invoke the constructor
156 // for a field whose only purpose is to leave the GC scope. 156 // for a field whose only purpose is to leave the GC scope.
157 // GarbageCollectedMixinConstructorMarker's constructor takes care of 157 // GarbageCollectedMixinConstructorMarker's constructor takes care of
158 // this and the field is declared by way of USING_GARBAGE_COLLECTED_MIXIN(). 158 // this and the field is declared by way of USING_GARBAGE_COLLECTED_MIXIN().
159 159
160 #define DEFINE_GARBAGE_COLLECTED_MIXIN_CONSTRUCTOR_MARKER(TYPE) \ 160 #define DEFINE_GARBAGE_COLLECTED_MIXIN_CONSTRUCTOR_MARKER(TYPE) \
161 public: \ 161 public: \
162 GC_PLUGIN_IGNORE("crbug.com/456823") NO_SANITIZE_UNRELATED_CAST \ 162 GC_PLUGIN_IGNORE("crbug.com/456823") NO_SANITIZE_UNRELATED_CAST \
163 void* operator new(size_t size) \ 163 void* operator new(size_t size) \
164 { \ 164 { \
165 void* object = TYPE::allocateObject(size); \ 165 void* object = TYPE::allocateObject(size, IsEagerlyFinalizedType<TYPE>:: value); \
166 ThreadState* state = ThreadStateFor<ThreadingTrait<TYPE>::Affinity>::sta te(); \ 166 ThreadState* state = ThreadStateFor<ThreadingTrait<TYPE>::Affinity>::sta te(); \
167 state->enterGCForbiddenScopeIfNeeded(&(reinterpret_cast<TYPE*>(object)-> m_mixinConstructorMarker)); \ 167 state->enterGCForbiddenScopeIfNeeded(&(reinterpret_cast<TYPE*>(object)-> m_mixinConstructorMarker)); \
168 return object; \ 168 return object; \
169 } \ 169 } \
170 GarbageCollectedMixinConstructorMarker m_mixinConstructorMarker; \ 170 GarbageCollectedMixinConstructorMarker m_mixinConstructorMarker; \
171 private: 171 private:
172 172
173 // Mixins that wrap/nest others requires extra handling: 173 // Mixins that wrap/nest others requires extra handling:
174 // 174 //
175 // class A : public GarbageCollected<A>, public GarbageCollectedMixin { 175 // class A : public GarbageCollected<A>, public GarbageCollectedMixin {
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 #define GC_PLUGIN_IGNORE(bug) \ 399 #define GC_PLUGIN_IGNORE(bug) \
400 __attribute__((annotate("blink_gc_plugin_ignore"))) 400 __attribute__((annotate("blink_gc_plugin_ignore")))
401 #else 401 #else
402 #define STACK_ALLOCATED() DISALLOW_ALLOCATION() 402 #define STACK_ALLOCATED() DISALLOW_ALLOCATION()
403 #define GC_PLUGIN_IGNORE(bug) 403 #define GC_PLUGIN_IGNORE(bug)
404 #endif 404 #endif
405 405
406 } // namespace blink 406 } // namespace blink
407 407
408 #endif 408 #endif
OLDNEW
« no previous file with comments | « Source/core/events/EventTarget.h ('k') | Source/platform/heap/Heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698