Skip to content

Commit

Permalink
[dbg] Enrich text output for Unimplemented exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
zakkak committed May 17, 2018
1 parent 6a383d0 commit e1a09eb
Show file tree
Hide file tree
Showing 28 changed files with 82 additions and 67 deletions.
Expand Up @@ -51,7 +51,7 @@ public BitRangeOrder bitRangeEndianness() {

@Override
protected List<RiscTemplate> createTemplates() {
assert false : "Unimplemented";
assert false : "Unimplemented T1X createTemplates";
final RiscTemplateCreator creator = new RiscTemplateCreator();
return creator.templates();
}
Expand Down
Expand Up @@ -463,7 +463,7 @@ CiFrame decodeFrame(DecodingStream in, int fpt, int frameIndex, FrameAccess fa,
} else if (platform().isa == ISA.ARM) {
fp = ARMV7.r13;
} else {
throw FatalError.unimplemented();
throw FatalError.unimplemented("com.oracle.max.vm.ext.maxri.DebugInfo.decodeFrame");
}
final int offsetInFrame = ss.index() * target().spillSlotSize;
if (ss.inCallerFrame()) {
Expand Down Expand Up @@ -657,7 +657,7 @@ private int retrieveDataFromDebugInfo(int safepointIndex,
retrievedData = memberIndex;
break;
default:
FatalError.unimplemented();
FatalError.unimplemented("com.oracle.max.vm.ext.maxri.DebugInfo.retrieveDataFromDebugInfo");
}
return retrievedData;
}
Expand Down
Expand Up @@ -240,7 +240,7 @@ public String disassemble(CiTargetMethod ciTM, MaxTargetMethod maxTM) {
fp = Aarch64.fp;
refMapToFPOffset = 0;
} else {
throw FatalError.unimplemented();
throw FatalError.unimplemented("com.oracle.max.vm.ext.maxri.MaxRuntime.disassemble(com.sun.cri.ci.CiTargetMethod, com.oracle.max.vm.ext.maxri.MaxTargetMethod)");
}
RefMapFormatter slotFormatter = new RefMapFormatter(target().arch, target().spillSlotSize, fp, refMapToFPOffset);
for (Safepoint safepoint : ciTM.safepoints) {
Expand Down
Expand Up @@ -274,7 +274,7 @@ public static Object createOutOfBoundsException(int index) {

@MAX_RUNTIME_ENTRYPOINT(runtimeCall = CiRuntimeCall.GenericCallback)
public static Object genericCallback(CiGenericCallback cb, Object arg) {
throw FatalError.unimplemented();
throw FatalError.unimplemented("com.oracle.max.vm.ext.maxri.MaxRuntimeCalls.genericCallback");
}

@HOSTED_ONLY
Expand Down
Expand Up @@ -192,7 +192,7 @@ public VMFrameLayout frameLayout() {
} else if (platform().isa == ISA.ARM) {
return ARMTargetMethodUtil.frameLayout(this);
} else {
throw FatalError.unimplemented();
throw FatalError.unimplemented("com.oracle.max.vm.ext.maxri.MaxTargetMethod.frameLayout");
}
}

Expand Down Expand Up @@ -243,7 +243,7 @@ public boolean isPatchableCallSite(CodePointer callSite) {
} else if (platform().target.arch.isAarch64()) {
return Aarch64TargetMethodUtil.isPatchableCallSite(callSite);
} else {
throw FatalError.unimplemented();
throw FatalError.unimplemented("com.oracle.max.vm.ext.maxri.MaxTargetMethod.isPatchableCallSite");
}
}

Expand All @@ -256,7 +256,7 @@ public CodePointer fixupCallSite(int callOffset, CodePointer callEntryPoint) {
} else if (platform().target.arch.isAarch64()) {
return Aarch64TargetMethodUtil.fixupCall32Site(this, callOffset, callEntryPoint);
} else {
throw FatalError.unimplemented();
throw FatalError.unimplemented("com.oracle.max.vm.ext.maxri.MaxTargetMethod.fixupCallSite");
}
}

Expand All @@ -267,7 +267,7 @@ public CodePointer patchCallSite(int callOffset, CodePointer callEntryPoint) {
} else if (platform().isa == ISA.ARM) {
return ARMTargetMethodUtil.mtSafePatchCallDisplacement(this, codeAt(callOffset), callEntryPoint);
} else {
throw FatalError.unimplemented();
throw FatalError.unimplemented("com.oracle.max.vm.ext.maxri.MaxTargetMethod.patchCallSite");
}
}

