Properly inline getters; Simplify blocks when last statement returns

This commit is contained in:
dcodeIO
2018-06-22 15:26:59 +02:00
parent 525795b354
commit 7a8995b18b
75 changed files with 5090 additions and 6836 deletions

View File

@ -1,16 +1,16 @@
(module
(type $iii (func (param i32 i32) (result i32)))
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $ii (func (param i32) (result i32)))
(type $iiiiv (func (param i32 i32 i32 i32)))
(type $iv (func (param i32)))
(type $iiii (func (param i32 i32 i32) (result i32)))
(type $iiiv (func (param i32 i32 i32)))
(type $iii (func (param i32 i32) (result i32)))
(type $iiv (func (param i32 i32)))
(type $v (func))
(import "env" "abort" (func $~lib/env/abort (param i32 i32 i32 i32)))
(global $~lib/allocator/arena/startOffset (mut i32) (i32.const 0))
(global $~lib/allocator/arena/offset (mut i32) (i32.const 0))
(global $~lib/symbol/nextId (mut i32) (i32.const 1))
(global $~lib/symbol/nextId (mut i32) (i32.const 12))
(global $std/symbol/sym1 (mut i32) (i32.const 0))
(global $std/symbol/sym2 (mut i32) (i32.const 0))
(global $~lib/symbol/stringToId (mut i32) (i32.const 0))
@ -29,7 +29,7 @@
(data (i32.const 96) "\1c\00\00\00~\00l\00i\00b\00/\00i\00n\00t\00e\00r\00n\00a\00l\00/\00a\00r\00r\00a\00y\00b\00u\00f\00f\00e\00r\00.\00t\00s")
(export "memory" (memory $0))
(start $start)
(func $~lib/symbol/Symbol#constructor (; 1 ;) (type $iii) (param $0 i32) (param $1 i32) (result i32)
(func $~lib/symbol/Symbol (; 1 ;) (type $ii) (param $0 i32) (result i32)
(set_global $~lib/symbol/nextId
(i32.add
(tee_local $0
@ -914,15 +914,13 @@
(call $~lib/arraybuffer/ArrayBuffer#constructor
(i32.const 0)
(i32.mul
(tee_local $2
(tee_local $8
(i32.trunc_s/f64
(f64.mul
(f64.convert_s/i32
(get_local $2)
)
(f64.const 2.6666666666666665)
(tee_local $7
(i32.trunc_s/f64
(f64.mul
(f64.convert_s/i32
(get_local $2)
)
(f64.const 2.6666666666666665)
)
)
)
@ -931,29 +929,25 @@
(i32.const 1)
)
)
(set_local $6
(set_local $8
(i32.add
(tee_local $3
(tee_local $2
(i32.add
(i32.load offset=8
(get_local $0)
)
(i32.const 8)
(i32.add
(i32.load offset=8
(get_local $0)
)
(i32.const 8)
)
)
(i32.mul
(tee_local $6
(i32.load offset=16
(get_local $0)
)
(i32.load offset=16
(get_local $0)
)
(i32.const 12)
)
)
)
(set_local $3
(set_local $2
(i32.add
(get_local $5)
(i32.const 8)
@ -962,44 +956,44 @@
(loop $continue|0
(if
(i32.ne
(get_local $2)
(get_local $6)
(get_local $3)
(get_local $8)
)
(block
(if
(i32.eqz
(i32.and
(i32.load offset=8
(get_local $2)
(get_local $3)
)
(i32.const 1)
)
)
(block
(i32.store
(get_local $3)
(get_local $2)
(i32.load
(get_local $2)
(get_local $3)
)
)
(i32.store offset=4
(get_local $3)
(get_local $2)
(i32.load offset=4
(get_local $2)
(get_local $3)
)
)
(i32.store offset=8
(get_local $3)
(get_local $2)
(i32.load offset=8
(tee_local $7
(tee_local $6
(i32.add
(get_local $4)
(i32.shl
(i32.and
(tee_local $7
(tee_local $6
(call $~lib/internal/hash/hashStr
(i32.load
(get_local $2)
(get_local $3)
)
)
)
@ -1012,20 +1006,20 @@
)
)
(i32.store offset=8
(get_local $7)
(get_local $3)
(get_local $6)
(get_local $2)
)
(set_local $3
(set_local $2
(i32.add
(get_local $3)
(get_local $2)
(i32.const 12)
)
)
)
)
(set_local $2
(set_local $3
(i32.add
(get_local $2)
(get_local $3)
(i32.const 12)
)
)
@ -1047,7 +1041,7 @@
)
(i32.store offset=12
(get_local $0)
(get_local $8)
(get_local $7)
)
(i32.store offset=16
(get_local $0)
@ -1088,7 +1082,7 @@
)
(call $~lib/map/Map<String,usize>#rehash
(get_local $0)
(tee_local $4
(tee_local $3
(if (result i32)
(i32.lt_s
(i32.load offset=20
@ -1122,11 +1116,8 @@
)
)
(set_local $3
(i32.add
(i32.load offset=8
(get_local $0)
)
(i32.const 8)
(i32.load offset=8
(get_local $0)
)
)
(i32.store offset=16
@ -1143,7 +1134,10 @@
(i32.store
(tee_local $3
(i32.add
(get_local $3)
(i32.add
(get_local $3)
(i32.const 8)
)
(i32.mul
(get_local $4)
(i32.const 12)
@ -1328,15 +1322,13 @@
(call $~lib/arraybuffer/ArrayBuffer#constructor
(i32.const 0)
(i32.mul
(tee_local $2
(tee_local $8
(i32.trunc_s/f64
(f64.mul
(f64.convert_s/i32
(get_local $2)
)
(f64.const 2.6666666666666665)
(tee_local $7
(i32.trunc_s/f64
(f64.mul
(f64.convert_s/i32
(get_local $2)
)
(f64.const 2.6666666666666665)
)
)
)
@ -1345,29 +1337,25 @@
(i32.const 1)
)
)
(set_local $6
(set_local $8
(i32.add
(tee_local $3
(tee_local $2
(i32.add
(i32.load offset=8
(get_local $0)
)
(i32.const 8)
(i32.add
(i32.load offset=8
(get_local $0)
)
(i32.const 8)
)
)
(i32.mul
(tee_local $6
(i32.load offset=16
(get_local $0)
)
(i32.load offset=16
(get_local $0)
)
(i32.const 12)
)
)
)
(set_local $3
(set_local $2
(i32.add
(get_local $5)
(i32.const 8)
@ -1376,44 +1364,44 @@
(loop $continue|0
(if
(i32.ne
(get_local $2)
(get_local $6)
(get_local $3)
(get_local $8)
)
(block
(if
(i32.eqz
(i32.and
(i32.load offset=8
(get_local $2)
(get_local $3)
)
(i32.const 1)
)
)
(block
(i32.store
(get_local $3)
(get_local $2)
(i32.load
(get_local $2)
(get_local $3)
)
)
(i32.store offset=4
(get_local $3)
(get_local $2)
(i32.load offset=4
(get_local $2)
(get_local $3)
)
)
(i32.store offset=8
(get_local $3)
(get_local $2)
(i32.load offset=8
(tee_local $7
(tee_local $6
(i32.add
(get_local $4)
(i32.shl
(i32.and
(tee_local $7
(tee_local $6
(call $~lib/internal/hash/hash32
(i32.load
(get_local $2)
(get_local $3)
)
)
)
@ -1426,20 +1414,20 @@
)
)
(i32.store offset=8
(get_local $7)
(get_local $3)
(get_local $6)
(get_local $2)
)
(set_local $3
(set_local $2
(i32.add
(get_local $3)
(get_local $2)
(i32.const 12)
)
)
)
)
(set_local $2
(set_local $3
(i32.add
(get_local $2)
(get_local $3)
(i32.const 12)
)
)
@ -1461,7 +1449,7 @@
)
(i32.store offset=12
(get_local $0)
(get_local $8)
(get_local $7)
)
(i32.store offset=16
(get_local $0)
@ -1502,7 +1490,7 @@
)
(call $~lib/map/Map<usize,String>#rehash
(get_local $0)
(tee_local $4
(tee_local $3
(if (result i32)
(i32.lt_s
(i32.load offset=20
@ -1536,11 +1524,8 @@
)
)
(set_local $3
(i32.add
(i32.load offset=8
(get_local $0)
)
(i32.const 8)
(i32.load offset=8
(get_local $0)
)
)
(i32.store offset=16
@ -1557,7 +1542,10 @@
(i32.store
(tee_local $3
(i32.add
(get_local $3)
(i32.add
(get_local $3)
(i32.const 8)
)
(i32.mul
(get_local $4)
(i32.const 12)
@ -1734,14 +1722,12 @@
(get_global $~lib/allocator/arena/startOffset)
)
(set_global $std/symbol/sym1
(call $~lib/symbol/Symbol#constructor
(i32.const 0)
(call $~lib/symbol/Symbol
(i32.const 8)
)
)
(set_global $std/symbol/sym2
(call $~lib/symbol/Symbol#constructor
(i32.const 0)
(call $~lib/symbol/Symbol
(i32.const 8)
)
)