diff options
author | Alon Zakai <alonzakai@gmail.com> | 2018-01-10 11:34:53 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-10 11:34:53 -0800 |
commit | 623e42aa7be8aa030093b204491d94f3c297d312 (patch) | |
tree | 05158ff7c3ef2856345c1650192283ed737f91fd /test/binaryen.js | |
parent | 8f90b655201e4cd77196a0b90ea4f398ecfe2c56 (diff) | |
download | binaryen-623e42aa7be8aa030093b204491d94f3c297d312.tar.gz binaryen-623e42aa7be8aa030093b204491d94f3c297d312.tar.bz2 binaryen-623e42aa7be8aa030093b204491d94f3c297d312.zip |
Optimize out memory and table when possible (#1352)
We can remove the memory/table (itself, or an import if imported) if they are not used. This is pretty minor on a large wasm file, but when reading small wasts it's very noticeable to have an unused memory and table all the time.
Diffstat (limited to 'test/binaryen.js')
-rw-r--r-- | test/binaryen.js/call_import_error.js.txt | 1 | ||||
-rw-r--r-- | test/binaryen.js/functions.js.txt | 1 | ||||
-rw-r--r-- | test/binaryen.js/hello-world.js.txt | 2 | ||||
-rw-r--r-- | test/binaryen.js/kitchen-sink.js.txt | 9 |
4 files changed, 0 insertions, 13 deletions
diff --git a/test/binaryen.js/call_import_error.js.txt b/test/binaryen.js/call_import_error.js.txt index 6f2e3b2ac..752f17b49 100644 --- a/test/binaryen.js/call_import_error.js.txt +++ b/test/binaryen.js/call_import_error.js.txt @@ -1,7 +1,6 @@ (module (type $v (func)) (import "env" "fn" (func $fn)) - (memory $0 0) (export "main" (func $main)) (func $main (; 1 ;) (type $v) (call $fn) diff --git a/test/binaryen.js/functions.js.txt b/test/binaryen.js/functions.js.txt index 145c05a2a..4d1015d15 100644 --- a/test/binaryen.js/functions.js.txt +++ b/test/binaryen.js/functions.js.txt @@ -7,6 +7,5 @@ getExpressionInfo(body)={"id":15,"value":3} (module (type $i (func (result i32))) (global $a-global i32 (i32.const 3)) - (memory $0 0) ) diff --git a/test/binaryen.js/hello-world.js.txt b/test/binaryen.js/hello-world.js.txt index 48a4e0a60..e1aff31c5 100644 --- a/test/binaryen.js/hello-world.js.txt +++ b/test/binaryen.js/hello-world.js.txt @@ -1,6 +1,5 @@ (module (type $iii (func (param i32 i32) (result i32))) - (memory $0 0) (export "adder" (func $adder)) (func $adder (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (return @@ -16,7 +15,6 @@ optimized: (module (type $iii (func (param i32 i32) (result i32))) - (memory $0 0) (export "adder" (func $adder)) (func $adder (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.add diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt index fe9765d12..ed1bfe10c 100644 --- a/test/binaryen.js/kitchen-sink.js.txt +++ b/test/binaryen.js/kitchen-sink.js.txt @@ -579,7 +579,6 @@ raw: (type $vi (func (param i32))) (type $i (func (result i32))) (import "module" "check" (func $check (param i32))) - (memory $0 0) (func $just-one-block (; 1 ;) (type $v) (local $0 i32) (call $check @@ -1063,13 +1062,11 @@ raw: optimized: (module - (memory $0 0) ) module loaded from binary form: (module (type $0 (func (param i32 i32) (result i32))) - (memory $0 0) (func $adder (; 0 ;) (type $0) (param $var$0 i32) (param $var$1 i32) (result i32) (i32.add (get_local $var$0) @@ -1082,7 +1079,6 @@ module loaded from binary form: (type $vi (func (param i32))) (type $v (func)) (import "spectest" "print" (func $print-i32 (param i32))) - (memory $0 0) (start $starter) (func $starter (; 1 ;) (type $v) (call $print-i32 @@ -1094,7 +1090,6 @@ module loaded from binary form: (i32.const 1234) (module (type $v (func)) - (memory $0 0) (func $func (; 0 ;) (type $v) (local $0 i32) (set_local $0 @@ -2474,7 +2469,6 @@ raw: (type $vi (func (param i32))) (type $i (func (result i32))) (import "module" "check" (func $check (param i32))) - (memory $0 0) (func $just-one-block (; 1 ;) (type $v) (local $0 i32) (call $check @@ -2967,7 +2961,6 @@ raw: optimized: BinaryenModulePrint(the_module); (module - (memory $0 0) ) BinaryenModuleDispose(the_module); @@ -2982,7 +2975,6 @@ optimized: test_parsing text: (module (type $iii (func (param i32 i32) (result i32))) - (memory $0 0) (func $adder (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.add (get_local $0) @@ -2994,7 +2986,6 @@ test_parsing text: module loaded from text form: (module (type $iii (func (param i32 i32) (result i32))) - (memory $0 0) (func $ADD_ER (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32) (i32.add (get_local $0) |