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

Side by Side Diff: tools/clang/blink_gc_plugin/Edge.h

Issue 1275383002: Revert of GC plugin: consider references equal to raw pointers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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
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 TOOLS_BLINK_GC_PLUGIN_EDGE_H_ 5 #ifndef TOOLS_BLINK_GC_PLUGIN_EDGE_H_
6 #define TOOLS_BLINK_GC_PLUGIN_EDGE_H_ 6 #define TOOLS_BLINK_GC_PLUGIN_EDGE_H_
7 7
8 #include <deque> 8 #include <deque>
9 9
10 #include "TracingStatus.h" 10 #include "TracingStatus.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 protected: 117 protected:
118 PtrEdge(Edge* ptr) : ptr_(ptr) { 118 PtrEdge(Edge* ptr) : ptr_(ptr) {
119 assert(ptr && "EdgePtr pointer must be non-null"); 119 assert(ptr && "EdgePtr pointer must be non-null");
120 } 120 }
121 private: 121 private:
122 Edge* ptr_; 122 Edge* ptr_;
123 }; 123 };
124 124
125 class RawPtr : public PtrEdge { 125 class RawPtr : public PtrEdge {
126 public: 126 public:
127 RawPtr(Edge* ptr, bool is_ptr_class, bool is_ref_type) 127 explicit RawPtr(Edge* ptr, bool is_ptr_class)
128 : PtrEdge(ptr) 128 : PtrEdge(ptr), is_ptr_class_(is_ptr_class) { }
129 , is_ptr_class_(is_ptr_class)
130 , is_ref_type_(is_ref_type)
131 {
132 assert(!(is_ptr_class_ && is_ref_type_));
133 }
134
135 bool IsRawPtr() { return true; } 129 bool IsRawPtr() { return true; }
136 bool IsRawPtrClass() { return is_ptr_class_; } 130 bool IsRawPtrClass() { return is_ptr_class_; }
137 LivenessKind Kind() { return kWeak; } 131 LivenessKind Kind() { return kWeak; }
138 bool NeedsFinalization() { return false; } 132 bool NeedsFinalization() { return false; }
139 TracingStatus NeedsTracing(NeedsTracingOption) { 133 TracingStatus NeedsTracing(NeedsTracingOption) {
140 return TracingStatus::Unneeded(); 134 return TracingStatus::Unneeded();
141 } 135 }
142 void Accept(EdgeVisitor* visitor) { visitor->VisitRawPtr(this); } 136 void Accept(EdgeVisitor* visitor) { visitor->VisitRawPtr(this); }
143
144 bool HasReferenceType() { return is_ref_type_; }
145 private: 137 private:
146 bool is_ptr_class_; 138 bool is_ptr_class_;
147 bool is_ref_type_;
148 }; 139 };
149 140
150 class RefPtr : public PtrEdge { 141 class RefPtr : public PtrEdge {
151 public: 142 public:
152 explicit RefPtr(Edge* ptr) : PtrEdge(ptr) { } 143 explicit RefPtr(Edge* ptr) : PtrEdge(ptr) { }
153 bool IsRefPtr() { return true; } 144 bool IsRefPtr() { return true; }
154 LivenessKind Kind() { return kStrong; } 145 LivenessKind Kind() { return kStrong; }
155 bool NeedsFinalization() { return true; } 146 bool NeedsFinalization() { return true; }
156 TracingStatus NeedsTracing(NeedsTracingOption) { 147 TracingStatus NeedsTracing(NeedsTracingOption) {
157 return TracingStatus::Unneeded(); 148 return TracingStatus::Unneeded();
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 } 237 }
247 238
248 private: 239 private:
249 RecordInfo* info_; 240 RecordInfo* info_;
250 Members members_; 241 Members members_;
251 bool on_heap_; 242 bool on_heap_;
252 bool is_root_; 243 bool is_root_;
253 }; 244 };
254 245
255 #endif // TOOLS_BLINK_GC_PLUGIN_EDGE_H_ 246 #endif // TOOLS_BLINK_GC_PLUGIN_EDGE_H_
OLDNEW
« no previous file with comments | « tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp ('k') | tools/clang/blink_gc_plugin/RecordInfo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698