Array get convertion

This commit is contained in:
Michael Bogdanov
2015-04-04 12:56:35 +03:00
parent c8a4fa586c
commit d55c5fe0e4
@@ -16,31 +16,17 @@
package org.jetbrains.kotlin.codegen.intrinsics; package org.jetbrains.kotlin.codegen.intrinsics;
import kotlin.ExtensionFunction1; import org.jetbrains.kotlin.codegen.AsmUtil.correctElementType
import kotlin.Unit; import org.jetbrains.kotlin.codegen.Callable
import org.jetbrains.annotations.NotNull; import org.jetbrains.kotlin.codegen.CallableMethod
import org.jetbrains.kotlin.codegen.Callable; import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter
import org.jetbrains.kotlin.codegen.CallableMethod;
import org.jetbrains.org.objectweb.asm.Type;
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter;
import static org.jetbrains.kotlin.codegen.AsmUtil.correctElementType; public class ArrayGet : IntrinsicMethod() {
public class ArrayGet extends IntrinsicMethod { override fun toCallable(method: CallableMethod): Callable {
return MappedCallable(method) {
@NotNull val type = correctElementType(calcReceiverType())
@Override it.aload(type)
public Callable toCallable(@NotNull CallableMethod method) { }
return new MappedCallable(method, new ExtensionFunction1<MappedCallable, InstructionAdapter, Unit>() {
@Override
public Unit invoke(
MappedCallable callable,
InstructionAdapter adapter
) {
Type type = correctElementType(callable.calcReceiverType());
adapter.aload(type);
return Unit.INSTANCE$;
}
});
} }
} }