Rename memory instructions; Rework constant handling (#177)

* Rename memory instructions as proposed by the bulk-memory-operations spec.
* Rename memory manager functions to memory.* as well
* Remove automatic inlining of constant globals (Binaryen does this now)
* Improve 'const' enum compatibility
* Improve module-level export generation
* Enable the inline decorator for constant variables
* Add ERROR, WARNING and INFO macros that emit a user-defined diagnostic
* Reintroduce builtin decorator so these can appear anywhere in stdlib again
* Inline isNaN and isFinite by default
* Make an interface around gc.* similar to memory.*
* Emit an error when trying to inline a mutable variable
* Slim down CI stages
* Add a more convenient tracing utility for debugging
* Implement some prequesites for an eventual bundled GC
This commit is contained in:
Daniel Wirtz
2018-07-20 22:53:33 +02:00
committed by GitHub
parent 34e8facfdc
commit 39b489bee2
196 changed files with 28714 additions and 6674 deletions

View File

@ -5,8 +5,8 @@
(import "JSMath" "log" (func $~lib/math/JSMath.log (param f64) (result f64)))
(import "JSMath" "LN2" (global $~lib/math/JSMath.LN2 f64))
(import "env" "memory" (memory $0 0))
(export "computeLine" (func $assembly/index/computeLine))
(export "memory" (memory $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)
(local $4 f64)
(local $5 f64)

View File

@ -9,18 +9,18 @@
(import "env" "memory" (memory $0 0))
(global $assembly/index/NUM_COLORS i32 (i32.const 2048))
(global $HEAP_BASE i32 (i32.const 8))
(export "computeLine" (func $assembly/index/computeLine))
(export "memory" (memory $0))
(func $isFinite<f64> (; 2 ;) (type $Fi) (param $0 f64) (result i32)
;;@ ~lib/builtins.ts:22:26
(export "computeLine" (func $assembly/index/computeLine))
(func $~lib/builtins/isFinite<f64> (; 2 ;) (type $Fi) (param $0 f64) (result i32)
;;@ ~lib/builtins.ts:16:70
(f64.eq
;;@ ~lib/builtins.ts:22:9
;;@ ~lib/builtins.ts:16:53
(f64.sub
(get_local $0)
;;@ ~lib/builtins.ts:22:17
;;@ ~lib/builtins.ts:16:61
(get_local $0)
)
;;@ ~lib/builtins.ts:22:26
;;@ ~lib/builtins.ts:16:70
(f64.const 0)
)
)
@ -375,7 +375,7 @@
(set_local $17
;;@ assembly/index.ts:37:15
(if (result i32)
(call $isFinite<f64>
(call $~lib/builtins/isFinite<f64>
;;@ assembly/index.ts:37:24
(get_local $15)
)
@ -386,7 +386,7 @@
(f64.convert_s/i32
(i32.sub
;;@ assembly/index.ts:38:15
(i32.const 2048)
(get_global $assembly/index/NUM_COLORS)
;;@ assembly/index.ts:38:28
(i32.const 1)
)
@ -421,7 +421,7 @@
)
;;@ assembly/index.ts:39:8
(i32.sub
(i32.const 2048)
(get_global $assembly/index/NUM_COLORS)
;;@ assembly/index.ts:39:21
(i32.const 1)
)