From 67357fa5d42c9491ae737bd95a2c69298272c43e Mon Sep 17 00:00:00 2001 From: Zalim Bashorov Date: Fri, 31 Mar 2023 01:14:15 +0200 Subject: [PATCH] [Wasm] Replace heavyweight `stackTraceToString` with "pure" JS `stack` --- compiler/testData/codegen/box/size/add.kt | 2 +- compiler/testData/codegen/box/size/helloWorld.kt | 2 +- compiler/testData/codegen/box/size/helloWorldDOM.kt | 2 +- compiler/testData/codegen/box/size/ok.kt | 2 +- .../wasm/internal/kotlin/wasm/internal/ExceptionHelpers.kt | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/testData/codegen/box/size/add.kt b/compiler/testData/codegen/box/size/add.kt index 8dafa1a71b2..db2aa0bcba6 100644 --- a/compiler/testData/codegen/box/size/add.kt +++ b/compiler/testData/codegen/box/size/add.kt @@ -1,6 +1,6 @@ // TARGET_BACKEND: WASM -// WASM_DCE_EXPECTED_OUTPUT_SIZE: wasm 114_138 +// WASM_DCE_EXPECTED_OUTPUT_SIZE: wasm 72_224 // WASM_DCE_EXPECTED_OUTPUT_SIZE: mjs 6_517 // FILE: test.kt diff --git a/compiler/testData/codegen/box/size/helloWorld.kt b/compiler/testData/codegen/box/size/helloWorld.kt index fa614f3ea94..c6a5404ad37 100644 --- a/compiler/testData/codegen/box/size/helloWorld.kt +++ b/compiler/testData/codegen/box/size/helloWorld.kt @@ -1,6 +1,6 @@ // TARGET_BACKEND: WASM -// WASM_DCE_EXPECTED_OUTPUT_SIZE: wasm 114_456 +// WASM_DCE_EXPECTED_OUTPUT_SIZE: wasm 72_549 // WASM_DCE_EXPECTED_OUTPUT_SIZE: mjs 6_458 fun box(): String { diff --git a/compiler/testData/codegen/box/size/helloWorldDOM.kt b/compiler/testData/codegen/box/size/helloWorldDOM.kt index 8c3c8473677..3bd39cbd6c4 100644 --- a/compiler/testData/codegen/box/size/helloWorldDOM.kt +++ b/compiler/testData/codegen/box/size/helloWorldDOM.kt @@ -1,6 +1,6 @@ // TARGET_BACKEND: WASM -// WASM_DCE_EXPECTED_OUTPUT_SIZE: wasm 126_639 +// WASM_DCE_EXPECTED_OUTPUT_SIZE: wasm 84_364 // WASM_DCE_EXPECTED_OUTPUT_SIZE: mjs 6_956 // FILE: test.kt diff --git a/compiler/testData/codegen/box/size/ok.kt b/compiler/testData/codegen/box/size/ok.kt index 0127beb78bf..9527bbb73bc 100644 --- a/compiler/testData/codegen/box/size/ok.kt +++ b/compiler/testData/codegen/box/size/ok.kt @@ -1,6 +1,6 @@ // TARGET_BACKEND: WASM -// WASM_DCE_EXPECTED_OUTPUT_SIZE: wasm 114_189 +// WASM_DCE_EXPECTED_OUTPUT_SIZE: wasm 72_275 // WASM_DCE_EXPECTED_OUTPUT_SIZE: mjs 6_389 fun box() = "OK" \ No newline at end of file diff --git a/libraries/stdlib/wasm/internal/kotlin/wasm/internal/ExceptionHelpers.kt b/libraries/stdlib/wasm/internal/kotlin/wasm/internal/ExceptionHelpers.kt index afeb7304a93..368fb604a3f 100644 --- a/libraries/stdlib/wasm/internal/kotlin/wasm/internal/ExceptionHelpers.kt +++ b/libraries/stdlib/wasm/internal/kotlin/wasm/internal/ExceptionHelpers.kt @@ -17,7 +17,7 @@ private fun throwJsError(message: String?, wasmTypeName: String?, stack: String) } internal fun throwAsJsException(t: Throwable): Nothing { - throwJsError(t.message, getSimpleName(t.typeInfo), t.stackTraceToString()) + throwJsError(t.message, getSimpleName(t.typeInfo), t.stack) } internal var isNotFirstWasmExportCall: Boolean = false \ No newline at end of file