diff options
author | Sam Clegg <sbc@chromium.org> | 2024-03-22 17:26:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-22 17:26:43 -0700 |
commit | 81b8497164cff31af3bbd66f8b2aee55503b74cb (patch) | |
tree | 1f526a8aa0f408cfec39bb59831eaee8e9e3230c /test | |
parent | b3fea30f84fef3ff7aa77775e00b83ba62d997cc (diff) | |
download | binaryen-81b8497164cff31af3bbd66f8b2aee55503b74cb.tar.gz binaryen-81b8497164cff31af3bbd66f8b2aee55503b74cb.tar.bz2 binaryen-81b8497164cff31af3bbd66f8b2aee55503b74cb.zip |
Remove "minimal" JS import/export legalization (#6428)
This change removes the "minimal" mode from `LegalizeJSInterface`
which was added in #1883.
The idea behind this change was to avoid legalizing most function except
those we know that JS will be calling. The idea was that for dynamic
linking we always want the non-legalized version to be shared between
wasm module. These days we solve this problem in a different way with
the `legalize-js-interface-export-originals` which exports the original
functions alongside the legalized ones. Emscripten then always
prefers the `$orig` functions when doing dynamic linking.
Diffstat (limited to 'test')
-rw-r--r-- | test/lit/help/wasm-opt.test | 5 | ||||
-rw-r--r-- | test/lit/help/wasm2js.test | 5 | ||||
-rw-r--r-- | test/lit/passes/legalize-js-interface-minimally.wast | 86 |
3 files changed, 0 insertions, 96 deletions
diff --git a/test/lit/help/wasm-opt.test b/test/lit/help/wasm-opt.test index 0cf76e52e..84b5049dd 100644 --- a/test/lit/help/wasm-opt.test +++ b/test/lit/help/wasm-opt.test @@ -231,11 +231,6 @@ ;; CHECK-NEXT: --legalize-js-interface legalizes i64 types on the ;; CHECK-NEXT: import/export boundary ;; CHECK-NEXT: -;; CHECK-NEXT: --legalize-js-interface-minimally legalizes i64 types on the -;; CHECK-NEXT: import/export boundary in a -;; CHECK-NEXT: minimal manner, only on things -;; CHECK-NEXT: only JS will call -;; CHECK-NEXT: ;; CHECK-NEXT: --licm loop invariant code motion ;; CHECK-NEXT: ;; CHECK-NEXT: --limit-segments attempt to merge segments to fit diff --git a/test/lit/help/wasm2js.test b/test/lit/help/wasm2js.test index 9804718a8..3ab4099de 100644 --- a/test/lit/help/wasm2js.test +++ b/test/lit/help/wasm2js.test @@ -185,11 +185,6 @@ ;; CHECK-NEXT: --legalize-js-interface legalizes i64 types on the ;; CHECK-NEXT: import/export boundary ;; CHECK-NEXT: -;; CHECK-NEXT: --legalize-js-interface-minimally legalizes i64 types on the -;; CHECK-NEXT: import/export boundary in a -;; CHECK-NEXT: minimal manner, only on things -;; CHECK-NEXT: only JS will call -;; CHECK-NEXT: ;; CHECK-NEXT: --licm loop invariant code motion ;; CHECK-NEXT: ;; CHECK-NEXT: --limit-segments attempt to merge segments to fit diff --git a/test/lit/passes/legalize-js-interface-minimally.wast b/test/lit/passes/legalize-js-interface-minimally.wast deleted file mode 100644 index 664b024b3..000000000 --- a/test/lit/passes/legalize-js-interface-minimally.wast +++ /dev/null @@ -1,86 +0,0 @@ -;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. -;; NOTE: This test was ported using port_passes_tests_to_lit.py and could be cleaned up. - -;; RUN: foreach %s %t wasm-opt --legalize-js-interface-minimally -S -o - | filecheck %s - -(module - ;; CHECK: (type $0 (func (result i64))) - - ;; CHECK: (type $1 (func (param i32))) - - ;; CHECK: (type $2 (func (result i32))) - - ;; CHECK: (type $3 (func (param i64))) - - ;; CHECK: (type $4 (func (param i32 i32))) - - ;; CHECK: (import "env" "imported" (func $imported (result i64))) - (import "env" "imported" (func $imported (result i64))) - (import "env" "invoke_vj" (func $invoke_vj (param i64))) - ;; CHECK: (import "env" "setTempRet0" (func $setTempRet0 (param i32))) - - ;; CHECK: (import "env" "invoke_vj" (func $legalimport$invoke_vj (param i32 i32))) - - ;; CHECK: (export "func" (func $func)) - (export "func" (func $func)) - (export "dynCall_foo" (func $dyn)) - ;; CHECK: (export "dynCall_foo" (func $legalstub$dyn)) - - ;; CHECK: (func $func (result i64) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (call $imported) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $legalfunc$invoke_vj - ;; CHECK-NEXT: (i64.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: ) - (func $func (result i64) - (drop (call $imported)) - (call $invoke_vj (i64.const 0)) - (unreachable) - ) - ;; CHECK: (func $dyn (result i64) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (call $imported) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: ) - (func $dyn (result i64) - (drop (call $imported)) - (unreachable) - ) -) -;; CHECK: (func $legalstub$dyn (result i32) -;; CHECK-NEXT: (local $0 i64) -;; CHECK-NEXT: (local.set $0 -;; CHECK-NEXT: (call $dyn) -;; CHECK-NEXT: ) -;; CHECK-NEXT: (call $setTempRet0 -;; CHECK-NEXT: (i32.wrap_i64 -;; CHECK-NEXT: (i64.shr_u -;; CHECK-NEXT: (local.get $0) -;; CHECK-NEXT: (i64.const 32) -;; CHECK-NEXT: ) -;; CHECK-NEXT: ) -;; CHECK-NEXT: ) -;; CHECK-NEXT: (i32.wrap_i64 -;; CHECK-NEXT: (local.get $0) -;; CHECK-NEXT: ) -;; CHECK-NEXT: ) - -;; CHECK: (func $legalfunc$invoke_vj (param $0 i64) -;; CHECK-NEXT: (call $legalimport$invoke_vj -;; CHECK-NEXT: (i32.wrap_i64 -;; CHECK-NEXT: (local.get $0) -;; CHECK-NEXT: ) -;; CHECK-NEXT: (i32.wrap_i64 -;; CHECK-NEXT: (i64.shr_u -;; CHECK-NEXT: (local.get $0) -;; CHECK-NEXT: (i64.const 32) -;; CHECK-NEXT: ) -;; CHECK-NEXT: ) -;; CHECK-NEXT: ) -;; CHECK-NEXT: ) -(module) - |