Always compile globals because initializers might have side effects

This commit is contained in:
dcodeIO
2018-01-04 06:00:42 +01:00
parent 50dea3b1df
commit 7e9b58428b
14 changed files with 60 additions and 69 deletions

View File

@ -1,7 +1,7 @@
(module
(type $v (func))
(global $binary/i (mut i32) (i32.const 0))
(global $binary/b (mut i32) (i32.const 0))
(global $binary/i (mut i32) (i32.const 0))
(global $binary/I (mut i64) (i64.const 0))
(global $binary/f (mut f32) (f32.const 0))
(global $binary/F (mut f64) (f64.const 0))

View File

@ -1,7 +1,7 @@
(module
(type $v (func))
(global $binary/i (mut i32) (i32.const 0))
(global $binary/b (mut i32) (i32.const 0))
(global $binary/i (mut i32) (i32.const 0))
(global $binary/I (mut i64) (i64.const 0))
(global $binary/f (mut f32) (f32.const 0))
(global $binary/F (mut f64) (f64.const 0))

View File

@ -1,9 +1,9 @@
(module
(type $v (func))
(global $builtins/b (mut i32) (i32.const 0))
(global $builtins/i (mut i32) (i32.const 0))
(global $builtins/I (mut i64) (i64.const 0))
(global $builtins/f (mut f32) (f32.const 0))
(global $builtins/b (mut i32) (i32.const 0))
(global $builtins/F (mut f64) (f64.const 0))
(global $builtins/s (mut i32) (i32.const 0))
(memory $0 1)

View File

@ -1,9 +1,9 @@
(module
(type $v (func))
(global $builtins/b (mut i32) (i32.const 0))
(global $builtins/i (mut i32) (i32.const 0))
(global $builtins/I (mut i64) (i64.const 0))
(global $builtins/f (mut f32) (f32.const 0))
(global $builtins/b (mut i32) (i32.const 0))
(global $builtins/F (mut f64) (f64.const 0))
(global $builtins/s (mut i32) (i32.const 0))
(global $i8.MIN_VALUE i32 (i32.const -128))

View File

@ -1,7 +1,7 @@
(module
(type $v (func))
(import "env" "externalFunc" (func $declare/externalFunc))
(import "env" "externalConst" (global $declare/externalConst i32))
(import "env" "externalFunc" (func $declare/externalFunc))
(import "external" "externalFunc" (func $declare/external.externalFunc))
(import "external" "externalConst" (global $declare/external.externalConst i32))
(global $HEAP_BASE i32 (i32.const 4))

View File

@ -2,8 +2,8 @@
(type $i (func (result i32)))
(type $iiv (func (param i32 i32)))
(type $iiiiv (func (param i32 i32 i32 i32)))
(global $../../examples/i64-polyfill/assembly/i64/hi (mut i32) (i32.const 0))
(global $../../examples/i64-polyfill/assembly/i64/lo (mut i32) (i32.const 0))
(global $../../examples/i64-polyfill/assembly/i64/hi (mut i32) (i32.const 0))
(memory $0 1)
(export "getHi" (func $../../examples/i64-polyfill/assembly/i64/getHi))
(export "getLo" (func $../../examples/i64-polyfill/assembly/i64/getLo))

View File

@ -2,8 +2,8 @@
(type $i (func (result i32)))
(type $iiv (func (param i32 i32)))
(type $iiiiv (func (param i32 i32 i32 i32)))
(global $../../examples/i64-polyfill/assembly/i64/hi (mut i32) (i32.const 0))
(global $../../examples/i64-polyfill/assembly/i64/lo (mut i32) (i32.const 0))
(global $../../examples/i64-polyfill/assembly/i64/hi (mut i32) (i32.const 0))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "getHi" (func $../../examples/i64-polyfill/assembly/i64/getHi))

View File

@ -1,8 +1,8 @@
(module
(type $iii (func (param i32 i32) (result i32)))
(type $v (func))
(global $export/b i32 (i32.const 2))
(global $export/a i32 (i32.const 1))
(global $export/b i32 (i32.const 2))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "memory" (memory $0))

View File

@ -1,8 +1,8 @@
(module
(type $iii (func (param i32 i32) (result i32)))
(type $v (func))
(global $export/b i32 (i32.const 2))
(global $export/a i32 (i32.const 1))
(global $export/b i32 (i32.const 2))
(memory $0 1)
(export "add" (func $export/add))
(export "renamed_sub" (func $export/sub))

View File

@ -1,8 +1,8 @@
(module
(type $iii (func (param i32 i32) (result i32)))
(type $v (func))
(global $export/b i32 (i32.const 2))
(global $export/a i32 (i32.const 1))
(global $export/b i32 (i32.const 2))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "add" (func $export/add))

View File

@ -8,19 +8,27 @@
(type $v (func))
(global $tlsf/ALIGN_SIZE_LOG2 i32 (i32.const 3))
(global $tlsf/ALIGN_SIZE i32 (i32.const 8))
(global $tlsf/SL_INDEX_COUNT_LOG2 i32 (i32.const 5))
(global $tlsf/FL_INDEX_MAX i32 (i32.const 30))
(global $tlsf/SL_INDEX_COUNT i32 (i32.const 32))
(global $tlsf/FL_INDEX_SHIFT i32 (i32.const 8))
(global $tlsf/FL_INDEX_COUNT i32 (i32.const 23))
(global $tlsf/SMALL_BLOCK_SIZE i32 (i32.const 256))
(global $tlsf/BLOCK$PREV_PHYS_BLOCK_OFFSET i32 (i32.const 0))
(global $tlsf/BLOCK$TAGGED_SIZE_OFFSET i32 (i32.const 4))
(global $tlsf/BLOCK$NEXT_FREE_OFFSET i32 (i32.const 8))
(global $tlsf/BLOCK$PREV_FREE_OFFSET i32 (i32.const 12))
(global $tlsf/BLOCK$SIZE i32 (i32.const 16))
(global $tlsf/BLOCK_HEADER_FREE_BIT i32 (i32.const 1))
(global $tlsf/BLOCK_HEADER_PREV_FREE_BIT i32 (i32.const 2))
(global $tlsf/BLOCK_OVERHEAD i32 (i32.const 4))
(global $tlsf/BLOCK_START_OFFSET i32 (i32.const 8))
(global $tlsf/BLOCK_SIZE_MIN i32 (i32.const 12))
(global $tlsf/BLOCK_SIZE_MAX i32 (i32.const 1073741824))
(global $tlsf/CONTROL$FL_BITMAP_OFFSET i32 (i32.const 16))
(global $tlsf/FL_INDEX_MAX i32 (i32.const 30))
(global $tlsf/SL_INDEX_COUNT_LOG2 i32 (i32.const 5))
(global $tlsf/FL_INDEX_SHIFT i32 (i32.const 8))
(global $tlsf/FL_INDEX_COUNT i32 (i32.const 23))
(global $tlsf/CONTROL$SL_BITMAP_OFFSET i32 (i32.const 20))
(global $tlsf/SL_INDEX_COUNT i32 (i32.const 32))
(global $tlsf/CONTROL$BLOCKS_OFFSET i32 (i32.const 112))
(global $tlsf/CONTROL$SIZE i32 (i32.const 3056))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "control$construct" (func $tlsf/control$construct))