Try parsing signatures only if node is callable, see #149; Minor refactoring

This commit is contained in:
dcodeIO
2018-06-24 01:04:24 +02:00
parent 7a8995b18b
commit 188b4e48ce
14 changed files with 933 additions and 813 deletions

View File

@@ -26,7 +26,6 @@
(local $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
(if
(get_local $0)
(block
@@ -65,26 +64,24 @@
(grow_memory
(select
(get_local $2)
(tee_local $4
(tee_local $3
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $0)
(get_local $1)
)
(i32.const 65535)
(tee_local $3
(i32.shr_u
(i32.and
(i32.add
(i32.sub
(get_local $0)
(get_local $1)
)
(i32.const -65536)
(i32.const 65535)
)
(i32.const 16)
(i32.const -65536)
)
(i32.const 16)
)
)
(i32.gt_s
(get_local $2)
(get_local $4)
(get_local $3)
)
)
)
@@ -112,13 +109,13 @@
(i32.const 0)
)
(func $assembly/index/Body#constructor (; 2 ;) (type $iFFFFFFFi) (param $0 i32) (param $1 f64) (param $2 f64) (param $3 f64) (param $4 f64) (param $5 f64) (param $6 f64) (param $7 f64) (result i32)
(local $8 i32)
(if (result i32)
(get_local $0)
(get_local $0)
(block (result i32)
(if
(i32.eqz
(get_local $0)
)
(block
(f64.store
(tee_local $8
(tee_local $0
(call $~lib/allocator/arena/allocate_memory
(i32.const 56)
)
@@ -126,36 +123,36 @@
(get_local $1)
)
(f64.store offset=8
(get_local $8)
(get_local $0)
(get_local $2)
)
(f64.store offset=16
(get_local $8)
(get_local $0)
(get_local $3)
)
(f64.store offset=24
(get_local $8)
(get_local $0)
(get_local $4)
)
(f64.store offset=32
(get_local $8)
(get_local $0)
(get_local $5)
)
(f64.store offset=40
(get_local $8)
(get_local $0)
(get_local $6)
)
(f64.store offset=48
(get_local $8)
(get_local $0)
(get_local $7)
)
(get_local $8)
)
)
(get_local $0)
)
(func $~lib/memory/set_memory (; 3 ;) (type $iiiv) (param $0 i32) (param $1 i32) (param $2 i32)
(local $3 i64)
(local $4 i32)
(local $3 i32)
(local $4 i64)
(if
(i32.eqz
(get_local $2)
@@ -199,9 +196,11 @@
)
(i32.store8
(i32.sub
(i32.add
(get_local $0)
(get_local $2)
(tee_local $3
(i32.add
(get_local $0)
(get_local $2)
)
)
(i32.const 2)
)
@@ -209,10 +208,7 @@
)
(i32.store8
(i32.sub
(i32.add
(get_local $0)
(get_local $2)
)
(get_local $3)
(i32.const 3)
)
(get_local $1)
@@ -248,19 +244,25 @@
)
(return)
)
(set_local $2
(i32.sub
(get_local $2)
(tee_local $3
(i32.and
(i32.sub
(i32.const 0)
(get_local $0)
)
(i32.const 3)
)
)
)
)
(i32.store
(tee_local $0
(i32.add
(get_local $0)
(tee_local $4
(i32.and
(i32.sub
(i32.const 0)
(get_local $0)
)
(i32.const 3)
)
)
(get_local $3)
)
)
(tee_local $1
@@ -279,10 +281,7 @@
(get_local $0)
(tee_local $2
(i32.and
(i32.sub
(get_local $2)
(get_local $4)
)
(get_local $2)
(i32.const -4)
)
)
@@ -314,9 +313,11 @@
)
(i32.store
(i32.sub
(i32.add
(get_local $0)
(get_local $2)
(tee_local $3
(i32.add
(get_local $0)
(get_local $2)
)
)
(i32.const 12)
)
@@ -324,10 +325,7 @@
)
(i32.store
(i32.sub
(i32.add
(get_local $0)
(get_local $2)
)
(get_local $3)
(i32.const 8)
)
(get_local $1)
@@ -369,9 +367,11 @@
)
(i32.store
(i32.sub
(i32.add
(get_local $0)
(get_local $2)
(tee_local $3
(i32.add
(get_local $0)
(get_local $2)
)
)
(i32.const 28)
)
@@ -379,30 +379,21 @@
)
(i32.store
(i32.sub
(i32.add
(get_local $0)
(get_local $2)
)
(get_local $3)
(i32.const 24)
)
(get_local $1)
)
(i32.store
(i32.sub
(i32.add
(get_local $0)
(get_local $2)
)
(get_local $3)
(i32.const 20)
)
(get_local $1)
)
(i32.store
(i32.sub
(i32.add
(get_local $0)
(get_local $2)
)
(get_local $3)
(i32.const 16)
)
(get_local $1)
@@ -410,7 +401,7 @@
(set_local $0
(i32.add
(get_local $0)
(tee_local $4
(tee_local $3
(i32.add
(i32.and
(get_local $0)
@@ -424,18 +415,18 @@
(set_local $2
(i32.sub
(get_local $2)
(get_local $4)
(get_local $3)
)
)
(set_local $3
(set_local $4
(i64.or
(i64.extend_u/i32
(get_local $1)
)
(i64.shl
(tee_local $4
(i64.extend_u/i32
(get_local $1)
)
)
(i64.shl
(get_local $4)
(i64.const 32)
)
)
@@ -449,28 +440,28 @@
(block
(i64.store
(get_local $0)
(get_local $3)
(get_local $4)
)
(i64.store
(i32.add
(get_local $0)
(i32.const 8)
)
(get_local $3)
(get_local $4)
)
(i64.store
(i32.add
(get_local $0)
(i32.const 16)
)
(get_local $3)
(get_local $4)
)
(i64.store
(i32.add
(get_local $0)
(i32.const 24)
)
(get_local $3)
(get_local $4)
)
(set_local $2
(i32.sub
@@ -492,7 +483,6 @@
(func $~lib/array/Array<Body>#constructor (; 4 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
(if
(i32.gt_u
(get_local $1)
@@ -509,7 +499,7 @@
)
)
(i32.store
(tee_local $4
(tee_local $3
(call $~lib/allocator/arena/allocate_memory
(i32.shl
(i32.const 1)
@@ -518,11 +508,9 @@
(i32.clz
(i32.add
(tee_local $2
(tee_local $3
(i32.shl
(get_local $1)
(i32.const 2)
)
(i32.shl
(get_local $1)
(i32.const 2)
)
)
(i32.const 7)
@@ -534,9 +522,6 @@
)
(get_local $2)
)
(set_local $2
(get_local $4)
)
(if
(i32.eqz
(get_local $0)
@@ -558,7 +543,7 @@
)
(i32.store
(get_local $0)
(get_local $2)
(get_local $3)
)
(i32.store offset=4
(get_local $0)
@@ -566,11 +551,11 @@
)
(call $~lib/memory/set_memory
(i32.add
(get_local $2)
(get_local $3)
(i32.const 8)
)
(i32.const 0)
(get_local $3)
(get_local $2)
)
(get_local $0)
)
@@ -701,10 +686,11 @@
(f64.const 39.47841760435743)
)
)
(if (result i32)
(get_local $0)
(get_local $0)
(block (result i32)
(if
(i32.eqz
(get_local $0)
)
(block
(i32.store
(tee_local $2
(call $~lib/allocator/arena/allocate_memory
@@ -713,172 +699,172 @@
)
(get_local $1)
)
(get_local $2)
(set_local $0
(get_local $2)
)
)
)
(get_local $0)
)
(func $assembly/index/init (; 6 ;) (type $v)
(local $0 i32)
(local $1 i32)
(local $2 i32)
(set_local $1
(call $~lib/array/Array<Body>#constructor
(i32.const 0)
(i32.const 5)
)
)
(set_local $0
(call $assembly/index/Body#constructor
(i32.const 0)
(f64.const 0)
(f64.const 0)
(f64.const 0)
(f64.const 0)
(f64.const 0)
(f64.const 0)
(f64.const 39.47841760435743)
)
)
(i32.store offset=8
(i32.load
(get_local $1)
)
(get_local $0)
)
(set_local $0
(call $assembly/index/Body#constructor
(i32.const 0)
(f64.const 4.841431442464721)
(f64.const -1.1603200440274284)
(f64.const -0.10362204447112311)
(f64.const 0.606326392995832)
(f64.const 2.81198684491626)
(f64.const -0.02521836165988763)
(f64.const 0.03769367487038949)
)
)
(i32.store offset=8
(i32.add
(i32.load
(get_local $1)
)
(i32.const 4)
)
(get_local $0)
)
(set_local $0
(call $assembly/index/Body#constructor
(i32.const 0)
(f64.const 8.34336671824458)
(f64.const 4.124798564124305)
(f64.const -0.4035234171143214)
(f64.const -1.0107743461787924)
(f64.const 1.8256623712304119)
(f64.const 0.008415761376584154)
(f64.const 0.011286326131968767)
)
)
(i32.store offset=8
(i32.add
(i32.load
(get_local $1)
)
(i32.const 8)
)
(get_local $0)
)
(set_local $0
(call $assembly/index/Body#constructor
(i32.const 0)
(f64.const 12.894369562139131)
(f64.const -15.111151401698631)
(f64.const -0.22330757889265573)
(f64.const 1.0827910064415354)
(f64.const 0.8687130181696082)
(f64.const -0.010832637401363636)
(f64.const 1.7237240570597112e-03)
)
)
(i32.store offset=8
(i32.add
(i32.load
(get_local $1)
)
(i32.const 12)
)
(get_local $0)
)
(set_local $0
(call $assembly/index/Body#constructor
(i32.const 0)
(f64.const 15.379697114850917)
(f64.const -25.919314609987964)
(f64.const 0.17925877295037118)
(f64.const 0.979090732243898)
(f64.const 0.5946989986476762)
(f64.const -0.034755955504078104)
(f64.const 2.0336868699246304e-03)
)
)
(i32.store offset=8
(i32.add
(i32.load
(get_local $1)
)
(i32.const 16)
)
(get_local $0)
)
(set_global $assembly/index/system
(call $assembly/index/NBodySystem#constructor
(i32.const 0)
(block (result i32)
(set_local $0
(tee_local $1
(call $~lib/array/Array<Body>#constructor
(i32.const 0)
(i32.const 5)
)
)
)
(set_local $2
(call $assembly/index/Body#constructor
(i32.const 0)
(f64.const 0)
(f64.const 0)
(f64.const 0)
(f64.const 0)
(f64.const 0)
(f64.const 0)
(f64.const 39.47841760435743)
)
)
(i32.store offset=8
(i32.load
(get_local $0)
)
(get_local $2)
)
(set_local $0
(call $assembly/index/Body#constructor
(i32.const 0)
(f64.const 4.841431442464721)
(f64.const -1.1603200440274284)
(f64.const -0.10362204447112311)
(f64.const 0.606326392995832)
(f64.const 2.81198684491626)
(f64.const -0.02521836165988763)
(f64.const 0.03769367487038949)
)
)
(i32.store offset=8
(i32.add
(i32.load
(get_local $1)
)
(i32.const 4)
)
(get_local $0)
)
(set_local $0
(call $assembly/index/Body#constructor
(i32.const 0)
(f64.const 8.34336671824458)
(f64.const 4.124798564124305)
(f64.const -0.4035234171143214)
(f64.const -1.0107743461787924)
(f64.const 1.8256623712304119)
(f64.const 0.008415761376584154)
(f64.const 0.011286326131968767)
)
)
(i32.store offset=8
(i32.add
(i32.load
(get_local $1)
)
(i32.const 8)
)
(get_local $0)
)
(set_local $0
(call $assembly/index/Body#constructor
(i32.const 0)
(f64.const 12.894369562139131)
(f64.const -15.111151401698631)
(f64.const -0.22330757889265573)
(f64.const 1.0827910064415354)
(f64.const 0.8687130181696082)
(f64.const -0.010832637401363636)
(f64.const 1.7237240570597112e-03)
)
)
(i32.store offset=8
(i32.add
(i32.load
(get_local $1)
)
(i32.const 12)
)
(get_local $0)
)
(set_local $0
(call $assembly/index/Body#constructor
(i32.const 0)
(f64.const 15.379697114850917)
(f64.const -25.919314609987964)
(f64.const 0.17925877295037118)
(f64.const 0.979090732243898)
(f64.const 0.5946989986476762)
(f64.const -0.034755955504078104)
(f64.const 2.0336868699246304e-03)
)
)
(i32.store offset=8
(i32.add
(i32.load
(get_local $1)
)
(i32.const 16)
)
(get_local $0)
)
(get_local $1)
)
(get_local $1)
)
)
)
(func $assembly/index/getBody (; 7 ;) (type $ii) (param $0 i32) (result i32)
(local $1 i32)
(if (result i32)
(i32.lt_u
(get_local $0)
(i32.load offset=4
(tee_local $1
(i32.load
(get_global $assembly/index/system)
)
)
)
)
(tee_local $0
(if (result i32)
(i32.lt_u
(get_local $0)
(i32.shr_u
(i32.load
(tee_local $1
(i32.load
(get_local $1)
)
(i32.load offset=4
(tee_local $1
(i32.load
(get_global $assembly/index/system)
)
)
(i32.const 2)
)
)
(i32.load offset=8
(i32.add
(get_local $1)
(i32.shl
(get_local $0)
(if (result i32)
(i32.lt_u
(get_local $0)
(i32.shr_u
(i32.load
(tee_local $1
(i32.load
(get_local $1)
)
)
)
(i32.const 2)
)
)
(i32.load offset=8
(i32.add
(get_local $1)
(i32.shl
(get_local $0)
(i32.const 2)
)
)
)
(unreachable)
)
(unreachable)
(i32.const 0)
)
(i32.const 0)
)
)
(func $assembly/index/NBodySystem#advance (; 8 ;) (type $iFv) (param $0 i32) (param $1 f64)
@@ -899,6 +885,7 @@
(local $16 f64)
(local $17 f64)
(local $18 f64)
(local $19 f64)
(set_local $14
(i32.load offset=4
(tee_local $13
@@ -977,67 +964,58 @@
(get_local $14)
)
)
(set_local $3
(f64.mul
(get_local $18)
(set_local $12
(f64.sqrt
(tee_local $9
(f64.div
(get_local $1)
(f64.mul
(tee_local $3
(f64.add
(f64.add
(f64.mul
(tee_local $10
(f64.sub
(get_local $15)
(f64.load
(tee_local $2
(i32.load offset=8
(i32.add
(i32.load
(get_local $13)
)
(i32.shl
(get_local $8)
(i32.const 2)
)
)
(f64.add
(f64.add
(f64.mul
(tee_local $3
(tee_local $19
(f64.sub
(get_local $15)
(f64.load
(tee_local $2
(i32.load offset=8
(i32.add
(i32.load
(get_local $13)
)
(i32.shl
(get_local $8)
(i32.const 2)
)
)
)
)
)
(get_local $10)
)
(f64.mul
(tee_local $11
(f64.sub
(get_local $16)
(f64.load offset=8
(get_local $2)
)
)
)
(get_local $11)
)
)
(f64.mul
(tee_local $12
(f64.sub
(get_local $17)
(f64.load offset=16
(get_local $2)
)
)
)
(get_local $3)
)
(f64.mul
(tee_local $10
(f64.sub
(get_local $16)
(f64.load offset=8
(get_local $2)
)
(get_local $12)
)
)
(get_local $10)
)
)
(f64.mul
(tee_local $11
(f64.sub
(get_local $17)
(f64.load offset=16
(get_local $2)
)
)
)
(f64.sqrt
(get_local $3)
)
(get_local $11)
)
)
)
@@ -1047,13 +1025,21 @@
(f64.sub
(get_local $5)
(f64.mul
(get_local $10)
(get_local $3)
(tee_local $9
(f64.mul
(f64.load offset=48
(get_local $2)
)
(get_local $9)
(tee_local $12
(f64.div
(get_local $1)
(f64.mul
(get_local $9)
(get_local $12)
)
)
)
)
)
)
@@ -1063,7 +1049,7 @@
(f64.sub
(get_local $6)
(f64.mul
(get_local $11)
(get_local $10)
(get_local $9)
)
)
@@ -1072,7 +1058,7 @@
(f64.sub
(get_local $7)
(f64.mul
(get_local $12)
(get_local $11)
(get_local $9)
)
)
@@ -1084,8 +1070,13 @@
(get_local $2)
)
(f64.mul
(get_local $10)
(get_local $3)
(get_local $19)
(tee_local $3
(f64.mul
(get_local $18)
(get_local $12)
)
)
)
)
)
@@ -1096,7 +1087,7 @@
(get_local $2)
)
(f64.mul
(get_local $11)
(get_local $10)
(get_local $3)
)
)
@@ -1108,7 +1099,7 @@
(get_local $2)
)
(f64.mul
(get_local $12)
(get_local $11)
(get_local $3)
)
)