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

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

Issue 406523002: Oilpan: Make sure that vtables for garbage collected mixin objects have (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix non-oilpan compilation Created 6 years, 5 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 /* 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 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 // USING_GARBAGE_COLLECTED_MIXIN(A) 579 // USING_GARBAGE_COLLECTED_MIXIN(A)
580 // }; 580 // };
581 // 581 //
582 // With the helper, as long as we are using Member<B>, TypeTrait<B> will 582 // With the helper, as long as we are using Member<B>, TypeTrait<B> will
583 // dispatch adjustAndMark dynamically to find collect addr of the object header. 583 // dispatch adjustAndMark dynamically to find collect addr of the object header.
584 // Note that this is only enabled for Member<B>. For Member<A> which we can 584 // Note that this is only enabled for Member<B>. For Member<A> which we can
585 // compute the object header addr statically, this dynamic dispatch is not used. 585 // compute the object header addr statically, this dynamic dispatch is not used.
586 586
587 class GarbageCollectedMixin { 587 class GarbageCollectedMixin {
588 public: 588 public:
589 virtual void adjustAndMark(Visitor*) const = 0; 589 virtual void adjustAndMark(Visitor*) const { };
zerny-chromium 2014/07/19 07:21:58 DBC we need to extend the plugin checks (or find a
590 virtual bool isAlive(Visitor*) const = 0; 590 virtual bool isAlive(Visitor*) const { return true; };
591 virtual void trace(Visitor*) { }
591 }; 592 };
592 593
593 #define USING_GARBAGE_COLLECTED_MIXIN(TYPE) \ 594 #define USING_GARBAGE_COLLECTED_MIXIN(TYPE) \
594 public: \ 595 public: \
595 virtual void adjustAndMark(WebCore::Visitor* visitor) const OVERRIDE \ 596 virtual void adjustAndMark(WebCore::Visitor* visitor) const OVERRIDE \
596 { \ 597 { \
597 typedef WTF::IsSubclassOfTemplate<typename WTF::RemoveConst<TYPE>::Type, WebCore::GarbageCollected> IsSubclassOfGarbageCollected; \ 598 typedef WTF::IsSubclassOfTemplate<typename WTF::RemoveConst<TYPE>::Type, WebCore::GarbageCollected> IsSubclassOfGarbageCollected; \
598 COMPILE_ASSERT(IsSubclassOfGarbageCollected::value, OnlyGarbageCollected ObjectsCanHaveGarbageCollectedMixins); \ 599 COMPILE_ASSERT(IsSubclassOfGarbageCollected::value, OnlyGarbageCollected ObjectsCanHaveGarbageCollectedMixins); \
599 visitor->mark(static_cast<const TYPE*>(this), &WebCore::TraceTrait<TYPE> ::trace); \ 600 visitor->mark(static_cast<const TYPE*>(this), &WebCore::TraceTrait<TYPE> ::trace); \
600 } \ 601 } \
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 struct GCInfoTrait { 656 struct GCInfoTrait {
656 static const GCInfo* get() 657 static const GCInfo* get()
657 { 658 {
658 return GCInfoAtBase<typename GetGarbageCollectedBase<T>::type>::get(); 659 return GCInfoAtBase<typename GetGarbageCollectedBase<T>::type>::get();
659 } 660 }
660 }; 661 };
661 662
662 } 663 }
663 664
664 #endif 665 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698