More stdlib setup

This commit is contained in:
dcodeIO
2017-12-16 17:54:53 +01:00
parent 85a9fb1eb5
commit 2720515982
47 changed files with 875 additions and 733 deletions

View File

@ -1,6 +1,6 @@
(module
(type $v (func))
(global $HEAP_START i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
@ -58,7 +58,7 @@
f64
isize
usize
HEAP_START
HEAP_BASE
[program.exports]
;)

View File

@ -5,7 +5,7 @@
(global $binary/I (mut i64) (i64.const 0))
(global $binary/f (mut f32) (f32.const 0))
(global $binary/F (mut f64) (f64.const 0))
(global $HEAP_START i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
@ -861,7 +861,7 @@
f64
isize
usize
HEAP_START
HEAP_BASE
binary/b
binary/i
binary/I

View File

@ -6,7 +6,7 @@
(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 $HEAP_START i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
@ -1078,7 +1078,7 @@
f64
isize
usize
HEAP_START
HEAP_BASE
builtins/b
builtins/i
builtins/I

View File

@ -3,7 +3,7 @@
(type $fff (func (param f32 f32) (result f32)))
(type $v (func))
(global $class/Animal.MAX (mut i32) (i32.const 1))
(global $HEAP_START i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
@ -86,7 +86,7 @@
f64
isize
usize
HEAP_START
HEAP_BASE
class/Animal
class/Animal.MAX
class/Animal.add

View File

@ -1,7 +1,7 @@
(module
(type $v (func))
(import "env" "external" (func $declare/external))
(global $HEAP_START i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "external" (func $declare/external))
(export "memory" (memory $0))
@ -51,7 +51,7 @@
f64
isize
usize
HEAP_START
HEAP_BASE
declare/external
[program.exports]
declare/external

View File

@ -1,6 +1,6 @@
(module
(type $iv (func (param i32)))
(global $HEAP_START i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "loopDo" (func $do/loopDo))
(export "loopDoInDo" (func $do/loopDoInDo))
@ -96,7 +96,7 @@
f64
isize
usize
HEAP_START
HEAP_BASE
do/loopDo
do/loopDoInDo
[program.exports]

View File

@ -15,7 +15,7 @@
(global $enum/Mixed.FOUR i32 (i32.const 4))
(global $enum/NonConstant.ZERO (mut i32) (i32.const 0))
(global $enum/NonConstant.ONE (mut i32) (i32.const 0))
(global $HEAP_START i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
@ -81,7 +81,7 @@
f64
isize
usize
HEAP_START
HEAP_BASE
enum/Implicit
enum/Explicit
enum/Mixed

View File

@ -3,7 +3,7 @@
(type $v (func))
(global $export/a i32 (i32.const 1))
(global $export/b i32 (i32.const 2))
(global $HEAP_START i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "add" (func $export/add))
(export "renamed_sub" (func $export/sub))
@ -75,7 +75,7 @@
f64
isize
usize
HEAP_START
HEAP_BASE
export/add
export/sub
export/a

View File

@ -1,7 +1,7 @@
(module
(type $v (func))
(global $for/i (mut i32) (i32.const 0))
(global $HEAP_START i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
@ -192,7 +192,7 @@
f64
isize
usize
HEAP_START
HEAP_BASE
for/i
[program.exports]

View File

@ -4,7 +4,7 @@
(global $../../examples/game-of-life/assembly/game-of-life/w (mut i32) (i32.const 0))
(global $../../examples/game-of-life/assembly/game-of-life/h (mut i32) (i32.const 0))
(global $../../examples/game-of-life/assembly/game-of-life/s (mut i32) (i32.const 0))
(global $HEAP_START i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "init" (func $../../examples/game-of-life/assembly/game-of-life/init))
(export "step" (func $../../examples/game-of-life/assembly/game-of-life/step))
@ -353,7 +353,7 @@
f64
isize
usize
HEAP_START
HEAP_BASE
../../examples/game-of-life/assembly/game-of-life/w
../../examples/game-of-life/assembly/game-of-life/h
../../examples/game-of-life/assembly/game-of-life/s

View File

@ -4,7 +4,7 @@
(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 $HEAP_START i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "getHi" (func $../../examples/i64-polyfill/assembly/i64/getHi))
(export "getLo" (func $../../examples/i64-polyfill/assembly/i64/getLo))
@ -1234,7 +1234,7 @@
f64
isize
usize
HEAP_START
HEAP_BASE
../../examples/i64-polyfill/assembly/i64/lo
../../examples/i64-polyfill/assembly/i64/hi
../../examples/i64-polyfill/assembly/i64/getLo

View File

@ -1,6 +1,6 @@
(module
(type $ii (func (param i32) (result i32)))
(global $HEAP_START i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "ifThenElse" (func $if/ifThenElse))
(export "ifThen" (func $if/ifThen))
@ -91,7 +91,7 @@
f64
isize
usize
HEAP_START
HEAP_BASE
if/ifThenElse
if/ifThen
if/ifThenElseBlock

View File

@ -3,7 +3,7 @@
(type $v (func))
(global $export/a i32 (i32.const 1))
(global $export/b i32 (i32.const 2))
(global $HEAP_START i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
@ -86,7 +86,7 @@
f64
isize
usize
HEAP_START
HEAP_BASE
export/add
export/sub
export/a

View File

@ -22,7 +22,7 @@
(global $f32.MAX_SAFE_INTEGER f32 (f32.const 16777215))
(global $f64.MIN_SAFE_INTEGER f64 (f64.const -9007199254740991))
(global $f64.MAX_SAFE_INTEGER f64 (f64.const 9007199254740991))
(global $HEAP_START i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
@ -152,7 +152,7 @@
f64
isize
usize
HEAP_START
HEAP_BASE
[program.exports]
;)

View File

@ -1,6 +1,6 @@
(module
(type $v (func))
(global $HEAP_START i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
@ -184,7 +184,7 @@
f64
isize
usize
HEAP_START
HEAP_BASE
[program.exports]
;)

View File

@ -4,7 +4,7 @@
(global $logical/I (mut i64) (i64.const 0))
(global $logical/f (mut f32) (f32.const 0))
(global $logical/F (mut f64) (f64.const 0))
(global $HEAP_START i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
@ -300,7 +300,7 @@
f64
isize
usize
HEAP_START
HEAP_BASE
logical/i
logical/I
logical/f

View File

@ -3,7 +3,7 @@
(type $v (func))
(global $memcpy/base i32 (i32.const 8))
(global $memcpy/dest (mut i32) (i32.const 0))
(global $HEAP_START i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "memcpy" (func $memcpy/memcpy))
(export "memory" (memory $0))
@ -2098,7 +2098,7 @@
f64
isize
usize
HEAP_START
HEAP_BASE
memcpy/memcpy
memcpy/base
memcpy/dest

View File

@ -1,7 +1,7 @@
(module
(type $v (func))
(global $namespace/Outer.Inner.aVar (mut i32) (i32.const 0))
(global $HEAP_START i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "test" (func $namespace/test))
(export "memory" (memory $0))
@ -62,7 +62,7 @@
f64
isize
usize
HEAP_START
HEAP_BASE
namespace/Outer
namespace/Outer.Inner
namespace/Outer.Inner.aVar

View File

@ -4,7 +4,7 @@
(global $portable-conversions/I (mut i64) (i64.const 0))
(global $portable-conversions/f (mut f32) (f32.const 0))
(global $portable-conversions/F (mut f64) (f64.const 0))
(global $HEAP_START i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
@ -374,7 +374,7 @@
f64
isize
usize
HEAP_START
HEAP_BASE
portable-conversions/i
portable-conversions/I
portable-conversions/f

View File

@ -3,7 +3,7 @@
(type $v (func))
(global $export/a i32 (i32.const 1))
(global $export/b i32 (i32.const 2))
(global $HEAP_START i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "add" (func $export/add))
(export "renamed_sub" (func $export/sub))
@ -91,7 +91,7 @@
f64
isize
usize
HEAP_START
HEAP_BASE
export/add
export/sub
export/a

View File

@ -1,11 +0,0 @@
(module
(type $v (func))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
(func $start (; 0 ;) (type $v)
(block $__inlined_func$Array.test
(nop)
)
)
)

View File

@ -1,12 +1,4 @@
(module
(type $v (func))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
(func $Array.test (; 0 ;) (type $v)
(nop)
)
(func $start (; 1 ;) (type $v)
(call $Array.test)
)
)

View File

@ -1,2 +1 @@
// Array.fromPtr<i32>(1);
Array.test();

View File

@ -1,14 +1,7 @@
(module
(type $v (func))
(global $HEAP_START i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
(func $Array.test (; 0 ;) (type $v)
)
(func $start (; 1 ;) (type $v)
(call $Array.test)
)
)
(;
[program.elements]
@ -55,21 +48,30 @@
f64
isize
usize
HEAP_START
HEAP_BASE
Array
Array.fromPtr
Array.test
Error
RangeError
heap/ALIGN_LOG2
heap/ALIGN_SIZE
heap/ALIGN_MASK
heap/HEAP_OFFSET
Heap
Heap.allocate
Heap.dispose
Heap.get_used
Heap.get_free
Heap.get_size
Heap.allocate
Heap.dispose
Heap.copy
Map
Set
String
[program.exports]
Array
Error
RangeError
Heap
Map
Set
String
;)

View File

@ -4,7 +4,7 @@
(type $v (func))
(global $heap/HEAP_OFFSET (mut i32) (i32.const 0))
(global $std/heap/ptr (mut i32) (i32.const 0))
(global $HEAP_START i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
@ -100,7 +100,7 @@
(func $start (; 1 ;) (type $v)
(local $0 i32)
(set_global $heap/HEAP_OFFSET
(get_global $HEAP_START)
(get_global $HEAP_BASE)
)
(set_global $std/heap/ptr
(call $Heap.allocate

View File

@ -4,7 +4,7 @@
(type $v (func))
(global $heap/HEAP_OFFSET (mut i32) (i32.const 0))
(global $std/heap/ptr (mut i32) (i32.const 0))
(global $HEAP_START i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
@ -102,7 +102,7 @@
)
(func $start (; 2 ;) (type $v)
(set_global $heap/HEAP_OFFSET
(get_global $HEAP_START)
(get_global $HEAP_BASE)
)
(set_global $std/heap/ptr
(call $Heap.allocate

View File

@ -8,7 +8,7 @@
(global $heap/ALIGN_SIZE i32 (i32.const 8))
(global $heap/ALIGN_MASK i32 (i32.const 7))
(global $std/heap/ptr (mut i32) (i32.const 0))
(global $HEAP_START i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
@ -113,7 +113,7 @@
)
(func $start (; 2 ;) (type $v)
(set_global $heap/HEAP_OFFSET
(get_global $HEAP_START)
(get_global $HEAP_BASE)
)
(set_global $std/heap/ptr
(call $Heap.allocate
@ -170,22 +170,31 @@
f64
isize
usize
HEAP_START
HEAP_BASE
Array
Array.fromPtr
Array.test
Error
RangeError
heap/ALIGN_LOG2
heap/ALIGN_SIZE
heap/ALIGN_MASK
heap/HEAP_OFFSET
Heap
Heap.allocate
Heap.dispose
Heap.get_used
Heap.get_free
Heap.get_size
Heap.allocate
Heap.dispose
Heap.copy
Map
Set
String
std/heap/ptr
[program.exports]
Array
Error
RangeError
Heap
Map
Set
String
;)

View File

@ -1,6 +1,6 @@
(module
(type $ii (func (param i32) (result i32)))
(global $HEAP_START i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "doSwitch" (func $switch/doSwitch))
(export "doSwitchDefaultFirst" (func $switch/doSwitchDefaultFirst))
@ -190,7 +190,7 @@
f64
isize
usize
HEAP_START
HEAP_BASE
switch/doSwitch
switch/doSwitchDefaultFirst
switch/doSwitchDefaultOmitted

View File

@ -1,7 +1,7 @@
(module
(type $v (func))
(global $ternary/a (mut i32) (i32.const 0))
(global $HEAP_START i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
@ -78,7 +78,7 @@
f64
isize
usize
HEAP_START
HEAP_BASE
ternary/a
[program.exports]

View File

@ -21,7 +21,7 @@
(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 $HEAP_START i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "control$construct" (func $tlsf/control$construct))
(export "memory" (memory $0))
@ -373,7 +373,7 @@
f64
isize
usize
HEAP_START
HEAP_BASE
tlsf/fls
tlsf/ffs
tlsf/ALIGN_SIZE_LOG2

View File

@ -4,7 +4,7 @@
(global $unary/I (mut i64) (i64.const 0))
(global $unary/f (mut f32) (f32.const 0))
(global $unary/F (mut f64) (f64.const 0))
(global $HEAP_START i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "memory" (memory $0))
(start $start)
@ -666,7 +666,7 @@
f64
isize
usize
HEAP_START
HEAP_BASE
unary/i
unary/I
unary/f

View File

@ -1,6 +1,6 @@
(module
(type $iv (func (param i32)))
(global $HEAP_START i32 (i32.const 4))
(global $HEAP_BASE i32 (i32.const 4))
(memory $0 1)
(export "loopWhile" (func $while/loopWhile))
(export "loopWhileInWhile" (func $while/loopWhileInWhile))
@ -105,7 +105,7 @@
f64
isize
usize
HEAP_START
HEAP_BASE
while/loopWhile
while/loopWhileInWhile
[program.exports]