[Wasm] Support coroutines

- Reuse JS IR Suspend function lowering
  - Fix types
  - Disable reinterpretCast-based optimization for inline
    classes
- Add basic support to Wasm stdlib
- Explicitly transform suspend functions into regular functions
  with continuations
- Clean suspend function handling from JS IR codegen
This commit is contained in:
Svyatoslav Kuzmich
2021-10-11 15:57:38 +03:00
parent e3f826d1b9
commit 3bce0cc055
27 changed files with 817 additions and 238 deletions
@@ -14,8 +14,9 @@ internal fun <T> getContinuation(): Continuation<T> { throw Exception("Implement
// Do we really need this intrinsic in JS?
@PublishedApi
@Suppress("UNCHECKED_CAST")
internal suspend fun <T> returnIfSuspended(@Suppress("UNUSED_PARAMETER") argument: Any?): T {
throw Exception("Implemented as intrinsic")
return argument as T
}
@PublishedApi