compileTypeConversion(oper1.getType(), type, mv, compileContext);
// plant a goto skipping over the else expression
mv.visitJumpInsn(Opcodes.GOTO, endLabel);
// check the stack height is what we expect, either 1 or 2 words depending upon the result type
if (compileContext.getStackCount() != currentStack + expected) {
throw new CompileException("ConditionalEvalExpression.compile : invalid true branch stack height " + compileContext.getStackCount() + " expecting " + currentStack + expected);
}
// ok, now reset stack height for false branch
compileContext.addStackCount(-expected);
// else starts here
mv.visitLabel(elseLabel);
// compile the else branch
oper2.compile(mv, compileContext);
// make sure we type convert to our result type so that either branch stacks the same thing
compileTypeConversion(oper2.getType(), type, mv, compileContext);
// the end is nigh
mv.visitLabel(endLabel);
// check the stack height is what we expect, either 1 or 2 words depending upon the result type
if (compileContext.getStackCount() != currentStack + expected) {
throw new CompileException("ConditionalEvalExpression.compile : invalid false branch stack height " + compileContext.getStackCount() + " expecting " + currentStack + expected);
}
// no need to check max stack height as teh left and right expressions will have exceeded anything
// we stacked inside this call
}