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

Method trace

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

Source from the content-addressed store, hash-verified

1349 }
1350
1351 protected void trace(InstanceScope scope, int ip) {
1352 final ST self = scope.st;
1353 StringBuilder tr = new StringBuilder();
1354 BytecodeDisassembler dis = new BytecodeDisassembler(self.impl);
1355 StringBuilder buf = new StringBuilder();
1356 dis.disassembleInstruction(buf, ip);
1357 String name = self.impl.name+":";
1358 if ( Misc.referenceEquals(self.impl.name, ST.UNKNOWN_NAME) ) name = "";
1359 tr.append(String.format("%-40s", name+buf));
1360 tr.append("\tstack=[");
1361 for (int i = 0; i<= sp; i++) {
1362 Object o = operands[i];
1363 printForTrace(tr, scope, o);
1364 }
1365 tr.append(" ], calls=");
1366 tr.append(getEnclosingInstanceStackString(scope));
1367 tr.append(", sp="+sp+", nw="+nwline);
1368 String s = tr.toString();
1369 if ( debug ) executeTrace.add(s);
1370 if ( trace ) System.out.println(s);
1371 }
1372
1373 protected void printForTrace(StringBuilder tr, InstanceScope scope, Object o) {
1374 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