[Wasm] Imporove external interface support

* Support boxing/unboxing when casting to Any
* Support ===, equals, hashCode, toString

* Support adapting String in interop boundary
This commit is contained in:
Svyatoslav Kuzmich
2021-10-15 23:04:22 +03:00
parent baa53b5cf3
commit 4fc461a2ff
30 changed files with 1240 additions and 81 deletions
@@ -216,6 +216,12 @@ internal annotation class WasmOp(val name: String) {
const val RETURN = "RETURN"
const val CALL = "CALL"
const val CALL_INDIRECT = "CALL_INDIRECT"
const val TRY = "TRY"
const val CATCH = "CATCH"
const val CATCH_ALL = "CATCH_ALL"
const val DELEGATE = "DELEGATE"
const val THROW = "THROW"
const val RETHROW = "RETHROW"
const val DROP = "DROP"
const val SELECT = "SELECT"
const val SELECT_TYPED = "SELECT_TYPED"
@@ -255,5 +261,19 @@ internal annotation class WasmOp(val name: String) {
const val REF_TEST = "REF_TEST"
const val REF_CAST = "REF_CAST"
const val BR_ON_CAST = "BR_ON_CAST"
const val BR_ON_CAST_FAIL = "BR_ON_CAST_FAIL"
const val REF_IS_FUNC = "REF_IS_FUNC"
const val REF_IS_DATA = "REF_IS_DATA"
const val REF_IS_I31 = "REF_IS_I31"
const val REF_AS_FUNC = "REF_AS_FUNC"
const val REF_AS_DATA = "REF_AS_DATA"
const val REF_AS_I31 = "REF_AS_I31"
const val BR_ON_FUNC = "BR_ON_FUNC"
const val BR_ON_DATA = "BR_ON_DATA"
const val BR_ON_I31 = "BR_ON_I31"
const val BR_ON_NON_FUNC = "BR_ON_NON_FUNC"
const val BR_ON_NON_DATA = "BR_ON_NON_DATA"
const val BR_ON_NON_I31 = "BR_ON_NON_I31"
const val GET_UNIT = "GET_UNIT"
}
}
@@ -13,4 +13,18 @@ package kotlin.js
@ExperimentalJsExport
@Retention(AnnotationRetention.BINARY)
@Target(AnnotationTarget.FUNCTION)
public actual annotation class JsExport
public actual annotation class JsExport
/**
* Specifies JavaScript name for external and imported declarations
*/
@Retention(AnnotationRetention.BINARY)
@Target(
AnnotationTarget.CLASS,
AnnotationTarget.FUNCTION,
AnnotationTarget.PROPERTY,
AnnotationTarget.CONSTRUCTOR,
AnnotationTarget.PROPERTY_GETTER,
AnnotationTarget.PROPERTY_SETTER
)
public actual annotation class JsName(actual val name: String)