Minor: calleeContainingClass -> thisOrOuterClass
This commit is contained in:
@@ -2615,40 +2615,40 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public StackValue generateThisOrOuter(@NotNull ClassDescriptor calleeContainingClass, boolean isSuper, boolean forceOuter) {
|
public StackValue generateThisOrOuter(@NotNull ClassDescriptor thisOrOuterClass, boolean isSuper, boolean forceOuter) {
|
||||||
if (!calleeContainingClass.getKind().isSingleton()) {
|
if (!thisOrOuterClass.getKind().isSingleton()) {
|
||||||
return generateThisOrOuterFromContext(calleeContainingClass, isSuper, forceOuter);
|
return generateThisOrOuterFromContext(thisOrOuterClass, isSuper, forceOuter);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (calleeContainingClass.equals(context.getThisDescriptor()) &&
|
if (thisOrOuterClass.equals(context.getThisDescriptor()) &&
|
||||||
!CodegenUtilKt.isJvmStaticInObjectOrClass(context.getFunctionDescriptor())) {
|
!CodegenUtilKt.isJvmStaticInObjectOrClass(context.getFunctionDescriptor())) {
|
||||||
return StackValue.local(0, typeMapper.mapType(calleeContainingClass));
|
return StackValue.local(0, typeMapper.mapType(thisOrOuterClass));
|
||||||
}
|
}
|
||||||
else if (shouldGenerateSingletonAsThisOrOuterFromContext(calleeContainingClass)) {
|
else if (shouldGenerateSingletonAsThisOrOuterFromContext(thisOrOuterClass)) {
|
||||||
return generateThisOrOuterFromContext(calleeContainingClass, isSuper, forceOuter);
|
return generateThisOrOuterFromContext(thisOrOuterClass, isSuper, forceOuter);
|
||||||
}
|
}
|
||||||
else if (isEnumEntry(calleeContainingClass)) {
|
else if (isEnumEntry(thisOrOuterClass)) {
|
||||||
return StackValue.enumEntry(calleeContainingClass, typeMapper);
|
return StackValue.enumEntry(thisOrOuterClass, typeMapper);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return StackValue.singleton(calleeContainingClass, typeMapper);
|
return StackValue.singleton(thisOrOuterClass, typeMapper);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private StackValue generateThisOrOuterFromContext(@NotNull ClassDescriptor calleeContainingClass, boolean isSuper, boolean forceOuter) {
|
private StackValue generateThisOrOuterFromContext(@NotNull ClassDescriptor thisOrOuterClass, boolean isSuper, boolean forceOuter) {
|
||||||
CodegenContext cur = context;
|
CodegenContext cur = context;
|
||||||
Type type = asmType(calleeContainingClass.getDefaultType());
|
Type type = asmType(thisOrOuterClass.getDefaultType());
|
||||||
StackValue result = StackValue.local(0, type);
|
StackValue result = StackValue.local(0, type);
|
||||||
boolean inStartConstructorContext = cur instanceof ConstructorContext;
|
boolean inStartConstructorContext = cur instanceof ConstructorContext;
|
||||||
while (cur != null) {
|
while (cur != null) {
|
||||||
ClassDescriptor thisDescriptor = cur.getThisDescriptor();
|
ClassDescriptor thisDescriptor = cur.getThisDescriptor();
|
||||||
|
|
||||||
if (!isSuper && thisDescriptor == calleeContainingClass) {
|
if (!isSuper && thisDescriptor == thisOrOuterClass) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!forceOuter && isSuper && DescriptorUtils.isSubclass(thisDescriptor, calleeContainingClass)) {
|
if (!forceOuter && isSuper && DescriptorUtils.isSubclass(thisDescriptor, thisOrOuterClass)) {
|
||||||
return castToRequiredTypeOfInterfaceIfNeeded(result, thisDescriptor, calleeContainingClass);
|
return castToRequiredTypeOfInterfaceIfNeeded(result, thisDescriptor, thisOrOuterClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
forceOuter = false;
|
forceOuter = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user