return generateReturn(varExpression, variableContext);
}
// Is e a conditional op (if <cond expr> <then expr> <else expr>)?
// Since this is the top level compilation scheme we can generate an actual 'if' statement.
CondTuple conditionExpressions = CondTuple.isCondOp(e);
if (conditionExpressions != null) {
if (codeGenerationStats != null) {
codeGenerationStats.incrementOptimizedIfThenElse();
}
// This is a conditional op. The conditionExpressions tuple holds (kCond, kThen, kElse) expressions
// Generate the code for kThen and kElse, as arguments to a new I_Cond instruction
Expression condExpression = conditionExpressions.getConditionExpression();
ExpressionContextPair pair = generateUnboxedArgument(JavaTypeName.BOOLEAN, condExpression, variableContext);
// Then
variableContext.pushJavaScope();
JavaStatement thenPart = genS_R (conditionExpressions.getThenExpression(), variableContext);
Block thenBlock = variableContext.popJavaScope();
thenBlock.addStatement(thenPart);
// Else
variableContext.pushJavaScope();
JavaStatement elsePart = genS_R (conditionExpressions.getElseExpression(), variableContext);
Block elseBlock = variableContext.popJavaScope();
elseBlock.addStatement(elsePart);
JavaExpression conditionExpression = pair.getJavaExpression();