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

Unified Diff: tools/clang/blink_gc_plugin/Edge.h

Issue 207913002: Global cycle detection analysis. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comments Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/clang/blink_gc_plugin/Config.h ('k') | tools/clang/blink_gc_plugin/JsonWriter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/clang/blink_gc_plugin/Edge.h
diff --git a/tools/clang/blink_gc_plugin/Edge.h b/tools/clang/blink_gc_plugin/Edge.h
index 36ff1e83f9de27b83cf3fd480ffcd2fae35a17ff..d0d521e65c8f160b63efa91e879bb64d97bdff34 100644
--- a/tools/clang/blink_gc_plugin/Edge.h
+++ b/tools/clang/blink_gc_plugin/Edge.h
@@ -72,8 +72,10 @@ class RecursiveEdgeVisitor : public EdgeVisitor {
class Edge {
public:
enum NeedsTracingOption { kRecursive, kNonRecursive };
+ enum LivenessKind { kWeak, kStrong, kRoot };
virtual ~Edge() { }
+ virtual LivenessKind Kind() = 0;
virtual void Accept(EdgeVisitor*) = 0;
virtual bool NeedsFinalization() = 0;
virtual TracingStatus NeedsTracing(NeedsTracingOption) {
@@ -95,6 +97,7 @@ class Value : public Edge {
public:
explicit Value(RecordInfo* value) : value_(value) {};
bool IsValue() { return true; }
+ LivenessKind Kind() { return kStrong; }
bool NeedsFinalization();
TracingStatus NeedsTracing(NeedsTracingOption);
void Accept(EdgeVisitor* visitor) { visitor->VisitValue(this); }
@@ -120,6 +123,7 @@ class RawPtr : public PtrEdge {
public:
explicit RawPtr(Edge* ptr) : PtrEdge(ptr) { }
bool IsRawPtr() { return true; }
+ LivenessKind Kind() { return kWeak; }
bool NeedsFinalization() { return false; }
TracingStatus NeedsTracing(NeedsTracingOption) {
return TracingStatus::Unneeded();
@@ -131,6 +135,7 @@ class RefPtr : public PtrEdge {
public:
explicit RefPtr(Edge* ptr) : PtrEdge(ptr) { }
bool IsRefPtr() { return true; }
+ LivenessKind Kind() { return kStrong; }
bool NeedsFinalization() { return true; }
TracingStatus NeedsTracing(NeedsTracingOption) {
return TracingStatus::Unneeded();
@@ -142,6 +147,7 @@ class OwnPtr : public PtrEdge {
public:
explicit OwnPtr(Edge* ptr) : PtrEdge(ptr) { }
bool IsOwnPtr() { return true; }
+ LivenessKind Kind() { return kStrong; }
bool NeedsFinalization() { return true; }
TracingStatus NeedsTracing(NeedsTracingOption) {
return TracingStatus::Unneeded();
@@ -153,6 +159,7 @@ class Member : public PtrEdge {
public:
explicit Member(Edge* ptr) : PtrEdge(ptr) { }
bool IsMember() { return true; }
+ LivenessKind Kind() { return kStrong; }
bool NeedsFinalization() { return false; }
TracingStatus NeedsTracing(NeedsTracingOption) {
return TracingStatus::Needed();
@@ -164,6 +171,7 @@ class WeakMember : public PtrEdge {
public:
explicit WeakMember(Edge* ptr) : PtrEdge(ptr) { }
bool IsWeakMember() { return true; }
+ LivenessKind Kind() { return kWeak; }
bool NeedsFinalization() { return false; }
TracingStatus NeedsTracing(NeedsTracingOption) {
return TracingStatus::Needed();
@@ -175,6 +183,7 @@ class Persistent : public PtrEdge {
public:
explicit Persistent(Edge* ptr) : PtrEdge(ptr) { }
bool IsPersistent() { return true; }
+ LivenessKind Kind() { return kRoot; }
bool NeedsFinalization() { return true; }
TracingStatus NeedsTracing(NeedsTracingOption) {
return TracingStatus::Unneeded();
@@ -196,6 +205,7 @@ class Collection : public Edge {
}
}
bool IsCollection() { return true; }
+ LivenessKind Kind() { return is_root_ ? kRoot : kStrong; }
bool on_heap() { return on_heap_; }
bool is_root() { return is_root_; }
Members& members() { return members_; }
« no previous file with comments | « tools/clang/blink_gc_plugin/Config.h ('k') | tools/clang/blink_gc_plugin/JsonWriter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698