diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2019-12-11 17:12:37 -0800 |
---|---|---|
committer | Alon Zakai <azakai@google.com> | 2019-12-11 17:12:37 -0800 |
commit | 759c485a9f35bd859d43b86b02e1397a669fa469 (patch) | |
tree | a5c7475002b406e35c6d1e5c2d843000947ef192 /test/unit.fromasm.imprecise.no-opts | |
parent | acd786dbd1e59f9d105c4ec8603c2ff46f233649 (diff) | |
download | binaryen-759c485a9f35bd859d43b86b02e1397a669fa469.tar.gz binaryen-759c485a9f35bd859d43b86b02e1397a669fa469.tar.bz2 binaryen-759c485a9f35bd859d43b86b02e1397a669fa469.zip |
Remove FunctionType (#2510)
Function signatures were previously redundantly stored on Function
objects as well as on FunctionType objects. These two signature
representations had to always be kept in sync, which was error-prone
and needlessly complex. This PR takes advantage of the new ability of
Type to represent multiple value types by consolidating function
signatures as a pair of Types (params and results) stored on the
Function object.
Since there are no longer module-global named function types,
significant changes had to be made to the printing and emitting of
function types, as well as their parsing and manipulation in various
passes.
The C and JS APIs and their tests also had to be updated to remove
named function types.
Diffstat (limited to 'test/unit.fromasm.imprecise.no-opts')
-rw-r--r-- | test/unit.fromasm.imprecise.no-opts | 46 |
1 files changed, 30 insertions, 16 deletions
diff --git a/test/unit.fromasm.imprecise.no-opts b/test/unit.fromasm.imprecise.no-opts index b2b0a5f40..619dc88c1 100644 --- a/test/unit.fromasm.imprecise.no-opts +++ b/test/unit.fromasm.imprecise.no-opts @@ -1,12 +1,26 @@ (module - (type $FUNCSIG$ddd (func (param f64 f64) (result f64))) - (type $FUNCSIG$vf (func (param f32))) - (type $FUNCSIG$vi (func (param i32))) - (type $FUNCSIG$v (func)) - (type $FUNCSIG$idi (func (param f64 i32) (result i32))) - (type $FUNCSIG$ii (func (param i32) (result i32))) - (type $FUNCSIG$dd (func (param f64) (result f64))) - (type $FUNCSIG$i (func (result i32))) + (type $none_=>_none (func)) + (type $i32_=>_none (func (param i32))) + (type $none_=>_i32 (func (result i32))) + (type $i32_=>_i32 (func (param i32) (result i32))) + (type $f32_=>_none (func (param f32))) + (type $none_=>_f64 (func (result f64))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) + (type $f64_=>_i32 (func (param f64) (result i32))) + (type $none_=>_f32 (func (result f32))) + (type $i32_=>_f32 (func (param i32) (result f32))) + (type $f64_=>_f64 (func (param f64) (result f64))) + (type $f64_f64_=>_f64 (func (param f64 f64) (result f64))) + (type $i32_i32_=>_none (func (param i32 i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) + (type $i32_i32_i32_i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32 i32 i32 i32))) + (type $i32_f32_=>_none (func (param i32 f32))) + (type $i32_f64_f32_=>_none (func (param i32 f64 f32))) + (type $f32_f64_=>_none (func (param f32 f64))) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) + (type $f64_i32_=>_i32 (func (param f64 i32) (result i32))) + (type $f64_f64_f64_=>_i32 (func (param f64 f64 f64) (result i32))) + (type $i32_f32_f64_=>_f32 (func (param i32 f32 f64) (result f32))) (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table $table 25 25 funcref)) (elem (global.get $__table_base) $v $big_negative $v $v $w $w $importedDoubles $w $z $cneg $z $z $z $z $z $z $vi $vi $vi $vi $vi $vi $vi $vi $ii) @@ -527,7 +541,7 @@ (local.get $x) ) ) - (call_indirect (type $FUNCSIG$vf) + (call_indirect (type $f32_=>_none) (local.get $x) (i32.add (i32.and @@ -539,7 +553,7 @@ ) ) (func $cneg (; 25 ;) (param $x f32) - (call_indirect (type $FUNCSIG$vf) + (call_indirect (type $f32_=>_none) (local.get $x) (i32.add (i32.and @@ -589,7 +603,7 @@ ) ) (func $cneg_nosemicolon (; 28 ;) - (call_indirect (type $FUNCSIG$vi) + (call_indirect (type $i32_=>_none) (i32.const 1) (i32.add (i32.and @@ -1911,14 +1925,14 @@ ) ) (func $relocatableAndModules (; 67 ;) (result i32) - (call_indirect (type $FUNCSIG$v) + (call_indirect (type $none_=>_none) (i32.const 10) ) - (call_indirect (type $FUNCSIG$v) + (call_indirect (type $none_=>_none) (i32.const 20) ) (return - (call_indirect (type $FUNCSIG$idi) + (call_indirect (type $f64_i32_=>_i32) (f64.const 1.5) (i32.const 200) (i32.const 30) @@ -1998,7 +2012,7 @@ (local $i1 i32) (local.set $i1 (block (result i32) - (call_indirect (type $FUNCSIG$vi) + (call_indirect (type $i32_=>_none) (i32.const 0) (i32.add (i32.and @@ -2014,7 +2028,7 @@ ) (func $emterpretify_assertions_safeHeap (; 74 ;) (local $i1 i32) - (call_indirect (type $FUNCSIG$vi) + (call_indirect (type $i32_=>_none) (local.get $i1) (i32.add (i32.and |