1 package org.simantics.scl.runtime.profiling;
3 public class BranchPoint {
4 public static final BranchPoint[] EMPTY_ARRAY = new BranchPoint[0];
6 private final long location;
7 private final int codeSize;
8 private final BranchPoint[] children;
10 public int visitCounter;
12 public BranchPoint(long location, int codeSize, BranchPoint[] children) {
13 this.location = location;
14 this.codeSize = codeSize;
15 this.children = children;
18 public void resetVisitCountersRecursively() {
20 for(BranchPoint branchPoint : getChildren())
21 branchPoint.resetVisitCountersRecursively();
24 public long getLocation() {
28 public int getCodeSize() {
32 public int getVisitCounter() {
36 public void incrementVisitCounter(int amount) {
37 visitCounter = visitCounter + amount;
40 public BranchPoint[] getChildren() {
45 public String toString() {
46 StringBuilder sb = new StringBuilder();
47 sb.append("BP[visitCounter=").append(visitCounter).append(", codeSize=").append(codeSize).append(", location=").append(location);
48 if (children.length > 0)
49 sb.append(", children=").append(children.length);