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 | |
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')
-rw-r--r-- | test/unit.fromasm.imprecise | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/test/unit.fromasm.imprecise b/test/unit.fromasm.imprecise index 04528ad47..584e46d9f 100644 --- a/test/unit.fromasm.imprecise +++ b/test/unit.fromasm.imprecise @@ -1,12 +1,23 @@ (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_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 $none_=>_f32 (func (result f32))) + (type $i32_f32_f64_=>_f32 (func (param i32 f32 f64) (result f32))) + (type $f64_=>_f64 (func (param f64) (result f64))) (import "env" "memory" (memory $memory 256 256)) (import "env" "table" (table $table 25 25 funcref)) (elem (global.get $__table_base) $big_negative $big_negative $big_negative $big_negative $w $w $importedDoubles $w $fr $cneg $fr $fr $fr $fr $fr $fr $vi $vi $vi $vi $vi $vi $vi $vi $ii) @@ -221,13 +232,13 @@ (f64.const -0) ) (func $neg (; 19 ;) (; has Stack IR ;) - (call_indirect (type $FUNCSIG$vf) + (call_indirect (type $f32_=>_none) (f32.const -0) (i32.const 9) ) ) (func $cneg (; 20 ;) (; has Stack IR ;) (param $0 f32) - (call_indirect (type $FUNCSIG$vf) + (call_indirect (type $f32_=>_none) (local.get $0) (i32.const 9) ) @@ -258,7 +269,7 @@ ) ) (func $cneg_nosemicolon (; 22 ;) (; has Stack IR ;) - (call_indirect (type $FUNCSIG$vi) + (call_indirect (type $i32_=>_none) (i32.const 1) (i32.const 17) ) @@ -1077,13 +1088,13 @@ ) ) (func $relocatableAndModules (; 55 ;) (; has Stack IR ;) (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) ) - (call_indirect (type $FUNCSIG$idi) + (call_indirect (type $f64_i32_=>_i32) (f64.const 1.5) (i32.const 200) (i32.const 30) @@ -1093,11 +1104,11 @@ (local.get $1) ) (func $keepAlive (; 57 ;) (; has Stack IR ;) - (call_indirect (type $FUNCSIG$vi) + (call_indirect (type $i32_=>_none) (i32.const 0) (i32.const 17) ) - (call_indirect (type $FUNCSIG$vi) + (call_indirect (type $i32_=>_none) (i32.const 0) (block (result i32) (global.set $Int |