mirror of
https://github.com/fluencelabs/asmble
synced 2025-04-24 22:32:19 +00:00
Upgrade kotlin and minor warning suppression
This commit is contained in:
parent
3e912b2b15
commit
cb8470f54f
@ -2,7 +2,7 @@ group 'asmble'
|
||||
version '0.1.0'
|
||||
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.1.2'
|
||||
ext.kotlin_version = '1.1.51'
|
||||
ext.asm_version = '5.2'
|
||||
|
||||
repositories {
|
||||
|
@ -6,6 +6,7 @@ import asmble.compile.jvm.ClsContext
|
||||
import asmble.compile.jvm.withComputedFramesAndMaxs
|
||||
import java.io.FileOutputStream
|
||||
|
||||
@Suppress("NAME_SHADOWING")
|
||||
open class Compile : Command<Compile.Args>() {
|
||||
|
||||
override val name = "compile"
|
||||
|
@ -28,6 +28,7 @@ fun KFunction<*>.invokeStatic() =
|
||||
fun KFunction<*>.invokeVirtual() =
|
||||
MethodInsnNode(Opcodes.INVOKEVIRTUAL, this.declarer.ref.asmName, this.name, this.asmDesc, false)
|
||||
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
inline fun <T : Function<*>> forceFnType(fn: T) = fn as KFunction<*>
|
||||
|
||||
val KClass<*>.const: LdcInsnNode get() = (if (this == Void::class) Void.TYPE else this.java).const
|
||||
|
@ -21,11 +21,9 @@ open class AstToSExpr(val parensInstrs: Boolean = true) {
|
||||
newMulti("assert_trap") + fromAction(v.action) + v.failure
|
||||
is Script.Cmd.Assertion.Malformed -> when (v.module) {
|
||||
is Script.LazyModule.SExpr -> newMulti("assert_malformed") + v.module.sexpr + v.failure
|
||||
else -> newMulti("assert_malformed") + fromModule(v.module.value) + v.failure
|
||||
}
|
||||
is Script.Cmd.Assertion.Invalid -> when (v.module) {
|
||||
is Script.LazyModule.SExpr -> newMulti("assert_invalid") + v.module.sexpr + v.failure
|
||||
else -> newMulti("assert_invalid") + fromModule(v.module.value) + v.failure
|
||||
}
|
||||
is Script.Cmd.Assertion.SoftInvalid ->
|
||||
newMulti("assert_soft_invalid") + fromModule(v.module) + v.failure
|
||||
|
@ -283,6 +283,7 @@ data class ScriptContext(
|
||||
bindImport(import, true, MethodType.methodType(Class.forName(mem.memType.asm.className))).
|
||||
invokeWithArguments()!!
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
fun resolveImportTable(import: Node.Import, tableType: Node.Type.Table) =
|
||||
bindImport(import, true, MethodType.methodType(Array<MethodHandle>::class.java)).
|
||||
invokeWithArguments()!! as Array<MethodHandle>
|
||||
|
Loading…
x
Reference in New Issue
Block a user