From 759c485a9f35bd859d43b86b02e1397a669fa469 Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Wed, 11 Dec 2019 17:12:37 -0800 Subject: 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. --- test/dylib.wasm.fromBinary | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test/dylib.wasm.fromBinary') diff --git a/test/dylib.wasm.fromBinary b/test/dylib.wasm.fromBinary index 00441ea30..45d64fb67 100644 --- a/test/dylib.wasm.fromBinary +++ b/test/dylib.wasm.fromBinary @@ -1,7 +1,7 @@ (module - (type $0 (func (param i32) (result i32))) - (type $1 (func (result i32))) - (type $2 (func)) + (type $none_=>_none (func)) + (type $none_=>_i32 (func (result i32))) + (type $i32_=>_i32 (func (param i32) (result i32))) (import "env" "memory" (memory $2 256)) (data (global.get $gimport$0) "hello, world!") (import "env" "table" (table $timport$3 0 funcref)) @@ -15,7 +15,7 @@ (export "_main" (func $0)) (export "runPostSets" (func $1)) (export "_str" (global $global$2)) - (func $0 (; 1 ;) (type $1) (result i32) + (func $0 (; 1 ;) (result i32) (block $label$1 (result i32) (drop (call $fimport$1 @@ -25,10 +25,10 @@ (i32.const 0) ) ) - (func $1 (; 2 ;) (type $2) + (func $1 (; 2 ;) (nop) ) - (func $2 (; 3 ;) (type $2) + (func $2 (; 3 ;) (block $label$1 (global.set $global$0 (i32.add -- cgit v1.2.3