mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-14 15:31:31 +00:00
Rename lib prefix to '~lib' (parens aren't valid); Add built-in alignof<T>; Prepare for ArrayBufferView
This commit is contained in:
@ -7,14 +7,13 @@
|
||||
(type $iiiv (func (param i32 i32 i32)))
|
||||
(type $v (func))
|
||||
(import "env" "abort" (func $abort (param i32 i32 i32 i32)))
|
||||
(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 "$(lib)/arraybuffer/HEADER_SIZE" i32 (i32.const 4))
|
||||
(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 $~lib/arraybuffer/HEADER_SIZE i32 (i32.const 4))
|
||||
(global $std/arraybuffer/buffer (mut i32) (i32.const 0))
|
||||
(global "$(lib)/arraybuffer/ArrayBuffer.EMPTY" (mut i32) (i32.const 0))
|
||||
(global $argumentCount (mut i32) (i32.const 0))
|
||||
(global $std/arraybuffer/sliced (mut i32) (i32.const 0))
|
||||
(global $HEAP_BASE i32 (i32.const 44))
|
||||
@ -22,7 +21,7 @@
|
||||
(data (i32.const 4) "\12\00\00\00s\00t\00d\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s\00")
|
||||
(export "memory" (memory $0))
|
||||
(start $start)
|
||||
(func "$(lib)/allocator/arena/allocate_memory" (; 1 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(func $~lib/allocator/arena/allocate_memory (; 1 ;) (type $ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
@ -38,7 +37,7 @@
|
||||
)
|
||||
)
|
||||
(set_local $1
|
||||
(get_global "$(lib)/allocator/arena/offset")
|
||||
(get_global $~lib/allocator/arena/offset)
|
||||
)
|
||||
(set_local $2
|
||||
(i32.and
|
||||
@ -118,14 +117,14 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global "$(lib)/allocator/arena/offset"
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_local $2)
|
||||
)
|
||||
(return
|
||||
(get_local $1)
|
||||
)
|
||||
)
|
||||
(func "$(lib)/arraybuffer/ArrayBuffer#constructor" (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(func $~lib/arraybuffer/ArrayBuffer#constructor (; 2 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(local $2 i32)
|
||||
(if
|
||||
(i32.gt_u
|
||||
@ -135,7 +134,7 @@
|
||||
(unreachable)
|
||||
)
|
||||
(set_local $2
|
||||
(call "$(lib)/allocator/arena/allocate_memory"
|
||||
(call $~lib/allocator/arena/allocate_memory
|
||||
(i32.add
|
||||
(i32.const 4)
|
||||
(get_local $1)
|
||||
@ -150,7 +149,7 @@
|
||||
(get_local $2)
|
||||
)
|
||||
)
|
||||
(func "$(lib)/memory/copy_memory" (; 3 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(func $~lib/memory/copy_memory (; 3 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
@ -1953,7 +1952,7 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(func "$(lib)/memory/move_memory" (; 4 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(func $~lib/memory/move_memory (; 4 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(local $3 i32)
|
||||
(if
|
||||
(i32.eq
|
||||
@ -1986,7 +1985,7 @@
|
||||
(i32.const 1)
|
||||
)
|
||||
(block
|
||||
(call "$(lib)/memory/copy_memory"
|
||||
(call $~lib/memory/copy_memory
|
||||
(get_local $0)
|
||||
(get_local $1)
|
||||
(get_local $2)
|
||||
@ -2276,11 +2275,12 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(func "$(lib)/arraybuffer/ArrayBuffer#slice" (; 5 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
||||
(func $~lib/arraybuffer/ArrayBuffer#slice (; 5 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
(local $7 i32)
|
||||
(set_local $3
|
||||
(i32.load
|
||||
(get_local $0)
|
||||
@ -2377,65 +2377,37 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(get_local $6)
|
||||
(block
|
||||
(set_local $4
|
||||
(call "$(lib)/allocator/arena/allocate_memory"
|
||||
(i32.add
|
||||
(i32.const 4)
|
||||
(get_local $6)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.store
|
||||
(get_local $4)
|
||||
(set_local $7
|
||||
(call $~lib/allocator/arena/allocate_memory
|
||||
(i32.add
|
||||
(i32.const 4)
|
||||
(get_local $6)
|
||||
)
|
||||
(call "$(lib)/memory/move_memory"
|
||||
(i32.add
|
||||
(get_local $4)
|
||||
(i32.const 4)
|
||||
)
|
||||
(i32.add
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
(i32.const 4)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(get_local $6)
|
||||
)
|
||||
(return
|
||||
(get_local $4)
|
||||
)
|
||||
)
|
||||
(if
|
||||
(get_global "$(lib)/arraybuffer/ArrayBuffer.EMPTY")
|
||||
(return
|
||||
(get_global "$(lib)/arraybuffer/ArrayBuffer.EMPTY")
|
||||
)
|
||||
(block
|
||||
(set_local $4
|
||||
(call "$(lib)/allocator/arena/allocate_memory"
|
||||
(i32.const 4)
|
||||
)
|
||||
)
|
||||
(i32.store
|
||||
(get_local $4)
|
||||
(i32.const 0)
|
||||
)
|
||||
(set_global "$(lib)/arraybuffer/ArrayBuffer.EMPTY"
|
||||
(get_local $4)
|
||||
)
|
||||
(return
|
||||
(get_local $4)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(i32.store
|
||||
(get_local $7)
|
||||
(get_local $6)
|
||||
)
|
||||
(call $~lib/memory/move_memory
|
||||
(i32.add
|
||||
(get_local $7)
|
||||
(i32.const 4)
|
||||
)
|
||||
(i32.add
|
||||
(i32.add
|
||||
(get_local $0)
|
||||
(i32.const 4)
|
||||
)
|
||||
(get_local $1)
|
||||
)
|
||||
(get_local $6)
|
||||
)
|
||||
(return
|
||||
(get_local $7)
|
||||
)
|
||||
)
|
||||
(func "$(lib)/arraybuffer/ArrayBuffer#slice|trampoline" (; 6 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
||||
(func $~lib/arraybuffer/ArrayBuffer#slice|trampoline (; 6 ;) (type $iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
||||
(block $2of2
|
||||
(block $1of2
|
||||
(block $0of2
|
||||
@ -2454,14 +2426,14 @@
|
||||
(i32.const 2147483647)
|
||||
)
|
||||
)
|
||||
(call "$(lib)/arraybuffer/ArrayBuffer#slice"
|
||||
(call $~lib/arraybuffer/ArrayBuffer#slice
|
||||
(get_local $0)
|
||||
(get_local $1)
|
||||
(get_local $2)
|
||||
)
|
||||
)
|
||||
(func $start (; 7 ;) (type $v)
|
||||
(set_global "$(lib)/allocator/arena/startOffset"
|
||||
(set_global $~lib/allocator/arena/startOffset
|
||||
(i32.and
|
||||
(i32.add
|
||||
(get_global $HEAP_BASE)
|
||||
@ -2473,11 +2445,11 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(set_global "$(lib)/allocator/arena/offset"
|
||||
(get_global "$(lib)/allocator/arena/startOffset")
|
||||
(set_global $~lib/allocator/arena/offset
|
||||
(get_global $~lib/allocator/arena/startOffset)
|
||||
)
|
||||
(set_global $std/arraybuffer/buffer
|
||||
(call "$(lib)/arraybuffer/ArrayBuffer#constructor"
|
||||
(call $~lib/arraybuffer/ArrayBuffer#constructor
|
||||
(i32.const 0)
|
||||
(i32.const 8)
|
||||
)
|
||||
@ -2506,7 +2478,7 @@
|
||||
(set_global $argumentCount
|
||||
(i32.const 0)
|
||||
)
|
||||
(call "$(lib)/arraybuffer/ArrayBuffer#slice|trampoline"
|
||||
(call $~lib/arraybuffer/ArrayBuffer#slice|trampoline
|
||||
(get_global $std/arraybuffer/buffer)
|
||||
(i32.const 0)
|
||||
(i32.const 0)
|
||||
@ -2554,7 +2526,7 @@
|
||||
(set_global $argumentCount
|
||||
(i32.const 1)
|
||||
)
|
||||
(call "$(lib)/arraybuffer/ArrayBuffer#slice|trampoline"
|
||||
(call $~lib/arraybuffer/ArrayBuffer#slice|trampoline
|
||||
(get_global $std/arraybuffer/buffer)
|
||||
(i32.const 1)
|
||||
(i32.const 0)
|
||||
@ -2585,7 +2557,7 @@
|
||||
(set_global $argumentCount
|
||||
(i32.const 1)
|
||||
)
|
||||
(call "$(lib)/arraybuffer/ArrayBuffer#slice|trampoline"
|
||||
(call $~lib/arraybuffer/ArrayBuffer#slice|trampoline
|
||||
(get_global $std/arraybuffer/buffer)
|
||||
(i32.const -1)
|
||||
(i32.const 0)
|
||||
@ -2612,7 +2584,7 @@
|
||||
)
|
||||
)
|
||||
(set_global $std/arraybuffer/sliced
|
||||
(call "$(lib)/arraybuffer/ArrayBuffer#slice"
|
||||
(call $~lib/arraybuffer/ArrayBuffer#slice
|
||||
(get_global $std/arraybuffer/buffer)
|
||||
(i32.const 1)
|
||||
(i32.const 3)
|
||||
@ -2638,7 +2610,7 @@
|
||||
)
|
||||
)
|
||||
(set_global $std/arraybuffer/sliced
|
||||
(call "$(lib)/arraybuffer/ArrayBuffer#slice"
|
||||
(call $~lib/arraybuffer/ArrayBuffer#slice
|
||||
(get_global $std/arraybuffer/buffer)
|
||||
(i32.const 1)
|
||||
(i32.const -1)
|
||||
@ -2664,7 +2636,7 @@
|
||||
)
|
||||
)
|
||||
(set_global $std/arraybuffer/sliced
|
||||
(call "$(lib)/arraybuffer/ArrayBuffer#slice"
|
||||
(call $~lib/arraybuffer/ArrayBuffer#slice
|
||||
(get_global $std/arraybuffer/buffer)
|
||||
(i32.const -3)
|
||||
(i32.const -1)
|
||||
@ -2690,7 +2662,7 @@
|
||||
)
|
||||
)
|
||||
(set_global $std/arraybuffer/sliced
|
||||
(call "$(lib)/arraybuffer/ArrayBuffer#slice"
|
||||
(call $~lib/arraybuffer/ArrayBuffer#slice
|
||||
(get_global $std/arraybuffer/buffer)
|
||||
(i32.const -4)
|
||||
(i32.const 42)
|
||||
@ -2720,7 +2692,7 @@
|
||||
(set_global $argumentCount
|
||||
(i32.const 1)
|
||||
)
|
||||
(call "$(lib)/arraybuffer/ArrayBuffer#slice|trampoline"
|
||||
(call $~lib/arraybuffer/ArrayBuffer#slice|trampoline
|
||||
(get_global $std/arraybuffer/buffer)
|
||||
(i32.const 42)
|
||||
(i32.const 0)
|
||||
|
Reference in New Issue
Block a user