MCPcopy Create free account
hub / github.com/antlr/codebuff / trace

Method trace

output/java8/1.4.16/Interpreter.java:1327–1347  ·  view source on GitHub ↗
(InstanceScope scope, int ip)

Source from the content-addressed store, hash-verified

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