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

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: remove HeapIndexTrait + tidy up 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
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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 #define DEFINE_GARBAGE_COLLECTED_MIXIN_CONSTRUCTOR_MARKER(TYPE) \ 162 #define DEFINE_GARBAGE_COLLECTED_MIXIN_CONSTRUCTOR_MARKER(TYPE) \
163 public: \ 163 public: \
164 ALWAYS_INLINE static void forbidGCDuringConstruction(void* object) \ 164 ALWAYS_INLINE static void forbidGCDuringConstruction(void* object) \
165 { \ 165 { \
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 } \ 168 } \
169 GC_PLUGIN_IGNORE("crbug.com/456823") \ 169 GC_PLUGIN_IGNORE("crbug.com/456823") \
170 void* operator new(size_t size) \ 170 void* operator new(size_t size) \
171 { \ 171 { \
172 void* object = TYPE::allocateObject(size); \ 172 void* object = TYPE::allocateObject(size, IsEagerlyFinalizedType<TYPE>:: value); \
173 forbidGCDuringConstruction(object); \ 173 forbidGCDuringConstruction(object); \
174 return object; \ 174 return object; \
175 } \ 175 } \
176 GarbageCollectedMixinConstructorMarker m_mixinConstructorMarker; \ 176 GarbageCollectedMixinConstructorMarker m_mixinConstructorMarker; \
177 private: 177 private:
178 178
179 // Mixins that wrap/nest others requires extra handling: 179 // Mixins that wrap/nest others requires extra handling:
180 // 180 //
181 // class A : public GarbageCollected<A>, public GarbageCollectedMixin { 181 // class A : public GarbageCollected<A>, public GarbageCollectedMixin {
182 // USING_GARBAGE_COLLECTED_MIXIN(A); 182 // USING_GARBAGE_COLLECTED_MIXIN(A);
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 #define GC_PLUGIN_IGNORE(bug) \ 405 #define GC_PLUGIN_IGNORE(bug) \
406 __attribute__((annotate("blink_gc_plugin_ignore"))) 406 __attribute__((annotate("blink_gc_plugin_ignore")))
407 #else 407 #else
408 #define STACK_ALLOCATED() DISALLOW_ALLOCATION() 408 #define STACK_ALLOCATED() DISALLOW_ALLOCATION()
409 #define GC_PLUGIN_IGNORE(bug) 409 #define GC_PLUGIN_IGNORE(bug)
410 #endif 410 #endif
411 411
412 } // namespace blink 412 } // namespace blink
413 413
414 #endif 414 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698