Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 3.0.1
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
ExtremeAssertions configs are failing to build with the following stacktrace:
Instruction EG call t181a(Lorg/jikesrvm/runtime/ReflectionBase
LR = <unused>, virtual"< BootstrapCL, Lorg/jikesrvm/classloader/RVMMethod; >.getInvoker ()Lor\
g/jikesrvm/runtime/ReflectionBase;", <unused>, <null> JTOC improperly accessed as NullCheck
Error compiling method: < BootstrapCL, Ljava/lang/Class; >.getDeclaredMethod (Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
org.jikesrvm.compilers.opt.OptimizingCompilerException
at org.jikesrvm.compilers.opt.ir.InstructionFormat.fail(InstructionFormat.java:340)
at org.jikesrvm.compilers.opt.ir.NullCheck.getClearGuardResult(NullCheck.java:64)
at org.jikesrvm.compilers.opt.Simplifier.call(Simplifier.java:3187)
at org.jikesrvm.compilers.opt.Simplifier.simplify(Simplifier.java:525)
at org.jikesrvm.compilers.opt.bc2ir.BC2IR._callHelper(BC2IR.java:2836)
at org.jikesrvm.compilers.opt.bc2ir.BC2IR.generateFrom(BC2IR.java:1821)
at org.jikesrvm.compilers.opt.bc2ir.BC2IR.generateHIR(BC2IR.java:379)
at org.jikesrvm.compilers.opt.bc2ir.BC2IR.generateHIR(BC2IR.java:177)
at org.jikesrvm.compilers.opt.inlining.Inliner.execute(Inliner.java:443)
at org.jikesrvm.compilers.opt.bc2ir.BC2IR.maybeInlineMethod(BC2IR.java:4655)
at org.jikesrvm.compilers.opt.bc2ir.BC2IR.generateFrom(BC2IR.java:1928)
at org.jikesrvm.compilers.opt.bc2ir.BC2IR.generateHIR(BC2IR.java:364)
at org.jikesrvm.compilers.opt.bc2ir.BC2IR.generateHIR(BC2IR.java:177)
at org.jikesrvm.compilers.opt.inlining.Inliner.execute(Inliner.java:443)
at org.jikesrvm.compilers.opt.bc2ir.BC2IR.maybeInlineMethod(BC2IR.java:4655)
at org.jikesrvm.compilers.opt.bc2ir.BC2IR.generateFrom(BC2IR.java:1976)
at org.jikesrvm.compilers.opt.bc2ir.BC2IR.generateHIR(BC2IR.java:379)
at org.jikesrvm.compilers.opt.bc2ir.BC2IR.generateHIR(BC2IR.java:177)
at org.jikesrvm.compilers.opt.bc2ir.ConvertBCtoHIR.perform(ConvertBCtoHIR.java:36)
at org.jikesrvm.compilers.opt.driver.CompilerPhase.performPhase(CompilerPhase.java:205)
at org.jikesrvm.compilers.opt.driver.OptimizationPlanAtomicElement.perform(OptimizationPlanAtomicElement.java:89)
at org.jikesrvm.compilers.opt.driver.OptimizationPlanCompositeElement.perform(OptimizationPlanCompositeElement.java:143)
at org.jikesrvm.compilers.opt.driver.CompilationPlan.execute(CompilationPlan.java:131)
at org.jikesrvm.compilers.opt.driver.OptimizingCompiler.compile(OptimizingCompiler.java:224)
at org.jikesrvm.compilers.opt.driver.OptimizingBootImageCompiler.compileMethod(OptimizingBootImageCompiler.java:119)
at org.jikesrvm.compilers.common.BootImageCompiler.compile(BootImageCompiler.java:62)
at org.jikesrvm.compilers.common.BootImageCompiler.compile(BootImageCompiler.java:66)
at org.jikesrvm.classloader.NormalMethod.genCode(NormalMethod.java:173)
at org.jikesrvm.classloader.RVMMethod.compile(RVMMethod.java:708)
at org.jikesrvm.classloader.RVMMethod.getCurrentEntryCodeArray(RVMMethod.java:692)
at org.jikesrvm.classloader.RVMClass.instantiate(RVMClass.java:1980)
at org.jikesrvm.tools.bootImageWriter.BootImageWorker.run(BootImageWorker.java:44)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
at java.lang.Thread.run(Thread.java:810)
Looking at the code in question, the immediate problem is that Call doesn't have a GuardResult. But this isn't the real problem. The whole clause calleeThis.isNullConstant is non-sensical. Calls are guarded by explicit NULL_CHECK operations so if calleeThis is a nullConstant, then this is already dead code, or the IR is wrong for some other reason (guard not properly connected or otherwise malformed).
private static DefUseEffect call(boolean HIR, AbstractRegisterPool regpool, Instruction s) {
if (CF_FIELDS) {
MethodOperand methOp = Call.getMethod(s);
if (methOp == null) {
return DefUseEffect.UNCHANGED;
}
if (methOp.isVirtual() && !methOp.hasPreciseTarget()) {
Operand calleeThis = Call.getParam(s, 0);
if (calleeThis.isNullConstant()) {
Trap.mutate(s, TRAP, NullCheck.getClearGuardResult(s), TrapCodeOperand.NullPtr());
return DefUseEffect.TRAP_REDUCED;
} else if (calleeThis.isConstant() || calleeThis.asRegister().isPreciseType()) {
TypeReference calleeClass = calleeThis.getType();
if (calleeClass.isResolved()) {
methOp.refine(calleeClass.peekType());
return DefUseEffect.UNCHANGED;
}
}
} else if (methOp.isStatic() && methOp.hasPreciseTarget() && HIR) {
Fixed in r14940.