Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ other words, there is a (name, signature) pair that can be resolved for the type
/** Connection between a captured LOCAL and the corresponding CLOSURE_BINDING */
public static final String CAPTURED_BY = "CAPTURED_BY";

/** The edge connects try control structure nodes to catch/handler bodies. */
public static final String CATCH_BODY = "CATCH_BODY";

/** A CDG edge expresses that the destination node is control dependent on the source node. */
public static final String CDG = "CDG";

Expand All @@ -53,12 +56,30 @@ other words, there is a (name, signature) pair that can be resolved for the type
/** This edge connects a node to the method that contains it. */
public static final String CONTAINS = "CONTAINS";

/** The edge connects do-while control structure nodes to their body. */
public static final String DO_BODY = "DO_BODY";

/** This edge indicates that the source node immediately dominates the destination node. */
public static final String DOMINATE = "DOMINATE";

/** This edge connects a node to its evaluation type. */
public static final String EVAL_TYPE = "EVAL_TYPE";

/** The edge connects control structure nodes to their false branch/body. */
public static final String FALSE_BODY = "FALSE_BODY";

/** The edge connects try control structure nodes to their finally body. */
public static final String FINALLY_BODY = "FINALLY_BODY";

/** The edge connects for-loop control structure nodes to their body. */
public static final String FOR_BODY = "FOR_BODY";

/** The edge connects for-loop control structure nodes to their initialization expression(s). */
public static final String FOR_INIT = "FOR_INIT";

/** The edge connects for-loop control structure nodes to their update/step expression(s). */
public static final String FOR_UPDATE = "FOR_UPDATE";

/** Edge from imports to dependencies */
public static final String IMPORTS = "IMPORTS";

Expand Down Expand Up @@ -104,6 +125,12 @@ other words, there is a (name, signature) pair that can be resolved for the type
/** Edges from nodes to the tags they are tagged by. */
public static final String TAGGED_BY = "TAGGED_BY";

/** The edge connects control structure nodes to their true branch/body. */
public static final String TRUE_BODY = "TRUE_BODY";

/** The edge connects try control structure nodes to their try body. */
public static final String TRY_BODY = "TRY_BODY";

