Inline StackValueWithSimpleReceiver utility constructor

This commit is contained in:
Michael Bogdanov
2014-11-19 17:10:22 +03:00
parent fad64faabb
commit 21d5785986
@@ -748,7 +748,7 @@ public abstract class StackValue {
private final Type type; private final Type type;
public ArrayElement(Type type, StackValue array, StackValue index) { public ArrayElement(Type type, StackValue array, StackValue index) {
super(type, false, false, new Receiver(Type.LONG_TYPE, array, index)); super(type, false, false, new Receiver(Type.LONG_TYPE, array, index), true);
this.type = type; this.type = type;
} }
@@ -984,7 +984,7 @@ public abstract class StackValue {
ExpressionCodegen codegen, ExpressionCodegen codegen,
GenerationState state GenerationState state
) { ) {
super(type, false, false, collectionElementReceiver); super(type, false, false, collectionElementReceiver, true);
this.resolvedGetCall = resolvedGetCall; this.resolvedGetCall = resolvedGetCall;
this.resolvedSetCall = resolvedSetCall; this.resolvedSetCall = resolvedSetCall;
this.state = state; this.state = state;
@@ -1115,7 +1115,7 @@ public abstract class StackValue {
@Nullable String fieldName, @NotNull Type type, @NotNull GenerationState state, @Nullable String fieldName, @NotNull Type type, @NotNull GenerationState state,
@NotNull StackValue receiver @NotNull StackValue receiver
) { ) {
super(type, isStatic(isStaticBackingField, getter), isStatic(isStaticBackingField, setter), receiver); super(type, isStatic(isStaticBackingField, getter), isStatic(isStaticBackingField, setter), receiver, true);
this.backingFieldOwner = backingFieldOwner; this.backingFieldOwner = backingFieldOwner;
this.getter = getter; this.getter = getter;
this.setter = setter; this.setter = setter;
@@ -1462,15 +1462,6 @@ public abstract class StackValue {
this.isStaticStore = isStaticStore; this.isStaticStore = isStaticStore;
} }
public StackValueWithSimpleReceiver(
@NotNull Type type,
boolean isStaticPut,
boolean isStaticStore,
@NotNull StackValue receiver
) {
this(type, isStaticPut, isStaticStore, receiver, true);
}
@Override @Override
public void putReceiver(@NotNull InstructionAdapter v, boolean isRead) { public void putReceiver(@NotNull InstructionAdapter v, boolean isRead) {
boolean hasReceiver = isNonStaticAccess(isRead); boolean hasReceiver = isNonStaticAccess(isRead);
@@ -1536,7 +1527,7 @@ public abstract class StackValue {
} }
} }
static class ComplexReceiver extends StackValue { private static class ComplexReceiver extends StackValue {
private final StackValueWithSimpleReceiver originalValueWithReceiver; private final StackValueWithSimpleReceiver originalValueWithReceiver;
private final boolean[] isReadOperations; private final boolean[] isReadOperations;
@@ -1671,7 +1662,7 @@ public abstract class StackValue {
@Nullable private final Label ifNull; @Nullable private final Label ifNull;
public SafeFallback(@NotNull Type type, @Nullable Label ifNull, StackValue receiver) { public SafeFallback(@NotNull Type type, @Nullable Label ifNull, StackValue receiver) {
super(type, false, false, receiver); super(type, false, false, receiver, true);
this.ifNull = ifNull; this.ifNull = ifNull;
} }