mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-07-31 06:02:11 +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 48
|
||||
i32.const 151
|
||||
i32.const 149
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@@ -166,7 +165,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 48
|
||||
i32.const 153
|
||||
i32.const 151
|
||||
i32.const 4
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@@ -176,7 +175,7 @@
|
||||
i32.store
|
||||
local.get $0
|
||||
)
|
||||
(func $~lib/date/Date#constructor (; 7 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32)
|
||||
(func $~lib/date/Date#constructor (; 8 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32)
|
||||
block (result i32)
|
||||
local.get $0
|
||||
i32.eqz
|
||||
@@ -196,17 +195,17 @@
|
||||
i64.store
|
||||
local.get $0
|
||||
)
|
||||
(func $~lib/date/Date#getTime (; 8 ;) (type $FUNCSIG$ji) (param $0 i32) (result i64)
|
||||
(func $~lib/date/Date#getTime (; 9 ;) (type $FUNCSIG$ji) (param $0 i32) (result i64)
|
||||
local.get $0
|
||||
i64.load
|
||||
)
|
||||
(func $~lib/date/Date#setTime (; 9 ;) (type $FUNCSIG$jij) (param $0 i32) (param $1 i64) (result i64)
|
||||
(func $~lib/date/Date#setTime (; 10 ;) (type $FUNCSIG$jij) (param $0 i32) (param $1 i64) (result i64)
|
||||
local.get $0
|
||||
local.get $1
|
||||
i64.store
|
||||
local.get $1
|
||||
)
|
||||
(func $start:std/date (; 10 ;) (type $FUNCSIG$v)
|
||||
(func $start:std/date (; 11 ;) (type $FUNCSIG$v)
|
||||
(local $0 i32)
|
||||
(local $1 i32)
|
||||
(local $2 i32)
|
||||
@@ -391,9 +390,9 @@
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $start (; 11 ;) (type $FUNCSIG$v)
|
||||
(func $start (; 12 ;) (type $FUNCSIG$v)
|
||||
call $start:std/date
|
||||
)
|
||||
(func $null (; 12 ;) (type $FUNCSIG$v)
|
||||
(func $null (; 13 ;) (type $FUNCSIG$v)
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user