Code block reorganization

This commit is contained in:
Mikhael Bogdanov
2013-10-30 15:35:15 +04:00
parent 318214b9d7
commit 10396b853a
@@ -2269,16 +2269,18 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
Type type = asmType(calleeContainingClass.getDefaultType());
StackValue result = StackValue.local(0, type);
while (cur != null) {
ClassDescriptor thisDescriptor = cur.getThisDescriptor();
if (!isSuper && thisDescriptor.equals(calleeContainingClass)
|| isSuper && DescriptorUtils.isSubclass(thisDescriptor, calleeContainingClass)) {
return castToRequiredTypeOfInterfaceIfNeeded(result, thisDescriptor, calleeContainingClass);
}
if (cur instanceof MethodContext && !(cur instanceof ConstructorContext)) {
cur = cur.getParentContext();
}
assert cur != null;
ClassDescriptor thisDescriptor = cur.getThisDescriptor();
if (!isSuper && thisDescriptor.equals(calleeContainingClass)
|| isSuper && DescriptorUtils.isSubclass(thisDescriptor, calleeContainingClass)) {
return castToRequiredTypeOfInterfaceIfNeeded(result, thisDescriptor, calleeContainingClass);
}
result = cur.getOuterExpression(result, false);