package bfrc.java.jit;

import java.util.Arrays;

@SuppressWarnings("serial")
class Trace extends Throwable {

	public Trace(int blockID) {
		super("compile block " + blockID);

		// just print calls inside the JIT
		StackTraceElement[] stack = getStackTrace();

		int end = 1; // skip JITBackend.compile
		while (!stack[end++].getMethodName().equals("work"))
			;
		end--;

		StackTraceElement[] newStack = Arrays.copyOfRange(stack, 1, end);
		setStackTrace(newStack);
	}
}

@@ -328,14 +328,13 @@
 .get
-Method
+Class
 Name
@@ -347,14 +347,34 @@
 als(
-%22work%22
+JITBackend.class.getName()
 ))%0A%09

make JIT Trace refactoring-safe