mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-28 06:01:51 +00:00
unify mem/ref interface
This commit is contained in:
@ -39,92 +39,91 @@
|
||||
i32.sub
|
||||
i32.shl
|
||||
)
|
||||
(func $~lib/memory/memory.allocate (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $~lib/allocator/arena/__mem_allocate (; 4 ;) (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 (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
call $~lib/allocator/arena/__mem_allocate
|
||||
return
|
||||
)
|
||||
(func $~lib/runtime/allocate (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $~lib/runtime/allocate (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(local $1 i32)
|
||||
local.get $0
|
||||
call $~lib/runtime/ADJUSTOBLOCK
|
||||
@ -140,7 +139,7 @@
|
||||
global.get $~lib/runtime/HEADER_SIZE
|
||||
i32.add
|
||||
)
|
||||
(func $~lib/runtime/register (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(func $~lib/runtime/register (; 7 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
|
||||
(local $2 i32)
|
||||
local.get $0
|
||||
global.get $~lib/memory/HEAP_BASE
|
||||
@ -149,7 +148,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 16
|
||||
i32.const 151
|
||||
i32.const 149
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -166,7 +165,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 16
|
||||
i32.const 153
|
||||
i32.const 151
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -176,7 +175,7 @@
|
||||
i32.store
|
||||
local.get $0
|
||||
)
|
||||
(func $optional-typeparameters/TestConcrete<i32,i32>#constructor (; 7 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $optional-typeparameters/TestConcrete<i32,i32>#constructor (; 8 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
if
|
||||
@ -188,12 +187,12 @@
|
||||
end
|
||||
local.get $0
|
||||
)
|
||||
(func $optional-typeparameters/TestConcrete<i32,i32>#test<i32> (; 8 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
||||
(func $optional-typeparameters/TestConcrete<i32,i32>#test<i32> (; 9 ;) (type $FUNCSIG$iiii) (param $0 i32) (param $1 i32) (param $2 i32) (result i32)
|
||||
local.get $1
|
||||
local.get $2
|
||||
i32.add
|
||||
)
|
||||
(func $optional-typeparameters/TestDerived<f64,f64>#constructor (; 9 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
(func $optional-typeparameters/TestDerived<f64,f64>#constructor (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
if
|
||||
@ -205,12 +204,12 @@
|
||||
end
|
||||
local.get $0
|
||||
)
|
||||
(func $optional-typeparameters/TestDerived<f64,f64>#test<f64> (; 10 ;) (type $FUNCSIG$didd) (param $0 i32) (param $1 f64) (param $2 f64) (result f64)
|
||||
(func $optional-typeparameters/TestDerived<f64,f64>#test<f64> (; 11 ;) (type $FUNCSIG$didd) (param $0 i32) (param $1 f64) (param $2 f64) (result f64)
|
||||
local.get $1
|
||||
local.get $2
|
||||
f64.add
|
||||
)
|
||||
(func $start:optional-typeparameters (; 11 ;) (type $FUNCSIG$v)
|
||||
(func $start:optional-typeparameters (; 12 ;) (type $FUNCSIG$v)
|
||||
i32.const 1
|
||||
call $optional-typeparameters/testConcrete<i32,i32>
|
||||
drop
|
||||
@ -244,9 +243,9 @@
|
||||
call $optional-typeparameters/TestDerived<f64,f64>#test<f64>
|
||||
drop
|
||||
)
|
||||
(func $start (; 12 ;) (type $FUNCSIG$v)
|
||||
(func $start (; 13 ;) (type $FUNCSIG$v)
|
||||
call $start:optional-typeparameters
|
||||
)
|
||||
(func $null (; 13 ;) (type $FUNCSIG$v)
|
||||
(func $null (; 14 ;) (type $FUNCSIG$v)
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user