public static Set<String> ALL = new HashSet<String>() {{
add(ALIAS_OF);
add(ARGUMENT);
Expand All @@ -113,12 +140,19 @@ other words, there is a (name, signature) pair that can be resolved for the type
add(CALL);
add(CAPTURE);
add(CAPTURED_BY);
add(CATCH_BODY);
add(CDG);
add(CFG);
add(CONDITION);
add(CONTAINS);
add(DO_BODY);
add(DOMINATE);
add(EVAL_TYPE);
add(FALSE_BODY);
add(FINALLY_BODY);
add(FOR_BODY);
add(FOR_INIT);
add(FOR_UPDATE);
add(IMPORTS);
add(INHERITS_FROM);
add(IS_CALL_FOR_IMPORT);
Expand All @@ -129,6 +163,8 @@ other words, there is a (name, signature) pair that can be resolved for the type
add(REF);
add(SOURCE_FILE);
add(TAGGED_BY);
add(TRUE_BODY);
add(TRY_BODY);
}};

}
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,19 @@ object GraphSchema extends flatgraph.Schema {
"CALL",
"CAPTURE",
"CAPTURED_BY",
"CATCH_BODY",
"CDG",
"CFG",
"CONDITION",
"CONTAINS",
"DOMINATE",
"DO_BODY",
"EVAL_TYPE",
"FALSE_BODY",
"FINALLY_BODY",
"FOR_BODY",
"FOR_INIT",
"FOR_UPDATE",
"IMPORTS",
"INHERITS_FROM",
"IS_CALL_FOR_IMPORT",
Expand All @@ -73,7 +80,9 @@ object GraphSchema extends flatgraph.Schema {
"RECEIVER",
"REF",
"SOURCE_FILE",
"TAGGED_BY"
"TAGGED_BY",
"TRUE_BODY",
"TRY_BODY"
)
val edgeKindByLabel = edgeLabels.zipWithIndex.toMap
val edgePropertyAllocators: Array[Int => Array[?]] = Array(
Expand All @@ -96,7 +105,16 @@ object GraphSchema extends flatgraph.Schema {
size => null,
size => null,
size => null,
size => Array.fill(size)("<empty>") /* label = REACHING_DEF, id = 19 */,
size => null,
size => null,
size => null,
size => null,
size => null,
size => null,
size => null,
size => Array.fill(size)("<empty>") /* label = REACHING_DEF, id = 26 */,
size => null,
size => null,
size => null,
size => null,
size => null,
Expand Down Expand Up @@ -156,12 +174,19 @@ object GraphSchema extends flatgraph.Schema {
(s, d, subseq, p) => new edges.Call(s, d, subseq, p),
(s, d, subseq, p) => new edges.Capture(s, d, subseq, p),
(s, d, subseq, p) => new edges.CapturedBy(s, d, subseq, p),
(s, d, subseq, p) => new edges.CatchBody(s, d, subseq, p),
(s, d, subseq, p) => new edges.Cdg(s, d, subseq, p),
(s, d, subseq, p) => new edges.Cfg(s, d, subseq, p),
(s, d, subseq, p) => new edges.Condition(s, d, subseq, p),
(s, d, subseq, p) => new edges.Contains(s, d, subseq, p),
(s, d, subseq, p) => new edges.Dominate(s, d, subseq, p),
(s, d, subseq, p) => new edges.DoBody(s, d, subseq, p),
(s, d, subseq, p) => new edges.EvalType(s, d, subseq, p),
(s, d, subseq, p) => new edges.FalseBody(s, d, subseq, p),
(s, d, subseq, p) => new edges.FinallyBody(s, d, subseq, p),
(s, d, subseq, p) => new edges.ForBody(s, d, subseq, p),
(s, d, subseq, p) => new edges.ForInit(s, d, subseq, p),
(s, d, subseq, p) => new edges.ForUpdate(s, d, subseq, p),
(s, d, subseq, p) => new edges.Imports(s, d, subseq, p),
(s, d, subseq, p) => new edges.InheritsFrom(s, d, subseq, p),
(s, d, subseq, p) => new edges.IsCallForImport(s, d, subseq, p),
Expand All @@ -171,7 +196,9 @@ object GraphSchema extends flatgraph.Schema {
(s, d, subseq, p) => new edges.Receiver(s, d, subseq, p),
(s, d, subseq, p) => new edges.Ref(s, d, subseq, p),
(s, d, subseq, p) => new edges.SourceFile(s, d, subseq, p),
(s, d, subseq, p) => new edges.TaggedBy(s, d, subseq, p)
(s, d, subseq, p) => new edges.TaggedBy(s, d, subseq, p),
(s, d, subseq, p) => new edges.TrueBody(s, d, subseq, p),
(s, d, subseq, p) => new edges.TryBody(s, d, subseq, p)
)
val nodePropertyAllocators: Array[Int => Array[?]] = Array(
size => new Array[String](size),
Expand Down Expand Up @@ -1450,7 +1477,7 @@ object GraphSchema extends flatgraph.Schema {
_newNodeInserters
}
override def getNumberOfNodeKinds: Int = 43
override def getNumberOfEdgeKinds: Int = 24
override def getNumberOfEdgeKinds: Int = 33
override def getNodeLabel(nodeKind: Int): String = nodeLabels(nodeKind)
override def getNodeKindByLabel(label: String): Int = nodeKindByLabel.getOrElse(label, flatgraph.Schema.UndefinedKind)
override def getEdgeLabel(nodeKind: Int, edgeKind: Int): String = edgeLabels(edgeKind)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,101 +64,157 @@ object CapturedBy {
class CapturedBy(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 7, subSeq_4862, property_4862) {}

object CatchBody {
val Label = "CATCH_BODY"

}

class CatchBody(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 8, subSeq_4862, property_4862) {}

object Cdg {
val Label = "CDG"

}

class Cdg(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 8, subSeq_4862, property_4862) {}
extends flatgraph.Edge(src_4762, dst_4762, 9, subSeq_4862, property_4862) {}

object Cfg {
val Label = "CFG"

}

class Cfg(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 9, subSeq_4862, property_4862) {}
extends flatgraph.Edge(src_4762, dst_4762, 10, subSeq_4862, property_4862) {}

object Condition {
val Label = "CONDITION"

}

class Condition(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 10, subSeq_4862, property_4862) {}
extends flatgraph.Edge(src_4762, dst_4762, 11, subSeq_4862, property_4862) {}

object Contains {
val Label = "CONTAINS"

}

class Contains(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 11, subSeq_4862, property_4862) {}
extends flatgraph.Edge(src_4762, dst_4762, 12, subSeq_4862, property_4862) {}

object Dominate {
val Label = "DOMINATE"

}

class Dominate(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 12, subSeq_4862, property_4862) {}
extends flatgraph.Edge(src_4762, dst_4762, 13, subSeq_4862, property_4862) {}

object DoBody {
val Label = "DO_BODY"

}

class DoBody(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 14, subSeq_4862, property_4862) {}

object EvalType {
val Label = "EVAL_TYPE"

}

class EvalType(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 13, subSeq_4862, property_4862) {}
extends flatgraph.Edge(src_4762, dst_4762, 15, subSeq_4862, property_4862) {}

object FalseBody {
val Label = "FALSE_BODY"

}

class FalseBody(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 16, subSeq_4862, property_4862) {}

object FinallyBody {
val Label = "FINALLY_BODY"

}

class FinallyBody(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 17, subSeq_4862, property_4862) {}

object ForBody {
val Label = "FOR_BODY"

}

class ForBody(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 18, subSeq_4862, property_4862) {}

object ForInit {
val Label = "FOR_INIT"

}

class ForInit(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 19, subSeq_4862, property_4862) {}

object ForUpdate {
val Label = "FOR_UPDATE"

}

class ForUpdate(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 20, subSeq_4862, property_4862) {}

object Imports {
val Label = "IMPORTS"

}

class Imports(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 14, subSeq_4862, property_4862) {}
extends flatgraph.Edge(src_4762, dst_4762, 21, subSeq_4862, property_4862) {}

object InheritsFrom {
val Label = "INHERITS_FROM"

}

class InheritsFrom(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 15, subSeq_4862, property_4862) {}
extends flatgraph.Edge(src_4762, dst_4762, 22, subSeq_4862, property_4862) {}

object IsCallForImport {
val Label = "IS_CALL_FOR_IMPORT"

}

class IsCallForImport(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 16, subSeq_4862, property_4862) {}
extends flatgraph.Edge(src_4762, dst_4762, 23, subSeq_4862, property_4862) {}

object ParameterLink {
val Label = "PARAMETER_LINK"

}

class ParameterLink(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 17, subSeq_4862, property_4862) {}
extends flatgraph.Edge(src_4762, dst_4762, 24, subSeq_4862, property_4862) {}

object PostDominate {
val Label = "POST_DOMINATE"

}

class PostDominate(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 18, subSeq_4862, property_4862) {}
extends flatgraph.Edge(src_4762, dst_4762, 25, subSeq_4862, property_4862) {}

object ReachingDef {
val Label = "REACHING_DEF"
val propertyName: Option[String] = Some("VARIABLE")
}

class ReachingDef(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 19, subSeq_4862, property_4862) {
extends flatgraph.Edge(src_4762, dst_4762, 26, subSeq_4862, property_4862) {
override def propertyName: Option[String] = ReachingDef.propertyName
}

Expand All @@ -168,28 +224,44 @@ object Receiver {
}

class Receiver(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 20, subSeq_4862, property_4862) {}
extends flatgraph.Edge(src_4762, dst_4762, 27, subSeq_4862, property_4862) {}

object Ref {
val Label = "REF"

}

class Ref(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 21, subSeq_4862, property_4862) {}
extends flatgraph.Edge(src_4762, dst_4762, 28, subSeq_4862, property_4862) {}

object SourceFile {
val Label = "SOURCE_FILE"

}

class SourceFile(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 22, subSeq_4862, property_4862) {}
extends flatgraph.Edge(src_4762, dst_4762, 29, subSeq_4862, property_4862) {}

object TaggedBy {
val Label = "TAGGED_BY"

}

class TaggedBy(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 23, subSeq_4862, property_4862) {}
extends flatgraph.Edge(src_4762, dst_4762, 30, subSeq_4862, property_4862) {}

object TrueBody {
val Label = "TRUE_BODY"

}

class TrueBody(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 31, subSeq_4862, property_4862) {}

object TryBody {
val Label = "TRY_BODY"

}

class TryBody(src_4762: flatgraph.GNode, dst_4762: flatgraph.GNode, subSeq_4862: Int, property_4862: Any)
extends flatgraph.Edge(src_4762, dst_4762, 32, subSeq_4862, property_4862) {}
Loading
Loading