mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-23 11:41:45 +00:00
Rework inlining logic (#463)
This commit is contained in:
@ -139,6 +139,8 @@
|
||||
if
|
||||
block $~lib/collector/itcm/refToObj|inlined.0 (result i32)
|
||||
local.get $0
|
||||
local.set $1
|
||||
local.get $1
|
||||
global.get $~lib/collector/itcm/HEADER_SIZE
|
||||
i32.sub
|
||||
end
|
||||
@ -382,6 +384,8 @@
|
||||
global.set $~argc
|
||||
block $~lib/collector/itcm/objToRef|inlined.0 (result i32)
|
||||
local.get $0
|
||||
local.set $1
|
||||
local.get $1
|
||||
global.get $~lib/collector/itcm/HEADER_SIZE
|
||||
i32.add
|
||||
end
|
||||
@ -434,13 +438,11 @@
|
||||
i32.ge_u
|
||||
if
|
||||
block $~lib/memory/memory.free|inlined.0
|
||||
block
|
||||
local.get $0
|
||||
call $~lib/allocator/arena/__memory_free
|
||||
br $~lib/memory/memory.free|inlined.0
|
||||
unreachable
|
||||
end
|
||||
unreachable
|
||||
local.get $0
|
||||
local.set $1
|
||||
local.get $1
|
||||
call $~lib/allocator/arena/__memory_free
|
||||
br $~lib/memory/memory.free|inlined.0
|
||||
end
|
||||
end
|
||||
else
|
||||
@ -524,6 +526,8 @@
|
||||
call $~lib/collector/itcm/ManagedObjectList#push
|
||||
block $~lib/collector/itcm/objToRef|inlined.1 (result i32)
|
||||
local.get $3
|
||||
local.set $2
|
||||
local.get $2
|
||||
global.get $~lib/collector/itcm/HEADER_SIZE
|
||||
i32.add
|
||||
end
|
||||
@ -2272,6 +2276,7 @@
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $2
|
||||
@ -2305,37 +2310,43 @@
|
||||
local.get $1
|
||||
call $~lib/internal/arraybuffer/allocateUnsafe
|
||||
local.set $3
|
||||
local.get $3
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.set $4
|
||||
local.get $0
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.set $5
|
||||
local.get $4
|
||||
local.get $5
|
||||
local.get $2
|
||||
call $~lib/internal/memory/memmove
|
||||
block $~lib/memory/memory.copy|inlined.0
|
||||
local.get $3
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.set $4
|
||||
local.get $0
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.set $5
|
||||
local.get $2
|
||||
local.set $6
|
||||
local.get $4
|
||||
local.get $5
|
||||
local.get $6
|
||||
call $~lib/internal/memory/memmove
|
||||
end
|
||||
local.get $3
|
||||
local.set $0
|
||||
end
|
||||
local.get $0
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.get $2
|
||||
i32.add
|
||||
local.set $3
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $1
|
||||
local.get $2
|
||||
i32.sub
|
||||
local.set $4
|
||||
local.get $3
|
||||
local.get $5
|
||||
local.get $4
|
||||
call $~lib/internal/memory/memset
|
||||
block $~lib/memory/memory.fill|inlined.0
|
||||
local.get $0
|
||||
global.get $~lib/internal/arraybuffer/HEADER_SIZE
|
||||
i32.add
|
||||
local.get $2
|
||||
i32.add
|
||||
local.set $3
|
||||
i32.const 0
|
||||
local.set $6
|
||||
local.get $1
|
||||
local.get $2
|
||||
i32.sub
|
||||
local.set $5
|
||||
local.get $3
|
||||
local.get $6
|
||||
local.get $5
|
||||
call $~lib/internal/memory/memset
|
||||
end
|
||||
else
|
||||
local.get $1
|
||||
local.get $2
|
||||
@ -2365,19 +2376,23 @@
|
||||
(local $3 i32)
|
||||
block $~lib/collector/itcm/refToObj|inlined.1 (result i32)
|
||||
local.get $0
|
||||
local.set $2
|
||||
local.get $2
|
||||
global.get $~lib/collector/itcm/HEADER_SIZE
|
||||
i32.sub
|
||||
end
|
||||
local.set $2
|
||||
local.get $2
|
||||
local.set $3
|
||||
local.get $3
|
||||
call $~lib/collector/itcm/ManagedObject#get:color
|
||||
global.get $~lib/collector/itcm/white
|
||||
i32.eqz
|
||||
i32.eq
|
||||
local.tee $3
|
||||
local.tee $2
|
||||
if (result i32)
|
||||
block $~lib/collector/itcm/refToObj|inlined.3 (result i32)
|
||||
local.get $1
|
||||
local.set $2
|
||||
local.get $2
|
||||
global.get $~lib/collector/itcm/HEADER_SIZE
|
||||
i32.sub
|
||||
end
|
||||
@ -2385,10 +2400,10 @@
|
||||
global.get $~lib/collector/itcm/white
|
||||
i32.eq
|
||||
else
|
||||
local.get $3
|
||||
local.get $2
|
||||
end
|
||||
if
|
||||
local.get $2
|
||||
local.get $3
|
||||
call $~lib/collector/itcm/ManagedObject#makeGray
|
||||
end
|
||||
)
|
||||
@ -2396,6 +2411,9 @@
|
||||
(local $3 i32)
|
||||
(local $4 i32)
|
||||
(local $5 i32)
|
||||
(local $6 i32)
|
||||
(local $7 i32)
|
||||
(local $8 i32)
|
||||
local.get $0
|
||||
i32.load
|
||||
local.set $3
|
||||
@ -2436,17 +2454,25 @@
|
||||
i32.add
|
||||
i32.store offset=4
|
||||
end
|
||||
i32.const 0
|
||||
local.set $5
|
||||
local.get $3
|
||||
local.get $1
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $5
|
||||
i32.add
|
||||
local.get $2
|
||||
i32.store offset=8
|
||||
block $~lib/internal/arraybuffer/STORE<Foo,Foo>|inlined.0
|
||||
local.get $3
|
||||
local.set $5
|
||||
local.get $1
|
||||
local.set $6
|
||||
local.get $2
|
||||
local.set $7
|
||||
i32.const 0
|
||||
local.set $8
|
||||
local.get $5
|
||||
local.get $6
|
||||
i32.const 2
|
||||
i32.shl
|
||||
i32.add
|
||||
local.get $8
|
||||
i32.add
|
||||
local.get $7
|
||||
i32.store offset=8
|
||||
end
|
||||
local.get $0
|
||||
local.get $2
|
||||
call $~lib/collector/itcm/__gc_link
|
||||
|
Reference in New Issue
Block a user