use of org.graalvm.compiler.bytecode.Bytecode in project graal by oracle.
the class GraphUtil method approxSourceStackTraceElement.
/**
* Gets an approximate source code location for frame state.
*
* @return the StackTraceElements if an approximate source location is found, null otherwise
*/
public static StackTraceElement[] approxSourceStackTraceElement(FrameState frameState) {
ArrayList<StackTraceElement> elements = new ArrayList<>();
FrameState state = frameState;
while (state != null) {
Bytecode code = state.getCode();
if (code != null) {
elements.add(code.asStackTraceElement(state.bci - 1));
}
state = state.outerFrameState();
}
return elements.toArray(new StackTraceElement[0]);
}
use of org.graalvm.compiler.bytecode.Bytecode in project graal by oracle.
the class ClassfileBytecodeProviderTest method checkMethod.
private static void checkMethod(ClassfileBytecodeProvider cbp, MetaAccessProvider metaAccess, Executable executable) {
ResolvedJavaMethod method = metaAccess.lookupJavaMethod(executable);
if (method.hasBytecodes()) {
ResolvedJavaMethodBytecode expected = new ResolvedJavaMethodBytecode(method);
Bytecode actual = getBytecode(cbp, method);
new BytecodeComparer(expected, actual).compare();
}
}
Aggregations