mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-23 11:41:45 +00:00
unify mem/ref interface
This commit is contained in:
@ -115,92 +115,91 @@
|
||||
i32.sub
|
||||
i32.shl
|
||||
)
|
||||
(func $~lib/memory/memory.allocate (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $~lib/allocator/arena/__mem_allocate (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
(local $7 i32)
|
||||
block $~lib/allocator/arena/__memory_allocate|inlined.0 (result i32)
|
||||
local.get $0
|
||||
local.set $1
|
||||
local.get $1
|
||||
i32.const 1073741824
|
||||
i32.gt_u
|
||||
if
|
||||
unreachable
|
||||
end
|
||||
global.get $~lib/allocator/arena/offset
|
||||
local.set $2
|
||||
local.get $2
|
||||
local.get $1
|
||||
local.tee $3
|
||||
i32.const 1
|
||||
local.tee $4
|
||||
local.get $3
|
||||
local.get $0
|
||||
i32.const 1073741824
|
||||
i32.gt_u
|
||||
if
|
||||
unreachable
|
||||
end
|
||||
global.get $~lib/allocator/arena/offset
|
||||
local.set $1
|
||||
local.get $1
|
||||
local.get $0
|
||||
local.tee $2
|
||||
i32.const 1
|
||||
local.tee $3
|
||||
local.get $2
|
||||
local.get $3
|
||||
i32.gt_u
|
||||
select
|
||||
i32.add
|
||||
i32.const 7
|
||||
i32.add
|
||||
i32.const 7
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
local.set $4
|
||||
current_memory
|
||||
local.set $5
|
||||
local.get $4
|
||||
local.get $5
|
||||
i32.const 16
|
||||
i32.shl
|
||||
i32.gt_u
|
||||
if
|
||||
local.get $4
|
||||
i32.gt_u
|
||||
select
|
||||
local.get $1
|
||||
i32.sub
|
||||
i32.const 65535
|
||||
i32.add
|
||||
i32.const 7
|
||||
i32.add
|
||||
i32.const 7
|
||||
i32.const 65535
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
local.set $3
|
||||
current_memory
|
||||
local.set $4
|
||||
local.get $3
|
||||
local.get $4
|
||||
i32.const 16
|
||||
i32.shl
|
||||
i32.gt_u
|
||||
i32.shr_u
|
||||
local.set $2
|
||||
local.get $5
|
||||
local.tee $3
|
||||
local.get $2
|
||||
local.tee $6
|
||||
local.get $3
|
||||
local.get $6
|
||||
i32.gt_s
|
||||
select
|
||||
local.set $3
|
||||
local.get $3
|
||||
grow_memory
|
||||
i32.const 0
|
||||
i32.lt_s
|
||||
if
|
||||
local.get $3
|
||||
local.get $2
|
||||
i32.sub
|
||||
i32.const 65535
|
||||
i32.add
|
||||
i32.const 65535
|
||||
i32.const -1
|
||||
i32.xor
|
||||
i32.and
|
||||
i32.const 16
|
||||
i32.shr_u
|
||||
local.set $5
|
||||
local.get $4
|
||||
local.tee $6
|
||||
local.get $5
|
||||
local.tee $7
|
||||
local.get $6
|
||||
local.get $7
|
||||
i32.gt_s
|
||||
select
|
||||
local.set $6
|
||||
local.get $6
|
||||
grow_memory
|
||||
i32.const 0
|
||||
i32.lt_s
|
||||
if
|
||||
local.get $5
|
||||
grow_memory
|
||||
i32.const 0
|
||||
i32.lt_s
|
||||
if
|
||||
unreachable
|
||||
end
|
||||
unreachable
|
||||
end
|
||||
end
|
||||
local.get $3
|
||||
global.set $~lib/allocator/arena/offset
|
||||
local.get $2
|
||||
end
|
||||
local.get $4
|
||||
global.set $~lib/allocator/arena/offset
|
||||
local.get $1
|
||||
)
|
||||
(func $~lib/memory/memory.allocate (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
call $~lib/allocator/arena/__mem_allocate
|
||||
return
|
||||
)
|
||||
(func $~lib/runtime/allocate (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $~lib/runtime/allocate (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
local.get $0
|
||||
call $~lib/runtime/ADJUSTOBLOCK
|
||||
@ -222,10 +221,10 @@
|
||||
global.get $~lib/runtime/HEADER_SIZE
|
||||
i32.add
|
||||
)
|
||||
(func $~lib/collector/dummy/__ref_register (; 10 ;) (type $FUNCSIG$vi) (param $0 i32)
|
||||
(func $~lib/collector/dummy/__ref_register (; 11 ;) (type $FUNCSIG$vi) (param $0 i32)
|
||||
nop
|
||||
)
|
||||
(func $~lib/runtime/register (; 11 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(func $~lib/runtime/register (; 12 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(local $2 i32)
|
||||
local.get $0
|
||||
global.get $~lib/memory/HEAP_BASE
|
||||
@ -234,7 +233,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 296
|
||||
i32.const 151
|
||||
i32.const 149
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -251,7 +250,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 296
|
||||
i32.const 153
|
||||
i32.const 151
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -263,13 +262,13 @@
|
||||
call $~lib/collector/dummy/__ref_register
|
||||
local.get $0
|
||||
)
|
||||
(func $~lib/collector/dummy/__ref_link (; 12 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
|
||||
(func $~lib/collector/dummy/__ref_link (; 13 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
|
||||
nop
|
||||
)
|
||||
(func $~lib/collector/dummy/__ref_unlink (; 13 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
|
||||
(func $~lib/collector/dummy/__ref_unlink (; 14 ;) (type $FUNCSIG$vii) (param $0 i32) (param $1 i32)
|
||||
nop
|
||||
)
|
||||
(func $~lib/util/memory/memcpy (; 14 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(func $~lib/util/memory/memcpy (; 15 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
@ -1470,7 +1469,7 @@
|
||||
i32.store8
|
||||
end
|
||||
)
|
||||
(func $~lib/memory/memory.copy (; 15 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(func $~lib/memory/memory.copy (; 16 ;) (type $FUNCSIG$viii) (param $0 i32) (param $1 i32) (param $2 i32)
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
@ -1701,7 +1700,7 @@
|
||||
end
|
||||
end
|
||||
)
|
||||
(func $~lib/runtime/makeArray (; 16 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
|
||||
(func $~lib/runtime/makeArray (; 17 ;) (type $FUNCSIG$iiiii) (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (result i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
@ -1765,7 +1764,7 @@
|
||||
end
|
||||
local.get $4
|
||||
)
|
||||
(func $std/array-literal/Ref#constructor (; 17 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $std/array-literal/Ref#constructor (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
if
|
||||
@ -1777,11 +1776,11 @@
|
||||
end
|
||||
local.get $0
|
||||
)
|
||||
(func $~lib/array/Array<std/array-literal/Ref>#get:length (; 18 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $~lib/array/Array<std/array-literal/Ref>#get:length (; 19 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.load offset=12
|
||||
)
|
||||
(func $std/array-literal/RefWithCtor#constructor (; 19 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $std/array-literal/RefWithCtor#constructor (; 20 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
if
|
||||
@ -1793,11 +1792,11 @@
|
||||
end
|
||||
local.get $0
|
||||
)
|
||||
(func $~lib/array/Array<std/array-literal/RefWithCtor>#get:length (; 20 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $~lib/array/Array<std/array-literal/RefWithCtor>#get:length (; 21 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.load offset=12
|
||||
)
|
||||
(func $start:std/array-literal (; 21 ;) (type $FUNCSIG$v)
|
||||
(func $start:std/array-literal (; 22 ;) (type $FUNCSIG$v)
|
||||
(local $0 i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
@ -2237,9 +2236,9 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $start (; 22 ;) (type $FUNCSIG$v)
|
||||
(func $start (; 23 ;) (type $FUNCSIG$v)
|
||||
call $start:std/array-literal
|
||||
)
|
||||
(func $null (; 23 ;) (type $FUNCSIG$v)
|
||||
(func $null (; 24 ;) (type $FUNCSIG$v)
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user