Update Binaryen to latest; Various fixes

This commit is contained in:
Daniel Wirtz
2018-10-11 08:49:08 +02:00
committed by GitHub
parent b54a97c0fe
commit f7c734789e
228 changed files with 12372 additions and 14996 deletions

View File

@ -1,13 +1,17 @@
(module
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $FF (func (param f64) (result f64)))
(import "JSMath" "sqrt" (func $~lib/math/JSMath.sqrt (param f64) (result f64)))
(import "JSMath" "log" (func $~lib/math/JSMath.log (param f64) (result f64)))
(import "JSMath" "LN2" (global $~lib/math/JSMath.LN2 f64))
(type $v (func))
(import "env" "memory" (memory $0 0))
(table 1 anyfunc)
(elem (i32.const 0) $null)
(import "Math" "LN2" (global $~lib/bindings/Math/LN2 f64))
(import "Math" "sqrt" (func $~lib/bindings/Math/sqrt (param f64) (result f64)))
(import "Math" "log" (func $~lib/bindings/Math/log (param f64) (result f64)))
(export "memory" (memory $0))
(export "table" (table $0))
(export "computeLine" (func $assembly/index/computeLine))
(func $assembly/index/computeLine (; 2 ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32)
(func $assembly/index/computeLine (; 2 ;) (; has Stack IR ;) (type $iiiiv) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32)
(local $4 f64)
(local $5 f64)
(local $6 f64)
@ -279,11 +283,11 @@
;;@ assembly/index.ts:36:15
(f64.div
;;@ assembly/index.ts:36:20
(call $~lib/math/JSMath.log
(call $~lib/bindings/Math/log
;;@ assembly/index.ts:36:29
(call $~lib/math/JSMath.log
(call $~lib/bindings/Math/log
;;@ assembly/index.ts:36:38
(call $~lib/math/JSMath.sqrt
(call $~lib/bindings/Math/sqrt
;;@ assembly/index.ts:36:43
(f64.add
(f64.mul
@ -300,7 +304,7 @@
)
)
;;@ assembly/index.ts:36:66
(get_global $~lib/math/JSMath.LN2)
(get_global $~lib/bindings/Math/LN2)
)
)
(get_local $6)
@ -352,4 +356,7 @@
)
)
)
(func $null (; 3 ;) (; has Stack IR ;) (type $v)
(nop)
)
)

View File

@ -3,24 +3,28 @@
(type $FF (func (param f64) (result f64)))
(type $Fi (func (param f64) (result i32)))
(type $FFFF (func (param f64 f64 f64) (result f64)))
(import "JSMath" "sqrt" (func $~lib/math/JSMath.sqrt (param f64) (result f64)))
(import "JSMath" "log" (func $~lib/math/JSMath.log (param f64) (result f64)))
(import "JSMath" "LN2" (global $~lib/math/JSMath.LN2 f64))
(type $v (func))
(import "env" "memory" (memory $0 0))
(table 1 anyfunc)
(elem (i32.const 0) $null)
(import "Math" "LN2" (global $~lib/bindings/Math/LN2 f64))
(import "Math" "sqrt" (func $~lib/bindings/Math/sqrt (param f64) (result f64)))
(import "Math" "log" (func $~lib/bindings/Math/log (param f64) (result f64)))
(global $assembly/index/NUM_COLORS i32 (i32.const 2048))
(global $HEAP_BASE i32 (i32.const 8))
(export "memory" (memory $0))
(export "table" (table $0))
(export "computeLine" (func $assembly/index/computeLine))
(func $~lib/builtins/isFinite<f64> (; 2 ;) (type $Fi) (param $0 f64) (result i32)
;;@ ~lib/builtins.ts:16:70
;;@ ~lib/builtins.ts:16:78
(f64.eq
;;@ ~lib/builtins.ts:16:53
;;@ ~lib/builtins.ts:16:61
(f64.sub
(get_local $0)
;;@ ~lib/builtins.ts:16:61
;;@ ~lib/builtins.ts:16:69
(get_local $0)
)
;;@ ~lib/builtins.ts:16:70
;;@ ~lib/builtins.ts:16:78
(f64.const 0)
)
)
@ -195,6 +199,7 @@
(f64.const 4)
)
(block
;;@ assembly/index.ts:18:55
(block
;;@ assembly/index.ts:19:6
(set_local $15
@ -345,11 +350,11 @@
;;@ assembly/index.ts:36:15
(f64.div
;;@ assembly/index.ts:36:20
(call $~lib/math/JSMath.log
(call $~lib/bindings/Math/log
;;@ assembly/index.ts:36:29
(call $~lib/math/JSMath.log
(call $~lib/bindings/Math/log
;;@ assembly/index.ts:36:38
(call $~lib/math/JSMath.sqrt
(call $~lib/bindings/Math/sqrt
;;@ assembly/index.ts:36:43
(f64.add
(f64.mul
@ -368,7 +373,7 @@
)
)
;;@ assembly/index.ts:36:66
(get_global $~lib/math/JSMath.LN2)
(get_global $~lib/bindings/Math/LN2)
)
)
;;@ assembly/index.ts:37:4
@ -460,4 +465,6 @@
)
)
)
(func $null (; 5 ;) (type $v)
)
)

View File

@ -49,7 +49,7 @@ fetch("build/optimized.wasm")
.then(response => response.arrayBuffer())
.then(buffer => WebAssembly.instantiate(buffer, {
env: { memory: memory },
JSMath: Math
Math
}))
.then(module => {
var exports = module.instance.exports;