Fix 'static readonly' not being recognized as constant anymore, see #44

This commit is contained in:
dcodeIO
2018-03-19 19:36:39 +01:00
parent 5323e64af9
commit fea8e65a41
22 changed files with 2391 additions and 2368 deletions

View File

@ -6,6 +6,7 @@
(type $iv (func (param i32)))
(type $v (func))
(import "env" "abort" (func $abort (param i32 i32 i32 i32)))
(global "$(lib)/allocator/arena/startOffset" (mut i32) (i32.const 0))
(global "$(lib)/allocator/arena/offset" (mut i32) (i32.const 0))
(global $std/allocator_arena/ptr1 (mut i32) (i32.const 0))
(global $std/allocator_arena/ptr2 (mut i32) (i32.const 0))
@ -2361,6 +2362,11 @@
)
(func "$(lib)/allocator/arena/reset_memory" (; 7 ;) (type $v)
(set_global "$(lib)/allocator/arena/offset"
(get_global "$(lib)/allocator/arena/startOffset")
)
)
(func $start (; 8 ;) (type $v)
(set_global "$(lib)/allocator/arena/startOffset"
(i32.and
(i32.add
(get_global $HEAP_BASE)
@ -2369,16 +2375,8 @@
(i32.const -8)
)
)
)
(func $start (; 8 ;) (type $v)
(set_global "$(lib)/allocator/arena/offset"
(i32.and
(i32.add
(get_global $HEAP_BASE)
(i32.const 7)
)
(i32.const -8)
)
(get_global "$(lib)/allocator/arena/startOffset")
)
(set_global $std/allocator_arena/ptr1
(call "$(lib)/allocator/arena/allocate_memory"

View File

@ -10,6 +10,7 @@
(global "$(lib)/allocator/common/alignment/BITS" i32 (i32.const 3))
(global "$(lib)/allocator/common/alignment/SIZE" i32 (i32.const 8))
(global "$(lib)/allocator/common/alignment/MASK" i32 (i32.const 7))
(global "$(lib)/allocator/arena/startOffset" (mut i32) (i32.const 0))
(global "$(lib)/allocator/arena/offset" (mut i32) (i32.const 0))
(global $std/allocator_arena/size i32 (i32.const 42))
(global $std/allocator_arena/ptr1 (mut i32) (i32.const 0))
@ -2668,6 +2669,11 @@
)
(func "$(lib)/allocator/arena/reset_memory" (; 7 ;) (type $v)
(set_global "$(lib)/allocator/arena/offset"
(get_global "$(lib)/allocator/arena/startOffset")
)
)
(func $start (; 8 ;) (type $v)
(set_global "$(lib)/allocator/arena/startOffset"
(i32.and
(i32.add
(get_global $HEAP_BASE)
@ -2679,19 +2685,8 @@
)
)
)
)
(func $start (; 8 ;) (type $v)
(set_global "$(lib)/allocator/arena/offset"
(i32.and
(i32.add
(get_global $HEAP_BASE)
(i32.const 7)
)
(i32.xor
(i32.const 7)
(i32.const -1)
)
)
(get_global "$(lib)/allocator/arena/startOffset")
)
(set_global $std/allocator_arena/ptr1
(call "$(lib)/allocator/arena/allocate_memory"

View File

@ -9,6 +9,7 @@
(type $iiiii (func (param i32 i32 i32 i32) (result i32)))
(type $v (func))
(import "env" "abort" (func $abort (param i32 i32 i32 i32)))
(global "$(lib)/allocator/arena/startOffset" (mut i32) (i32.const 0))
(global "$(lib)/allocator/arena/offset" (mut i32) (i32.const 0))
(global $std/array/arr (mut i32) (i32.const 0))
(global $std/array/i (mut i32) (i32.const 0))
@ -3068,7 +3069,7 @@
)
)
(func $start (; 19 ;) (type $v)
(set_global "$(lib)/allocator/arena/offset"
(set_global "$(lib)/allocator/arena/startOffset"
(i32.and
(i32.add
(get_global $HEAP_BASE)
@ -3077,6 +3078,9 @@
(i32.const -8)
)
)
(set_global "$(lib)/allocator/arena/offset"
(get_global "$(lib)/allocator/arena/startOffset")
)
(set_global $std/array/arr
(call "$(lib)/allocator/arena/allocate_memory"
(i32.const 12)

View File

@ -13,6 +13,7 @@
(global "$(lib)/allocator/common/alignment/BITS" i32 (i32.const 3))
(global "$(lib)/allocator/common/alignment/SIZE" i32 (i32.const 8))
(global "$(lib)/allocator/common/alignment/MASK" i32 (i32.const 7))
(global "$(lib)/allocator/arena/startOffset" (mut i32) (i32.const 0))
(global "$(lib)/allocator/arena/offset" (mut i32) (i32.const 0))
(global $std/array/arr (mut i32) (i32.const 0))
(global $std/array/i (mut i32) (i32.const 0))
@ -3434,7 +3435,7 @@
)
)
(func $start (; 19 ;) (type $v)
(set_global "$(lib)/allocator/arena/offset"
(set_global "$(lib)/allocator/arena/startOffset"
(i32.and
(i32.add
(get_global $HEAP_BASE)
@ -3446,6 +3447,9 @@
)
)
)
(set_global "$(lib)/allocator/arena/offset"
(get_global "$(lib)/allocator/arena/startOffset")
)
(set_global $std/array/arr
(call "$(lib)/allocator/arena/allocate_memory"
(i32.add

View File

@ -2,6 +2,7 @@
(type $ii (func (param i32) (result i32)))
(type $ifv (func (param i32 f32)))
(type $v (func))
(global "$(lib)/allocator/arena/startOffset" (mut i32) (i32.const 0))
(global "$(lib)/allocator/arena/offset" (mut i32) (i32.const 0))
(global $std/new/aClass (mut i32) (i32.const 0))
(global $HEAP_BASE i32 (i32.const 4))
@ -107,7 +108,7 @@
)
(func $start (; 2 ;) (type $v)
(local $0 i32)
(set_global "$(lib)/allocator/arena/offset"
(set_global "$(lib)/allocator/arena/startOffset"
(i32.and
(i32.add
(get_global $HEAP_BASE)
@ -116,6 +117,9 @@
(i32.const -8)
)
)
(set_global "$(lib)/allocator/arena/offset"
(get_global "$(lib)/allocator/arena/startOffset")
)
(set_global $std/new/aClass
(block (result i32)
(i32.store

View File

@ -6,6 +6,7 @@
(global "$(lib)/allocator/common/alignment/BITS" i32 (i32.const 3))
(global "$(lib)/allocator/common/alignment/SIZE" i32 (i32.const 8))
(global "$(lib)/allocator/common/alignment/MASK" i32 (i32.const 7))
(global "$(lib)/allocator/arena/startOffset" (mut i32) (i32.const 0))
(global "$(lib)/allocator/arena/offset" (mut i32) (i32.const 0))
(global $std/new/aClass (mut i32) (i32.const 0))
(global $HEAP_BASE i32 (i32.const 4))
@ -132,7 +133,7 @@
)
(func $start (; 2 ;) (type $v)
(local $0 i32)
(set_global "$(lib)/allocator/arena/offset"
(set_global "$(lib)/allocator/arena/startOffset"
(i32.and
(i32.add
(get_global $HEAP_BASE)
@ -144,6 +145,9 @@
)
)
)
(set_global "$(lib)/allocator/arena/offset"
(get_global "$(lib)/allocator/arena/startOffset")
)
(set_global $std/new/aClass
(block (result i32)
(set_local $0

View File

@ -6,6 +6,7 @@
(type $iv (func (param i32)))
(type $v (func))
(import "env" "abort" (func $abort (param i32 i32 i32 i32)))
(global "$(lib)/allocator/arena/startOffset" (mut i32) (i32.const 0))
(global "$(lib)/allocator/arena/offset" (mut i32) (i32.const 0))
(global $std/set/set (mut i32) (i32.const 0))
(global $HEAP_BASE i32 (i32.const 56))
@ -2273,7 +2274,7 @@
)
)
(func $start (; 10 ;) (type $v)
(set_global "$(lib)/allocator/arena/offset"
(set_global "$(lib)/allocator/arena/startOffset"
(i32.and
(i32.add
(get_global $HEAP_BASE)
@ -2282,6 +2283,9 @@
(i32.const -8)
)
)
(set_global "$(lib)/allocator/arena/offset"
(get_global "$(lib)/allocator/arena/startOffset")
)
(set_global $std/set/set
(call "$(lib)/allocator/arena/allocate_memory"
(i32.const 12)

View File

@ -10,6 +10,7 @@
(global "$(lib)/allocator/common/alignment/BITS" i32 (i32.const 3))
(global "$(lib)/allocator/common/alignment/SIZE" i32 (i32.const 8))
(global "$(lib)/allocator/common/alignment/MASK" i32 (i32.const 7))
(global "$(lib)/allocator/arena/startOffset" (mut i32) (i32.const 0))
(global "$(lib)/allocator/arena/offset" (mut i32) (i32.const 0))
(global $std/set/set (mut i32) (i32.const 0))
(global $HEAP_BASE i32 (i32.const 56))
@ -2596,7 +2597,7 @@
)
)
(func $start (; 10 ;) (type $v)
(set_global "$(lib)/allocator/arena/offset"
(set_global "$(lib)/allocator/arena/startOffset"
(i32.and
(i32.add
(get_global $HEAP_BASE)
@ -2608,6 +2609,9 @@
)
)
)
(set_global "$(lib)/allocator/arena/offset"
(get_global "$(lib)/allocator/arena/startOffset")
)
(set_global $std/set/set
(call "$(lib)/allocator/arena/allocate_memory"
(i32.add