Expand All @@ -286,7 +286,7 @@ public void redirectTo(TargetMethod tm) {
}
FatalError.check(Stubs.isJumpToStaticTrampoline(this), "sanity check");
} else {
throw FatalError.unimplemented();
throw FatalError.unimplemented("com.oracle.max.vm.ext.maxri.MaxTargetMethod.redirectTo");
}
}

Expand Down Expand Up @@ -761,7 +761,7 @@ public boolean acceptStackFrameVisitor(StackFrameCursor current, StackFrameVisit
} else if (platform().isa == ISA.ARM) {
return ARMTargetMethodUtil.acceptStackFrameVisitor(current, visitor);
}
throw FatalError.unimplemented();
throw FatalError.unimplemented("acceptStackFrameVisitor");
}

/**
Expand All @@ -787,7 +787,7 @@ public void advance(StackFrameCursor current) {
}
ARMTargetMethodUtil.advance(current, csl, csa);
} else {
throw FatalError.unimplemented();
throw FatalError.unimplemented("com.oracle.max.vm.ext.maxri.MaxTargetMethod.advance");
}
}

Expand All @@ -798,7 +798,7 @@ public Pointer returnAddressPointer(StackFrameCursor frame) {
} else if (platform().isa == ISA.ARM) {
return ARMTargetMethodUtil.returnAddressPointer(frame);
} else {
throw FatalError.unimplemented();
throw FatalError.unimplemented("com.oracle.max.vm.ext.maxri.MaxTargetMethod.returnAddressPointer");
}
}

Expand Down
Expand Up @@ -546,7 +546,7 @@ public XirSnippet genNewMultiArray(XirSite site, XirArgument[] lengths, RiType t
return new XirSnippet(multiNewArrayTemplate[rank].unresolved, Utils.concat(lengths, guard));
}
if (rank >= multiNewArrayTemplate.length) {
FatalError.unimplemented();
FatalError.unimplemented("com.oracle.max.vm.ext.maxri.MaxXirGenerator.genNewMultiArray");
}
XirArgument hub = XirArgument.forObject(hubFor(type));
return new XirSnippet(multiNewArrayTemplate[rank].resolved, Utils.concat(lengths, hub));
Expand Down
Expand Up @@ -393,7 +393,7 @@ public boolean isPatchableCallSite(CodePointer callSite) {
} else if (isARM()) {
return ARMTargetMethodUtil.isPatchableCallSite(callSite);
} else {
throw FatalError.unimplemented();
throw FatalError.unimplemented("com.oracle.max.vm.ext.t1x.T1XTargetMethod.isPatchableCallSite");
}
}

Expand All @@ -404,7 +404,7 @@ public CodePointer fixupCallSite(int callOffset, CodePointer callEntryPoint) {
} else if (isARM()) {
return ARMTargetMethodUtil.fixupCall32Site(this, callOffset, callEntryPoint);
} else {
throw FatalError.unimplemented();
throw FatalError.unimplemented("com.oracle.max.vm.ext.t1x.T1XTargetMethod.fixupCallSite");
}
}

Expand Down Expand Up @@ -445,7 +445,7 @@ public CodePointer patchCallSite(int callOffset, CodePointer callEntryPoint) {
} else if (isARM()) {
return ARMTargetMethodUtil.mtSafePatchCallDisplacement(this, codeAt(callOffset), callEntryPoint);
} else {
throw FatalError.unimplemented();
throw FatalError.unimplemented("com.oracle.max.vm.ext.t1x.T1XTargetMethod.patchCallSite");
}
}

Expand Down
Expand Up @@ -314,32 +314,32 @@ protected void assignDouble(CiRegister dst, double value) {

@Override
protected int callDirect() {
assert false : "Unimplemented";
assert false : "Unimplemented T1X callDirect";
return 0;
// XXX Implement me
}

@Override
protected int callDirect(int receiverStackIndex) {
assert false : "Unimplemented";
assert false : "Unimplemented T1X callDirect";
return 0;
}

@Override
protected int callIndirect(CiRegister target, int receiverStackIndex) {
assert false : "Unimplemented";
assert false : "Unimplemented T1X callIndirect";
return 0;
// XXX Implement me
}

@Override
protected void nullCheck(CiRegister src) {
assert false : "Unimplemented";
assert false : "Unimplemented T1X nullCheck";
// XXX Implement me
}

private void alignDirectCall(int callPos) {
assert false : "Unimplemented";
assert false : "Unimplemented T1X alignDirectCall";
// XXX Implement me
}

Expand Down
Expand Up @@ -273,7 +273,7 @@ public static class BootstrapMethodsAttribute extends Attribute {

@Override
protected void writeData(ClassfileWriter cf) throws IOException {
throw FatalError.unimplemented();
throw FatalError.unimplemented("com.sun.max.vm.classfile.ClassfileWriter.BootstrapMethodsAttribute.writeData");
// cf.writeUnsigned2(bootstrapMethods.length);
// for (BootstrapMethod bootstrapMethod : bootstrapMethods) {
// cf.writeUnsigned2(bootstrapMethod.bootstrapMethodRef);
Expand Down
Expand Up @@ -231,7 +231,7 @@ assert validCodeAddress(callTarget) : "invalid call target (address) in direct c
assert actualCallee != null && validEntryPoint(callTarget, actualCallee) : "invalid entry point in direct call from " + targetMethod + "@" + spi + " -> " + actualCallee +
" (target: " + callTarget.to0xHexString() + ")";
} else {
throw FatalError.unimplemented();
throw FatalError.unimplemented("com.sun.max.vm.code.CodeCacheValidation.validateDirectCallsOf");
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions com.oracle.max.vm/src/com/sun/max/vm/code/CodeEviction.java
Expand Up @@ -295,7 +295,7 @@ static boolean invalidateCode(byte[] code) {
byte int3 = (byte) 0xcc;
Arrays.fill(code, int3);
} else {
throw FatalError.unimplemented();
throw FatalError.unimplemented("com.sun.max.vm.code.CodeEviction.invalidateCode");
}
return true;
}
Expand Down Expand Up @@ -387,7 +387,7 @@ public boolean doTargetMethod(TargetMethod targetMethod) {
} else if (platform().isa == ISA.ARM) {
target = ARMTargetMethodUtil.readCall32Target(targetMethod, callPos);
} else {
throw FatalError.unimplemented();
throw FatalError.unimplemented("com.sun.max.vm.code.CodeEviction.BaselineFixCalls.doTargetMethod");
}

final CodePointer itarget = target.minus(delta);
Expand Down Expand Up @@ -442,7 +442,7 @@ public boolean doTargetMethod(TargetMethod targetMethod) {
} else if (platform().isa == ISA.ARM) {
target = ARMTargetMethodUtil.readCall32Target(targetMethod, callPos);
} else {
throw FatalError.unimplemented();
throw FatalError.unimplemented("com.sun.max.vm.code.CodeEviction.OptFixCalls.doTargetMethod");
}
if (CodeManager.runtimeBaselineCodeRegion.isInFromSpace(target.toAddress())) {
if (!haveLoggedMethod) {
Expand Down Expand Up @@ -850,7 +850,7 @@ private int patchDirectCallsIn(TargetMethod tm) {
} else if (platform().isa == ISA.ARM) {
target = ARMTargetMethodUtil.readCall32Target(tm, callPos);
} else {
throw FatalError.unimplemented();
throw FatalError.unimplemented("com.sun.max.vm.code.CodeEviction.patchDirectCallsIn");
}
final TargetMethod callee = target.toTargetMethod();
assert callee != null : "callee should not be null in " + tm + "@" + callPos + " " + target.to0xHexString();
Expand Down Expand Up @@ -1045,7 +1045,7 @@ public boolean doTargetMethod(TargetMethod targetMethod) {
} else if (platform().isa == ISA.ARM) {
target = ARMTargetMethodUtil.readCall32Target(targetMethod, callPos);
} else {
throw FatalError.unimplemented();
throw FatalError.unimplemented("com.sun.max.vm.code.CodeEviction.DumpDirectCalls.doTargetMethod");
}
final TargetMethod callee = target.toTargetMethod();
assert callee != null : "callee should not be null in " + targetMethod + "@" + callPos + "->" + target.to0xHexString();
Expand Down
Expand Up @@ -961,7 +961,7 @@ public boolean visitFrame(StackFrameCursor current, StackFrameCursor callee) {
}
return true;
}
throw FatalError.unimplemented();
throw FatalError.unimplemented("com.sun.max.vm.compiler.CompilationBroker.DirectCallPatcher.visitFrame");
}
}

Expand Down
Expand Up @@ -687,7 +687,7 @@ public static void patchReturnAddress(StackFrameCursor caller, StackFrameCursor
if (platform().isa == ISA.AMD64) {
to = to.plus(AMD64TargetMethodUtil.RIP_CALL_INSTRUCTION_SIZE);
} else {
throw FatalError.unimplemented();
throw FatalError.unimplemented("com.sun.max.vm.compiler.deopt.Deoptimization.patchReturnAddress");
}
}
patch.writeWord(0, to.toAddress());
Expand Down
Expand Up @@ -379,7 +379,7 @@ public static RegisterConfigs create() {
return new RegisterConfigs(standard, n2j, trampoline, template, compilerStub, uncommonTrapStub, trapStub);
}
} else {
throw FatalError.unimplemented();
throw FatalError.unimplemented("com.sun.max.vm.compiler.target.RegisterConfigs.create");
}
return null;
}
Expand Down
Expand Up @@ -385,7 +385,7 @@ public static int safepointPosForCall(int callPos, int callSize) {
if (platform().isa == ISA.AMD64 || platform().isa == ISA.ARM || platform().isa == ISA.Aarch64) {
return callPos + callSize;
} else {
throw FatalError.unimplemented();
throw FatalError.unimplemented("com.sun.max.vm.compiler.target.Safepoints.safepointPosForCall");
}
}

Expand Down
12 changes: 6 additions & 6 deletions com.oracle.max.vm/src/com/sun/max/vm/compiler/target/Stub.java
Expand Up @@ -141,7 +141,7 @@ public static boolean isDeoptStubEntry(Pointer ip, TargetMethod tm, StackFrameCu
// Take into account return address adjustment in static trampoline
return ip.asPointer().equals(tm.codeStart().plus(AMD64TargetMethodUtil.RIP_CALL_INSTRUCTION_SIZE));
}
throw FatalError.unimplemented();
throw FatalError.unimplemented("com.sun.max.vm.compiler.target.Stub.isDeoptStubEntry");
}
return ip.asPointer().equals(tm.codeStart());
} else {
Expand Down Expand Up @@ -226,7 +226,7 @@ public Pointer returnAddressPointer(StackFrameCursor frame) {
} else if (platform().isa == ISA.ARM) {
return ARMTargetMethodUtil.returnAddressPointer(frame);
} else {
throw FatalError.unimplemented();
throw FatalError.unimplemented("com.sun.max.vm.compiler.target.Stub.returnAddressPointer");
}
}

Expand All @@ -249,7 +249,7 @@ public void advance(StackFrameCursor current) {
}
ARMTargetMethodUtil.advance(current, csl, csa);
} else {
throw FatalError.unimplemented();
throw FatalError.unimplemented("com.sun.max.vm.compiler.target.Stub.advance");
}
}

Expand All @@ -261,7 +261,7 @@ public boolean acceptStackFrameVisitor(StackFrameCursor current, StackFrameVisit
} else if (platform().isa == ISA.ARM) {
return ARMTargetMethodUtil.acceptStackFrameVisitor(current, visitor);
} else {
throw FatalError.unimplemented();
throw FatalError.unimplemented("com.sun.max.vm.compiler.target.Stub.acceptStackFrameVisitor");
}
}

Expand All @@ -272,7 +272,7 @@ public VMFrameLayout frameLayout() {
} else if (platform().isa == ISA.ARM) {
return ARMTargetMethodUtil.frameLayout(this);
} else {
throw FatalError.unimplemented();
throw FatalError.unimplemented("com.sun.max.vm.compiler.target.Stub.frameLayout");
}
}

Expand Down Expand Up @@ -300,7 +300,7 @@ public CodePointer fixupCallSite(int callOffset, CodePointer callEntryPoint) {
} else if (platform().isa == ISA.Aarch64) {
return Aarch64TargetMethodUtil.fixupCall32Site(this, callOffset, callEntryPoint);
} else {
throw FatalError.unimplemented();
throw FatalError.unimplemented("com.sun.max.vm.compiler.target.Stub.fixupCallSite");
}
}

Expand Down

0 comments on commit e1a09eb

Please sign in to comment.