forked from oracle/graal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
12efe62
commit 0119420
Showing
6 changed files
with
162 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...raal.pointsto/src/com/oracle/graal/pointsto/reports/causality/events/CauseConnection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.oracle.graal.pointsto.reports.causality.events; | ||
|
||
public final class CauseConnection extends CausalityEvent { | ||
public final StackTraceElement from; | ||
public final StackTraceElement to; | ||
|
||
CauseConnection(StackTraceElement from, StackTraceElement to) { | ||
this.from = from; | ||
this.to = to; | ||
} | ||
|
||
@Override | ||
public boolean essential() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public EventKinds typeDescriptor() { | ||
return EventKinds.CauseConnection; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return from + ";" + to + typeDescriptor().suffix; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...pointsto/src/com/oracle/graal/pointsto/reports/causality/events/CauseConnectionStack.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.oracle.graal.pointsto.reports.causality.events; | ||
|
||
public final class CauseConnectionStack extends CausalityEvent { | ||
public final ImmutableStackTrace stackTrace; | ||
|
||
CauseConnectionStack(ImmutableStackTrace stackTrace) { | ||
this.stackTrace = stackTrace; | ||
} | ||
|
||
@Override | ||
public boolean essential() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public EventKinds typeDescriptor() { | ||
return EventKinds.CauseConnectionStack; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return stackTrace.toString() + typeDescriptor().suffix; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
....pointsto/src/com/oracle/graal/pointsto/reports/causality/events/ImmutableStackTrace.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.oracle.graal.pointsto.reports.causality.events; | ||
|
||
import java.util.Arrays; | ||
|
||
public record ImmutableStackTrace(StackTraceElement[] stackTrace) { | ||
@Override | ||
public boolean equals(Object obj) { | ||
return obj instanceof ImmutableStackTrace other && Arrays.equals(stackTrace, other.stackTrace); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Arrays.hashCode(stackTrace); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
StringBuilder sb = new StringBuilder(); | ||
for (StackTraceElement element : stackTrace) { | ||
sb.append(element).append(";"); | ||
} | ||
return sb.toString(); | ||
} | ||
} |