mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-27 05:31:56 +00:00
Update binaryen to latest nightly; Source map support
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
import "std:memory/arena";
|
||||
import "allocator/arena";
|
||||
|
||||
const size: usize = 42;
|
||||
let ptr1: usize = allocate_memory(size);
|
||||
@ -22,6 +22,6 @@ assert(compare_memory(ptr1, ptr2, size) == 0);
|
||||
free_memory(ptr1);
|
||||
free_memory(ptr2);
|
||||
|
||||
clear_memory();
|
||||
reset_memory();
|
||||
ptr1 = allocate_memory(size);
|
||||
assert(ptr1 == HEAP_BASE);
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
import "std:memory/arena";
|
||||
import "allocator/arena";
|
||||
|
||||
var arr = changetype<i32[]>(allocate_memory(sizeof<usize>() + 2 * sizeof<i32>()));
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,171 +1,332 @@
|
||||
(module
|
||||
(type $iiiiv (func (param i32 i32 i32 i32)))
|
||||
(type $iii (func (param i32 i32) (result i32)))
|
||||
(type $iiiv (func (param i32 i32 i32)))
|
||||
(type $v (func))
|
||||
(import "env" "abort" (func $abort (param i32 i32 i32 i32)))
|
||||
(global $std/carray/arr (mut i32) (i32.const 0))
|
||||
(global $HEAP_BASE i32 (i32.const 4))
|
||||
(global $HEAP_BASE i32 (i32.const 40))
|
||||
(memory $0 1)
|
||||
(data (i32.const 8) "\0d\00\00\00s\00t\00d\00/\00c\00a\00r\00r\00a\00y\00.\00t\00s")
|
||||
(export "memory" (memory $0))
|
||||
(start $start)
|
||||
(func $std:array/CArray#__get (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(func "$(lib)/array/CArray#__get" (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
;;@ (lib)/array.ts:173:4
|
||||
(if
|
||||
;;@ (lib)/array.ts:173:8
|
||||
(i32.lt_s
|
||||
(get_local $1)
|
||||
;;@ (lib)/array.ts:173:16
|
||||
(i32.const 0)
|
||||
)
|
||||
;;@ (lib)/array.ts:174:6
|
||||
(unreachable)
|
||||
)
|
||||
;;@ (lib)/array.ts:175:11
|
||||
(i32.load
|
||||
;;@ (lib)/array.ts:175:19
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
;;@ (lib)/array.ts:175:45
|
||||
(i32.mul
|
||||
(get_local $1)
|
||||
;;@ (lib)/array.ts:175:60
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(func $std:array/CArray#__set (; 1 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(func "$(lib)/array/CArray#__set" (; 2 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
;;@ (lib)/array.ts:180:4
|
||||
(if
|
||||
;;@ (lib)/array.ts:180:8
|
||||
(i32.lt_s
|
||||
(get_local $1)
|
||||
;;@ (lib)/array.ts:180:16
|
||||
(i32.const 0)
|
||||
)
|
||||
;;@ (lib)/array.ts:181:6
|
||||
(unreachable)
|
||||
)
|
||||
;;@ (lib)/array.ts:182:4
|
||||
(i32.store
|
||||
;;@ (lib)/array.ts:182:13
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
;;@ (lib)/array.ts:182:39
|
||||
(i32.mul
|
||||
(get_local $1)
|
||||
;;@ (lib)/array.ts:182:54
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
;;@ (lib)/array.ts:182:67
|
||||
(get_local $2)
|
||||
)
|
||||
)
|
||||
(func $start (; 2 ;) (type $v)
|
||||
(func $start (; 3 ;) (type $v)
|
||||
(local $0 i32)
|
||||
(set_global $std/carray/arr
|
||||
;;@ std/carray.ts:6:23
|
||||
(get_global $HEAP_BASE)
|
||||
)
|
||||
;;@ std/carray.ts:8:0
|
||||
(if
|
||||
;;@ std/carray.ts:8:7
|
||||
(i32.load
|
||||
;;@ std/carray.ts:8:17
|
||||
(get_global $HEAP_BASE)
|
||||
)
|
||||
(unreachable)
|
||||
(block
|
||||
(call $abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 8)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
;;@ std/carray.ts:9:0
|
||||
(if
|
||||
;;@ std/carray.ts:9:7
|
||||
(i32.load
|
||||
;;@ std/carray.ts:9:17
|
||||
(i32.add
|
||||
(get_global $HEAP_BASE)
|
||||
;;@ std/carray.ts:9:29
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
(unreachable)
|
||||
(block
|
||||
(call $abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 9)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
;;@ std/carray.ts:11:0
|
||||
(if
|
||||
(call $std:array/CArray#__get
|
||||
;;@ std/carray.ts:11:7
|
||||
(call "$(lib)/array/CArray#__get"
|
||||
(get_global $std/carray/arr)
|
||||
;;@ std/carray.ts:11:11
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
(block
|
||||
(call $abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 11)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
;;@ std/carray.ts:12:0
|
||||
(if
|
||||
(call $std:array/CArray#__get
|
||||
;;@ std/carray.ts:12:7
|
||||
(call "$(lib)/array/CArray#__get"
|
||||
(get_global $std/carray/arr)
|
||||
;;@ std/carray.ts:12:11
|
||||
(i32.const 1)
|
||||
)
|
||||
(unreachable)
|
||||
(block
|
||||
(call $abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 12)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(call $std:array/CArray#__set
|
||||
;;@ std/carray.ts:14:0
|
||||
(call "$(lib)/array/CArray#__set"
|
||||
(get_global $std/carray/arr)
|
||||
;;@ std/carray.ts:14:4
|
||||
(i32.const 0)
|
||||
;;@ std/carray.ts:14:9
|
||||
(i32.const 42)
|
||||
)
|
||||
(call $std:array/CArray#__set
|
||||
;;@ std/carray.ts:15:0
|
||||
(call "$(lib)/array/CArray#__set"
|
||||
(get_global $std/carray/arr)
|
||||
;;@ std/carray.ts:15:4
|
||||
(i32.const 1)
|
||||
;;@ std/carray.ts:15:9
|
||||
(i32.const 24)
|
||||
)
|
||||
;;@ std/carray.ts:17:0
|
||||
(if
|
||||
;;@ std/carray.ts:17:7
|
||||
(i32.ne
|
||||
(i32.load
|
||||
;;@ std/carray.ts:17:17
|
||||
(get_global $HEAP_BASE)
|
||||
)
|
||||
;;@ std/carray.ts:17:31
|
||||
(i32.const 42)
|
||||
)
|
||||
(unreachable)
|
||||
(block
|
||||
(call $abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 17)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
;;@ std/carray.ts:18:0
|
||||
(if
|
||||
;;@ std/carray.ts:18:7
|
||||
(i32.ne
|
||||
(i32.load
|
||||
;;@ std/carray.ts:18:17
|
||||
(i32.add
|
||||
(get_global $HEAP_BASE)
|
||||
;;@ std/carray.ts:18:29
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
;;@ std/carray.ts:18:35
|
||||
(i32.const 24)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
(if
|
||||
(i32.ne
|
||||
(call $std:array/CArray#__get
|
||||
(get_global $std/carray/arr)
|
||||
(block
|
||||
(call $abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 18)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
;;@ std/carray.ts:20:0
|
||||
(if
|
||||
;;@ std/carray.ts:20:7
|
||||
(i32.ne
|
||||
(call "$(lib)/array/CArray#__get"
|
||||
(get_global $std/carray/arr)
|
||||
;;@ std/carray.ts:20:11
|
||||
(i32.const 0)
|
||||
)
|
||||
;;@ std/carray.ts:20:17
|
||||
(i32.const 42)
|
||||
)
|
||||
(unreachable)
|
||||
(block
|
||||
(call $abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 20)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
;;@ std/carray.ts:21:0
|
||||
(if
|
||||
;;@ std/carray.ts:21:7
|
||||
(i32.ne
|
||||
(call $std:array/CArray#__get
|
||||
(call "$(lib)/array/CArray#__get"
|
||||
(get_global $std/carray/arr)
|
||||
;;@ std/carray.ts:21:11
|
||||
(i32.const 1)
|
||||
)
|
||||
;;@ std/carray.ts:21:17
|
||||
(i32.const 24)
|
||||
)
|
||||
(unreachable)
|
||||
(block
|
||||
(call $abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 21)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
;;@ std/carray.ts:23:0
|
||||
(if
|
||||
;;@ std/carray.ts:23:7
|
||||
(block (result i32)
|
||||
(call $std:array/CArray#__set
|
||||
(call "$(lib)/array/CArray#__set"
|
||||
;;@ std/carray.ts:23:8
|
||||
(get_global $std/carray/arr)
|
||||
;;@ std/carray.ts:23:12
|
||||
(i32.const 3)
|
||||
(tee_local $0
|
||||
;;@ std/carray.ts:23:17
|
||||
(i32.const 9000)
|
||||
)
|
||||
)
|
||||
;;@ std/carray.ts:23:7
|
||||
(i32.ne
|
||||
(get_local $0)
|
||||
;;@ std/carray.ts:23:26
|
||||
(i32.const 9000)
|
||||
)
|
||||
)
|
||||
(unreachable)
|
||||
(block
|
||||
(call $abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 23)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
;;@ std/carray.ts:25:0
|
||||
(if
|
||||
;;@ std/carray.ts:25:7
|
||||
(i32.ne
|
||||
(i32.load
|
||||
;;@ std/carray.ts:25:17
|
||||
(i32.add
|
||||
(get_global $HEAP_BASE)
|
||||
;;@ std/carray.ts:25:29
|
||||
(i32.const 12)
|
||||
)
|
||||
)
|
||||
;;@ std/carray.ts:25:36
|
||||
(i32.const 9000)
|
||||
)
|
||||
(unreachable)
|
||||
(block
|
||||
(call $abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 25)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
;;@ std/carray.ts:26:0
|
||||
(if
|
||||
;;@ std/carray.ts:26:7
|
||||
(i32.ne
|
||||
(call $std:array/CArray#__get
|
||||
(call "$(lib)/array/CArray#__get"
|
||||
(get_global $std/carray/arr)
|
||||
;;@ std/carray.ts:26:11
|
||||
(i32.const 3)
|
||||
)
|
||||
;;@ std/carray.ts:26:17
|
||||
(i32.const 9000)
|
||||
)
|
||||
(unreachable)
|
||||
(block
|
||||
(call $abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 26)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
@ -1,207 +1,372 @@
|
||||
(module
|
||||
(type $iiiiv (func (param i32 i32 i32 i32)))
|
||||
(type $iii (func (param i32 i32) (result i32)))
|
||||
(type $iiiv (func (param i32 i32 i32)))
|
||||
(type $v (func))
|
||||
(import "env" "abort" (func $abort (param i32 i32 i32 i32)))
|
||||
(global $std/carray/arr (mut i32) (i32.const 0))
|
||||
(global $HEAP_BASE i32 (i32.const 4))
|
||||
(global $HEAP_BASE i32 (i32.const 40))
|
||||
(memory $0 1)
|
||||
(data (i32.const 8) "\0d\00\00\00s\00t\00d\00/\00c\00a\00r\00r\00a\00y\00.\00t\00s\00")
|
||||
(export "memory" (memory $0))
|
||||
(start $start)
|
||||
(func $std:array/CArray#__get (; 0 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(func "$(lib)/array/CArray#__get" (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
;;@ (lib)/array.ts:173:4
|
||||
(if
|
||||
;;@ (lib)/array.ts:173:8
|
||||
(i32.lt_s
|
||||
(get_local $1)
|
||||
;;@ (lib)/array.ts:173:16
|
||||
(i32.const 0)
|
||||
)
|
||||
;;@ (lib)/array.ts:174:6
|
||||
(unreachable)
|
||||
)
|
||||
;;@ (lib)/array.ts:175:71
|
||||
(return
|
||||
;;@ (lib)/array.ts:175:11
|
||||
(i32.load
|
||||
;;@ (lib)/array.ts:175:19
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
;;@ (lib)/array.ts:175:45
|
||||
(i32.mul
|
||||
(get_local $1)
|
||||
;;@ (lib)/array.ts:175:60
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(func $std:array/CArray#__set (; 1 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(func "$(lib)/array/CArray#__set" (; 2 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
;;@ (lib)/array.ts:180:4
|
||||
(if
|
||||
;;@ (lib)/array.ts:180:8
|
||||
(i32.lt_s
|
||||
(get_local $1)
|
||||
;;@ (lib)/array.ts:180:16
|
||||
(i32.const 0)
|
||||
)
|
||||
;;@ (lib)/array.ts:181:6
|
||||
(unreachable)
|
||||
)
|
||||
;;@ (lib)/array.ts:182:4
|
||||
(i32.store
|
||||
;;@ (lib)/array.ts:182:13
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
;;@ (lib)/array.ts:182:39
|
||||
(i32.mul
|
||||
(get_local $1)
|
||||
;;@ (lib)/array.ts:182:54
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
;;@ (lib)/array.ts:182:67
|
||||
(get_local $2)
|
||||
)
|
||||
)
|
||||
(func $start (; 2 ;) (type $v)
|
||||
(func $start (; 3 ;) (type $v)
|
||||
(local $0 i32)
|
||||
(set_global $std/carray/arr
|
||||
;;@ std/carray.ts:6:23
|
||||
(get_global $HEAP_BASE)
|
||||
)
|
||||
;;@ std/carray.ts:8:0
|
||||
(if
|
||||
(i32.eqz
|
||||
;;@ std/carray.ts:8:7
|
||||
(i32.eq
|
||||
(i32.load
|
||||
;;@ std/carray.ts:8:17
|
||||
(get_global $HEAP_BASE)
|
||||
)
|
||||
;;@ std/carray.ts:8:31
|
||||
(i32.const 0)
|
||||
)
|
||||
)
|
||||
(unreachable)
|
||||
(block
|
||||
(call $abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 8)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
;;@ std/carray.ts:9:0
|
||||
(if
|
||||
(i32.eqz
|
||||
;;@ std/carray.ts:9:7
|
||||
(i32.eq
|
||||
(i32.load
|
||||
;;@ std/carray.ts:9:17
|
||||
(i32.add
|
||||
(get_global $HEAP_BASE)
|
||||
;;@ std/carray.ts:9:29
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
;;@ std/carray.ts:9:35
|
||||
(i32.const 0)
|
||||
)
|
||||
)
|
||||
(unreachable)
|
||||
(block
|
||||
(call $abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 9)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
;;@ std/carray.ts:11:0
|
||||
(if
|
||||
(i32.eqz
|
||||
;;@ std/carray.ts:11:7
|
||||
(i32.eq
|
||||
(call $std:array/CArray#__get
|
||||
(call "$(lib)/array/CArray#__get"
|
||||
(get_global $std/carray/arr)
|
||||
;;@ std/carray.ts:11:11
|
||||
(i32.const 0)
|
||||
)
|
||||
;;@ std/carray.ts:11:17
|
||||
(i32.const 0)
|
||||
)
|
||||
)
|
||||
(unreachable)
|
||||
(block
|
||||
(call $abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 11)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
;;@ std/carray.ts:12:0
|
||||
(if
|
||||
(i32.eqz
|
||||
;;@ std/carray.ts:12:7
|
||||
(i32.eq
|
||||
(call $std:array/CArray#__get
|
||||
(call "$(lib)/array/CArray#__get"
|
||||
(get_global $std/carray/arr)
|
||||
;;@ std/carray.ts:12:11
|
||||
(i32.const 1)
|
||||
)
|
||||
;;@ std/carray.ts:12:17
|
||||
(i32.const 0)
|
||||
)
|
||||
)
|
||||
(unreachable)
|
||||
(block
|
||||
(call $abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 12)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
(call $std:array/CArray#__set
|
||||
;;@ std/carray.ts:14:0
|
||||
(call "$(lib)/array/CArray#__set"
|
||||
(get_global $std/carray/arr)
|
||||
;;@ std/carray.ts:14:4
|
||||
(i32.const 0)
|
||||
;;@ std/carray.ts:14:9
|
||||
(i32.const 42)
|
||||
)
|
||||
(call $std:array/CArray#__set
|
||||
;;@ std/carray.ts:15:0
|
||||
(call "$(lib)/array/CArray#__set"
|
||||
(get_global $std/carray/arr)
|
||||
;;@ std/carray.ts:15:4
|
||||
(i32.const 1)
|
||||
;;@ std/carray.ts:15:9
|
||||
(i32.const 24)
|
||||
)
|
||||
;;@ std/carray.ts:17:0
|
||||
(if
|
||||
(i32.eqz
|
||||
;;@ std/carray.ts:17:7
|
||||
(i32.eq
|
||||
(i32.load
|
||||
;;@ std/carray.ts:17:17
|
||||
(get_global $HEAP_BASE)
|
||||
)
|
||||
;;@ std/carray.ts:17:31
|
||||
(i32.const 42)
|
||||
)
|
||||
)
|
||||
(unreachable)
|
||||
(block
|
||||
(call $abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 17)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
;;@ std/carray.ts:18:0
|
||||
(if
|
||||
(i32.eqz
|
||||
;;@ std/carray.ts:18:7
|
||||
(i32.eq
|
||||
(i32.load
|
||||
;;@ std/carray.ts:18:17
|
||||
(i32.add
|
||||
(get_global $HEAP_BASE)
|
||||
;;@ std/carray.ts:18:29
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
;;@ std/carray.ts:18:35
|
||||
(i32.const 24)
|
||||
)
|
||||
)
|
||||
(unreachable)
|
||||
(block
|
||||
(call $abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 18)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
;;@ std/carray.ts:20:0
|
||||
(if
|
||||
(i32.eqz
|
||||
;;@ std/carray.ts:20:7
|
||||
(i32.eq
|
||||
(call $std:array/CArray#__get
|
||||
(call "$(lib)/array/CArray#__get"
|
||||
(get_global $std/carray/arr)
|
||||
;;@ std/carray.ts:20:11
|
||||
(i32.const 0)
|
||||
)
|
||||
;;@ std/carray.ts:20:17
|
||||
(i32.const 42)
|
||||
)
|
||||
)
|
||||
(unreachable)
|
||||
(block
|
||||
(call $abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 20)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
;;@ std/carray.ts:21:0
|
||||
(if
|
||||
(i32.eqz
|
||||
;;@ std/carray.ts:21:7
|
||||
(i32.eq
|
||||
(call $std:array/CArray#__get
|
||||
(call "$(lib)/array/CArray#__get"
|
||||
(get_global $std/carray/arr)
|
||||
;;@ std/carray.ts:21:11
|
||||
(i32.const 1)
|
||||
)
|
||||
;;@ std/carray.ts:21:17
|
||||
(i32.const 24)
|
||||
)
|
||||
)
|
||||
(unreachable)
|
||||
(block
|
||||
(call $abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 21)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
;;@ std/carray.ts:23:0
|
||||
(if
|
||||
(i32.eqz
|
||||
;;@ std/carray.ts:23:7
|
||||
(i32.eq
|
||||
(block (result i32)
|
||||
(call $std:array/CArray#__set
|
||||
(call "$(lib)/array/CArray#__set"
|
||||
;;@ std/carray.ts:23:8
|
||||
(get_global $std/carray/arr)
|
||||
;;@ std/carray.ts:23:12
|
||||
(i32.const 3)
|
||||
(tee_local $0
|
||||
;;@ std/carray.ts:23:17
|
||||
(i32.const 9000)
|
||||
)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
;;@ std/carray.ts:23:26
|
||||
(i32.const 9000)
|
||||
)
|
||||
)
|
||||
(unreachable)
|
||||
(block
|
||||
(call $abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 23)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
;;@ std/carray.ts:25:0
|
||||
(if
|
||||
(i32.eqz
|
||||
;;@ std/carray.ts:25:7
|
||||
(i32.eq
|
||||
(i32.load
|
||||
;;@ std/carray.ts:25:17
|
||||
(i32.add
|
||||
(get_global $HEAP_BASE)
|
||||
;;@ std/carray.ts:25:29
|
||||
(i32.const 12)
|
||||
)
|
||||
)
|
||||
;;@ std/carray.ts:25:36
|
||||
(i32.const 9000)
|
||||
)
|
||||
)
|
||||
(unreachable)
|
||||
(block
|
||||
(call $abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 25)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
;;@ std/carray.ts:26:0
|
||||
(if
|
||||
(i32.eqz
|
||||
;;@ std/carray.ts:26:7
|
||||
(i32.eq
|
||||
(call $std:array/CArray#__get
|
||||
(call "$(lib)/array/CArray#__get"
|
||||
(get_global $std/carray/arr)
|
||||
;;@ std/carray.ts:26:11
|
||||
(i32.const 3)
|
||||
)
|
||||
;;@ std/carray.ts:26:17
|
||||
(i32.const 9000)
|
||||
)
|
||||
)
|
||||
(unreachable)
|
||||
(block
|
||||
(call $abort
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
(i32.const 26)
|
||||
(i32.const 0)
|
||||
)
|
||||
(unreachable)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
@ -235,6 +400,7 @@
|
||||
FUNCTION_PROTOTYPE: grow_memory
|
||||
FUNCTION_PROTOTYPE: changetype
|
||||
FUNCTION_PROTOTYPE: assert
|
||||
FUNCTION_PROTOTYPE: abort
|
||||
FUNCTION_PROTOTYPE: i8
|
||||
FUNCTION_PROTOTYPE: i16
|
||||
FUNCTION_PROTOTYPE: i32
|
||||
@ -249,78 +415,78 @@
|
||||
FUNCTION_PROTOTYPE: isize
|
||||
FUNCTION_PROTOTYPE: usize
|
||||
GLOBAL: HEAP_BASE
|
||||
CLASS_PROTOTYPE: std:array/Array
|
||||
PROPERTY: std:array/Array#length
|
||||
CLASS_PROTOTYPE: (lib)/array/Array
|
||||
PROPERTY: (lib)/array/Array#length
|
||||
CLASS_PROTOTYPE: Array
|
||||
CLASS_PROTOTYPE: std:array/CArray
|
||||
CLASS_PROTOTYPE: (lib)/array/CArray
|
||||
CLASS_PROTOTYPE: CArray
|
||||
CLASS_PROTOTYPE: std:error/Error
|
||||
CLASS_PROTOTYPE: (lib)/error/Error
|
||||
CLASS_PROTOTYPE: Error
|
||||
CLASS_PROTOTYPE: std:error/RangeError
|
||||
CLASS_PROTOTYPE: (lib)/error/RangeError
|
||||
CLASS_PROTOTYPE: RangeError
|
||||
CLASS_PROTOTYPE: std:map/Map
|
||||
PROPERTY: std:map/Map#size
|
||||
CLASS_PROTOTYPE: (lib)/map/Map
|
||||
PROPERTY: (lib)/map/Map#size
|
||||
CLASS_PROTOTYPE: Map
|
||||
FUNCTION_PROTOTYPE: std:memory/copy_memory
|
||||
FUNCTION_PROTOTYPE: std:memory/move_memory
|
||||
FUNCTION_PROTOTYPE: (lib)/memory/copy_memory
|
||||
FUNCTION_PROTOTYPE: (lib)/memory/move_memory
|
||||
FUNCTION_PROTOTYPE: move_memory
|
||||
FUNCTION_PROTOTYPE: std:memory/set_memory
|
||||
FUNCTION_PROTOTYPE: (lib)/memory/set_memory
|
||||
FUNCTION_PROTOTYPE: set_memory
|
||||
FUNCTION_PROTOTYPE: std:memory/compare_memory
|
||||
FUNCTION_PROTOTYPE: (lib)/memory/compare_memory
|
||||
FUNCTION_PROTOTYPE: compare_memory
|
||||
CLASS_PROTOTYPE: std:regexp/RegExp
|
||||
CLASS_PROTOTYPE: (lib)/regexp/RegExp
|
||||
CLASS_PROTOTYPE: RegExp
|
||||
CLASS_PROTOTYPE: std:set/Set
|
||||
PROPERTY: std:set/Set#size
|
||||
CLASS_PROTOTYPE: (lib)/set/Set
|
||||
PROPERTY: (lib)/set/Set#size
|
||||
CLASS_PROTOTYPE: Set
|
||||
GLOBAL: std:string/EMPTY
|
||||
GLOBAL: std:string/HEAD
|
||||
FUNCTION_PROTOTYPE: std:string/allocate
|
||||
CLASS_PROTOTYPE: std:string/String
|
||||
FUNCTION_PROTOTYPE: std:string/String.__concat
|
||||
FUNCTION_PROTOTYPE: std:string/String.__eq
|
||||
GLOBAL: (lib)/string/EMPTY
|
||||
GLOBAL: (lib)/string/HEAD
|
||||
FUNCTION_PROTOTYPE: (lib)/string/allocate
|
||||
CLASS_PROTOTYPE: (lib)/string/String
|
||||
FUNCTION_PROTOTYPE: (lib)/string/String.__concat
|
||||
FUNCTION_PROTOTYPE: (lib)/string/String.__eq
|
||||
CLASS_PROTOTYPE: String
|
||||
FUNCTION_PROTOTYPE: std:string/isWhiteSpaceOrLineTerminator
|
||||
ENUM: std:string/CharCode
|
||||
FUNCTION_PROTOTYPE: std:string/parseInt
|
||||
FUNCTION_PROTOTYPE: (lib)/string/isWhiteSpaceOrLineTerminator
|
||||
ENUM: (lib)/string/CharCode
|
||||
FUNCTION_PROTOTYPE: (lib)/string/parseInt
|
||||
FUNCTION_PROTOTYPE: parseInt
|
||||
FUNCTION_PROTOTYPE: std:string/parseI32
|
||||
FUNCTION_PROTOTYPE: (lib)/string/parseI32
|
||||
FUNCTION_PROTOTYPE: parseI32
|
||||
FUNCTION_PROTOTYPE: std:string/parseI64
|
||||
FUNCTION_PROTOTYPE: (lib)/string/parseI64
|
||||
FUNCTION_PROTOTYPE: parseI64
|
||||
FUNCTION_PROTOTYPE: std:string/parse
|
||||
FUNCTION_PROTOTYPE: std:string/parseFloat
|
||||
FUNCTION_PROTOTYPE: (lib)/string/parse
|
||||
FUNCTION_PROTOTYPE: (lib)/string/parseFloat
|
||||
FUNCTION_PROTOTYPE: parseFloat
|
||||
GLOBAL: std/carray/arr
|
||||
[program.exports]
|
||||
CLASS_PROTOTYPE: std:array/Array
|
||||
CLASS_PROTOTYPE: (lib)/array/Array
|
||||
CLASS_PROTOTYPE: Array
|
||||
CLASS_PROTOTYPE: std:array/CArray
|
||||
CLASS_PROTOTYPE: (lib)/array/CArray
|
||||
CLASS_PROTOTYPE: CArray
|
||||
CLASS_PROTOTYPE: std:error/Error
|
||||
CLASS_PROTOTYPE: (lib)/error/Error
|
||||
CLASS_PROTOTYPE: Error
|
||||
CLASS_PROTOTYPE: std:error/RangeError
|
||||
CLASS_PROTOTYPE: (lib)/error/RangeError
|
||||
CLASS_PROTOTYPE: RangeError
|
||||
CLASS_PROTOTYPE: std:map/Map
|
||||
CLASS_PROTOTYPE: (lib)/map/Map
|
||||
CLASS_PROTOTYPE: Map
|
||||
FUNCTION_PROTOTYPE: move_memory
|
||||
FUNCTION_PROTOTYPE: std:memory/move_memory
|
||||
FUNCTION_PROTOTYPE: (lib)/memory/move_memory
|
||||
FUNCTION_PROTOTYPE: set_memory
|
||||
FUNCTION_PROTOTYPE: std:memory/set_memory
|
||||
FUNCTION_PROTOTYPE: (lib)/memory/set_memory
|
||||
FUNCTION_PROTOTYPE: compare_memory
|
||||
FUNCTION_PROTOTYPE: std:memory/compare_memory
|
||||
CLASS_PROTOTYPE: std:regexp/RegExp
|
||||
FUNCTION_PROTOTYPE: (lib)/memory/compare_memory
|
||||
CLASS_PROTOTYPE: (lib)/regexp/RegExp
|
||||
CLASS_PROTOTYPE: RegExp
|
||||
CLASS_PROTOTYPE: std:set/Set
|
||||
CLASS_PROTOTYPE: (lib)/set/Set
|
||||
CLASS_PROTOTYPE: Set
|
||||
CLASS_PROTOTYPE: std:string/String
|
||||
CLASS_PROTOTYPE: (lib)/string/String
|
||||
CLASS_PROTOTYPE: String
|
||||
FUNCTION_PROTOTYPE: parseInt
|
||||
FUNCTION_PROTOTYPE: std:string/parseInt
|
||||
FUNCTION_PROTOTYPE: (lib)/string/parseInt
|
||||
FUNCTION_PROTOTYPE: parseI32
|
||||
FUNCTION_PROTOTYPE: std:string/parseI32
|
||||
FUNCTION_PROTOTYPE: (lib)/string/parseI32
|
||||
FUNCTION_PROTOTYPE: parseI64
|
||||
FUNCTION_PROTOTYPE: std:string/parseI64
|
||||
FUNCTION_PROTOTYPE: (lib)/string/parseI64
|
||||
FUNCTION_PROTOTYPE: parseFloat
|
||||
FUNCTION_PROTOTYPE: std:string/parseFloat
|
||||
FUNCTION_PROTOTYPE: (lib)/string/parseFloat
|
||||
;)
|
||||
|
@ -1,113 +1,148 @@
|
||||
(module
|
||||
(type $ii (func (param i32) (result i32)))
|
||||
(type $v (func))
|
||||
(global $std:memory/arena/HEAP_OFFSET (mut i32) (i32.const 0))
|
||||
(global "$(lib)/allocator/arena/HEAP_OFFSET" (mut i32) (i32.const 0))
|
||||
(global $std/new/aClass (mut i32) (i32.const 0))
|
||||
(global $HEAP_BASE i32 (i32.const 4))
|
||||
(memory $0 1)
|
||||
(export "memory" (memory $0))
|
||||
(start $start)
|
||||
(func $std:memory/arena/allocate_memory (; 0 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func "$(lib)/allocator/arena/allocate_memory" (; 0 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
;;@ (lib)/allocator/arena.ts:14:2
|
||||
(if
|
||||
;;@ (lib)/allocator/arena.ts:14:6
|
||||
(i32.eqz
|
||||
;;@ (lib)/allocator/arena.ts:14:7
|
||||
(get_local $0)
|
||||
)
|
||||
;;@ (lib)/allocator/arena.ts:14:20
|
||||
(return
|
||||
(i32.const 0)
|
||||
)
|
||||
)
|
||||
;;@ (lib)/allocator/arena.ts:18:2
|
||||
(if
|
||||
;;@ (lib)/allocator/arena.ts:18:6
|
||||
(i32.and
|
||||
(if (result i32)
|
||||
(i32.gt_u
|
||||
(tee_local $0
|
||||
(i32.and
|
||||
(i32.add
|
||||
(tee_local $0
|
||||
(i32.gt_u
|
||||
;;@ (lib)/allocator/arena.ts:16:2
|
||||
(tee_local $2
|
||||
;;@ (lib)/allocator/arena.ts:16:12
|
||||
(i32.and
|
||||
(i32.add
|
||||
(tee_local $2
|
||||
(get_global $std:memory/arena/HEAP_OFFSET)
|
||||
;;@ (lib)/allocator/arena.ts:16:13
|
||||
(i32.add
|
||||
;;@ (lib)/allocator/arena.ts:15:2
|
||||
(tee_local $3
|
||||
;;@ (lib)/allocator/arena.ts:15:12
|
||||
(get_global "$(lib)/allocator/arena/HEAP_OFFSET")
|
||||
)
|
||||
;;@ (lib)/allocator/arena.ts:16:19
|
||||
(get_local $0)
|
||||
)
|
||||
(get_local $0)
|
||||
;;@ (lib)/allocator/arena.ts:16:26
|
||||
(i32.const 7)
|
||||
)
|
||||
(i32.const 7)
|
||||
(i32.const -8)
|
||||
)
|
||||
(i32.const -8)
|
||||
)
|
||||
)
|
||||
(tee_local $1
|
||||
(i32.shl
|
||||
(current_memory)
|
||||
(i32.const 16)
|
||||
;;@ (lib)/allocator/arena.ts:17:2
|
||||
(tee_local $1
|
||||
;;@ (lib)/allocator/arena.ts:17:14
|
||||
(i32.shl
|
||||
(current_memory)
|
||||
;;@ (lib)/allocator/arena.ts:17:41
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
;;@ (lib)/allocator/arena.ts:18:21
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
;;@ (lib)/allocator/arena.ts:19:4
|
||||
(select
|
||||
(tee_local $3
|
||||
(tee_local $0
|
||||
;;@ (lib)/allocator/arena.ts:20:6
|
||||
(i32.shr_u
|
||||
(i32.sub
|
||||
;;@ (lib)/allocator/arena.ts:20:7
|
||||
(i32.and
|
||||
;;@ (lib)/allocator/arena.ts:20:8
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
;;@ (lib)/allocator/arena.ts:20:9
|
||||
(get_local $2)
|
||||
;;@ (lib)/allocator/arena.ts:20:15
|
||||
(i32.const 65535)
|
||||
)
|
||||
(i32.const -65536)
|
||||
)
|
||||
;;@ (lib)/allocator/arena.ts:20:36
|
||||
(get_local $1)
|
||||
)
|
||||
;;@ (lib)/allocator/arena.ts:20:46
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(tee_local $1
|
||||
;;@ (lib)/allocator/arena.ts:21:6
|
||||
(i32.shr_u
|
||||
(get_local $1)
|
||||
;;@ (lib)/allocator/arena.ts:21:46
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(i32.gt_u
|
||||
(get_local $3)
|
||||
(get_local $0)
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
)
|
||||
;;@ (lib)/allocator/arena.ts:23:6
|
||||
(i32.const 0)
|
||||
)
|
||||
(i32.gt_u
|
||||
(get_local $0)
|
||||
(get_local $1)
|
||||
)
|
||||
(get_local $0)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
;;@ (lib)/allocator/arena.ts:23:9
|
||||
(unreachable)
|
||||
)
|
||||
(set_global $std:memory/arena/HEAP_OFFSET
|
||||
(get_local $0)
|
||||
;;@ (lib)/allocator/arena.ts:24:2
|
||||
(set_global "$(lib)/allocator/arena/HEAP_OFFSET"
|
||||
;;@ (lib)/allocator/arena.ts:24:16
|
||||
(get_local $2)
|
||||
)
|
||||
(get_local $2)
|
||||
;;@ (lib)/allocator/arena.ts:25:9
|
||||
(get_local $3)
|
||||
)
|
||||
(func $start (; 1 ;) (type $v)
|
||||
(local $0 i32)
|
||||
(local $1 i32)
|
||||
(set_global $std:memory/arena/HEAP_OFFSET
|
||||
(set_global "$(lib)/allocator/arena/HEAP_OFFSET"
|
||||
;;@ (lib)/allocator/arena.ts:11:25
|
||||
(get_global $HEAP_BASE)
|
||||
)
|
||||
(set_global $std/new/aClass
|
||||
;;@ std/new.ts:13:13
|
||||
(block (result i32)
|
||||
(i32.store
|
||||
(tee_local $0
|
||||
(call $std:memory/arena/allocate_memory
|
||||
(call "$(lib)/allocator/arena/allocate_memory"
|
||||
(i32.const 8)
|
||||
)
|
||||
)
|
||||
;;@ std/new.ts:5:16
|
||||
(i32.const 1)
|
||||
)
|
||||
(f32.store offset=4
|
||||
(get_local $0)
|
||||
;;@ std/new.ts:6:22
|
||||
(f32.const 2)
|
||||
)
|
||||
(i32.store
|
||||
|
@ -1,4 +1,4 @@
|
||||
import "std:memory/arena";
|
||||
import "allocator/arena";
|
||||
|
||||
class AClass {
|
||||
static aStaticField: i32 = 0;
|
||||
|
@ -3,87 +3,121 @@
|
||||
(type $ii (func (param i32) (result i32)))
|
||||
(type $ifv (func (param i32 f32)))
|
||||
(type $v (func))
|
||||
(global $std:memory/arena/ALIGN_LOG2 i32 (i32.const 3))
|
||||
(global $std:memory/arena/ALIGN_SIZE i32 (i32.const 8))
|
||||
(global $std:memory/arena/ALIGN_MASK i32 (i32.const 7))
|
||||
(global $std:memory/arena/HEAP_OFFSET (mut i32) (i32.const 0))
|
||||
(global "$(lib)/allocator/arena/ALIGN_LOG2" i32 (i32.const 3))
|
||||
(global "$(lib)/allocator/arena/ALIGN_SIZE" i32 (i32.const 8))
|
||||
(global "$(lib)/allocator/arena/ALIGN_MASK" i32 (i32.const 7))
|
||||
(global "$(lib)/allocator/arena/HEAP_OFFSET" (mut i32) (i32.const 0))
|
||||
(global $std/new/aClass (mut i32) (i32.const 0))
|
||||
(global $HEAP_BASE i32 (i32.const 4))
|
||||
(memory $0 1)
|
||||
(export "memory" (memory $0))
|
||||
(start $start)
|
||||
(func $std:memory/arena/allocate_memory (; 0 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func "$(lib)/allocator/arena/allocate_memory" (; 0 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
;;@ (lib)/allocator/arena.ts:14:2
|
||||
(if
|
||||
;;@ (lib)/allocator/arena.ts:14:6
|
||||
(i32.eqz
|
||||
;;@ (lib)/allocator/arena.ts:14:7
|
||||
(get_local $0)
|
||||
)
|
||||
;;@ (lib)/allocator/arena.ts:14:20
|
||||
(return
|
||||
(i32.const 0)
|
||||
)
|
||||
)
|
||||
;;@ (lib)/allocator/arena.ts:15:2
|
||||
(set_local $1
|
||||
(get_global $std:memory/arena/HEAP_OFFSET)
|
||||
;;@ (lib)/allocator/arena.ts:15:12
|
||||
(get_global "$(lib)/allocator/arena/HEAP_OFFSET")
|
||||
)
|
||||
;;@ (lib)/allocator/arena.ts:16:2
|
||||
(set_local $2
|
||||
;;@ (lib)/allocator/arena.ts:16:12
|
||||
(i32.and
|
||||
(i32.add
|
||||
;;@ (lib)/allocator/arena.ts:16:13
|
||||
(i32.add
|
||||
(get_local $1)
|
||||
;;@ (lib)/allocator/arena.ts:16:19
|
||||
(get_local $0)
|
||||
)
|
||||
;;@ (lib)/allocator/arena.ts:16:26
|
||||
(i32.const 7)
|
||||
)
|
||||
;;@ (lib)/allocator/arena.ts:16:40
|
||||
(i32.xor
|
||||
;;@ (lib)/allocator/arena.ts:16:41
|
||||
(i32.const 7)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
;;@ (lib)/allocator/arena.ts:17:2
|
||||
(set_local $3
|
||||
;;@ (lib)/allocator/arena.ts:17:14
|
||||
(i32.shl
|
||||
(current_memory)
|
||||
;;@ (lib)/allocator/arena.ts:17:41
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
;;@ (lib)/allocator/arena.ts:18:2
|
||||
(if
|
||||
;;@ (lib)/allocator/arena.ts:18:6
|
||||
(i32.and
|
||||
(if (result i32)
|
||||
(i32.ne
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
(tee_local $4
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
;;@ (lib)/allocator/arena.ts:18:12
|
||||
(get_local $3)
|
||||
)
|
||||
)
|
||||
(i32.const 0)
|
||||
)
|
||||
;;@ (lib)/allocator/arena.ts:18:21
|
||||
(i32.lt_s
|
||||
(grow_memory
|
||||
;;@ (lib)/allocator/arena.ts:19:4
|
||||
(select
|
||||
(tee_local $4
|
||||
;;@ (lib)/allocator/arena.ts:20:6
|
||||
(i32.shr_u
|
||||
(i32.sub
|
||||
;;@ (lib)/allocator/arena.ts:20:7
|
||||
(i32.and
|
||||
;;@ (lib)/allocator/arena.ts:20:8
|
||||
(i32.add
|
||||
;;@ (lib)/allocator/arena.ts:20:9
|
||||
(get_local $2)
|
||||
;;@ (lib)/allocator/arena.ts:20:15
|
||||
(i32.const 65535)
|
||||
)
|
||||
;;@ (lib)/allocator/arena.ts:20:25
|
||||
(i32.xor
|
||||
;;@ (lib)/allocator/arena.ts:20:26
|
||||
(i32.const 65535)
|
||||
(i32.const -1)
|
||||
)
|
||||
)
|
||||
;;@ (lib)/allocator/arena.ts:20:36
|
||||
(get_local $3)
|
||||
)
|
||||
;;@ (lib)/allocator/arena.ts:20:46
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
(tee_local $5
|
||||
;;@ (lib)/allocator/arena.ts:21:6
|
||||
(i32.shr_u
|
||||
(get_local $3)
|
||||
;;@ (lib)/allocator/arena.ts:21:46
|
||||
(i32.const 16)
|
||||
)
|
||||
)
|
||||
@ -93,61 +127,72 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
;;@ (lib)/allocator/arena.ts:23:6
|
||||
(i32.const 0)
|
||||
)
|
||||
(i32.gt_u
|
||||
(get_local $2)
|
||||
(get_local $3)
|
||||
)
|
||||
(get_local $4)
|
||||
)
|
||||
(i32.const 1)
|
||||
)
|
||||
;;@ (lib)/allocator/arena.ts:23:9
|
||||
(unreachable)
|
||||
)
|
||||
(set_global $std:memory/arena/HEAP_OFFSET
|
||||
;;@ (lib)/allocator/arena.ts:24:2
|
||||
(set_global "$(lib)/allocator/arena/HEAP_OFFSET"
|
||||
;;@ (lib)/allocator/arena.ts:24:16
|
||||
(get_local $2)
|
||||
)
|
||||
;;@ (lib)/allocator/arena.ts:25:9
|
||||
(return
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
(func $std/new/AClass#constructor (; 1 ;) (type $ifv) (param $0 i32) (param $1 f32)
|
||||
;;@ std/new.ts:8:4
|
||||
(i32.store
|
||||
(get_local $0)
|
||||
(i32.add
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
)
|
||||
;;@ std/new.ts:8:19
|
||||
(i32.const 1)
|
||||
)
|
||||
)
|
||||
;;@ std/new.ts:9:4
|
||||
(f32.store offset=4
|
||||
(get_local $0)
|
||||
;;@ std/new.ts:9:24
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
(func $start (; 2 ;) (type $v)
|
||||
(local $0 i32)
|
||||
(set_global $std:memory/arena/HEAP_OFFSET
|
||||
(set_global "$(lib)/allocator/arena/HEAP_OFFSET"
|
||||
;;@ (lib)/allocator/arena.ts:11:25
|
||||
(get_global $HEAP_BASE)
|
||||
)
|
||||
(set_global $std/new/aClass
|
||||
;;@ std/new.ts:13:13
|
||||
(block (result i32)
|
||||
(set_local $0
|
||||
(call $std:memory/arena/allocate_memory
|
||||
(call "$(lib)/allocator/arena/allocate_memory"
|
||||
(i32.const 8)
|
||||
)
|
||||
)
|
||||
(i32.store
|
||||
(get_local $0)
|
||||
;;@ std/new.ts:5:16
|
||||
(i32.const 1)
|
||||
)
|
||||
(f32.store offset=4
|
||||
(get_local $0)
|
||||
;;@ std/new.ts:6:22
|
||||
(f32.const 2)
|
||||
)
|
||||
(call $std/new/AClass#constructor
|
||||
(get_local $0)
|
||||
;;@ std/new.ts:13:24
|
||||
(f32.const 3)
|
||||
)
|
||||
(get_local $0)
|
||||
@ -185,6 +230,7 @@
|
||||
FUNCTION_PROTOTYPE: grow_memory
|
||||
FUNCTION_PROTOTYPE: changetype
|
||||
FUNCTION_PROTOTYPE: assert
|
||||
FUNCTION_PROTOTYPE: abort
|
||||
FUNCTION_PROTOTYPE: i8
|
||||
FUNCTION_PROTOTYPE: i16
|
||||
FUNCTION_PROTOTYPE: i32
|
||||
@ -199,96 +245,96 @@
|
||||
FUNCTION_PROTOTYPE: isize
|
||||
FUNCTION_PROTOTYPE: usize
|
||||
GLOBAL: HEAP_BASE
|
||||
CLASS_PROTOTYPE: std:array/Array
|
||||
PROPERTY: std:array/Array#length
|
||||
CLASS_PROTOTYPE: (lib)/array/Array
|
||||
PROPERTY: (lib)/array/Array#length
|
||||
CLASS_PROTOTYPE: Array
|
||||
CLASS_PROTOTYPE: std:array/CArray
|
||||
CLASS_PROTOTYPE: (lib)/array/CArray
|
||||
CLASS_PROTOTYPE: CArray
|
||||
CLASS_PROTOTYPE: std:error/Error
|
||||
CLASS_PROTOTYPE: (lib)/error/Error
|
||||
CLASS_PROTOTYPE: Error
|
||||
CLASS_PROTOTYPE: std:error/RangeError
|
||||
CLASS_PROTOTYPE: (lib)/error/RangeError
|
||||
CLASS_PROTOTYPE: RangeError
|
||||
CLASS_PROTOTYPE: std:map/Map
|
||||
PROPERTY: std:map/Map#size
|
||||
CLASS_PROTOTYPE: (lib)/map/Map
|
||||
PROPERTY: (lib)/map/Map#size
|
||||
CLASS_PROTOTYPE: Map
|
||||
FUNCTION_PROTOTYPE: std:memory/copy_memory
|
||||
FUNCTION_PROTOTYPE: std:memory/move_memory
|
||||
FUNCTION_PROTOTYPE: (lib)/memory/copy_memory
|
||||
FUNCTION_PROTOTYPE: (lib)/memory/move_memory
|
||||
FUNCTION_PROTOTYPE: move_memory
|
||||
FUNCTION_PROTOTYPE: std:memory/set_memory
|
||||
FUNCTION_PROTOTYPE: (lib)/memory/set_memory
|
||||
FUNCTION_PROTOTYPE: set_memory
|
||||
FUNCTION_PROTOTYPE: std:memory/compare_memory
|
||||
FUNCTION_PROTOTYPE: (lib)/memory/compare_memory
|
||||
FUNCTION_PROTOTYPE: compare_memory
|
||||
CLASS_PROTOTYPE: std:regexp/RegExp
|
||||
CLASS_PROTOTYPE: (lib)/regexp/RegExp
|
||||
CLASS_PROTOTYPE: RegExp
|
||||
CLASS_PROTOTYPE: std:set/Set
|
||||
PROPERTY: std:set/Set#size
|
||||
CLASS_PROTOTYPE: (lib)/set/Set
|
||||
PROPERTY: (lib)/set/Set#size
|
||||
CLASS_PROTOTYPE: Set
|
||||
GLOBAL: std:string/EMPTY
|
||||
GLOBAL: std:string/HEAD
|
||||
FUNCTION_PROTOTYPE: std:string/allocate
|
||||
CLASS_PROTOTYPE: std:string/String
|
||||
FUNCTION_PROTOTYPE: std:string/String.__concat
|
||||
FUNCTION_PROTOTYPE: std:string/String.__eq
|
||||
GLOBAL: (lib)/string/EMPTY
|
||||
GLOBAL: (lib)/string/HEAD
|
||||
FUNCTION_PROTOTYPE: (lib)/string/allocate
|
||||
CLASS_PROTOTYPE: (lib)/string/String
|
||||
FUNCTION_PROTOTYPE: (lib)/string/String.__concat
|
||||
FUNCTION_PROTOTYPE: (lib)/string/String.__eq
|
||||
CLASS_PROTOTYPE: String
|
||||
FUNCTION_PROTOTYPE: std:string/isWhiteSpaceOrLineTerminator
|
||||
ENUM: std:string/CharCode
|
||||
FUNCTION_PROTOTYPE: std:string/parseInt
|
||||
FUNCTION_PROTOTYPE: (lib)/string/isWhiteSpaceOrLineTerminator
|
||||
ENUM: (lib)/string/CharCode
|
||||
FUNCTION_PROTOTYPE: (lib)/string/parseInt
|
||||
FUNCTION_PROTOTYPE: parseInt
|
||||
FUNCTION_PROTOTYPE: std:string/parseI32
|
||||
FUNCTION_PROTOTYPE: (lib)/string/parseI32
|
||||
FUNCTION_PROTOTYPE: parseI32
|
||||
FUNCTION_PROTOTYPE: std:string/parseI64
|
||||
FUNCTION_PROTOTYPE: (lib)/string/parseI64
|
||||
FUNCTION_PROTOTYPE: parseI64
|
||||
FUNCTION_PROTOTYPE: std:string/parse
|
||||
FUNCTION_PROTOTYPE: std:string/parseFloat
|
||||
FUNCTION_PROTOTYPE: (lib)/string/parse
|
||||
FUNCTION_PROTOTYPE: (lib)/string/parseFloat
|
||||
FUNCTION_PROTOTYPE: parseFloat
|
||||
CLASS_PROTOTYPE: std/new/AClass
|
||||
GLOBAL: std/new/AClass.aStaticField
|
||||
GLOBAL: std/new/aClass
|
||||
GLOBAL: std:memory/arena/ALIGN_LOG2
|
||||
GLOBAL: std:memory/arena/ALIGN_SIZE
|
||||
GLOBAL: std:memory/arena/ALIGN_MASK
|
||||
GLOBAL: std:memory/arena/HEAP_OFFSET
|
||||
FUNCTION_PROTOTYPE: std:memory/arena/allocate_memory
|
||||
GLOBAL: (lib)/allocator/arena/ALIGN_LOG2
|
||||
GLOBAL: (lib)/allocator/arena/ALIGN_SIZE
|
||||
GLOBAL: (lib)/allocator/arena/ALIGN_MASK
|
||||
GLOBAL: (lib)/allocator/arena/HEAP_OFFSET
|
||||
FUNCTION_PROTOTYPE: (lib)/allocator/arena/allocate_memory
|
||||
FUNCTION_PROTOTYPE: allocate_memory
|
||||
FUNCTION_PROTOTYPE: std:memory/arena/free_memory
|
||||
FUNCTION_PROTOTYPE: (lib)/allocator/arena/free_memory
|
||||
FUNCTION_PROTOTYPE: free_memory
|
||||
FUNCTION_PROTOTYPE: std:memory/arena/clear_memory
|
||||
FUNCTION_PROTOTYPE: clear_memory
|
||||
FUNCTION_PROTOTYPE: (lib)/allocator/arena/reset_memory
|
||||
FUNCTION_PROTOTYPE: reset_memory
|
||||
[program.exports]
|
||||
CLASS_PROTOTYPE: std:array/Array
|
||||
CLASS_PROTOTYPE: (lib)/array/Array
|
||||
CLASS_PROTOTYPE: Array
|
||||
CLASS_PROTOTYPE: std:array/CArray
|
||||
CLASS_PROTOTYPE: (lib)/array/CArray
|
||||
CLASS_PROTOTYPE: CArray
|
||||
CLASS_PROTOTYPE: std:error/Error
|
||||
CLASS_PROTOTYPE: (lib)/error/Error
|
||||
CLASS_PROTOTYPE: Error
|
||||
CLASS_PROTOTYPE: std:error/RangeError
|
||||
CLASS_PROTOTYPE: (lib)/error/RangeError
|
||||
CLASS_PROTOTYPE: RangeError
|
||||
CLASS_PROTOTYPE: std:map/Map
|
||||
CLASS_PROTOTYPE: (lib)/map/Map
|
||||
CLASS_PROTOTYPE: Map
|
||||
FUNCTION_PROTOTYPE: move_memory
|
||||
FUNCTION_PROTOTYPE: std:memory/move_memory
|
||||
FUNCTION_PROTOTYPE: (lib)/memory/move_memory
|
||||
FUNCTION_PROTOTYPE: set_memory
|
||||
FUNCTION_PROTOTYPE: std:memory/set_memory
|
||||
FUNCTION_PROTOTYPE: (lib)/memory/set_memory
|
||||
FUNCTION_PROTOTYPE: compare_memory
|
||||
FUNCTION_PROTOTYPE: std:memory/compare_memory
|
||||
CLASS_PROTOTYPE: std:regexp/RegExp
|
||||
FUNCTION_PROTOTYPE: (lib)/memory/compare_memory
|
||||
CLASS_PROTOTYPE: (lib)/regexp/RegExp
|
||||
CLASS_PROTOTYPE: RegExp
|
||||
CLASS_PROTOTYPE: std:set/Set
|
||||
CLASS_PROTOTYPE: (lib)/set/Set
|
||||
CLASS_PROTOTYPE: Set
|
||||
CLASS_PROTOTYPE: std:string/String
|
||||
CLASS_PROTOTYPE: (lib)/string/String
|
||||
CLASS_PROTOTYPE: String
|
||||
FUNCTION_PROTOTYPE: parseInt
|
||||
FUNCTION_PROTOTYPE: std:string/parseInt
|
||||
FUNCTION_PROTOTYPE: (lib)/string/parseInt
|
||||
FUNCTION_PROTOTYPE: parseI32
|
||||
FUNCTION_PROTOTYPE: std:string/parseI32
|
||||
FUNCTION_PROTOTYPE: (lib)/string/parseI32
|
||||
FUNCTION_PROTOTYPE: parseI64
|
||||
FUNCTION_PROTOTYPE: std:string/parseI64
|
||||
FUNCTION_PROTOTYPE: (lib)/string/parseI64
|
||||
FUNCTION_PROTOTYPE: parseFloat
|
||||
FUNCTION_PROTOTYPE: std:string/parseFloat
|
||||
FUNCTION_PROTOTYPE: (lib)/string/parseFloat
|
||||
FUNCTION_PROTOTYPE: allocate_memory
|
||||
FUNCTION_PROTOTYPE: std:memory/arena/allocate_memory
|
||||
FUNCTION_PROTOTYPE: (lib)/allocator/arena/allocate_memory
|
||||
FUNCTION_PROTOTYPE: free_memory
|
||||
FUNCTION_PROTOTYPE: std:memory/arena/free_memory
|
||||
FUNCTION_PROTOTYPE: clear_memory
|
||||
FUNCTION_PROTOTYPE: std:memory/arena/clear_memory
|
||||
FUNCTION_PROTOTYPE: (lib)/allocator/arena/free_memory
|
||||
FUNCTION_PROTOTYPE: reset_memory
|
||||
FUNCTION_PROTOTYPE: (lib)/allocator/arena/reset_memory
|
||||
;)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
import "std:memory/arena";
|
||||
import "allocator/arena";
|
||||
|
||||
// note that this doesn't test a real set implementation yet, see std/assembly/set.ts
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user