mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-14 15:31:31 +00:00
checked builtin array get, optimize abv layout
This commit is contained in:
@ -5,13 +5,13 @@
|
||||
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
|
||||
(memory $0 1)
|
||||
(data (i32.const 8) "\01\00\00\00\08\00\00\00\01\00\00\00\02\00\00\00")
|
||||
(data (i32.const 24) "\02\00\00\00\10\00\00\00\10\00\00\00\10\00\00\00\18\00\00\00\02\00\00\00")
|
||||
(data (i32.const 24) "\02\00\00\00\10\00\00\00\10\00\00\00\10\00\00\00\08\00\00\00\02\00\00\00")
|
||||
(data (i32.const 48) "\01\00\00\00\10\00\00\00\03\00\00\00\00\00\00\00\04\00\00\00\00\00\00\00")
|
||||
(data (i32.const 72) "\03\00\00\00\10\00\00\008\00\00\008\00\00\00H\00\00\00\02\00\00\00")
|
||||
(data (i32.const 72) "\03\00\00\00\10\00\00\008\00\00\008\00\00\00\10\00\00\00\02\00\00\00")
|
||||
(data (i32.const 96) "\01\00\00\00\08\00\00\00\00\00\c0?\00\00 @")
|
||||
(data (i32.const 112) "\04\00\00\00\10\00\00\00h\00\00\00h\00\00\00p\00\00\00\02\00\00\00")
|
||||
(data (i32.const 112) "\04\00\00\00\10\00\00\00h\00\00\00h\00\00\00\08\00\00\00\02\00\00\00")
|
||||
(data (i32.const 136) "\01\00\00\00\10\00\00\00\00\00\00\00\00\00\f4?\00\00\00\00\00\00\02@")
|
||||
(data (i32.const 160) "\05\00\00\00\10\00\00\00\90\00\00\00\90\00\00\00\a0\00\00\00\02\00\00\00")
|
||||
(data (i32.const 160) "\05\00\00\00\10\00\00\00\90\00\00\00\90\00\00\00\10\00\00\00\02\00\00\00")
|
||||
(data (i32.const 184) "\06\00\00\00&\00\00\00s\00t\00d\00/\00s\00t\00a\00t\00i\00c\00-\00a\00r\00r\00a\00y\00.\00t\00s\00")
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
@ -43,11 +43,65 @@
|
||||
i32.load offset=12
|
||||
)
|
||||
(func $start:std/static-array (; 5 ;) (type $FUNCSIG$v)
|
||||
(local $0 i32)
|
||||
(local $1 i32)
|
||||
global.get $std/static-array/i
|
||||
call $~lib/array/Array<i32>#get:length
|
||||
i32.const 2
|
||||
i32.eq
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 192
|
||||
i32.const 6
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
global.get $std/static-array/i
|
||||
local.tee $0
|
||||
i32.load offset=4
|
||||
i32.const 0
|
||||
i32.const 2
|
||||
i32.shl
|
||||
local.tee $1
|
||||
i32.add
|
||||
i32.const -1
|
||||
local.get $1
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.lt_u
|
||||
select
|
||||
i32.load
|
||||
i32.const 1
|
||||
i32.eq
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 192
|
||||
i32.const 7
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
global.get $std/static-array/i
|
||||
local.tee $0
|
||||
i32.load offset=4
|
||||
i32.const 1
|
||||
i32.const 2
|
||||
i32.shl
|
||||
local.tee $1
|
||||
i32.add
|
||||
i32.const -1
|
||||
local.get $1
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.lt_u
|
||||
select
|
||||
i32.load
|
||||
i32.const 2
|
||||
i32.eq
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 192
|
||||
@ -58,21 +112,23 @@
|
||||
end
|
||||
global.get $std/static-array/i
|
||||
i32.load offset=4
|
||||
i32.load
|
||||
i32.const 1
|
||||
i32.eq
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 192
|
||||
i32.const 9
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i32.const 2
|
||||
i32.store
|
||||
global.get $std/static-array/i
|
||||
local.tee $0
|
||||
i32.load offset=4
|
||||
i32.load offset=4
|
||||
i32.const 0
|
||||
i32.const 2
|
||||
i32.shl
|
||||
local.tee $1
|
||||
i32.add
|
||||
i32.const -1
|
||||
local.get $1
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.lt_u
|
||||
select
|
||||
i32.load
|
||||
i32.const 2
|
||||
i32.eq
|
||||
i32.eqz
|
||||
@ -84,24 +140,6 @@
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
global.get $std/static-array/i
|
||||
i32.load offset=4
|
||||
i32.const 2
|
||||
i32.store
|
||||
global.get $std/static-array/i
|
||||
i32.load offset=4
|
||||
i32.load
|
||||
i32.const 2
|
||||
i32.eq
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 192
|
||||
i32.const 12
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
global.get $std/static-array/I
|
||||
call $~lib/array/Array<i64>#get:length
|
||||
i32.const 2
|
||||
@ -110,13 +148,25 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 192
|
||||
i32.const 14
|
||||
i32.const 12
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
global.get $std/static-array/I
|
||||
local.tee $0
|
||||
i32.load offset=4
|
||||
i32.const 0
|
||||
i32.const 3
|
||||
i32.shl
|
||||
local.tee $1
|
||||
i32.add
|
||||
i32.const -1
|
||||
local.get $1
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.lt_u
|
||||
select
|
||||
i64.load
|
||||
i64.const 3
|
||||
i64.eq
|
||||
@ -124,21 +174,33 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 192
|
||||
i32.const 15
|
||||
i32.const 13
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
global.get $std/static-array/I
|
||||
local.tee $0
|
||||
i32.load offset=4
|
||||
i64.load offset=8
|
||||
i32.const 1
|
||||
i32.const 3
|
||||
i32.shl
|
||||
local.tee $1
|
||||
i32.add
|
||||
i32.const -1
|
||||
local.get $1
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.lt_u
|
||||
select
|
||||
i64.load
|
||||
i64.const 4
|
||||
i64.eq
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 192
|
||||
i32.const 16
|
||||
i32.const 14
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -148,7 +210,19 @@
|
||||
i64.const 4
|
||||
i64.store
|
||||
global.get $std/static-array/I
|
||||
local.tee $0
|
||||
i32.load offset=4
|
||||
i32.const 0
|
||||
i32.const 3
|
||||
i32.shl
|
||||
local.tee $1
|
||||
i32.add
|
||||
i32.const -1
|
||||
local.get $1
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.lt_u
|
||||
select
|
||||
i64.load
|
||||
i64.const 4
|
||||
i64.eq
|
||||
@ -156,7 +230,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 192
|
||||
i32.const 18
|
||||
i32.const 16
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -169,13 +243,25 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 192
|
||||
i32.const 20
|
||||
i32.const 18
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
global.get $std/static-array/f
|
||||
local.tee $0
|
||||
i32.load offset=4
|
||||
i32.const 0
|
||||
i32.const 2
|
||||
i32.shl
|
||||
local.tee $1
|
||||
i32.add
|
||||
i32.const -1
|
||||
local.get $1
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.lt_u
|
||||
select
|
||||
f32.load
|
||||
f32.const 1.5
|
||||
f32.eq
|
||||
@ -183,21 +269,33 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 192
|
||||
i32.const 21
|
||||
i32.const 19
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
global.get $std/static-array/f
|
||||
local.tee $0
|
||||
i32.load offset=4
|
||||
f32.load offset=4
|
||||
i32.const 1
|
||||
i32.const 2
|
||||
i32.shl
|
||||
local.tee $1
|
||||
i32.add
|
||||
i32.const -1
|
||||
local.get $1
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.lt_u
|
||||
select
|
||||
f32.load
|
||||
f32.const 2.5
|
||||
f32.eq
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 192
|
||||
i32.const 22
|
||||
i32.const 20
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -207,7 +305,19 @@
|
||||
f32.const 2.5
|
||||
f32.store
|
||||
global.get $std/static-array/f
|
||||
local.tee $0
|
||||
i32.load offset=4
|
||||
i32.const 0
|
||||
i32.const 2
|
||||
i32.shl
|
||||
local.tee $1
|
||||
i32.add
|
||||
i32.const -1
|
||||
local.get $1
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.lt_u
|
||||
select
|
||||
f32.load
|
||||
f32.const 2.5
|
||||
f32.eq
|
||||
@ -215,7 +325,7 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 192
|
||||
i32.const 24
|
||||
i32.const 22
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
@ -228,13 +338,25 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 192
|
||||
i32.const 26
|
||||
i32.const 24
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
global.get $std/static-array/F
|
||||
local.tee $0
|
||||
i32.load offset=4
|
||||
i32.const 0
|
||||
i32.const 3
|
||||
i32.shl
|
||||
local.tee $1
|
||||
i32.add
|
||||
i32.const -1
|
||||
local.get $1
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.lt_u
|
||||
select
|
||||
f64.load
|
||||
f64.const 1.25
|
||||
f64.eq
|
||||
@ -242,14 +364,56 @@
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 192
|
||||
i32.const 27
|
||||
i32.const 25
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
global.get $std/static-array/F
|
||||
local.tee $0
|
||||
i32.load offset=4
|
||||
i32.const 1
|
||||
i32.const 3
|
||||
i32.shl
|
||||
local.tee $1
|
||||
i32.add
|
||||
i32.const -1
|
||||
local.get $1
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.lt_u
|
||||
select
|
||||
f64.load
|
||||
f64.const 2.25
|
||||
f64.eq
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 192
|
||||
i32.const 26
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
global.get $std/static-array/F
|
||||
i32.load offset=4
|
||||
f64.load offset=8
|
||||
f64.const 2.25
|
||||
f64.store
|
||||
global.get $std/static-array/F
|
||||
local.tee $0
|
||||
i32.load offset=4
|
||||
i32.const 0
|
||||
i32.const 3
|
||||
i32.shl
|
||||
local.tee $1
|
||||
i32.add
|
||||
i32.const -1
|
||||
local.get $1
|
||||
local.get $0
|
||||
i32.load offset=8
|
||||
i32.lt_u
|
||||
select
|
||||
f64.load
|
||||
f64.const 2.25
|
||||
f64.eq
|
||||
i32.eqz
|
||||
@ -261,24 +425,6 @@
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
global.get $std/static-array/F
|
||||
i32.load offset=4
|
||||
f64.const 2.25
|
||||
f64.store
|
||||
global.get $std/static-array/F
|
||||
i32.load offset=4
|
||||
f64.load
|
||||
f64.const 2.25
|
||||
f64.eq
|
||||
i32.eqz
|
||||
if
|
||||
i32.const 0
|
||||
i32.const 192
|
||||
i32.const 30
|
||||
i32.const 0
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
)
|
||||
(func $start (; 6 ;) (type $FUNCSIG$v)
|
||||
call $start:std/static-array
|
||||
|
Reference in New Issue
Block a user