| OLD | NEW |
| 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 // This file provides a wrapper for CXXRecordDecl that accumulates GC related | 5 // This file provides a wrapper for CXXRecordDecl that accumulates GC related |
| 6 // information about a class. Accumulated information is memoized and the info | 6 // information about a class. Accumulated information is memoized and the info |
| 7 // objects are stored in a RecordCache. | 7 // objects are stored in a RecordCache. |
| 8 | 8 |
| 9 #ifndef TOOLS_BLINK_GC_PLUGIN_RECORD_INFO_H_ | 9 #ifndef TOOLS_BLINK_GC_PLUGIN_RECORD_INFO_H_ |
| 10 #define TOOLS_BLINK_GC_PLUGIN_RECORD_INFO_H_ | 10 #define TOOLS_BLINK_GC_PLUGIN_RECORD_INFO_H_ |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 bool GetTemplateArgs(size_t count, TemplateArgs* output_args); | 85 bool GetTemplateArgs(size_t count, TemplateArgs* output_args); |
| 86 | 86 |
| 87 bool IsHeapAllocatedCollection(); | 87 bool IsHeapAllocatedCollection(); |
| 88 bool IsGCDerived(); | 88 bool IsGCDerived(); |
| 89 bool IsGCAllocated(); | 89 bool IsGCAllocated(); |
| 90 bool IsGCFinalized(); | 90 bool IsGCFinalized(); |
| 91 bool IsGCMixin(); | 91 bool IsGCMixin(); |
| 92 bool IsStackAllocated(); | 92 bool IsStackAllocated(); |
| 93 bool IsNonNewable(); | 93 bool IsNonNewable(); |
| 94 bool IsOnlyPlacementNewable(); | 94 bool IsOnlyPlacementNewable(); |
| 95 bool IsGCMixinInstance(); |
| 95 clang::CXXMethodDecl* DeclaresNewOperator(); | 96 clang::CXXMethodDecl* DeclaresNewOperator(); |
| 96 | 97 |
| 97 bool RequiresTraceMethod(); | 98 bool RequiresTraceMethod(); |
| 98 bool NeedsFinalization(); | 99 bool NeedsFinalization(); |
| 100 bool DeclaresGCMixinMethods(); |
| 101 bool DeclaresLocalTraceMethod(); |
| 99 TracingStatus NeedsTracing(Edge::NeedsTracingOption); | 102 TracingStatus NeedsTracing(Edge::NeedsTracingOption); |
| 100 clang::CXXMethodDecl* InheritsNonVirtualTrace(); | 103 clang::CXXMethodDecl* InheritsNonVirtualTrace(); |
| 101 bool IsConsideredAbstract(); | 104 bool IsConsideredAbstract(); |
| 102 | 105 |
| 103 static clang::CXXRecordDecl* GetDependentTemplatedDecl(const clang::Type&); | 106 static clang::CXXRecordDecl* GetDependentTemplatedDecl(const clang::Type&); |
| 104 | 107 |
| 105 private: | 108 private: |
| 106 RecordInfo(clang::CXXRecordDecl* record, RecordCache* cache); | 109 RecordInfo(clang::CXXRecordDecl* record, RecordCache* cache); |
| 107 | 110 |
| 108 void walkBases(); | 111 void walkBases(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 119 const std::string name_; | 122 const std::string name_; |
| 120 TracingStatus fields_need_tracing_; | 123 TracingStatus fields_need_tracing_; |
| 121 Bases* bases_; | 124 Bases* bases_; |
| 122 Fields* fields_; | 125 Fields* fields_; |
| 123 | 126 |
| 124 enum CachedBool { kFalse = 0, kTrue = 1, kNotComputed = 2 }; | 127 enum CachedBool { kFalse = 0, kTrue = 1, kNotComputed = 2 }; |
| 125 CachedBool is_stack_allocated_; | 128 CachedBool is_stack_allocated_; |
| 126 CachedBool is_non_newable_; | 129 CachedBool is_non_newable_; |
| 127 CachedBool is_only_placement_newable_; | 130 CachedBool is_only_placement_newable_; |
| 128 CachedBool does_need_finalization_; | 131 CachedBool does_need_finalization_; |
| 132 CachedBool has_gc_mixin_methods_; |
| 133 CachedBool is_declaring_local_trace_; |
| 129 | 134 |
| 130 bool determined_trace_methods_; | 135 bool determined_trace_methods_; |
| 131 clang::CXXMethodDecl* trace_method_; | 136 clang::CXXMethodDecl* trace_method_; |
| 132 clang::CXXMethodDecl* trace_dispatch_method_; | 137 clang::CXXMethodDecl* trace_dispatch_method_; |
| 133 clang::CXXMethodDecl* finalize_dispatch_method_; | 138 clang::CXXMethodDecl* finalize_dispatch_method_; |
| 134 | 139 |
| 135 bool is_gc_derived_; | 140 bool is_gc_derived_; |
| 136 | 141 |
| 137 std::vector<std::string> gc_base_names_; | 142 std::vector<std::string> gc_base_names_; |
| 138 | 143 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 } | 175 } |
| 171 } | 176 } |
| 172 } | 177 } |
| 173 | 178 |
| 174 private: | 179 private: |
| 175 typedef std::map<clang::CXXRecordDecl*, RecordInfo> Cache; | 180 typedef std::map<clang::CXXRecordDecl*, RecordInfo> Cache; |
| 176 Cache cache_; | 181 Cache cache_; |
| 177 }; | 182 }; |
| 178 | 183 |
| 179 #endif // TOOLS_BLINK_GC_PLUGIN_RECORD_INFO_H_ | 184 #endif // TOOLS_BLINK_GC_PLUGIN_RECORD_INFO_H_ |
| OLD | NEW |