MCPcopy Index your code
hub / github.com/antlr/codebuff / trace

Method trace

output/java8/1.4.15/Interpreter.java:1323–1343  ·  view source on GitHub ↗
(InstanceScope scope, int ip)

Source from the content-addressed store, hash-verified

1321 }
1322
1323 protected void trace(InstanceScope scope, int ip) {
1324 final ST self = scope.st;
1325 StringBuilder tr = new StringBuilder();
1326 BytecodeDisassembler dis = new BytecodeDisassembler(self.impl);
1327 StringBuilder buf = new StringBuilder();
1328 dis.disassembleInstruction(buf, ip);
1329 String name = self.impl.name+":";
1330 if ( Misc.referenceEquals(self.impl.name, ST.UNKNOWN_NAME) ) name = "";
1331 tr.append(String.format("%-40s", name+buf));
1332 tr.append("\tstack=[");
1333 for (int i = 0; i<=sp; i++) {
1334 Object o = operands[i];
1335 printForTrace(tr, scope, o);
1336 }
1337 tr.append(" ], calls=");
1338 tr.append(getEnclosingInstanceStackString(scope));
1339 tr.append(", sp="+sp+", nw="+nwline);
1340 String s = tr.toString();
1341 if ( debug ) executeTrace.add(s);
1342 if ( trace ) System.out.println(s);
1343 }
1344
1345 protected void printForTrace(StringBuilder tr, InstanceScope scope, Object o) {
1346 if ( o instanceof ST ) {

Callers 1

_execMethod · 0.95

Calls 8

referenceEqualsMethod · 0.95
printForTraceMethod · 0.95
toStringMethod · 0.65
addMethod · 0.65
appendMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected