From 45e89f19e53974f47d7678fcf31826823ead15e4 Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Mon, 14 Dec 2020 17:56:18 +0200 Subject: [PATCH 01/14] use XXHash32 instead FNV-1a --- std/assembly/util/hash.ts | 132 +++-- tests/compiler/std/hash.optimized.wat | 177 +++++- tests/compiler/std/hash.untouched.wat | 422 ++++++++++---- tests/compiler/std/map.optimized.wat | 275 ++++------ tests/compiler/std/map.untouched.wat | 695 +++++++----------------- tests/compiler/std/set.optimized.wat | 285 ++++------ tests/compiler/std/set.untouched.wat | 499 +++++------------ tests/compiler/std/symbol.optimized.wat | 223 ++++++-- tests/compiler/std/symbol.untouched.wat | 354 +++++++++--- 9 files changed, 1565 insertions(+), 1497 deletions(-) diff --git a/std/assembly/util/hash.ts b/std/assembly/util/hash.ts index c168fa4903..f901ffbf5b 100644 --- a/std/assembly/util/hash.ts +++ b/std/assembly/util/hash.ts @@ -10,63 +10,113 @@ export function HASH(key: T): u32 { if (sizeof() == 4) return hash32(reinterpret(f32(key))); if (sizeof() == 8) return hash64(reinterpret(f64(key))); } else { - if (sizeof() == 1) return hash8 (u32(key)); - if (sizeof() == 2) return hash16(u32(key)); - if (sizeof() == 4) return hash32(u32(key)); + if (sizeof() <= 4) return hash32(u32(key)); if (sizeof() == 8) return hash64(u64(key)); } return unreachable(); } -// FNV-1a 32-bit as a starting point, see: http://isthe.com/chongo/tech/comp/fnv/ +// XXHash 32-bit as a starting point, see: https://cyan4973.github.io/xxHash +// primes // @ts-ignore: decorator -@inline const FNV_OFFSET: u32 = 2166136261; - +@inline const XXH32_P1: u32 = 2654435761; // @ts-ignore: decorator -@inline const FNV_PRIME: u32 = 16777619; - -function hash8(key: u32): u32 { - return (FNV_OFFSET ^ key) * FNV_PRIME; -} - -function hash16(key: u32): u32 { - var v = FNV_OFFSET; - v = (v ^ ( key & 0xff)) * FNV_PRIME; - v = (v ^ ( key >> 8 )) * FNV_PRIME; - return v; -} +@inline const XXH32_P2: u32 = 2246822519; +// @ts-ignore: decorator +@inline const XXH32_P3: u32 = 3266489917; +// @ts-ignore: decorator +@inline const XXH32_P4: u32 = 668265263; +// @ts-ignore: decorator +@inline const XXH32_P5: u32 = 374761393; +// @ts-ignore: decorator +@inline const XXH32_SEED: u32 = 0; function hash32(key: u32): u32 { - var v = FNV_OFFSET; - v = (v ^ ( key & 0xff)) * FNV_PRIME; - v = (v ^ ((key >> 8) & 0xff)) * FNV_PRIME; - v = (v ^ ((key >> 16) & 0xff)) * FNV_PRIME; - v = (v ^ ( key >> 24 )) * FNV_PRIME; - return v; + var h: u32 = XXH32_SEED + XXH32_P5; + h += key * XXH32_P3; + h = rotl(h, 17) * XXH32_P4; + h ^= h >> 15; + h *= XXH32_P2; + h ^= h >> 13; + h *= XXH32_P3; + h ^= h >> 16; + return h; } function hash64(key: u64): u32 { - var l = key; - var h = (key >>> 32); - var v = FNV_OFFSET; - v = (v ^ ( l & 0xff)) * FNV_PRIME; - v = (v ^ ((l >> 8) & 0xff)) * FNV_PRIME; - v = (v ^ ((l >> 16) & 0xff)) * FNV_PRIME; - v = (v ^ ( l >> 24 )) * FNV_PRIME; - v = (v ^ ( h & 0xff)) * FNV_PRIME; - v = (v ^ ((h >> 8) & 0xff)) * FNV_PRIME; - v = (v ^ ((h >> 16) & 0xff)) * FNV_PRIME; - v = (v ^ ( h >> 24 )) * FNV_PRIME; - return v; + var h: u32 = XXH32_SEED + XXH32_P5; + h += key * XXH32_P3; + h = rotl(h, 17) * XXH32_P4; + h += (key >> 32) * XXH32_P3; + h = rotl(h, 17) * XXH32_P4; + h ^= h >> 15; + h *= XXH32_P2; + h ^= h >> 13; + h *= XXH32_P3; + h ^= h >> 16; + return h; +} + +// @ts-ignore: decorator +@inline +function xxhMix(h: u32, c: u32): u32 { + h += c * XXH32_P2; + h = rotl(h, 13); + return h * XXH32_P1; } function hashStr(key: string): u32 { - var v = FNV_OFFSET; - if (key !== null) { - for (let i: usize = 0, k: usize = key.length << 1; i < k; ++i) { - v = (v ^ load(changetype(key) + i)) * FNV_PRIME; + if (key === null) { + return XXH32_SEED; + } + + var h: u32 = 0; + var len = key.length << 1; + + if (len >= 16) { + let s1 = XXH32_SEED + XXH32_P1 + XXH32_P2; + let s2 = XXH32_SEED + XXH32_P2; + let s3 = XXH32_SEED; + let s4 = XXH32_SEED - XXH32_P1; + + let i = 0; + len -= 16; + + while (i <= len) { + s1 = xxhMix(s1, load(changetype(key) + i)); + s2 = xxhMix(s2, load(changetype(key) + i, 4)); + s3 = xxhMix(s3, load(changetype(key) + i, 8)); + s4 = xxhMix(s4, load(changetype(key) + i, 12)); + i += 16; } + h = rotl(s1, 1) + rotl(s2, 7) + rotl(s3, 12) + rotl(s4, 18); + len -= i; + + } else { + h = XXH32_SEED + XXH32_P5; } - return v; + + var i = 0; + len -= 4; + + while (i <= len) { + h += load(changetype(key) + i) * XXH32_P3; + h = rotl(h, 17) * XXH32_P4; + i += 4; + } + + while (i < len) { + h += load(changetype(key) + i) * XXH32_P5; + h = rotl(h, 11) * XXH32_P1; + i++; + } + + h ^= h >> 15; + h *= XXH32_P2; + h ^= h >> 13; + h *= XXH32_P3; + h ^= h >> 16; + + return h; } diff --git a/tests/compiler/std/hash.optimized.wat b/tests/compiler/std/hash.optimized.wat index e0f7a02167..7346a10a49 100644 --- a/tests/compiler/std/hash.optimized.wat +++ b/tests/compiler/std/hash.optimized.wat @@ -12,43 +12,178 @@ (local $1 i32) (local $2 i32) (local $3 i32) - i32.const -2128831035 - local.set $2 + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) local.get $0 + i32.eqz if - local.get $0 - i32.const 20 + return + end + local.get $0 + i32.const 20 + i32.sub + i32.load offset=16 + i32.const 1 + i32.shr_u + i32.const 1 + i32.shl + local.tee $3 + i32.const 16 + i32.ge_s + if (result i32) + i32.const 606290984 + local.set $1 + i32.const -2048144777 + local.set $6 + i32.const 1640531535 + local.set $7 + local.get $3 + i32.const 16 i32.sub - i32.load offset=16 - i32.const 1 - i32.shr_u - i32.const 1 - i32.shl local.set $3 - loop $for-loop|0 - local.get $1 + loop $while-continue|0 local.get $3 - i32.lt_u + local.get $5 + i32.ge_s if - local.get $2 - local.get $0 local.get $1 + local.get $0 + local.get $5 i32.add - i32.load8_u - i32.xor - i32.const 16777619 + local.tee $8 + i32.load + i32.const -2048144777 i32.mul - local.set $2 - local.get $1 - i32.const 1 i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul local.set $1 - br $for-loop|0 + local.get $6 + local.get $8 + i32.load offset=4 + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $6 + local.get $4 + local.get $8 + i32.load offset=8 + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $4 + local.get $7 + local.get $8 + i32.load offset=12 + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $7 + local.get $5 + i32.const 16 + i32.add + local.set $5 + br $while-continue|0 end end + local.get $3 + local.get $5 + i32.sub + local.set $3 + local.get $1 + i32.const 1 + i32.rotl + local.get $6 + i32.const 7 + i32.rotl + i32.add + local.get $4 + i32.const 12 + i32.rotl + i32.add + local.get $7 + i32.const 18 + i32.rotl + i32.add + else + i32.const 374761393 + end + local.set $1 + local.get $3 + i32.const 4 + i32.sub + local.set $4 + loop $while-continue|1 + local.get $2 + local.get $4 + i32.le_s + if + local.get $1 + local.get $0 + local.get $2 + i32.add + i32.load + i32.const -1028477379 + i32.mul + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $1 + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $while-continue|1 + end + end + loop $while-continue|2 + local.get $2 + local.get $4 + i32.lt_s + if + local.get $1 + local.get $0 + local.get $2 + i32.add + i32.load8_u + i32.const 374761393 + i32.mul + i32.add + i32.const 11 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $1 + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $while-continue|2 + end end ) (func $~start + (local $0 i32) + (local $1 i64) i32.const 0 call $~lib/util/hash/hashStr i32.const 1056 diff --git a/tests/compiler/std/hash.untouched.wat b/tests/compiler/std/hash.untouched.wat index c1e7d41192..5dabda9e28 100644 --- a/tests/compiler/std/hash.untouched.wat +++ b/tests/compiler/std/hash.untouched.wat @@ -14,6 +14,9 @@ (func $~lib/rt/stub/__retain (param $0 i32) (result i32) local.get $0 ) + (func $~lib/rt/stub/__release (param $0 i32) + nop + ) (func $~lib/string/String#get:length (param $0 i32) (result i32) local.get $0 i32.const 20 @@ -22,192 +25,395 @@ i32.const 1 i32.shr_u ) - (func $~lib/rt/stub/__release (param $0 i32) - nop - ) (func $~lib/util/hash/hashStr (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) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) local.get $0 call $~lib/rt/stub/__retain local.set $0 - i32.const -2128831035 - local.set $1 local.get $0 i32.const 0 - i32.ne + i32.eq if i32.const 0 - local.set $2 + local.set $1 local.get $0 - call $~lib/string/String#get:length - i32.const 1 - i32.shl + call $~lib/rt/stub/__release + local.get $1 + return + end + i32.const 0 + local.set $2 + local.get $0 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.set $3 + local.get $3 + i32.const 16 + i32.ge_s + if + i32.const 0 + i32.const -1640531535 + i32.add + i32.const -2048144777 + i32.add + local.set $1 + i32.const 0 + i32.const -2048144777 + i32.add + local.set $4 + i32.const 0 + local.set $5 + i32.const 0 + i32.const -1640531535 + i32.sub + local.set $6 + i32.const 0 + local.set $7 + local.get $3 + i32.const 16 + i32.sub local.set $3 - loop $for-loop|0 - local.get $2 + loop $while-continue|0 + local.get $7 local.get $3 - i32.lt_u - local.set $4 - local.get $4 + i32.le_s + local.set $8 + local.get $8 if local.get $1 + local.set $10 local.get $0 - local.get $2 + local.get $7 + i32.add + i32.load + local.set $9 + local.get $10 + local.get $9 + i32.const -2048144777 + i32.mul i32.add - i32.load8_u - i32.xor - i32.const 16777619 + local.set $10 + local.get $10 + i32.const 13 + i32.rotl + local.set $10 + local.get $10 + i32.const -1640531535 i32.mul local.set $1 - local.get $2 - i32.const 1 + local.get $4 + local.set $10 + local.get $0 + local.get $7 i32.add - local.set $2 - br $for-loop|0 + i32.load offset=4 + local.set $9 + local.get $10 + local.get $9 + i32.const -2048144777 + i32.mul + i32.add + local.set $10 + local.get $10 + i32.const 13 + i32.rotl + local.set $10 + local.get $10 + i32.const -1640531535 + i32.mul + local.set $4 + local.get $5 + local.set $10 + local.get $0 + local.get $7 + i32.add + i32.load offset=8 + local.set $9 + local.get $10 + local.get $9 + i32.const -2048144777 + i32.mul + i32.add + local.set $10 + local.get $10 + i32.const 13 + i32.rotl + local.set $10 + local.get $10 + i32.const -1640531535 + i32.mul + local.set $5 + local.get $6 + local.set $10 + local.get $0 + local.get $7 + i32.add + i32.load offset=12 + local.set $9 + local.get $10 + local.get $9 + i32.const -2048144777 + i32.mul + i32.add + local.set $10 + local.get $10 + i32.const 13 + i32.rotl + local.set $10 + local.get $10 + i32.const -1640531535 + i32.mul + local.set $6 + local.get $7 + i32.const 16 + i32.add + local.set $7 + br $while-continue|0 end end + local.get $1 + i32.const 1 + i32.rotl + local.get $4 + i32.const 7 + i32.rotl + i32.add + local.get $5 + i32.const 12 + i32.rotl + i32.add + local.get $6 + i32.const 18 + i32.rotl + i32.add + local.set $2 + local.get $3 + local.get $7 + i32.sub + local.set $3 + else + i32.const 0 + i32.const 374761393 + i32.add + local.set $2 end - local.get $1 + i32.const 0 + local.set $11 + local.get $3 + i32.const 4 + i32.sub local.set $3 + loop $while-continue|1 + local.get $11 + local.get $3 + i32.le_s + local.set $7 + local.get $7 + if + local.get $2 + local.get $0 + local.get $11 + i32.add + i32.load + i32.const -1028477379 + i32.mul + i32.add + local.set $2 + local.get $2 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $2 + local.get $11 + i32.const 4 + i32.add + local.set $11 + br $while-continue|1 + end + end + loop $while-continue|2 + local.get $11 + local.get $3 + i32.lt_s + local.set $7 + local.get $7 + if + local.get $2 + local.get $0 + local.get $11 + i32.add + i32.load8_u + i32.const 374761393 + i32.mul + i32.add + local.set $2 + local.get $2 + i32.const 11 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $2 + local.get $11 + i32.const 1 + i32.add + local.set $11 + br $while-continue|2 + end + end + local.get $2 + local.get $2 + i32.const 15 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + i32.const -2048144777 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 13 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + i32.const -1028477379 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 16 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + local.set $7 local.get $0 call $~lib/rt/stub/__release - local.get $3 + local.get $7 ) (func $std/hash/check (param $0 i32) (result i32) i32.const 1 ) (func $~lib/util/hash/hash32 (param $0 i32) (result i32) (local $1 i32) - i32.const -2128831035 + i32.const 0 + i32.const 374761393 + i32.add local.set $1 local.get $1 local.get $0 - i32.const 255 - i32.and - i32.xor - i32.const 16777619 + i32.const -1028477379 i32.mul + i32.add local.set $1 local.get $1 - local.get $0 - i32.const 8 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $1 + local.get $1 + local.get $1 + i32.const 15 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 + local.set $1 + local.get $1 + i32.const -2048144777 i32.mul local.set $1 local.get $1 - local.get $0 - i32.const 16 + local.get $1 + i32.const 13 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 + local.set $1 + local.get $1 + i32.const -1028477379 i32.mul local.set $1 local.get $1 - local.get $0 - i32.const 24 + local.get $1 + i32.const 16 i32.shr_u i32.xor - i32.const 16777619 - i32.mul local.set $1 local.get $1 ) (func $~lib/util/hash/hash64 (param $0 i64) (result i32) (local $1 i32) - (local $2 i32) - (local $3 i32) + i32.const 0 + i32.const 374761393 + i32.add + local.set $1 + local.get $1 local.get $0 i32.wrap_i64 + i32.const -1028477379 + i32.mul + i32.add + local.set $1 + local.get $1 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul local.set $1 + local.get $1 local.get $0 i64.const 32 i64.shr_u i32.wrap_i64 - local.set $2 - i32.const -2128831035 - local.set $3 - local.get $3 - local.get $1 - i32.const 255 - i32.and - i32.xor - i32.const 16777619 + i32.const -1028477379 i32.mul - local.set $3 - local.get $3 + i32.add + local.set $1 local.get $1 - i32.const 8 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 + i32.const 17 + i32.rotl + i32.const 668265263 i32.mul - local.set $3 - local.get $3 + local.set $1 local.get $1 - i32.const 16 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.set $3 - local.get $3 local.get $1 - i32.const 24 + i32.const 15 i32.shr_u i32.xor - i32.const 16777619 - i32.mul - local.set $3 - local.get $3 - local.get $2 - i32.const 255 - i32.and - i32.xor - i32.const 16777619 + local.set $1 + local.get $1 + i32.const -2048144777 i32.mul - local.set $3 - local.get $3 - local.get $2 - i32.const 8 + local.set $1 + local.get $1 + local.get $1 + i32.const 13 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 + local.set $1 + local.get $1 + i32.const -1028477379 i32.mul - local.set $3 - local.get $3 - local.get $2 + local.set $1 + local.get $1 + local.get $1 i32.const 16 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 - i32.mul - local.set $3 - local.get $3 - local.get $2 - i32.const 24 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - local.set $3 - local.get $3 + local.set $1 + local.get $1 ) (func $start:std/hash (local $0 i32) diff --git a/tests/compiler/std/map.optimized.wat b/tests/compiler/std/map.optimized.wat index d65655a3d4..4ae78b26dd 100644 --- a/tests/compiler/std/map.optimized.wat +++ b/tests/compiler/std/map.optimized.wat @@ -1290,6 +1290,36 @@ local.get $1 call $~lib/rt/pure/__retain ) + (func $~lib/util/hash/hash32 (param $0 i32) (result i32) + local.get $0 + i32.const -1028477379 + i32.mul + i32.const 374761393 + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.tee $0 + local.get $0 + i32.const 15 + i32.shr_u + i32.xor + i32.const -2048144777 + i32.mul + local.tee $0 + local.get $0 + i32.const 13 + i32.shr_u + i32.xor + i32.const -1028477379 + i32.mul + local.tee $0 + local.get $0 + i32.const 16 + i32.shr_u + i32.xor + ) (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.load @@ -1341,10 +1371,7 @@ i32.shl i32.const 24 i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash32 call $~lib/map/Map#find i32.const 0 i32.ne @@ -1408,12 +1435,9 @@ i32.store offset=4 local.get $2 local.get $5 - local.get $1 local.get $6 - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash32 + local.get $1 i32.and i32.const 2 i32.shl @@ -1487,20 +1511,15 @@ (local $3 i32) (local $4 i32) (local $5 i32) + local.get $0 + local.get $1 local.get $1 i32.const 24 i32.shl i32.const 24 i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.tee $3 - local.set $5 - local.get $0 - local.get $1 - local.get $3 + call $~lib/util/hash/hash32 + local.tee $5 call $~lib/map/Map#find local.tee $3 if @@ -1595,10 +1614,7 @@ i32.shl i32.const 24 i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash32 call $~lib/map/Map#find local.tee $0 i32.eqz @@ -2475,12 +2491,9 @@ i32.store8 offset=1 local.get $2 local.get $5 - local.get $1 local.get $6 - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash32 + local.get $1 i32.and i32.const 2 i32.shl @@ -2554,19 +2567,17 @@ (local $3 i32) (local $4 i32) (local $5 i32) - local.get $0 - i32.load local.get $1 local.tee $3 i32.const 24 i32.shl i32.const 24 i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.tee $5 + call $~lib/util/hash/hash32 + local.set $5 + local.get $0 + i32.load + local.get $5 local.get $0 i32.load offset=4 i32.and @@ -2690,37 +2701,6 @@ local.get $0 call $~lib/rt/pure/__retain ) - (func $~lib/util/hash/hash32 (param $0 i32) (result i32) - local.get $0 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $0 - i32.const 8 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.get $0 - i32.const 16 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.get $0 - i32.const 24 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - ) (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.load @@ -2997,10 +2977,7 @@ i32.shl i32.const 24 i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash32 call $~lib/map/Map#find local.tee $1 i32.eqz @@ -3616,10 +3593,7 @@ local.get $1 i32.const 255 i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash32 call $~lib/map/Map#find i32.const 0 i32.ne @@ -3683,12 +3657,9 @@ i32.store offset=4 local.get $2 local.get $5 - local.get $1 local.get $6 - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash32 + local.get $1 i32.and i32.const 2 i32.shl @@ -3762,18 +3733,13 @@ (local $3 i32) (local $4 i32) (local $5 i32) + local.get $0 + local.get $1 local.get $1 i32.const 255 i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.tee $3 - local.set $5 - local.get $0 - local.get $1 - local.get $3 + call $~lib/util/hash/hash32 + local.tee $5 call $~lib/map/Map#find local.tee $3 if @@ -3866,10 +3832,7 @@ local.get $1 i32.const 255 i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash32 call $~lib/map/Map#find local.tee $0 i32.eqz @@ -4056,12 +4019,9 @@ i32.store8 offset=1 local.get $2 local.get $5 - local.get $1 local.get $6 - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash32 + local.get $1 i32.and i32.const 2 i32.shl @@ -4135,17 +4095,15 @@ (local $3 i32) (local $4 i32) (local $5 i32) - local.get $0 - i32.load local.get $1 local.tee $3 i32.const 255 i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.tee $5 + call $~lib/util/hash/hash32 + local.set $5 + local.get $0 + i32.load + local.get $5 local.get $0 i32.load offset=4 i32.and @@ -4276,10 +4234,7 @@ local.get $1 i32.const 255 i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash32 call $~lib/map/Map#find local.tee $1 i32.eqz @@ -4834,21 +4789,6 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/util/hash/hash16 (param $0 i32) (result i32) - local.get $0 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $0 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - ) (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.load @@ -4900,7 +4840,7 @@ i32.shl i32.const 16 i32.shr_s - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 call $~lib/map/Map#find i32.const 0 i32.ne @@ -4965,7 +4905,7 @@ local.get $2 local.get $5 local.get $6 - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 local.get $1 i32.and i32.const 2 @@ -5047,7 +4987,7 @@ i32.shl i32.const 16 i32.shr_s - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 local.tee $5 call $~lib/map/Map#find local.tee $3 @@ -5143,7 +5083,7 @@ i32.shl i32.const 16 i32.shr_s - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 call $~lib/map/Map#find local.tee $0 i32.eqz @@ -5385,7 +5325,7 @@ local.get $2 local.get $5 local.get $6 - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 local.get $1 i32.and i32.const 2 @@ -5466,7 +5406,7 @@ i32.shl i32.const 16 i32.shr_s - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 local.set $5 local.get $0 i32.load @@ -5603,7 +5543,7 @@ i32.shl i32.const 16 i32.shr_s - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 call $~lib/map/Map#find local.tee $1 i32.eqz @@ -6188,7 +6128,7 @@ local.get $1 i32.const 65535 i32.and - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 call $~lib/map/Map#find i32.const 0 i32.ne @@ -6253,7 +6193,7 @@ local.get $2 local.get $5 local.get $6 - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 local.get $1 i32.and i32.const 2 @@ -6333,7 +6273,7 @@ local.get $1 i32.const 65535 i32.and - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 local.tee $5 call $~lib/map/Map#find local.tee $3 @@ -6427,7 +6367,7 @@ local.get $1 i32.const 65535 i32.and - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 call $~lib/map/Map#find local.tee $0 i32.eqz @@ -6619,7 +6559,7 @@ local.get $2 local.get $5 local.get $6 - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 local.get $1 i32.and i32.const 2 @@ -6698,7 +6638,7 @@ local.tee $3 i32.const 65535 i32.and - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 local.set $5 local.get $0 i32.load @@ -6833,7 +6773,7 @@ local.get $1 i32.const 65535 i32.and - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 call $~lib/map/Map#find local.tee $1 i32.eqz @@ -8525,67 +8465,44 @@ (local $1 i32) local.get $0 i32.wrap_i64 - local.tee $1 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 8 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 16 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 + i32.const -1028477379 i32.mul - local.get $1 - i32.const 24 - i32.shr_u - i32.xor - i32.const 16777619 + i32.const 374761393 + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 i32.mul local.get $0 i64.const 32 i64.shr_u i32.wrap_i64 - local.tee $1 - i32.const 255 - i32.and - i32.xor - i32.const 16777619 + i32.const -1028477379 + i32.mul + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 i32.mul + local.tee $1 local.get $1 - i32.const 8 + i32.const 15 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 + i32.const -2048144777 i32.mul + local.tee $1 local.get $1 - i32.const 16 + i32.const 13 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 + i32.const -1028477379 i32.mul + local.tee $1 local.get $1 - i32.const 24 + i32.const 16 i32.shr_u i32.xor - i32.const 16777619 - i32.mul ) (func $~lib/map/Map#find (param $0 i32) (param $1 i64) (param $2 i32) (result i32) local.get $0 diff --git a/tests/compiler/std/map.untouched.wat b/tests/compiler/std/map.untouched.wat index 19ba13b674..a5db76415b 100644 --- a/tests/compiler/std/map.untouched.wat +++ b/tests/compiler/std/map.untouched.wat @@ -1803,12 +1803,51 @@ i32.store offset=20 local.get $0 ) - (func $~lib/util/hash/hash8 (param $0 i32) (result i32) - i32.const -2128831035 + (func $~lib/util/hash/hash32 (param $0 i32) (result i32) + (local $1 i32) + i32.const 0 + i32.const 374761393 + i32.add + local.set $1 + local.get $1 local.get $0 + i32.const -1028477379 + i32.mul + i32.add + local.set $1 + local.get $1 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $1 + local.get $1 + local.get $1 + i32.const 15 + i32.shr_u i32.xor - i32.const 16777619 + local.set $1 + local.get $1 + i32.const -2048144777 + i32.mul + local.set $1 + local.get $1 + local.get $1 + i32.const 13 + i32.shr_u + i32.xor + local.set $1 + local.get $1 + i32.const -1028477379 i32.mul + local.set $1 + local.get $1 + local.get $1 + i32.const 16 + i32.shr_u + i32.xor + local.set $1 + local.get $1 ) (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -1878,15 +1917,15 @@ i32.const 0 drop i32.const 1 - i32.const 1 - i32.eq + i32.const 4 + i32.le_u drop local.get $2 i32.const 24 i32.shl i32.const 24 i32.shr_s - call $~lib/util/hash/hash8 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.0 end call $~lib/map/Map#find @@ -1978,11 +2017,11 @@ i32.const 0 drop i32.const 1 - i32.const 1 - i32.eq + i32.const 4 + i32.le_u drop local.get $13 - call $~lib/util/hash/hash8 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.2 end local.get $1 @@ -2077,15 +2116,15 @@ i32.const 0 drop i32.const 1 - i32.const 1 - i32.eq + i32.const 4 + i32.le_u drop local.get $3 i32.const 24 i32.shl i32.const 24 i32.shr_s - call $~lib/util/hash/hash8 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.1 end local.set $4 @@ -2198,15 +2237,15 @@ i32.const 0 drop i32.const 1 - i32.const 1 - i32.eq + i32.const 4 + i32.le_u drop local.get $2 i32.const 24 i32.shl i32.const 24 i32.shr_s - call $~lib/util/hash/hash8 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.3 end call $~lib/map/Map#find @@ -4467,11 +4506,11 @@ i32.const 0 drop i32.const 1 - i32.const 1 - i32.eq + i32.const 4 + i32.le_u drop local.get $13 - call $~lib/util/hash/hash8 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.5 end local.get $1 @@ -4566,15 +4605,15 @@ i32.const 0 drop i32.const 1 - i32.const 1 - i32.eq + i32.const 4 + i32.le_u drop local.get $3 i32.const 24 i32.shl i32.const 24 i32.shr_s - call $~lib/util/hash/hash8 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.4 end local.set $4 @@ -4672,48 +4711,6 @@ local.get $0 call $~lib/rt/pure/__retain ) - (func $~lib/util/hash/hash32 (param $0 i32) (result i32) - (local $1 i32) - i32.const -2128831035 - local.set $1 - local.get $1 - local.get $0 - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.set $1 - local.get $1 - local.get $0 - i32.const 8 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.set $1 - local.get $1 - local.get $0 - i32.const 16 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.set $1 - local.get $1 - local.get $0 - i32.const 24 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - local.set $1 - local.get $1 - ) (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) @@ -4849,16 +4846,8 @@ i32.const 0 drop i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 i32.const 4 - i32.eq + i32.le_u drop local.get $13 call $~lib/util/hash/hash32 @@ -4956,16 +4945,8 @@ i32.const 0 drop i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 i32.const 4 - i32.eq + i32.le_u drop local.get $3 call $~lib/util/hash/hash32 @@ -5091,15 +5072,15 @@ i32.const 0 drop i32.const 1 - i32.const 1 - i32.eq + i32.const 4 + i32.le_u drop local.get $2 i32.const 24 i32.shl i32.const 24 i32.shr_s - call $~lib/util/hash/hash8 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.6 end call $~lib/map/Map#find @@ -5823,13 +5804,13 @@ i32.const 0 drop i32.const 1 - i32.const 1 - i32.eq + i32.const 4 + i32.le_u drop local.get $2 i32.const 255 i32.and - call $~lib/util/hash/hash8 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.0 end call $~lib/map/Map#find @@ -5921,11 +5902,11 @@ i32.const 0 drop i32.const 1 - i32.const 1 - i32.eq + i32.const 4 + i32.le_u drop local.get $13 - call $~lib/util/hash/hash8 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.2 end local.get $1 @@ -6020,13 +6001,13 @@ i32.const 0 drop i32.const 1 - i32.const 1 - i32.eq + i32.const 4 + i32.le_u drop local.get $3 i32.const 255 i32.and - call $~lib/util/hash/hash8 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.1 end local.set $4 @@ -6139,13 +6120,13 @@ i32.const 0 drop i32.const 1 - i32.const 1 - i32.eq + i32.const 4 + i32.le_u drop local.get $2 i32.const 255 i32.and - call $~lib/util/hash/hash8 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.3 end call $~lib/map/Map#find @@ -6650,11 +6631,11 @@ i32.const 0 drop i32.const 1 - i32.const 1 - i32.eq + i32.const 4 + i32.le_u drop local.get $13 - call $~lib/util/hash/hash8 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.5 end local.get $1 @@ -6749,13 +6730,13 @@ i32.const 0 drop i32.const 1 - i32.const 1 - i32.eq + i32.const 4 + i32.le_u drop local.get $3 i32.const 255 i32.and - call $~lib/util/hash/hash8 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.4 end local.set $4 @@ -6874,13 +6855,13 @@ i32.const 0 drop i32.const 1 - i32.const 1 - i32.eq + i32.const 4 + i32.le_u drop local.get $2 i32.const 255 i32.and - call $~lib/util/hash/hash8 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.6 end call $~lib/map/Map#find @@ -7516,28 +7497,6 @@ i32.store offset=20 local.get $0 ) - (func $~lib/util/hash/hash16 (param $0 i32) (result i32) - (local $1 i32) - i32.const -2128831035 - local.set $1 - local.get $1 - local.get $0 - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.set $1 - local.get $1 - local.get $0 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - local.set $1 - local.get $1 - ) (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) @@ -7606,19 +7565,15 @@ i32.const 0 drop i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq + i32.const 4 + i32.le_u drop local.get $2 i32.const 16 i32.shl i32.const 16 i32.shr_s - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.0 end call $~lib/map/Map#find @@ -7710,15 +7665,11 @@ i32.const 0 drop i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq + i32.const 4 + i32.le_u drop local.get $13 - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.2 end local.get $1 @@ -7813,19 +7764,15 @@ i32.const 0 drop i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq + i32.const 4 + i32.le_u drop local.get $3 i32.const 16 i32.shl i32.const 16 i32.shr_s - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.1 end local.set $4 @@ -7938,19 +7885,15 @@ i32.const 0 drop i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq + i32.const 4 + i32.le_u drop local.get $2 i32.const 16 i32.shl i32.const 16 i32.shr_s - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.3 end call $~lib/map/Map#find @@ -8457,15 +8400,11 @@ i32.const 0 drop i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq + i32.const 4 + i32.le_u drop local.get $13 - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.5 end local.get $1 @@ -8560,19 +8499,15 @@ i32.const 0 drop i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq + i32.const 4 + i32.le_u drop local.get $3 i32.const 16 i32.shl i32.const 16 i32.shr_s - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.4 end local.set $4 @@ -8691,19 +8626,15 @@ i32.const 0 drop i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq + i32.const 4 + i32.le_u drop local.get $2 i32.const 16 i32.shl i32.const 16 i32.shr_s - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.6 end call $~lib/map/Map#find @@ -9427,17 +9358,13 @@ i32.const 0 drop i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq + i32.const 4 + i32.le_u drop local.get $2 i32.const 65535 i32.and - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.0 end call $~lib/map/Map#find @@ -9529,15 +9456,11 @@ i32.const 0 drop i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq + i32.const 4 + i32.le_u drop local.get $13 - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.2 end local.get $1 @@ -9632,17 +9555,13 @@ i32.const 0 drop i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq + i32.const 4 + i32.le_u drop local.get $3 i32.const 65535 i32.and - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.1 end local.set $4 @@ -9755,17 +9674,13 @@ i32.const 0 drop i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq + i32.const 4 + i32.le_u drop local.get $2 i32.const 65535 i32.and - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.3 end call $~lib/map/Map#find @@ -10270,15 +10185,11 @@ i32.const 0 drop i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq + i32.const 4 + i32.le_u drop local.get $13 - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.5 end local.get $1 @@ -10373,17 +10284,13 @@ i32.const 0 drop i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq + i32.const 4 + i32.le_u drop local.get $3 i32.const 65535 i32.and - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.4 end local.set $4 @@ -10502,17 +10409,13 @@ i32.const 0 drop i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq + i32.const 4 + i32.le_u drop local.get $2 i32.const 65535 i32.and - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.6 end call $~lib/map/Map#find @@ -11122,16 +11025,8 @@ i32.const 0 drop i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 i32.const 4 - i32.eq + i32.le_u drop local.get $2 call $~lib/util/hash/hash32 @@ -11156,16 +11051,8 @@ i32.const 0 drop i32.const 4 - i32.const 1 - i32.eq - drop i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq + i32.le_u drop local.get $2 call $~lib/util/hash/hash32 @@ -11337,16 +11224,8 @@ i32.const 0 drop i32.const 4 - i32.const 1 - i32.eq - drop i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq + i32.le_u drop local.get $2 call $~lib/util/hash/hash32 @@ -12025,16 +11904,8 @@ i32.const 0 drop i32.const 4 - i32.const 1 - i32.eq - drop i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq + i32.le_u drop local.get $2 call $~lib/util/hash/hash32 @@ -12129,16 +12000,8 @@ i32.const 0 drop i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 i32.const 4 - i32.eq + i32.le_u drop local.get $13 call $~lib/util/hash/hash32 @@ -12236,16 +12099,8 @@ i32.const 0 drop i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 i32.const 4 - i32.eq + i32.le_u drop local.get $3 call $~lib/util/hash/hash32 @@ -12361,16 +12216,8 @@ i32.const 0 drop i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 i32.const 4 - i32.eq + i32.le_u drop local.get $2 call $~lib/util/hash/hash32 @@ -12876,16 +12723,8 @@ i32.const 0 drop i32.const 4 - i32.const 1 - i32.eq - drop i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq + i32.le_u drop local.get $13 call $~lib/util/hash/hash32 @@ -12983,16 +12822,8 @@ i32.const 0 drop i32.const 4 - i32.const 1 - i32.eq - drop i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq + i32.le_u drop local.get $3 call $~lib/util/hash/hash32 @@ -13114,16 +12945,8 @@ i32.const 0 drop i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 i32.const 4 - i32.eq + i32.le_u drop local.get $2 call $~lib/util/hash/hash32 @@ -13740,91 +13563,65 @@ ) (func $~lib/util/hash/hash64 (param $0 i64) (result i32) (local $1 i32) - (local $2 i32) - (local $3 i32) + i32.const 0 + i32.const 374761393 + i32.add + local.set $1 + local.get $1 local.get $0 i32.wrap_i64 + i32.const -1028477379 + i32.mul + i32.add + local.set $1 + local.get $1 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul local.set $1 + local.get $1 local.get $0 i64.const 32 i64.shr_u i32.wrap_i64 - local.set $2 - i32.const -2128831035 - local.set $3 - local.get $3 - local.get $1 - i32.const 255 - i32.and - i32.xor - i32.const 16777619 + i32.const -1028477379 i32.mul - local.set $3 - local.get $3 + i32.add + local.set $1 local.get $1 - i32.const 8 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 + i32.const 17 + i32.rotl + i32.const 668265263 i32.mul - local.set $3 - local.get $3 + local.set $1 local.get $1 - i32.const 16 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.set $3 - local.get $3 local.get $1 - i32.const 24 + i32.const 15 i32.shr_u i32.xor - i32.const 16777619 - i32.mul - local.set $3 - local.get $3 - local.get $2 - i32.const 255 - i32.and - i32.xor - i32.const 16777619 + local.set $1 + local.get $1 + i32.const -2048144777 i32.mul - local.set $3 - local.get $3 - local.get $2 - i32.const 8 + local.set $1 + local.get $1 + local.get $1 + i32.const 13 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 + local.set $1 + local.get $1 + i32.const -1028477379 i32.mul - local.set $3 - local.get $3 - local.get $2 + local.set $1 + local.get $1 + local.get $1 i32.const 16 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 - i32.mul - local.set $3 - local.get $3 - local.get $2 - i32.const 24 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - local.set $3 - local.get $3 + local.set $1 + local.get $1 ) (func $~lib/map/Map#find (param $0 i32) (param $1 i64) (param $2 i32) (result i32) (local $3 i32) @@ -13890,16 +13687,8 @@ i32.const 0 drop i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 i32.const 4 - i32.eq + i32.le_u drop i32.const 8 i32.const 8 @@ -13999,16 +13788,8 @@ i32.const 0 drop i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 i32.const 4 - i32.eq + i32.le_u drop i32.const 8 i32.const 8 @@ -14111,16 +13892,8 @@ i32.const 0 drop i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 i32.const 4 - i32.eq + i32.le_u drop i32.const 8 i32.const 8 @@ -14240,16 +14013,8 @@ i32.const 0 drop i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 i32.const 4 - i32.eq + i32.le_u drop i32.const 8 i32.const 8 @@ -14760,16 +14525,8 @@ i32.const 0 drop i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 i32.const 4 - i32.eq + i32.le_u drop i32.const 8 i32.const 8 @@ -14872,16 +14629,8 @@ i32.const 0 drop i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 i32.const 4 - i32.eq + i32.le_u drop i32.const 8 i32.const 8 @@ -15008,16 +14757,8 @@ i32.const 0 drop i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 i32.const 4 - i32.eq + i32.le_u drop i32.const 8 i32.const 8 @@ -15708,16 +15449,8 @@ i32.const 0 drop i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 i32.const 4 - i32.eq + i32.le_u drop i32.const 8 i32.const 8 @@ -15817,16 +15550,8 @@ i32.const 0 drop i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 i32.const 4 - i32.eq + i32.le_u drop i32.const 8 i32.const 8 @@ -15929,16 +15654,8 @@ i32.const 0 drop i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 i32.const 4 - i32.eq + i32.le_u drop i32.const 8 i32.const 8 @@ -16058,16 +15775,8 @@ i32.const 0 drop i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 i32.const 4 - i32.eq + i32.le_u drop i32.const 8 i32.const 8 @@ -16578,16 +16287,8 @@ i32.const 0 drop i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 i32.const 4 - i32.eq + i32.le_u drop i32.const 8 i32.const 8 @@ -16690,16 +16391,8 @@ i32.const 0 drop i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 i32.const 4 - i32.eq + i32.le_u drop i32.const 8 i32.const 8 @@ -16826,16 +16519,8 @@ i32.const 0 drop i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 i32.const 4 - i32.eq + i32.le_u drop i32.const 8 i32.const 8 diff --git a/tests/compiler/std/set.optimized.wat b/tests/compiler/std/set.optimized.wat index c185d03e5f..738c644711 100644 --- a/tests/compiler/std/set.optimized.wat +++ b/tests/compiler/std/set.optimized.wat @@ -1315,6 +1315,36 @@ i32.store offset=20 local.get $0 ) + (func $~lib/util/hash/hash32 (param $0 i32) (result i32) + local.get $0 + i32.const -1028477379 + i32.mul + i32.const 374761393 + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.tee $0 + local.get $0 + i32.const 15 + i32.shr_u + i32.xor + i32.const -2048144777 + i32.mul + local.tee $0 + local.get $0 + i32.const 13 + i32.shr_u + i32.xor + i32.const -1028477379 + i32.mul + local.tee $0 + local.get $0 + i32.const 16 + i32.shr_u + i32.xor + ) (func $~lib/set/Set#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.load @@ -1366,10 +1396,7 @@ i32.shl i32.const 24 i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash32 call $~lib/set/Set#find i32.const 0 i32.ne @@ -1389,60 +1416,58 @@ i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 + local.set $5 local.get $3 i32.const 3 i32.shl i32.const 3 i32.div_s - local.tee $6 + local.tee $7 i32.const 3 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $0 i32.load offset=8 - local.tee $8 + local.tee $4 local.get $0 i32.load offset=16 i32.const 3 i32.shl i32.add - local.set $5 + local.set $8 local.get $3 local.set $2 loop $while-continue|0 - local.get $5 + local.get $4 local.get $8 i32.ne if - local.get $8 + local.get $4 + local.tee $6 i32.load offset=4 i32.const 1 i32.and i32.eqz if local.get $2 - local.get $8 + local.get $6 i32.load8_s - local.tee $7 + local.tee $4 i32.store8 local.get $2 + local.get $5 local.get $4 + call $~lib/util/hash/hash32 local.get $1 - local.get $7 - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul i32.and i32.const 2 i32.shl i32.add - local.tee $7 + local.tee $4 i32.load i32.store offset=4 - local.get $7 + local.get $4 local.get $2 i32.store local.get $2 @@ -1450,24 +1475,24 @@ i32.add local.set $2 end - local.get $8 + local.get $6 i32.const 8 i32.add - local.set $8 + local.set $4 br $while-continue|0 end end - local.get $4 + local.get $5 local.tee $2 local.get $0 i32.load - local.tee $8 + local.tee $4 i32.ne if local.get $2 call $~lib/rt/pure/__retain local.set $2 - local.get $8 + local.get $4 call $~lib/rt/pure/__release end local.get $0 @@ -1493,13 +1518,13 @@ local.get $1 i32.store offset=8 local.get $0 - local.get $6 + local.get $7 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 - local.get $4 + local.get $5 call $~lib/rt/pure/__release local.get $3 call $~lib/rt/pure/__release @@ -1508,20 +1533,15 @@ (local $2 i32) (local $3 i32) (local $4 i32) + local.get $0 + local.get $1 local.get $1 i32.const 24 i32.shl i32.const 24 i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.tee $2 - local.set $3 - local.get $0 - local.get $1 - local.get $2 + call $~lib/util/hash/hash32 + local.tee $3 call $~lib/set/Set#find i32.eqz if @@ -2206,10 +2226,7 @@ i32.shl i32.const 24 i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash32 call $~lib/set/Set#find local.tee $1 i32.eqz @@ -2647,10 +2664,7 @@ local.get $1 i32.const 255 i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash32 call $~lib/set/Set#find i32.const 0 i32.ne @@ -2670,60 +2684,58 @@ i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $4 + local.set $5 local.get $3 i32.const 3 i32.shl i32.const 3 i32.div_s - local.tee $6 + local.tee $7 i32.const 3 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor local.set $3 local.get $0 i32.load offset=8 - local.tee $8 + local.tee $4 local.get $0 i32.load offset=16 i32.const 3 i32.shl i32.add - local.set $5 + local.set $8 local.get $3 local.set $2 loop $while-continue|0 - local.get $5 + local.get $4 local.get $8 i32.ne if - local.get $8 + local.get $4 + local.tee $6 i32.load offset=4 i32.const 1 i32.and i32.eqz if local.get $2 - local.get $8 + local.get $6 i32.load8_u - local.tee $7 + local.tee $4 i32.store8 local.get $2 + local.get $5 local.get $4 + call $~lib/util/hash/hash32 local.get $1 - local.get $7 - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul i32.and i32.const 2 i32.shl i32.add - local.tee $7 + local.tee $4 i32.load i32.store offset=4 - local.get $7 + local.get $4 local.get $2 i32.store local.get $2 @@ -2731,24 +2743,24 @@ i32.add local.set $2 end - local.get $8 + local.get $6 i32.const 8 i32.add - local.set $8 + local.set $4 br $while-continue|0 end end - local.get $4 + local.get $5 local.tee $2 local.get $0 i32.load - local.tee $8 + local.tee $4 i32.ne if local.get $2 call $~lib/rt/pure/__retain local.set $2 - local.get $8 + local.get $4 call $~lib/rt/pure/__release end local.get $0 @@ -2774,13 +2786,13 @@ local.get $1 i32.store offset=8 local.get $0 - local.get $6 + local.get $7 i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 - local.get $4 + local.get $5 call $~lib/rt/pure/__release local.get $3 call $~lib/rt/pure/__release @@ -2789,18 +2801,13 @@ (local $2 i32) (local $3 i32) (local $4 i32) + local.get $0 + local.get $1 local.get $1 i32.const 255 i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.tee $2 - local.set $3 - local.get $0 - local.get $1 - local.get $2 + call $~lib/util/hash/hash32 + local.tee $3 call $~lib/set/Set#find i32.eqz if @@ -3014,10 +3021,7 @@ local.get $1 i32.const 255 i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/hash32 call $~lib/set/Set#find local.tee $1 i32.eqz @@ -3408,21 +3412,6 @@ i32.store offset=20 local.get $0 ) - (func $~lib/util/hash/hash16 (param $0 i32) (result i32) - local.get $0 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $0 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - ) (func $~lib/set/Set#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.load @@ -3474,7 +3463,7 @@ i32.shl i32.const 16 i32.shr_s - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 call $~lib/set/Set#find i32.const 0 i32.ne @@ -3536,7 +3525,7 @@ local.get $2 local.get $5 local.get $4 - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 local.get $1 i32.and i32.const 2 @@ -3618,7 +3607,7 @@ i32.shl i32.const 16 i32.shr_s - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 local.tee $3 call $~lib/set/Set#find i32.eqz @@ -3891,7 +3880,7 @@ i32.shl i32.const 16 i32.shr_s - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 call $~lib/set/Set#find local.tee $1 i32.eqz @@ -4296,7 +4285,7 @@ local.get $1 i32.const 65535 i32.and - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 call $~lib/set/Set#find i32.const 0 i32.ne @@ -4358,7 +4347,7 @@ local.get $2 local.get $5 local.get $4 - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 local.get $1 i32.and i32.const 2 @@ -4438,7 +4427,7 @@ local.get $1 i32.const 65535 i32.and - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 local.tee $3 call $~lib/set/Set#find i32.eqz @@ -4659,7 +4648,7 @@ local.get $1 i32.const 65535 i32.and - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 call $~lib/set/Set#find local.tee $1 i32.eqz @@ -5050,37 +5039,6 @@ i32.store offset=20 local.get $0 ) - (func $~lib/util/hash/hash32 (param $0 i32) (result i32) - local.get $0 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $0 - i32.const 8 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.get $0 - i32.const 16 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.get $0 - i32.const 24 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - ) (func $~lib/set/Set#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.load @@ -6368,67 +6326,44 @@ (local $1 i32) local.get $0 i32.wrap_i64 - local.tee $1 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 8 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 16 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 + i32.const -1028477379 i32.mul - local.get $1 - i32.const 24 - i32.shr_u - i32.xor - i32.const 16777619 + i32.const 374761393 + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 i32.mul local.get $0 i64.const 32 i64.shr_u i32.wrap_i64 - local.tee $1 - i32.const 255 - i32.and - i32.xor - i32.const 16777619 + i32.const -1028477379 i32.mul + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.tee $1 local.get $1 - i32.const 8 + i32.const 15 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 + i32.const -2048144777 i32.mul + local.tee $1 local.get $1 - i32.const 16 + i32.const 13 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 + i32.const -1028477379 i32.mul + local.tee $1 local.get $1 - i32.const 24 + i32.const 16 i32.shr_u i32.xor - i32.const 16777619 - i32.mul ) (func $~lib/set/Set#find (param $0 i32) (param $1 i64) (param $2 i32) (result i32) local.get $0 diff --git a/tests/compiler/std/set.untouched.wat b/tests/compiler/std/set.untouched.wat index 271db743ff..7d72adcacb 100644 --- a/tests/compiler/std/set.untouched.wat +++ b/tests/compiler/std/set.untouched.wat @@ -1798,12 +1798,51 @@ i32.store offset=20 local.get $0 ) - (func $~lib/util/hash/hash8 (param $0 i32) (result i32) - i32.const -2128831035 + (func $~lib/util/hash/hash32 (param $0 i32) (result i32) + (local $1 i32) + i32.const 0 + i32.const 374761393 + i32.add + local.set $1 + local.get $1 local.get $0 + i32.const -1028477379 + i32.mul + i32.add + local.set $1 + local.get $1 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $1 + local.get $1 + local.get $1 + i32.const 15 + i32.shr_u i32.xor - i32.const 16777619 + local.set $1 + local.get $1 + i32.const -2048144777 i32.mul + local.set $1 + local.get $1 + local.get $1 + i32.const 13 + i32.shr_u + i32.xor + local.set $1 + local.get $1 + i32.const -1028477379 + i32.mul + local.set $1 + local.get $1 + local.get $1 + i32.const 16 + i32.shr_u + i32.xor + local.set $1 + local.get $1 ) (func $~lib/set/Set#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -1873,15 +1912,15 @@ i32.const 0 drop i32.const 1 - i32.const 1 - i32.eq + i32.const 4 + i32.le_u drop local.get $2 i32.const 24 i32.shl i32.const 24 i32.shr_s - call $~lib/util/hash/hash8 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.0 end call $~lib/set/Set#find @@ -1969,11 +2008,11 @@ i32.const 0 drop i32.const 1 - i32.const 1 - i32.eq + i32.const 4 + i32.le_u drop local.get $13 - call $~lib/util/hash/hash8 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.2 end local.get $1 @@ -2067,15 +2106,15 @@ i32.const 0 drop i32.const 1 - i32.const 1 - i32.eq + i32.const 4 + i32.le_u drop local.get $2 i32.const 24 i32.shl i32.const 24 i32.shr_s - call $~lib/util/hash/hash8 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.1 end local.set $3 @@ -3964,15 +4003,15 @@ i32.const 0 drop i32.const 1 - i32.const 1 - i32.eq + i32.const 4 + i32.le_u drop local.get $2 i32.const 24 i32.shl i32.const 24 i32.shr_s - call $~lib/util/hash/hash8 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.3 end call $~lib/set/Set#find @@ -4541,13 +4580,13 @@ i32.const 0 drop i32.const 1 - i32.const 1 - i32.eq + i32.const 4 + i32.le_u drop local.get $2 i32.const 255 i32.and - call $~lib/util/hash/hash8 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.0 end call $~lib/set/Set#find @@ -4635,11 +4674,11 @@ i32.const 0 drop i32.const 1 - i32.const 1 - i32.eq + i32.const 4 + i32.le_u drop local.get $13 - call $~lib/util/hash/hash8 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.2 end local.get $1 @@ -4733,13 +4772,13 @@ i32.const 0 drop i32.const 1 - i32.const 1 - i32.eq + i32.const 4 + i32.le_u drop local.get $2 i32.const 255 i32.and - call $~lib/util/hash/hash8 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.1 end local.set $3 @@ -5086,13 +5125,13 @@ i32.const 0 drop i32.const 1 - i32.const 1 - i32.eq + i32.const 4 + i32.le_u drop local.get $2 i32.const 255 i32.and - call $~lib/util/hash/hash8 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.3 end call $~lib/set/Set#find @@ -5587,28 +5626,6 @@ i32.store offset=20 local.get $0 ) - (func $~lib/util/hash/hash16 (param $0 i32) (result i32) - (local $1 i32) - i32.const -2128831035 - local.set $1 - local.get $1 - local.get $0 - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.set $1 - local.get $1 - local.get $0 - i32.const 8 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - local.set $1 - local.get $1 - ) (func $~lib/set/Set#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) @@ -5677,19 +5694,15 @@ i32.const 0 drop i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq + i32.const 4 + i32.le_u drop local.get $2 i32.const 16 i32.shl i32.const 16 i32.shr_s - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.0 end call $~lib/set/Set#find @@ -5777,15 +5790,11 @@ i32.const 0 drop i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq + i32.const 4 + i32.le_u drop local.get $13 - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.2 end local.get $1 @@ -5879,19 +5888,15 @@ i32.const 0 drop i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq + i32.const 4 + i32.le_u drop local.get $2 i32.const 16 i32.shl i32.const 16 i32.shr_s - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.1 end local.set $3 @@ -6238,19 +6243,15 @@ i32.const 0 drop i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq + i32.const 4 + i32.le_u drop local.get $2 i32.const 16 i32.shl i32.const 16 i32.shr_s - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.3 end call $~lib/set/Set#find @@ -6819,17 +6820,13 @@ i32.const 0 drop i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq + i32.const 4 + i32.le_u drop local.get $2 i32.const 65535 i32.and - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.0 end call $~lib/set/Set#find @@ -6917,15 +6914,11 @@ i32.const 0 drop i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq + i32.const 4 + i32.le_u drop local.get $13 - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.2 end local.get $1 @@ -7019,17 +7012,13 @@ i32.const 0 drop i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq + i32.const 4 + i32.le_u drop local.get $2 i32.const 65535 i32.and - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.1 end local.set $3 @@ -7376,17 +7365,13 @@ i32.const 0 drop i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq + i32.const 4 + i32.le_u drop local.get $2 i32.const 65535 i32.and - call $~lib/util/hash/hash16 + call $~lib/util/hash/hash32 br $~lib/util/hash/HASH|inlined.3 end call $~lib/set/Set#find @@ -7881,48 +7866,6 @@ i32.store offset=20 local.get $0 ) - (func $~lib/util/hash/hash32 (param $0 i32) (result i32) - (local $1 i32) - i32.const -2128831035 - local.set $1 - local.get $1 - local.get $0 - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.set $1 - local.get $1 - local.get $0 - i32.const 8 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.set $1 - local.get $1 - local.get $0 - i32.const 16 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.set $1 - local.get $1 - local.get $0 - i32.const 24 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - local.set $1 - local.get $1 - ) (func $~lib/set/Set#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) @@ -7987,16 +7930,8 @@ i32.const 0 drop i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 i32.const 4 - i32.eq + i32.le_u drop local.get $2 call $~lib/util/hash/hash32 @@ -8087,16 +8022,8 @@ i32.const 0 drop i32.const 4 - i32.const 1 - i32.eq - drop i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq + i32.le_u drop local.get $13 call $~lib/util/hash/hash32 @@ -8193,16 +8120,8 @@ i32.const 0 drop i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop i32.const 4 - i32.const 4 - i32.eq + i32.le_u drop local.get $2 call $~lib/util/hash/hash32 @@ -8552,16 +8471,8 @@ i32.const 0 drop i32.const 4 - i32.const 1 - i32.eq - drop i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq + i32.le_u drop local.get $2 call $~lib/util/hash/hash32 @@ -9111,16 +9022,8 @@ i32.const 0 drop i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop i32.const 4 - i32.const 4 - i32.eq + i32.le_u drop local.get $2 call $~lib/util/hash/hash32 @@ -9211,16 +9114,8 @@ i32.const 0 drop i32.const 4 - i32.const 1 - i32.eq - drop i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq + i32.le_u drop local.get $13 call $~lib/util/hash/hash32 @@ -9317,16 +9212,8 @@ i32.const 0 drop i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 i32.const 4 - i32.eq + i32.le_u drop local.get $2 call $~lib/util/hash/hash32 @@ -9676,16 +9563,8 @@ i32.const 0 drop i32.const 4 - i32.const 1 - i32.eq - drop i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq + i32.le_u drop local.get $2 call $~lib/util/hash/hash32 @@ -10173,91 +10052,65 @@ ) (func $~lib/util/hash/hash64 (param $0 i64) (result i32) (local $1 i32) - (local $2 i32) - (local $3 i32) + i32.const 0 + i32.const 374761393 + i32.add + local.set $1 + local.get $1 local.get $0 i32.wrap_i64 + i32.const -1028477379 + i32.mul + i32.add + local.set $1 + local.get $1 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul local.set $1 + local.get $1 local.get $0 i64.const 32 i64.shr_u i32.wrap_i64 - local.set $2 - i32.const -2128831035 - local.set $3 - local.get $3 - local.get $1 - i32.const 255 - i32.and - i32.xor - i32.const 16777619 + i32.const -1028477379 i32.mul - local.set $3 - local.get $3 + i32.add + local.set $1 local.get $1 - i32.const 8 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 + i32.const 17 + i32.rotl + i32.const 668265263 i32.mul - local.set $3 - local.get $3 + local.set $1 local.get $1 - i32.const 16 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.set $3 - local.get $3 local.get $1 - i32.const 24 + i32.const 15 i32.shr_u i32.xor - i32.const 16777619 - i32.mul - local.set $3 - local.get $3 - local.get $2 - i32.const 255 - i32.and - i32.xor - i32.const 16777619 + local.set $1 + local.get $1 + i32.const -2048144777 i32.mul - local.set $3 - local.get $3 - local.get $2 - i32.const 8 + local.set $1 + local.get $1 + local.get $1 + i32.const 13 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 + local.set $1 + local.get $1 + i32.const -1028477379 i32.mul - local.set $3 - local.get $3 - local.get $2 + local.set $1 + local.get $1 + local.get $1 i32.const 16 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 - i32.mul - local.set $3 - local.get $3 - local.get $2 - i32.const 24 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - local.set $3 - local.get $3 + local.set $1 + local.get $1 ) (func $~lib/set/Set#find (param $0 i32) (param $1 i64) (param $2 i32) (result i32) (local $3 i32) @@ -10323,16 +10176,8 @@ i32.const 0 drop i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 i32.const 4 - i32.eq + i32.le_u drop i32.const 8 i32.const 8 @@ -10428,16 +10273,8 @@ i32.const 0 drop i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 i32.const 4 - i32.eq + i32.le_u drop i32.const 8 i32.const 8 @@ -10539,16 +10376,8 @@ i32.const 0 drop i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 i32.const 4 - i32.eq + i32.le_u drop i32.const 8 i32.const 8 @@ -10903,16 +10732,8 @@ i32.const 0 drop i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 i32.const 4 - i32.eq + i32.le_u drop i32.const 8 i32.const 8 @@ -11467,16 +11288,8 @@ i32.const 0 drop i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 i32.const 4 - i32.eq + i32.le_u drop i32.const 8 i32.const 8 @@ -11572,16 +11385,8 @@ i32.const 0 drop i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 i32.const 4 - i32.eq + i32.le_u drop i32.const 8 i32.const 8 @@ -11683,16 +11488,8 @@ i32.const 0 drop i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 i32.const 4 - i32.eq + i32.le_u drop i32.const 8 i32.const 8 @@ -12047,16 +11844,8 @@ i32.const 0 drop i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 i32.const 4 - i32.eq + i32.le_u drop i32.const 8 i32.const 8 diff --git a/tests/compiler/std/symbol.optimized.wat b/tests/compiler/std/symbol.optimized.wat index 7b2fd6d543..9331d15600 100644 --- a/tests/compiler/std/symbol.optimized.wat +++ b/tests/compiler/std/symbol.optimized.wat @@ -347,42 +347,194 @@ (local $1 i32) (local $2 i32) (local $3 i32) - i32.const -2128831035 - local.set $1 + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) local.get $0 + i32.eqz if - local.get $0 - i32.const 20 + i32.const 0 + return + end + local.get $0 + i32.const 20 + i32.sub + i32.load offset=16 + i32.const 1 + i32.shr_u + i32.const 1 + i32.shl + local.tee $3 + i32.const 16 + i32.ge_s + if (result i32) + i32.const 606290984 + local.set $1 + i32.const -2048144777 + local.set $6 + i32.const 1640531535 + local.set $7 + local.get $3 + i32.const 16 i32.sub - i32.load offset=16 - i32.const 1 - i32.shr_u - i32.const 1 - i32.shl local.set $3 - loop $for-loop|0 - local.get $2 + loop $while-continue|0 local.get $3 - i32.lt_u + local.get $5 + i32.ge_s if local.get $1 local.get $0 - local.get $2 + local.get $5 i32.add - i32.load8_u - i32.xor - i32.const 16777619 + local.tee $8 + i32.load + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 i32.mul local.set $1 - local.get $2 - i32.const 1 + local.get $6 + local.get $8 + i32.load offset=4 + i32.const -2048144777 + i32.mul i32.add - local.set $2 - br $for-loop|0 + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $6 + local.get $4 + local.get $8 + i32.load offset=8 + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $4 + local.get $7 + local.get $8 + i32.load offset=12 + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $7 + local.get $5 + i32.const 16 + i32.add + local.set $5 + br $while-continue|0 end end + local.get $3 + local.get $5 + i32.sub + local.set $3 + local.get $1 + i32.const 1 + i32.rotl + local.get $6 + i32.const 7 + i32.rotl + i32.add + local.get $4 + i32.const 12 + i32.rotl + i32.add + local.get $7 + i32.const 18 + i32.rotl + i32.add + else + i32.const 374761393 + end + local.set $1 + local.get $3 + i32.const 4 + i32.sub + local.set $4 + loop $while-continue|1 + local.get $2 + local.get $4 + i32.le_s + if + local.get $1 + local.get $0 + local.get $2 + i32.add + i32.load + i32.const -1028477379 + i32.mul + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $1 + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $while-continue|1 + end + end + loop $while-continue|2 + local.get $2 + local.get $4 + i32.lt_s + if + local.get $1 + local.get $0 + local.get $2 + i32.add + i32.load8_u + i32.const 374761393 + i32.mul + i32.add + i32.const 11 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $1 + local.get $2 + i32.const 1 + i32.add + local.set $2 + br $while-continue|2 + end end local.get $1 + local.get $1 + i32.const 15 + i32.shr_u + i32.xor + i32.const -2048144777 + i32.mul + local.tee $0 + local.get $0 + i32.const 13 + i32.shr_u + i32.xor + i32.const -1028477379 + i32.mul + local.tee $0 + local.get $0 + i32.const 16 + i32.shr_u + i32.xor ) (func $~lib/string/String.__eq (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -654,34 +806,33 @@ ) (func $~lib/util/hash/hash32 (param $0 i32) (result i32) local.get $0 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 + i32.const -1028477379 + i32.mul + i32.const 374761393 + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 i32.mul + local.tee $0 local.get $0 - i32.const 8 + i32.const 15 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 + i32.const -2048144777 i32.mul + local.tee $0 local.get $0 - i32.const 16 + i32.const 13 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 + i32.const -1028477379 i32.mul + local.tee $0 local.get $0 - i32.const 24 + i32.const 16 i32.shr_u i32.xor - i32.const 16777619 - i32.mul ) (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 diff --git a/tests/compiler/std/symbol.untouched.wat b/tests/compiler/std/symbol.untouched.wat index 8e803a5f0f..db74b9a631 100644 --- a/tests/compiler/std/symbol.untouched.wat +++ b/tests/compiler/std/symbol.untouched.wat @@ -559,51 +559,279 @@ (local $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) local.get $0 call $~lib/rt/stub/__retain local.set $0 - i32.const -2128831035 - local.set $1 local.get $0 i32.const 0 - i32.ne + i32.eq if i32.const 0 - local.set $2 + local.set $1 local.get $0 - call $~lib/string/String#get:length - i32.const 1 - i32.shl + call $~lib/rt/stub/__release + local.get $1 + return + end + i32.const 0 + local.set $2 + local.get $0 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.set $3 + local.get $3 + i32.const 16 + i32.ge_s + if + i32.const 0 + i32.const -1640531535 + i32.add + i32.const -2048144777 + i32.add + local.set $1 + i32.const 0 + i32.const -2048144777 + i32.add + local.set $4 + i32.const 0 + local.set $5 + i32.const 0 + i32.const -1640531535 + i32.sub + local.set $6 + i32.const 0 + local.set $7 + local.get $3 + i32.const 16 + i32.sub local.set $3 - loop $for-loop|0 - local.get $2 + loop $while-continue|0 + local.get $7 local.get $3 - i32.lt_u - local.set $4 - local.get $4 + i32.le_s + local.set $8 + local.get $8 if local.get $1 + local.set $10 local.get $0 - local.get $2 + local.get $7 i32.add - i32.load8_u - i32.xor - i32.const 16777619 + i32.load + local.set $9 + local.get $10 + local.get $9 + i32.const -2048144777 + i32.mul + i32.add + local.set $10 + local.get $10 + i32.const 13 + i32.rotl + local.set $10 + local.get $10 + i32.const -1640531535 i32.mul local.set $1 - local.get $2 - i32.const 1 + local.get $4 + local.set $10 + local.get $0 + local.get $7 i32.add - local.set $2 - br $for-loop|0 + i32.load offset=4 + local.set $9 + local.get $10 + local.get $9 + i32.const -2048144777 + i32.mul + i32.add + local.set $10 + local.get $10 + i32.const 13 + i32.rotl + local.set $10 + local.get $10 + i32.const -1640531535 + i32.mul + local.set $4 + local.get $5 + local.set $10 + local.get $0 + local.get $7 + i32.add + i32.load offset=8 + local.set $9 + local.get $10 + local.get $9 + i32.const -2048144777 + i32.mul + i32.add + local.set $10 + local.get $10 + i32.const 13 + i32.rotl + local.set $10 + local.get $10 + i32.const -1640531535 + i32.mul + local.set $5 + local.get $6 + local.set $10 + local.get $0 + local.get $7 + i32.add + i32.load offset=12 + local.set $9 + local.get $10 + local.get $9 + i32.const -2048144777 + i32.mul + i32.add + local.set $10 + local.get $10 + i32.const 13 + i32.rotl + local.set $10 + local.get $10 + i32.const -1640531535 + i32.mul + local.set $6 + local.get $7 + i32.const 16 + i32.add + local.set $7 + br $while-continue|0 end end + local.get $1 + i32.const 1 + i32.rotl + local.get $4 + i32.const 7 + i32.rotl + i32.add + local.get $5 + i32.const 12 + i32.rotl + i32.add + local.get $6 + i32.const 18 + i32.rotl + i32.add + local.set $2 + local.get $3 + local.get $7 + i32.sub + local.set $3 + else + i32.const 0 + i32.const 374761393 + i32.add + local.set $2 end - local.get $1 + i32.const 0 + local.set $11 + local.get $3 + i32.const 4 + i32.sub local.set $3 + loop $while-continue|1 + local.get $11 + local.get $3 + i32.le_s + local.set $7 + local.get $7 + if + local.get $2 + local.get $0 + local.get $11 + i32.add + i32.load + i32.const -1028477379 + i32.mul + i32.add + local.set $2 + local.get $2 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $2 + local.get $11 + i32.const 4 + i32.add + local.set $11 + br $while-continue|1 + end + end + loop $while-continue|2 + local.get $11 + local.get $3 + i32.lt_s + local.set $7 + local.get $7 + if + local.get $2 + local.get $0 + local.get $11 + i32.add + i32.load8_u + i32.const 374761393 + i32.mul + i32.add + local.set $2 + local.get $2 + i32.const 11 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $2 + local.get $11 + i32.const 1 + i32.add + local.set $11 + br $while-continue|2 + end + end + local.get $2 + local.get $2 + i32.const 15 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + i32.const -2048144777 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 13 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + i32.const -1028477379 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 16 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + local.set $7 local.get $0 call $~lib/rt/stub/__release - local.get $3 + local.get $7 ) (func $~lib/util/string/compareImpl (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) (local $5 i32) @@ -1231,43 +1459,47 @@ ) (func $~lib/util/hash/hash32 (param $0 i32) (result i32) (local $1 i32) - i32.const -2128831035 + i32.const 0 + i32.const 374761393 + i32.add local.set $1 local.get $1 local.get $0 - i32.const 255 - i32.and - i32.xor - i32.const 16777619 + i32.const -1028477379 i32.mul + i32.add local.set $1 local.get $1 - local.get $0 - i32.const 8 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $1 + local.get $1 + local.get $1 + i32.const 15 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 + local.set $1 + local.get $1 + i32.const -2048144777 i32.mul local.set $1 local.get $1 - local.get $0 - i32.const 16 + local.get $1 + i32.const 13 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 + local.set $1 + local.get $1 + i32.const -1028477379 i32.mul local.set $1 local.get $1 - local.get $0 - i32.const 24 + local.get $1 + i32.const 16 i32.shr_u i32.xor - i32.const 16777619 - i32.mul local.set $1 local.get $1 ) @@ -1406,16 +1638,8 @@ i32.const 0 drop i32.const 4 - i32.const 1 - i32.eq - drop i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq + i32.le_u drop local.get $13 call $~lib/util/hash/hash32 @@ -1516,16 +1740,8 @@ i32.const 0 drop i32.const 4 - i32.const 1 - i32.eq - drop i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq + i32.le_u drop local.get $3 call $~lib/util/hash/hash32 @@ -1722,16 +1938,8 @@ i32.const 0 drop i32.const 4 - i32.const 1 - i32.eq - drop i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq + i32.le_u drop local.get $2 call $~lib/util/hash/hash32 @@ -1756,16 +1964,8 @@ i32.const 0 drop i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 i32.const 4 - i32.eq + i32.le_u drop local.get $2 call $~lib/util/hash/hash32 From bc8b45064d247fd018aa1fccf4b8108240802e77 Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Mon, 14 Dec 2020 18:39:45 +0200 Subject: [PATCH 02/14] simplify. Add more tests --- std/assembly/util/hash.ts | 5 +- tests/compiler/std/hash.optimized.wat | 90 ++++++++++++--------- tests/compiler/std/hash.ts | 6 ++ tests/compiler/std/hash.untouched.wat | 103 ++++++++++++++++++++++-- tests/compiler/std/symbol.optimized.wat | 72 ++++++++--------- tests/compiler/std/symbol.untouched.wat | 7 +- 6 files changed, 197 insertions(+), 86 deletions(-) diff --git a/std/assembly/util/hash.ts b/std/assembly/util/hash.ts index f901ffbf5b..71b57fb41e 100644 --- a/std/assembly/util/hash.ts +++ b/std/assembly/util/hash.ts @@ -71,7 +71,7 @@ function hashStr(key: string): u32 { return XXH32_SEED; } - var h: u32 = 0; + var h: u32 = XXH32_SEED + XXH32_P5; var len = key.length << 1; if (len >= 16) { @@ -92,9 +92,6 @@ function hashStr(key: string): u32 { } h = rotl(s1, 1) + rotl(s2, 7) + rotl(s3, 12) + rotl(s4, 18); len -= i; - - } else { - h = XXH32_SEED + XXH32_P5; } var i = 0; diff --git a/tests/compiler/std/hash.optimized.wat b/tests/compiler/std/hash.optimized.wat index 7346a10a49..ecd0d10924 100644 --- a/tests/compiler/std/hash.optimized.wat +++ b/tests/compiler/std/hash.optimized.wat @@ -6,6 +6,12 @@ (data (i32.const 1068) "\02\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00a") (data (i32.const 1100) "\04\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\04\00\00\00a\00b") (data (i32.const 1132) "\06\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\06\00\00\00a\00b\00c") + (data (i32.const 1164) "\08\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\08\00\00\00a\00b\00c\00d") + (data (i32.const 1196) "\n\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00a\00b\00c\00d\00e") + (data (i32.const 1228) "\0c\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\0c\00\00\00a\00b\00c\00d\00e\00f") + (data (i32.const 1260) "\0e\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\0e\00\00\00a\00b\00c\00d\00e\00f\00g") + (data (i32.const 1308) "\10\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\10\00\00\00a\00b\00c\00d\00e\00f\00g\00h") + (data (i32.const 1356) "\12\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\12\00\00\00a\00b\00c\00d\00e\00f\00g\00h\00i") (export "memory" (memory $0)) (start $~start) (func $~lib/util/hash/hashStr (param $0 i32) @@ -30,30 +36,30 @@ i32.shr_u i32.const 1 i32.shl - local.tee $3 + local.tee $2 i32.const 16 i32.ge_s if (result i32) i32.const 606290984 local.set $1 i32.const -2048144777 - local.set $6 + local.set $5 i32.const 1640531535 - local.set $7 - local.get $3 + local.set $6 + local.get $2 i32.const 16 i32.sub - local.set $3 + local.set $7 loop $while-continue|0 local.get $3 - local.get $5 - i32.ge_s + local.get $7 + i32.le_s if local.get $1 local.get $0 - local.get $5 + local.get $3 i32.add - local.tee $8 + local.tee $2 i32.load i32.const -2048144777 i32.mul @@ -63,8 +69,8 @@ i32.const -1640531535 i32.mul local.set $1 - local.get $6 - local.get $8 + local.get $5 + local.get $2 i32.load offset=4 i32.const -2048144777 i32.mul @@ -73,9 +79,9 @@ i32.rotl i32.const -1640531535 i32.mul - local.set $6 - local.get $4 + local.set $5 local.get $8 + local.get $2 i32.load offset=8 i32.const -2048144777 i32.mul @@ -84,9 +90,9 @@ i32.rotl i32.const -1640531535 i32.mul - local.set $4 - local.get $7 - local.get $8 + local.set $8 + local.get $6 + local.get $2 i32.load offset=12 i32.const -2048144777 i32.mul @@ -95,30 +101,30 @@ i32.rotl i32.const -1640531535 i32.mul - local.set $7 - local.get $5 + local.set $6 + local.get $3 i32.const 16 i32.add - local.set $5 + local.set $3 br $while-continue|0 end end + local.get $7 local.get $3 - local.get $5 i32.sub - local.set $3 + local.set $2 local.get $1 i32.const 1 i32.rotl - local.get $6 + local.get $5 i32.const 7 i32.rotl i32.add - local.get $4 + local.get $8 i32.const 12 i32.rotl i32.add - local.get $7 + local.get $6 i32.const 18 i32.rotl i32.add @@ -126,18 +132,18 @@ i32.const 374761393 end local.set $1 - local.get $3 + local.get $2 i32.const 4 i32.sub - local.set $4 + local.set $3 loop $while-continue|1 - local.get $2 + local.get $3 local.get $4 - i32.le_s + i32.ge_s if local.get $1 local.get $0 - local.get $2 + local.get $4 i32.add i32.load i32.const -1028477379 @@ -148,21 +154,21 @@ i32.const 668265263 i32.mul local.set $1 - local.get $2 + local.get $4 i32.const 4 i32.add - local.set $2 + local.set $4 br $while-continue|1 end end loop $while-continue|2 - local.get $2 + local.get $3 local.get $4 - i32.lt_s + i32.gt_s if local.get $1 local.get $0 - local.get $2 + local.get $4 i32.add i32.load8_u i32.const 374761393 @@ -173,10 +179,10 @@ i32.const -1640531535 i32.mul local.set $1 - local.get $2 + local.get $4 i32.const 1 i32.add - local.set $2 + local.set $4 br $while-continue|2 end end @@ -194,5 +200,17 @@ call $~lib/util/hash/hashStr i32.const 1152 call $~lib/util/hash/hashStr + i32.const 1184 + call $~lib/util/hash/hashStr + i32.const 1216 + call $~lib/util/hash/hashStr + i32.const 1248 + call $~lib/util/hash/hashStr + i32.const 1280 + call $~lib/util/hash/hashStr + i32.const 1328 + call $~lib/util/hash/hashStr + i32.const 1376 + call $~lib/util/hash/hashStr ) ) diff --git a/tests/compiler/std/hash.ts b/tests/compiler/std/hash.ts index b46889ba88..155caebe09 100644 --- a/tests/compiler/std/hash.ts +++ b/tests/compiler/std/hash.ts @@ -9,6 +9,12 @@ check(HASH("")); check(HASH("a")); check(HASH("ab")); check(HASH("abc")); +check(HASH("abcd")); +check(HASH("abcde")); +check(HASH("abcdef")); +check(HASH("abcdefg")); +check(HASH("abcdefgh")); +check(HASH("abcdefghi")); check(HASH(0.0)); check(HASH(1.0)); diff --git a/tests/compiler/std/hash.untouched.wat b/tests/compiler/std/hash.untouched.wat index 5dabda9e28..9dfcbd278f 100644 --- a/tests/compiler/std/hash.untouched.wat +++ b/tests/compiler/std/hash.untouched.wat @@ -8,6 +8,12 @@ (data (i32.const 44) "\02\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00a\00") (data (i32.const 76) "\04\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\04\00\00\00a\00b\00") (data (i32.const 108) "\06\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\06\00\00\00a\00b\00c\00") + (data (i32.const 140) "\08\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\08\00\00\00a\00b\00c\00d\00") + (data (i32.const 172) "\n\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00a\00b\00c\00d\00e\00") + (data (i32.const 204) "\0c\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\0c\00\00\00a\00b\00c\00d\00e\00f\00") + (data (i32.const 236) "\0e\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\0e\00\00\00a\00b\00c\00d\00e\00f\00g\00") + (data (i32.const 284) "\10\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\10\00\00\00a\00b\00c\00d\00e\00f\00g\00h\00") + (data (i32.const 332) "\12\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\12\00\00\00a\00b\00c\00d\00e\00f\00g\00h\00i\00") (table $0 1 funcref) (export "memory" (memory $0)) (start $~start) @@ -52,6 +58,8 @@ return end i32.const 0 + i32.const 374761393 + i32.add local.set $2 local.get $0 call $~lib/string/String#get:length @@ -202,11 +210,6 @@ local.get $7 i32.sub local.set $3 - else - i32.const 0 - i32.const 374761393 - i32.add - local.set $2 end i32.const 0 local.set $11 @@ -496,6 +499,96 @@ end call $std/hash/check drop + block $~lib/util/hash/HASH<~lib/string/String>|inlined.4 (result i32) + i32.const 160 + local.set $1 + i32.const 1 + drop + local.get $1 + call $~lib/util/hash/hashStr + local.set $0 + local.get $1 + call $~lib/rt/stub/__release + local.get $0 + br $~lib/util/hash/HASH<~lib/string/String>|inlined.4 + end + call $std/hash/check + drop + block $~lib/util/hash/HASH<~lib/string/String>|inlined.5 (result i32) + i32.const 192 + local.set $0 + i32.const 1 + drop + local.get $0 + call $~lib/util/hash/hashStr + local.set $1 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + br $~lib/util/hash/HASH<~lib/string/String>|inlined.5 + end + call $std/hash/check + drop + block $~lib/util/hash/HASH<~lib/string/String>|inlined.6 (result i32) + i32.const 224 + local.set $1 + i32.const 1 + drop + local.get $1 + call $~lib/util/hash/hashStr + local.set $0 + local.get $1 + call $~lib/rt/stub/__release + local.get $0 + br $~lib/util/hash/HASH<~lib/string/String>|inlined.6 + end + call $std/hash/check + drop + block $~lib/util/hash/HASH<~lib/string/String>|inlined.7 (result i32) + i32.const 256 + local.set $0 + i32.const 1 + drop + local.get $0 + call $~lib/util/hash/hashStr + local.set $1 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + br $~lib/util/hash/HASH<~lib/string/String>|inlined.7 + end + call $std/hash/check + drop + block $~lib/util/hash/HASH<~lib/string/String>|inlined.8 (result i32) + i32.const 304 + local.set $1 + i32.const 1 + drop + local.get $1 + call $~lib/util/hash/hashStr + local.set $0 + local.get $1 + call $~lib/rt/stub/__release + local.get $0 + br $~lib/util/hash/HASH<~lib/string/String>|inlined.8 + end + call $std/hash/check + drop + block $~lib/util/hash/HASH<~lib/string/String>|inlined.9 (result i32) + i32.const 352 + local.set $0 + i32.const 1 + drop + local.get $0 + call $~lib/util/hash/hashStr + local.set $1 + local.get $0 + call $~lib/rt/stub/__release + local.get $1 + br $~lib/util/hash/HASH<~lib/string/String>|inlined.9 + end + call $std/hash/check + drop block $~lib/util/hash/HASH|inlined.0 (result i32) f32.const 0 local.set $2 diff --git a/tests/compiler/std/symbol.optimized.wat b/tests/compiler/std/symbol.optimized.wat index 9331d15600..1cf179cebe 100644 --- a/tests/compiler/std/symbol.optimized.wat +++ b/tests/compiler/std/symbol.optimized.wat @@ -366,30 +366,30 @@ i32.shr_u i32.const 1 i32.shl - local.tee $3 + local.tee $2 i32.const 16 i32.ge_s if (result i32) i32.const 606290984 local.set $1 i32.const -2048144777 - local.set $6 + local.set $5 i32.const 1640531535 - local.set $7 - local.get $3 + local.set $6 + local.get $2 i32.const 16 i32.sub - local.set $3 + local.set $7 loop $while-continue|0 local.get $3 - local.get $5 - i32.ge_s + local.get $7 + i32.le_s if local.get $1 local.get $0 - local.get $5 + local.get $3 i32.add - local.tee $8 + local.tee $2 i32.load i32.const -2048144777 i32.mul @@ -399,8 +399,8 @@ i32.const -1640531535 i32.mul local.set $1 - local.get $6 - local.get $8 + local.get $5 + local.get $2 i32.load offset=4 i32.const -2048144777 i32.mul @@ -409,9 +409,9 @@ i32.rotl i32.const -1640531535 i32.mul - local.set $6 - local.get $4 + local.set $5 local.get $8 + local.get $2 i32.load offset=8 i32.const -2048144777 i32.mul @@ -420,9 +420,9 @@ i32.rotl i32.const -1640531535 i32.mul - local.set $4 - local.get $7 - local.get $8 + local.set $8 + local.get $6 + local.get $2 i32.load offset=12 i32.const -2048144777 i32.mul @@ -431,30 +431,30 @@ i32.rotl i32.const -1640531535 i32.mul - local.set $7 - local.get $5 + local.set $6 + local.get $3 i32.const 16 i32.add - local.set $5 + local.set $3 br $while-continue|0 end end + local.get $7 local.get $3 - local.get $5 i32.sub - local.set $3 + local.set $2 local.get $1 i32.const 1 i32.rotl - local.get $6 + local.get $5 i32.const 7 i32.rotl i32.add - local.get $4 + local.get $8 i32.const 12 i32.rotl i32.add - local.get $7 + local.get $6 i32.const 18 i32.rotl i32.add @@ -462,18 +462,18 @@ i32.const 374761393 end local.set $1 - local.get $3 + local.get $2 i32.const 4 i32.sub - local.set $4 + local.set $3 loop $while-continue|1 - local.get $2 + local.get $3 local.get $4 - i32.le_s + i32.ge_s if local.get $1 local.get $0 - local.get $2 + local.get $4 i32.add i32.load i32.const -1028477379 @@ -484,21 +484,21 @@ i32.const 668265263 i32.mul local.set $1 - local.get $2 + local.get $4 i32.const 4 i32.add - local.set $2 + local.set $4 br $while-continue|1 end end loop $while-continue|2 - local.get $2 + local.get $3 local.get $4 - i32.lt_s + i32.gt_s if local.get $1 local.get $0 - local.get $2 + local.get $4 i32.add i32.load8_u i32.const 374761393 @@ -509,10 +509,10 @@ i32.const -1640531535 i32.mul local.set $1 - local.get $2 + local.get $4 i32.const 1 i32.add - local.set $2 + local.set $4 br $while-continue|2 end end diff --git a/tests/compiler/std/symbol.untouched.wat b/tests/compiler/std/symbol.untouched.wat index db74b9a631..9785e9d873 100644 --- a/tests/compiler/std/symbol.untouched.wat +++ b/tests/compiler/std/symbol.untouched.wat @@ -581,6 +581,8 @@ return end i32.const 0 + i32.const 374761393 + i32.add local.set $2 local.get $0 call $~lib/string/String#get:length @@ -731,11 +733,6 @@ local.get $7 i32.sub local.set $3 - else - i32.const 0 - i32.const 374761393 - i32.add - local.set $2 end i32.const 0 local.set $11 From 51765ca6faa32dff989f436e26091a2ccd725d35 Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Mon, 14 Dec 2020 19:00:45 +0200 Subject: [PATCH 03/14] refactor --- std/assembly/util/hash.ts | 14 ++++++-------- tests/compiler/std/hash.untouched.wat | 16 ---------------- tests/compiler/std/symbol.untouched.wat | 16 ---------------- 3 files changed, 6 insertions(+), 40 deletions(-) diff --git a/std/assembly/util/hash.ts b/std/assembly/util/hash.ts index 71b57fb41e..f2b7c70704 100644 --- a/std/assembly/util/hash.ts +++ b/std/assembly/util/hash.ts @@ -60,10 +60,8 @@ function hash64(key: u64): u32 { // @ts-ignore: decorator @inline -function xxhMix(h: u32, c: u32): u32 { - h += c * XXH32_P2; - h = rotl(h, 13); - return h * XXH32_P1; +function mix(h: u32, key: u32): u32 { + return rotl(h + key * XXH32_P2, 13) * XXH32_P1; } function hashStr(key: string): u32 { @@ -84,10 +82,10 @@ function hashStr(key: string): u32 { len -= 16; while (i <= len) { - s1 = xxhMix(s1, load(changetype(key) + i)); - s2 = xxhMix(s2, load(changetype(key) + i, 4)); - s3 = xxhMix(s3, load(changetype(key) + i, 8)); - s4 = xxhMix(s4, load(changetype(key) + i, 12)); + s1 = mix(s1, load(changetype(key) + i)); + s2 = mix(s2, load(changetype(key) + i, 4)); + s3 = mix(s3, load(changetype(key) + i, 8)); + s4 = mix(s4, load(changetype(key) + i, 12)); i += 16; } h = rotl(s1, 1) + rotl(s2, 7) + rotl(s3, 12) + rotl(s4, 18); diff --git a/tests/compiler/std/hash.untouched.wat b/tests/compiler/std/hash.untouched.wat index 9dfcbd278f..bc6280099d 100644 --- a/tests/compiler/std/hash.untouched.wat +++ b/tests/compiler/std/hash.untouched.wat @@ -111,12 +111,8 @@ i32.const -2048144777 i32.mul i32.add - local.set $10 - local.get $10 i32.const 13 i32.rotl - local.set $10 - local.get $10 i32.const -1640531535 i32.mul local.set $1 @@ -132,12 +128,8 @@ i32.const -2048144777 i32.mul i32.add - local.set $10 - local.get $10 i32.const 13 i32.rotl - local.set $10 - local.get $10 i32.const -1640531535 i32.mul local.set $4 @@ -153,12 +145,8 @@ i32.const -2048144777 i32.mul i32.add - local.set $10 - local.get $10 i32.const 13 i32.rotl - local.set $10 - local.get $10 i32.const -1640531535 i32.mul local.set $5 @@ -174,12 +162,8 @@ i32.const -2048144777 i32.mul i32.add - local.set $10 - local.get $10 i32.const 13 i32.rotl - local.set $10 - local.get $10 i32.const -1640531535 i32.mul local.set $6 diff --git a/tests/compiler/std/symbol.untouched.wat b/tests/compiler/std/symbol.untouched.wat index 9785e9d873..620afb0b4d 100644 --- a/tests/compiler/std/symbol.untouched.wat +++ b/tests/compiler/std/symbol.untouched.wat @@ -634,12 +634,8 @@ i32.const -2048144777 i32.mul i32.add - local.set $10 - local.get $10 i32.const 13 i32.rotl - local.set $10 - local.get $10 i32.const -1640531535 i32.mul local.set $1 @@ -655,12 +651,8 @@ i32.const -2048144777 i32.mul i32.add - local.set $10 - local.get $10 i32.const 13 i32.rotl - local.set $10 - local.get $10 i32.const -1640531535 i32.mul local.set $4 @@ -676,12 +668,8 @@ i32.const -2048144777 i32.mul i32.add - local.set $10 - local.get $10 i32.const 13 i32.rotl - local.set $10 - local.get $10 i32.const -1640531535 i32.mul local.set $5 @@ -697,12 +685,8 @@ i32.const -2048144777 i32.mul i32.add - local.set $10 - local.get $10 i32.const 13 i32.rotl - local.set $10 - local.get $10 i32.const -1640531535 i32.mul local.set $6 From 2faee48d1c13ebca8e6cecddea67b0420f0e9479 Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Tue, 15 Dec 2020 00:27:23 +0200 Subject: [PATCH 04/14] refactor. Also take into account size of input --- std/assembly/util/hash.ts | 23 +- tests/compiler/std/hash.optimized.wat | 309 ++- tests/compiler/std/hash.untouched.wat | 1270 +++++---- tests/compiler/std/map.optimized.wat | 402 ++- tests/compiler/std/map.untouched.wat | 3399 ++++++++++------------- tests/compiler/std/set.optimized.wat | 330 ++- tests/compiler/std/set.untouched.wat | 2151 +++++++------- tests/compiler/std/symbol.optimized.wat | 340 +-- tests/compiler/std/symbol.untouched.wat | 740 +++-- 9 files changed, 4249 insertions(+), 4715 deletions(-) diff --git a/std/assembly/util/hash.ts b/std/assembly/util/hash.ts index f2b7c70704..58e390a347 100644 --- a/std/assembly/util/hash.ts +++ b/std/assembly/util/hash.ts @@ -1,5 +1,3 @@ -// @ts-ignore: decorator -@inline export function HASH(key: T): u32 { if (isString()) { return hashStr(changetype(key)); @@ -10,7 +8,7 @@ export function HASH(key: T): u32 { if (sizeof() == 4) return hash32(reinterpret(f32(key))); if (sizeof() == 8) return hash64(reinterpret(f64(key))); } else { - if (sizeof() <= 4) return hash32(u32(key)); + if (sizeof() <= 4) return hash32(u32(key), sizeof()); if (sizeof() == 8) return hash64(u64(key)); } return unreachable(); @@ -32,8 +30,10 @@ export function HASH(key: T): u32 { // @ts-ignore: decorator @inline const XXH32_SEED: u32 = 0; -function hash32(key: u32): u32 { - var h: u32 = XXH32_SEED + XXH32_P5; +// @ts-ignore: decorator +@inline +function hash32(key: u32, len: u32 = 4): u32 { + var h: u32 = XXH32_SEED + XXH32_P5 + len; h += key * XXH32_P3; h = rotl(h, 17) * XXH32_P4; h ^= h >> 15; @@ -44,8 +44,10 @@ function hash32(key: u32): u32 { return h; } +// @ts-ignore: decorator +@inline function hash64(key: u64): u32 { - var h: u32 = XXH32_SEED + XXH32_P5; + var h: u32 = XXH32_SEED + XXH32_P5 + 8; h += key * XXH32_P3; h = rotl(h, 17) * XXH32_P4; h += (key >> 32) * XXH32_P3; @@ -64,13 +66,15 @@ function mix(h: u32, key: u32): u32 { return rotl(h + key * XXH32_P2, 13) * XXH32_P1; } +// @ts-ignore: decorator +@inline function hashStr(key: string): u32 { if (key === null) { return XXH32_SEED; } - var h: u32 = XXH32_SEED + XXH32_P5; var len = key.length << 1; + var h: u32 = len; if (len >= 16) { let s1 = XXH32_SEED + XXH32_P1 + XXH32_P2; @@ -88,8 +92,10 @@ function hashStr(key: string): u32 { s4 = mix(s4, load(changetype(key) + i, 12)); i += 16; } - h = rotl(s1, 1) + rotl(s2, 7) + rotl(s3, 12) + rotl(s4, 18); + h += rotl(s1, 1) + rotl(s2, 7) + rotl(s3, 12) + rotl(s4, 18); len -= i; + } else { + h += XXH32_SEED + XXH32_P5; } var i = 0; @@ -112,6 +118,5 @@ function hashStr(key: string): u32 { h ^= h >> 13; h *= XXH32_P3; h ^= h >> 16; - return h; } diff --git a/tests/compiler/std/hash.optimized.wat b/tests/compiler/std/hash.optimized.wat index ecd0d10924..2178f9ab86 100644 --- a/tests/compiler/std/hash.optimized.wat +++ b/tests/compiler/std/hash.optimized.wat @@ -14,7 +14,7 @@ (data (i32.const 1356) "\12\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\12\00\00\00a\00b\00c\00d\00e\00f\00g\00h\00i") (export "memory" (memory $0)) (start $~start) - (func $~lib/util/hash/hashStr (param $0 i32) + (func $~lib/util/hash/HASH<~lib/string/String|null> (param $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -24,193 +24,200 @@ (local $7 i32) (local $8 i32) local.get $0 - i32.eqz if - return - end - local.get $0 - i32.const 20 - i32.sub - i32.load offset=16 - i32.const 1 - i32.shr_u - i32.const 1 - i32.shl - local.tee $2 - i32.const 16 - i32.ge_s - if (result i32) - i32.const 606290984 - local.set $1 - i32.const -2048144777 - local.set $5 - i32.const 1640531535 - local.set $6 - local.get $2 - i32.const 16 + local.get $0 + i32.const 20 i32.sub - local.set $7 - loop $while-continue|0 + i32.load offset=16 + i32.const 1 + i32.shr_u + i32.const 1 + i32.shl + local.tee $3 + i32.const 16 + i32.ge_s + if + i32.const 606290984 + local.set $2 + i32.const -2048144777 + local.set $4 + i32.const 1640531535 + local.set $5 local.get $3 + i32.const 16 + i32.sub + local.set $7 + loop $while-continue|0 + local.get $1 + local.get $7 + i32.le_s + if + local.get $2 + local.get $0 + local.get $1 + i32.add + local.tee $6 + i32.load + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $2 + local.get $4 + local.get $6 + i32.load offset=4 + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $4 + local.get $8 + local.get $6 + i32.load offset=8 + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $8 + local.get $5 + local.get $6 + i32.load offset=12 + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $5 + local.get $1 + i32.const 16 + i32.add + local.set $1 + br $while-continue|0 + end + end + local.get $3 + local.get $2 + i32.const 1 + i32.rotl + local.get $4 + i32.const 7 + i32.rotl + i32.add + local.get $8 + i32.const 12 + i32.rotl + i32.add + local.get $5 + i32.const 18 + i32.rotl + i32.add + i32.add + local.set $2 local.get $7 + local.get $1 + i32.sub + local.set $3 + else + local.get $3 + i32.const 374761393 + i32.add + local.set $2 + end + i32.const 0 + local.set $1 + local.get $3 + i32.const 4 + i32.sub + local.set $3 + loop $while-continue|1 + local.get $1 + local.get $3 i32.le_s if - local.get $1 + local.get $2 local.get $0 - local.get $3 + local.get $1 i32.add - local.tee $2 i32.load - i32.const -2048144777 + i32.const -1028477379 i32.mul i32.add - i32.const 13 + i32.const 17 i32.rotl - i32.const -1640531535 - i32.mul - local.set $1 - local.get $5 - local.get $2 - i32.load offset=4 - i32.const -2048144777 + i32.const 668265263 i32.mul + local.set $2 + local.get $1 + i32.const 4 i32.add - i32.const 13 - i32.rotl - i32.const -1640531535 - i32.mul - local.set $5 - local.get $8 + local.set $1 + br $while-continue|1 + end + end + loop $while-continue|2 + local.get $1 + local.get $3 + i32.lt_s + if local.get $2 - i32.load offset=8 - i32.const -2048144777 - i32.mul + local.get $0 + local.get $1 i32.add - i32.const 13 - i32.rotl - i32.const -1640531535 - i32.mul - local.set $8 - local.get $6 - local.get $2 - i32.load offset=12 - i32.const -2048144777 + i32.load8_u + i32.const 374761393 i32.mul i32.add - i32.const 13 + i32.const 11 i32.rotl i32.const -1640531535 i32.mul - local.set $6 - local.get $3 - i32.const 16 + local.set $2 + local.get $1 + i32.const 1 i32.add - local.set $3 - br $while-continue|0 + local.set $1 + br $while-continue|2 end end - local.get $7 - local.get $3 - i32.sub - local.set $2 - local.get $1 - i32.const 1 - i32.rotl - local.get $5 - i32.const 7 - i32.rotl - i32.add - local.get $8 - i32.const 12 - i32.rotl - i32.add - local.get $6 - i32.const 18 - i32.rotl - i32.add - else - i32.const 374761393 - end - local.set $1 - local.get $2 - i32.const 4 - i32.sub - local.set $3 - loop $while-continue|1 - local.get $3 - local.get $4 - i32.ge_s - if - local.get $1 - local.get $0 - local.get $4 - i32.add - i32.load - i32.const -1028477379 - i32.mul - i32.add - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $1 - local.get $4 - i32.const 4 - i32.add - local.set $4 - br $while-continue|1 - end - end - loop $while-continue|2 - local.get $3 - local.get $4 - i32.gt_s - if - local.get $1 - local.get $0 - local.get $4 - i32.add - i32.load8_u - i32.const 374761393 - i32.mul - i32.add - i32.const 11 - i32.rotl - i32.const -1640531535 - i32.mul - local.set $1 - local.get $4 - i32.const 1 - i32.add - local.set $4 - br $while-continue|2 - end end ) (func $~start - (local $0 i32) - (local $1 i64) + (local $0 f32) + (local $1 i32) + (local $2 f64) + (local $3 i64) i32.const 0 - call $~lib/util/hash/hashStr + call $~lib/util/hash/HASH<~lib/string/String|null> i32.const 1056 - call $~lib/util/hash/hashStr + call $~lib/util/hash/HASH<~lib/string/String|null> i32.const 1088 - call $~lib/util/hash/hashStr + call $~lib/util/hash/HASH<~lib/string/String|null> i32.const 1120 - call $~lib/util/hash/hashStr + call $~lib/util/hash/HASH<~lib/string/String|null> i32.const 1152 - call $~lib/util/hash/hashStr + call $~lib/util/hash/HASH<~lib/string/String|null> i32.const 1184 - call $~lib/util/hash/hashStr + call $~lib/util/hash/HASH<~lib/string/String|null> i32.const 1216 - call $~lib/util/hash/hashStr + call $~lib/util/hash/HASH<~lib/string/String|null> i32.const 1248 - call $~lib/util/hash/hashStr + call $~lib/util/hash/HASH<~lib/string/String|null> i32.const 1280 - call $~lib/util/hash/hashStr + call $~lib/util/hash/HASH<~lib/string/String|null> i32.const 1328 - call $~lib/util/hash/hashStr + call $~lib/util/hash/HASH<~lib/string/String|null> i32.const 1376 - call $~lib/util/hash/hashStr + call $~lib/util/hash/HASH<~lib/string/String|null> ) ) diff --git a/tests/compiler/std/hash.untouched.wat b/tests/compiler/std/hash.untouched.wat index bc6280099d..fa1e594b14 100644 --- a/tests/compiler/std/hash.untouched.wat +++ b/tests/compiler/std/hash.untouched.wat @@ -2,7 +2,8 @@ (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) - (type $i64_=>_i32 (func (param i64) (result i32))) + (type $f32_=>_i32 (func (param f32) (result i32))) + (type $f64_=>_i32 (func (param f64) (result i32))) (memory $0 1) (data (i32.const 12) "\00\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00") (data (i32.const 44) "\02\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00a\00") @@ -31,7 +32,7 @@ i32.const 1 i32.shr_u ) - (func $~lib/util/hash/hashStr (param $0 i32) (result i32) + (func $~lib/util/hash/HASH<~lib/string/String|null> (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -46,795 +47,792 @@ local.get $0 call $~lib/rt/stub/__retain local.set $0 - local.get $0 - i32.const 0 - i32.eq - if - i32.const 0 - local.set $1 - local.get $0 - call $~lib/rt/stub/__release - local.get $1 - return - end - i32.const 0 - i32.const 374761393 - i32.add - local.set $2 - local.get $0 - call $~lib/string/String#get:length i32.const 1 - i32.shl - local.set $3 - local.get $3 - i32.const 16 - i32.ge_s - if - i32.const 0 - i32.const -1640531535 - i32.add - i32.const -2048144777 - i32.add + drop + block $~lib/util/hash/hashStr|inlined.0 (result i32) + local.get $0 + call $~lib/rt/stub/__retain local.set $1 + local.get $1 i32.const 0 - i32.const -2048144777 - i32.add - local.set $4 - i32.const 0 - local.set $5 - i32.const 0 - i32.const -1640531535 - i32.sub - local.set $6 - i32.const 0 - local.set $7 - local.get $3 - i32.const 16 - i32.sub + i32.eq + if + i32.const 0 + local.set $2 + local.get $1 + call $~lib/rt/stub/__release + local.get $2 + br $~lib/util/hash/hashStr|inlined.0 + end + local.get $1 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.set $2 + local.get $2 local.set $3 - loop $while-continue|0 + local.get $2 + i32.const 16 + i32.ge_s + if + i32.const 0 + i32.const -1640531535 + i32.add + i32.const -2048144777 + i32.add + local.set $4 + i32.const 0 + i32.const -2048144777 + i32.add + local.set $5 + i32.const 0 + local.set $6 + i32.const 0 + i32.const -1640531535 + i32.sub + local.set $7 + i32.const 0 + local.set $8 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + loop $while-continue|0 + local.get $8 + local.get $2 + i32.le_s + local.set $9 + local.get $9 + if + local.get $4 + local.set $11 + local.get $1 + local.get $8 + i32.add + i32.load + local.set $10 + local.get $11 + local.get $10 + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $4 + local.get $5 + local.set $11 + local.get $1 + local.get $8 + i32.add + i32.load offset=4 + local.set $10 + local.get $11 + local.get $10 + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $5 + local.get $6 + local.set $11 + local.get $1 + local.get $8 + i32.add + i32.load offset=8 + local.set $10 + local.get $11 + local.get $10 + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $6 + local.get $7 + local.set $11 + local.get $1 + local.get $8 + i32.add + i32.load offset=12 + local.set $10 + local.get $11 + local.get $10 + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $7 + local.get $8 + i32.const 16 + i32.add + local.set $8 + br $while-continue|0 + end + end + local.get $3 + local.get $4 + i32.const 1 + i32.rotl + local.get $5 + i32.const 7 + i32.rotl + i32.add + local.get $6 + i32.const 12 + i32.rotl + i32.add local.get $7 + i32.const 18 + i32.rotl + i32.add + i32.add + local.set $3 + local.get $2 + local.get $8 + i32.sub + local.set $2 + else local.get $3 - i32.le_s - local.set $8 + i32.const 0 + i32.const 374761393 + i32.add + i32.add + local.set $3 + end + i32.const 0 + local.set $8 + local.get $2 + i32.const 4 + i32.sub + local.set $2 + loop $while-continue|1 local.get $8 + local.get $2 + i32.le_s + local.set $7 + local.get $7 if + local.get $3 local.get $1 - local.set $10 - local.get $0 - local.get $7 + local.get $8 i32.add i32.load - local.set $9 - local.get $10 - local.get $9 - i32.const -2048144777 + i32.const -1028477379 i32.mul i32.add - i32.const 13 + local.set $3 + local.get $3 + i32.const 17 i32.rotl - i32.const -1640531535 + i32.const 668265263 i32.mul - local.set $1 - local.get $4 - local.set $10 - local.get $0 - local.get $7 + local.set $3 + local.get $8 + i32.const 4 i32.add - i32.load offset=4 - local.set $9 - local.get $10 - local.get $9 - i32.const -2048144777 - i32.mul - i32.add - i32.const 13 - i32.rotl - i32.const -1640531535 - i32.mul - local.set $4 - local.get $5 - local.set $10 - local.get $0 - local.get $7 + local.set $8 + br $while-continue|1 + end + end + loop $while-continue|2 + local.get $8 + local.get $2 + i32.lt_s + local.set $7 + local.get $7 + if + local.get $3 + local.get $1 + local.get $8 i32.add - i32.load offset=8 - local.set $9 - local.get $10 - local.get $9 - i32.const -2048144777 + i32.load8_u + i32.const 374761393 i32.mul i32.add - i32.const 13 + local.set $3 + local.get $3 + i32.const 11 i32.rotl i32.const -1640531535 i32.mul - local.set $5 - local.get $6 - local.set $10 - local.get $0 - local.get $7 + local.set $3 + local.get $8 + i32.const 1 i32.add - i32.load offset=12 - local.set $9 - local.get $10 - local.get $9 - i32.const -2048144777 - i32.mul - i32.add - i32.const 13 - i32.rotl - i32.const -1640531535 - i32.mul - local.set $6 - local.get $7 - i32.const 16 - i32.add - local.set $7 - br $while-continue|0 + local.set $8 + br $while-continue|2 end end - local.get $1 - i32.const 1 - i32.rotl - local.get $4 - i32.const 7 - i32.rotl - i32.add - local.get $5 - i32.const 12 - i32.rotl - i32.add - local.get $6 - i32.const 18 - i32.rotl - i32.add - local.set $2 local.get $3 - local.get $7 - i32.sub + local.get $3 + i32.const 15 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -2048144777 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 13 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -1028477379 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 16 + i32.shr_u + i32.xor local.set $3 - end - i32.const 0 - local.set $11 - local.get $3 - i32.const 4 - i32.sub - local.set $3 - loop $while-continue|1 - local.get $11 local.get $3 - i32.le_s local.set $7 + local.get $1 + call $~lib/rt/stub/__release local.get $7 + end + local.set $8 + local.get $0 + call $~lib/rt/stub/__release + local.get $8 + return + ) + (func $std/hash/check (param $0 i32) (result i32) + i32.const 1 + ) + (func $~lib/util/hash/HASH<~lib/string/String> (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) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + local.get $0 + call $~lib/rt/stub/__retain + local.set $0 + i32.const 1 + drop + block $~lib/util/hash/hashStr|inlined.1 (result i32) + local.get $0 + call $~lib/rt/stub/__retain + local.set $1 + local.get $1 + i32.const 0 + i32.eq if + i32.const 0 + local.set $2 + local.get $1 + call $~lib/rt/stub/__release local.get $2 - local.get $0 - local.get $11 + br $~lib/util/hash/hashStr|inlined.1 + end + local.get $1 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.set $2 + local.get $2 + local.set $3 + local.get $2 + i32.const 16 + i32.ge_s + if + i32.const 0 + i32.const -1640531535 i32.add - i32.load - i32.const -1028477379 - i32.mul + i32.const -2048144777 i32.add - local.set $2 + local.set $4 + i32.const 0 + i32.const -2048144777 + i32.add + local.set $5 + i32.const 0 + local.set $6 + i32.const 0 + i32.const -1640531535 + i32.sub + local.set $7 + i32.const 0 + local.set $8 local.get $2 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul + i32.const 16 + i32.sub local.set $2 - local.get $11 - i32.const 4 + loop $while-continue|0 + local.get $8 + local.get $2 + i32.le_s + local.set $9 + local.get $9 + if + local.get $4 + local.set $11 + local.get $1 + local.get $8 + i32.add + i32.load + local.set $10 + local.get $11 + local.get $10 + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $4 + local.get $5 + local.set $11 + local.get $1 + local.get $8 + i32.add + i32.load offset=4 + local.set $10 + local.get $11 + local.get $10 + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $5 + local.get $6 + local.set $11 + local.get $1 + local.get $8 + i32.add + i32.load offset=8 + local.set $10 + local.get $11 + local.get $10 + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $6 + local.get $7 + local.set $11 + local.get $1 + local.get $8 + i32.add + i32.load offset=12 + local.set $10 + local.get $11 + local.get $10 + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $7 + local.get $8 + i32.const 16 + i32.add + local.set $8 + br $while-continue|0 + end + end + local.get $3 + local.get $4 + i32.const 1 + i32.rotl + local.get $5 + i32.const 7 + i32.rotl i32.add - local.set $11 - br $while-continue|1 - end - end - loop $while-continue|2 - local.get $11 - local.get $3 - i32.lt_s - local.set $7 - local.get $7 - if - local.get $2 - local.get $0 - local.get $11 + local.get $6 + i32.const 12 + i32.rotl i32.add - i32.load8_u - i32.const 374761393 - i32.mul + local.get $7 + i32.const 18 + i32.rotl i32.add - local.set $2 + i32.add + local.set $3 local.get $2 - i32.const 11 - i32.rotl - i32.const -1640531535 - i32.mul + local.get $8 + i32.sub local.set $2 - local.get $11 - i32.const 1 + else + local.get $3 + i32.const 0 + i32.const 374761393 + i32.add i32.add - local.set $11 - br $while-continue|2 + local.set $3 + end + i32.const 0 + local.set $8 + local.get $2 + i32.const 4 + i32.sub + local.set $2 + loop $while-continue|1 + local.get $8 + local.get $2 + i32.le_s + local.set $7 + local.get $7 + if + local.get $3 + local.get $1 + local.get $8 + i32.add + i32.load + i32.const -1028477379 + i32.mul + i32.add + local.set $3 + local.get $3 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $3 + local.get $8 + i32.const 4 + i32.add + local.set $8 + br $while-continue|1 + end end + loop $while-continue|2 + local.get $8 + local.get $2 + i32.lt_s + local.set $7 + local.get $7 + if + local.get $3 + local.get $1 + local.get $8 + i32.add + i32.load8_u + i32.const 374761393 + i32.mul + i32.add + local.set $3 + local.get $3 + i32.const 11 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $3 + local.get $8 + i32.const 1 + i32.add + local.set $8 + br $while-continue|2 + end + end + local.get $3 + local.get $3 + i32.const 15 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -2048144777 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 13 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -1028477379 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 16 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + local.set $7 + local.get $1 + call $~lib/rt/stub/__release + local.get $7 end - local.get $2 - local.get $2 - i32.const 15 - i32.shr_u - i32.xor - local.set $2 - local.get $2 - i32.const -2048144777 - i32.mul - local.set $2 - local.get $2 - local.get $2 - i32.const 13 - i32.shr_u - i32.xor - local.set $2 - local.get $2 - i32.const -1028477379 - i32.mul - local.set $2 - local.get $2 - local.get $2 - i32.const 16 - i32.shr_u - i32.xor - local.set $2 - local.get $2 - local.set $7 + local.set $8 local.get $0 call $~lib/rt/stub/__release - local.get $7 + local.get $8 + return ) - (func $std/hash/check (param $0 i32) (result i32) - i32.const 1 - ) - (func $~lib/util/hash/hash32 (param $0 i32) (result i32) + (func $~lib/util/hash/HASH (param $0 f32) (result i32) (local $1 i32) + (local $2 i32) + (local $3 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 1 + drop + i32.const 4 + i32.const 4 + i32.eq + drop + local.get $0 + i32.reinterpret_f32 + local.set $1 + i32.const 4 + local.set $2 i32.const 0 i32.const 374761393 i32.add - local.set $1 + local.get $2 + i32.add + local.set $3 + local.get $3 local.get $1 - local.get $0 i32.const -1028477379 i32.mul i32.add - local.set $1 - local.get $1 + local.set $3 + local.get $3 i32.const 17 i32.rotl i32.const 668265263 i32.mul - local.set $1 - local.get $1 - local.get $1 + local.set $3 + local.get $3 + local.get $3 i32.const 15 i32.shr_u i32.xor - local.set $1 - local.get $1 + local.set $3 + local.get $3 i32.const -2048144777 i32.mul - local.set $1 - local.get $1 - local.get $1 + local.set $3 + local.get $3 + local.get $3 i32.const 13 i32.shr_u i32.xor - local.set $1 - local.get $1 + local.set $3 + local.get $3 i32.const -1028477379 i32.mul - local.set $1 - local.get $1 - local.get $1 + local.set $3 + local.get $3 + local.get $3 i32.const 16 i32.shr_u i32.xor - local.set $1 - local.get $1 + local.set $3 + local.get $3 + return ) - (func $~lib/util/hash/hash64 (param $0 i64) (result i32) - (local $1 i32) + (func $~lib/util/hash/HASH (param $0 f64) (result i32) + (local $1 i64) + (local $2 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 1 + drop + i32.const 8 + i32.const 4 + i32.eq + drop + i32.const 8 + i32.const 8 + i32.eq + drop + local.get $0 + i64.reinterpret_f64 + local.set $1 i32.const 0 i32.const 374761393 i32.add - local.set $1 + i32.const 8 + i32.add + local.set $2 + local.get $2 local.get $1 - local.get $0 i32.wrap_i64 i32.const -1028477379 i32.mul i32.add - local.set $1 - local.get $1 + local.set $2 + local.get $2 i32.const 17 i32.rotl i32.const 668265263 i32.mul - local.set $1 + local.set $2 + local.get $2 local.get $1 - local.get $0 i64.const 32 i64.shr_u i32.wrap_i64 i32.const -1028477379 i32.mul i32.add - local.set $1 - local.get $1 + local.set $2 + local.get $2 i32.const 17 i32.rotl i32.const 668265263 i32.mul - local.set $1 - local.get $1 - local.get $1 + local.set $2 + local.get $2 + local.get $2 i32.const 15 i32.shr_u i32.xor - local.set $1 - local.get $1 + local.set $2 + local.get $2 i32.const -2048144777 i32.mul - local.set $1 - local.get $1 - local.get $1 + local.set $2 + local.get $2 + local.get $2 i32.const 13 i32.shr_u i32.xor - local.set $1 - local.get $1 + local.set $2 + local.get $2 i32.const -1028477379 i32.mul - local.set $1 - local.get $1 - local.get $1 + local.set $2 + local.get $2 + local.get $2 i32.const 16 i32.shr_u i32.xor - local.set $1 - local.get $1 + local.set $2 + local.get $2 + return ) (func $start:std/hash - (local $0 i32) - (local $1 i32) - (local $2 f32) - (local $3 f64) - block $~lib/util/hash/HASH<~lib/string/String|null>|inlined.0 (result i32) - i32.const 0 - call $~lib/rt/stub/__retain - local.set $0 - i32.const 1 - drop - local.get $0 - call $~lib/util/hash/hashStr - local.set $1 - local.get $0 - call $~lib/rt/stub/__release - local.get $1 - br $~lib/util/hash/HASH<~lib/string/String|null>|inlined.0 - end + i32.const 0 + call $~lib/util/hash/HASH<~lib/string/String|null> call $std/hash/check drop - block $~lib/util/hash/HASH<~lib/string/String>|inlined.0 (result i32) - i32.const 32 - local.set $1 - i32.const 1 - drop - local.get $1 - call $~lib/util/hash/hashStr - local.set $0 - local.get $1 - call $~lib/rt/stub/__release - local.get $0 - br $~lib/util/hash/HASH<~lib/string/String>|inlined.0 - end + i32.const 32 + call $~lib/util/hash/HASH<~lib/string/String> call $std/hash/check drop - block $~lib/util/hash/HASH<~lib/string/String>|inlined.1 (result i32) - i32.const 64 - local.set $0 - i32.const 1 - drop - local.get $0 - call $~lib/util/hash/hashStr - local.set $1 - local.get $0 - call $~lib/rt/stub/__release - local.get $1 - br $~lib/util/hash/HASH<~lib/string/String>|inlined.1 - end + i32.const 64 + call $~lib/util/hash/HASH<~lib/string/String> call $std/hash/check drop - block $~lib/util/hash/HASH<~lib/string/String>|inlined.2 (result i32) - i32.const 96 - local.set $1 - i32.const 1 - drop - local.get $1 - call $~lib/util/hash/hashStr - local.set $0 - local.get $1 - call $~lib/rt/stub/__release - local.get $0 - br $~lib/util/hash/HASH<~lib/string/String>|inlined.2 - end + i32.const 96 + call $~lib/util/hash/HASH<~lib/string/String> call $std/hash/check drop - block $~lib/util/hash/HASH<~lib/string/String>|inlined.3 (result i32) - i32.const 128 - local.set $0 - i32.const 1 - drop - local.get $0 - call $~lib/util/hash/hashStr - local.set $1 - local.get $0 - call $~lib/rt/stub/__release - local.get $1 - br $~lib/util/hash/HASH<~lib/string/String>|inlined.3 - end + i32.const 128 + call $~lib/util/hash/HASH<~lib/string/String> call $std/hash/check drop - block $~lib/util/hash/HASH<~lib/string/String>|inlined.4 (result i32) - i32.const 160 - local.set $1 - i32.const 1 - drop - local.get $1 - call $~lib/util/hash/hashStr - local.set $0 - local.get $1 - call $~lib/rt/stub/__release - local.get $0 - br $~lib/util/hash/HASH<~lib/string/String>|inlined.4 - end + i32.const 160 + call $~lib/util/hash/HASH<~lib/string/String> call $std/hash/check drop - block $~lib/util/hash/HASH<~lib/string/String>|inlined.5 (result i32) - i32.const 192 - local.set $0 - i32.const 1 - drop - local.get $0 - call $~lib/util/hash/hashStr - local.set $1 - local.get $0 - call $~lib/rt/stub/__release - local.get $1 - br $~lib/util/hash/HASH<~lib/string/String>|inlined.5 - end + i32.const 192 + call $~lib/util/hash/HASH<~lib/string/String> call $std/hash/check drop - block $~lib/util/hash/HASH<~lib/string/String>|inlined.6 (result i32) - i32.const 224 - local.set $1 - i32.const 1 - drop - local.get $1 - call $~lib/util/hash/hashStr - local.set $0 - local.get $1 - call $~lib/rt/stub/__release - local.get $0 - br $~lib/util/hash/HASH<~lib/string/String>|inlined.6 - end + i32.const 224 + call $~lib/util/hash/HASH<~lib/string/String> call $std/hash/check drop - block $~lib/util/hash/HASH<~lib/string/String>|inlined.7 (result i32) - i32.const 256 - local.set $0 - i32.const 1 - drop - local.get $0 - call $~lib/util/hash/hashStr - local.set $1 - local.get $0 - call $~lib/rt/stub/__release - local.get $1 - br $~lib/util/hash/HASH<~lib/string/String>|inlined.7 - end + i32.const 256 + call $~lib/util/hash/HASH<~lib/string/String> call $std/hash/check drop - block $~lib/util/hash/HASH<~lib/string/String>|inlined.8 (result i32) - i32.const 304 - local.set $1 - i32.const 1 - drop - local.get $1 - call $~lib/util/hash/hashStr - local.set $0 - local.get $1 - call $~lib/rt/stub/__release - local.get $0 - br $~lib/util/hash/HASH<~lib/string/String>|inlined.8 - end + i32.const 304 + call $~lib/util/hash/HASH<~lib/string/String> call $std/hash/check drop - block $~lib/util/hash/HASH<~lib/string/String>|inlined.9 (result i32) - i32.const 352 - local.set $0 - i32.const 1 - drop - local.get $0 - call $~lib/util/hash/hashStr - local.set $1 - local.get $0 - call $~lib/rt/stub/__release - local.get $1 - br $~lib/util/hash/HASH<~lib/string/String>|inlined.9 - end + i32.const 352 + call $~lib/util/hash/HASH<~lib/string/String> call $std/hash/check drop - block $~lib/util/hash/HASH|inlined.0 (result i32) - f32.const 0 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.0 - end + f32.const 0 + call $~lib/util/hash/HASH call $std/hash/check drop - block $~lib/util/hash/HASH|inlined.1 (result i32) - f32.const 1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.1 - end + f32.const 1 + call $~lib/util/hash/HASH call $std/hash/check drop - block $~lib/util/hash/HASH|inlined.2 (result i32) - f32.const 1.100000023841858 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end + f32.const 1.100000023841858 + call $~lib/util/hash/HASH call $std/hash/check drop - block $~lib/util/hash/HASH|inlined.3 (result i32) - f32.const 0 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.3 - end + f32.const 0 + call $~lib/util/hash/HASH call $std/hash/check drop - block $~lib/util/hash/HASH|inlined.4 (result i32) - f32.const inf - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.4 - end + f32.const inf + call $~lib/util/hash/HASH call $std/hash/check drop - block $~lib/util/hash/HASH|inlined.5 (result i32) - f32.const nan:0x400000 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.5 - end + f32.const nan:0x400000 + call $~lib/util/hash/HASH call $std/hash/check drop - block $~lib/util/hash/HASH|inlined.0 (result i32) - f64.const 0 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $3 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.0 - end + f64.const 0 + call $~lib/util/hash/HASH call $std/hash/check drop - block $~lib/util/hash/HASH|inlined.1 (result i32) - f64.const 1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $3 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.1 - end + f64.const 1 + call $~lib/util/hash/HASH call $std/hash/check drop - block $~lib/util/hash/HASH|inlined.2 (result i32) - f64.const 1.1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $3 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.2 - end + f64.const 1.1 + call $~lib/util/hash/HASH call $std/hash/check drop - block $~lib/util/hash/HASH|inlined.3 (result i32) - f64.const 0 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $3 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.3 - end + f64.const 0 + call $~lib/util/hash/HASH call $std/hash/check drop - block $~lib/util/hash/HASH|inlined.4 (result i32) - f64.const inf - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $3 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.4 - end + f64.const inf + call $~lib/util/hash/HASH call $std/hash/check drop - block $~lib/util/hash/HASH|inlined.5 (result i32) - f64.const nan:0x8000000000000 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $3 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.5 - end + f64.const nan:0x8000000000000 + call $~lib/util/hash/HASH call $std/hash/check drop ) diff --git a/tests/compiler/std/map.optimized.wat b/tests/compiler/std/map.optimized.wat index 4ae78b26dd..7275ded1e6 100644 --- a/tests/compiler/std/map.optimized.wat +++ b/tests/compiler/std/map.optimized.wat @@ -22,6 +22,8 @@ (type $i32_f32_f32_=>_i32 (func (param i32 f32 f32) (result i32))) (type $i32_f64_f64_=>_i32 (func (param i32 f64 f64) (result i32))) (type $i64_=>_i32 (func (param i64) (result i32))) + (type $f32_=>_i32 (func (param f32) (result i32))) + (type $f64_=>_i32 (func (param f64) (result i32))) (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) @@ -1290,11 +1292,15 @@ local.get $1 call $~lib/rt/pure/__retain ) - (func $~lib/util/hash/hash32 (param $0 i32) (result i32) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) local.get $0 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s i32.const -1028477379 i32.mul - i32.const 374761393 + i32.const 374761394 i32.add i32.const 17 i32.rotl @@ -1367,11 +1373,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne @@ -1436,7 +1438,7 @@ local.get $2 local.get $5 local.get $6 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -1514,11 +1516,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.tee $5 call $~lib/map/Map#find local.tee $3 @@ -1610,11 +1608,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/map/Map#find local.tee $0 i32.eqz @@ -2492,7 +2486,7 @@ local.get $2 local.get $5 local.get $6 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -2569,11 +2563,7 @@ (local $5 i32) local.get $1 local.tee $3 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.set $5 local.get $0 i32.load @@ -2701,6 +2691,36 @@ local.get $0 call $~lib/rt/pure/__retain ) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) + local.get $0 + i32.const -1028477379 + i32.mul + i32.const 374761397 + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.tee $0 + local.get $0 + i32.const 15 + i32.shr_u + i32.xor + i32.const -2048144777 + i32.mul + local.tee $0 + local.get $0 + i32.const 13 + i32.shr_u + i32.xor + i32.const -1028477379 + i32.mul + local.tee $0 + local.get $0 + i32.const 16 + i32.shr_u + i32.xor + ) (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.load @@ -2802,7 +2822,7 @@ local.get $2 local.get $5 local.get $6 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -2880,7 +2900,7 @@ local.get $0 local.get $1 local.get $1 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.tee $5 call $~lib/map/Map#find local.tee $3 @@ -2973,11 +2993,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/map/Map#find local.tee $1 i32.eqz @@ -3587,13 +3603,43 @@ local.get $0 call $~lib/rt/pure/__release ) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) + local.get $0 + i32.const 255 + i32.and + i32.const -1028477379 + i32.mul + i32.const 374761394 + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.tee $0 + local.get $0 + i32.const 15 + i32.shr_u + i32.xor + i32.const -2048144777 + i32.mul + local.tee $0 + local.get $0 + i32.const 13 + i32.shr_u + i32.xor + i32.const -1028477379 + i32.mul + local.tee $0 + local.get $0 + i32.const 16 + i32.shr_u + i32.xor + ) (func $~lib/map/Map#has (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 - i32.const 255 - i32.and - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne @@ -3658,7 +3704,7 @@ local.get $2 local.get $5 local.get $6 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -3736,9 +3782,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 255 - i32.and - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.tee $5 call $~lib/map/Map#find local.tee $3 @@ -3830,9 +3874,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 255 - i32.and - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/map/Map#find local.tee $0 i32.eqz @@ -4020,7 +4062,7 @@ local.get $2 local.get $5 local.get $6 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -4097,9 +4139,7 @@ (local $5 i32) local.get $1 local.tee $3 - i32.const 255 - i32.and - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.set $5 local.get $0 i32.load @@ -4232,9 +4272,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 255 - i32.and - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/map/Map#find local.tee $1 i32.eqz @@ -4789,6 +4827,40 @@ local.get $0 call $~lib/rt/pure/__release ) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.const -1028477379 + i32.mul + i32.const 374761395 + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.tee $0 + local.get $0 + i32.const 15 + i32.shr_u + i32.xor + i32.const -2048144777 + i32.mul + local.tee $0 + local.get $0 + i32.const 13 + i32.shr_u + i32.xor + i32.const -1028477379 + i32.mul + local.tee $0 + local.get $0 + i32.const 16 + i32.shr_u + i32.xor + ) (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.load @@ -4836,11 +4908,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne @@ -4905,7 +4973,7 @@ local.get $2 local.get $5 local.get $6 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -4983,11 +5051,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.tee $5 call $~lib/map/Map#find local.tee $3 @@ -5079,11 +5143,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/map/Map#find local.tee $0 i32.eqz @@ -5325,7 +5385,7 @@ local.get $2 local.get $5 local.get $6 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -5402,11 +5462,7 @@ (local $5 i32) local.get $1 local.tee $3 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.set $5 local.get $0 i32.load @@ -5539,11 +5595,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/map/Map#find local.tee $1 i32.eqz @@ -6122,13 +6174,43 @@ local.get $0 call $~lib/rt/pure/__release ) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) + local.get $0 + i32.const 65535 + i32.and + i32.const -1028477379 + i32.mul + i32.const 374761395 + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.tee $0 + local.get $0 + i32.const 15 + i32.shr_u + i32.xor + i32.const -2048144777 + i32.mul + local.tee $0 + local.get $0 + i32.const 13 + i32.shr_u + i32.xor + i32.const -1028477379 + i32.mul + local.tee $0 + local.get $0 + i32.const 16 + i32.shr_u + i32.xor + ) (func $~lib/map/Map#has (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 - i32.const 65535 - i32.and - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne @@ -6193,7 +6275,7 @@ local.get $2 local.get $5 local.get $6 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -6271,9 +6353,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 65535 - i32.and - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.tee $5 call $~lib/map/Map#find local.tee $3 @@ -6365,9 +6445,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 65535 - i32.and - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/map/Map#find local.tee $0 i32.eqz @@ -6559,7 +6637,7 @@ local.get $2 local.get $5 local.get $6 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -6636,9 +6714,7 @@ (local $5 i32) local.get $1 local.tee $3 - i32.const 65535 - i32.and - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.set $5 local.get $0 i32.load @@ -6771,9 +6847,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 65535 - i32.and - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/map/Map#find local.tee $1 i32.eqz @@ -7334,7 +7408,7 @@ local.get $0 local.get $1 local.get $1 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne @@ -7343,7 +7417,7 @@ local.get $0 local.get $1 local.get $1 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/map/Map#find local.tee $0 i32.eqz @@ -7363,7 +7437,7 @@ local.get $0 local.get $1 local.get $1 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/map/Map#find local.tee $1 i32.eqz @@ -8461,13 +8535,13 @@ local.get $0 call $~lib/rt/pure/__release ) - (func $~lib/util/hash/hash64 (param $0 i64) (result i32) + (func $~lib/util/hash/HASH (param $0 i64) (result i32) (local $1 i32) local.get $0 i32.wrap_i64 i32.const -1028477379 i32.mul - i32.const 374761393 + i32.const 374761401 i32.add i32.const 17 i32.rotl @@ -8549,7 +8623,7 @@ local.get $0 local.get $1 local.get $1 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne @@ -8615,7 +8689,7 @@ local.get $2 local.get $5 local.get $8 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -8693,7 +8767,7 @@ local.get $0 local.get $1 local.get $1 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH local.tee $5 call $~lib/map/Map#find local.tee $3 @@ -8785,7 +8859,7 @@ local.get $0 local.get $1 local.get $1 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH call $~lib/map/Map#find local.tee $0 i32.eqz @@ -9101,7 +9175,7 @@ local.get $2 local.get $5 local.get $8 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -9177,7 +9251,7 @@ (local $4 i32) (local $5 i32) local.get $1 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH local.set $4 local.get $0 i32.load @@ -9309,7 +9383,7 @@ local.get $0 local.get $1 local.get $1 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH call $~lib/map/Map#find local.tee $2 i32.eqz @@ -10459,6 +10533,38 @@ local.get $1 call $~lib/rt/pure/__release ) + (func $~lib/util/hash/HASH (param $0 f32) (result i32) + (local $1 i32) + local.get $0 + i32.reinterpret_f32 + i32.const -1028477379 + i32.mul + i32.const 374761397 + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.tee $1 + local.get $1 + i32.const 15 + i32.shr_u + i32.xor + i32.const -2048144777 + i32.mul + local.tee $1 + local.get $1 + i32.const 13 + i32.shr_u + i32.xor + i32.const -1028477379 + i32.mul + local.tee $1 + local.get $1 + i32.const 16 + i32.shr_u + i32.xor + ) (func $~lib/map/Map#find (param $0 i32) (param $1 f32) (param $2 i32) (result i32) local.get $0 i32.load @@ -10504,8 +10610,7 @@ local.get $0 local.get $1 local.get $1 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne @@ -10571,8 +10676,7 @@ local.get $2 local.get $5 local.get $8 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -10650,8 +10754,7 @@ local.get $0 local.get $1 local.get $1 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.tee $5 call $~lib/map/Map#find local.tee $3 @@ -10743,8 +10846,7 @@ local.get $0 local.get $1 local.get $1 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/map/Map#find local.tee $0 i32.eqz @@ -10971,8 +11073,7 @@ local.get $2 local.get $5 local.get $8 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -11050,8 +11151,7 @@ local.get $0 local.get $1 local.get $1 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.tee $4 call $~lib/map/Map#find local.tee $3 @@ -11145,8 +11245,7 @@ local.get $0 local.get $1 local.get $1 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/map/Map#find local.tee $2 i32.eqz @@ -11689,6 +11788,52 @@ local.get $1 call $~lib/rt/pure/__release ) + (func $~lib/util/hash/HASH (param $0 f64) (result i32) + (local $1 i32) + (local $2 i64) + local.get $0 + i64.reinterpret_f64 + local.tee $2 + i32.wrap_i64 + i32.const -1028477379 + i32.mul + i32.const 374761401 + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.get $2 + i64.const 32 + i64.shr_u + i32.wrap_i64 + i32.const -1028477379 + i32.mul + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.tee $1 + local.get $1 + i32.const 15 + i32.shr_u + i32.xor + i32.const -2048144777 + i32.mul + local.tee $1 + local.get $1 + i32.const 13 + i32.shr_u + i32.xor + i32.const -1028477379 + i32.mul + local.tee $1 + local.get $1 + i32.const 16 + i32.shr_u + i32.xor + ) (func $~lib/map/Map#find (param $0 i32) (param $1 f64) (param $2 i32) (result i32) local.get $0 i32.load @@ -11734,8 +11879,7 @@ local.get $0 local.get $1 local.get $1 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne @@ -11801,8 +11945,7 @@ local.get $2 local.get $5 local.get $8 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -11880,8 +12023,7 @@ local.get $0 local.get $1 local.get $1 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH local.tee $5 call $~lib/map/Map#find local.tee $3 @@ -11973,8 +12115,7 @@ local.get $0 local.get $1 local.get $1 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH call $~lib/map/Map#find local.tee $0 i32.eqz @@ -12201,8 +12342,7 @@ local.get $2 local.get $5 local.get $8 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -12278,8 +12418,7 @@ (local $4 i32) (local $5 i32) local.get $1 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH local.set $4 local.get $0 i32.load @@ -12411,8 +12550,7 @@ local.get $0 local.get $1 local.get $1 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH call $~lib/map/Map#find local.tee $2 i32.eqz diff --git a/tests/compiler/std/map.untouched.wat b/tests/compiler/std/map.untouched.wat index a5db76415b..5199fe2697 100644 --- a/tests/compiler/std/map.untouched.wat +++ b/tests/compiler/std/map.untouched.wat @@ -17,12 +17,14 @@ (type $i32_i32_f32_=>_none (func (param i32 i32 f32))) (type $i32_i32_f64_=>_none (func (param i32 i32 f64))) (type $i32_i64_i64_=>_i32 (func (param i32 i64 i64) (result i32))) + (type $i64_=>_i32 (func (param i64) (result i32))) (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_f32_f32_=>_i32 (func (param i32 f32 f32) (result i32))) (type $i32_f64_f64_=>_i32 (func (param i32 f64 f64) (result i32))) - (type $i64_=>_i32 (func (param i64) (result i32))) + (type $f32_=>_i32 (func (param f32) (result i32))) + (type $f64_=>_i32 (func (param f64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) (data (i32.const 12) "(\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") @@ -1803,51 +1805,74 @@ i32.store offset=20 local.get $0 ) - (func $~lib/util/hash/hash32 (param $0 i32) (result i32) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) (local $1 i32) + (local $2 i32) + (local $3 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 1 + i32.const 4 + i32.le_u + drop + local.get $0 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + local.set $2 + i32.const 1 + local.set $1 i32.const 0 i32.const 374761393 i32.add - local.set $1 local.get $1 - local.get $0 + i32.add + local.set $3 + local.get $3 + local.get $2 i32.const -1028477379 i32.mul i32.add - local.set $1 - local.get $1 + local.set $3 + local.get $3 i32.const 17 i32.rotl i32.const 668265263 i32.mul - local.set $1 - local.get $1 - local.get $1 + local.set $3 + local.get $3 + local.get $3 i32.const 15 i32.shr_u i32.xor - local.set $1 - local.get $1 + local.set $3 + local.get $3 i32.const -2048144777 i32.mul - local.set $1 - local.get $1 - local.get $1 + local.set $3 + local.get $3 + local.get $3 i32.const 13 i32.shr_u i32.xor - local.set $1 - local.get $1 + local.set $3 + local.get $3 i32.const -1028477379 i32.mul - local.set $1 - local.get $1 - local.get $1 + local.set $3 + local.get $3 + local.get $3 i32.const 16 i32.shr_u i32.xor - local.set $1 - local.get $1 + local.set $3 + local.get $3 + return ) (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -1904,30 +1929,10 @@ i32.const 0 ) (func $~lib/map/Map#has (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 4 - i32.le_u - drop - local.get $2 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.0 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne @@ -2007,23 +2012,8 @@ local.get $10 i32.load offset=4 i32.store offset=4 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 4 - i32.le_u - drop - local.get $13 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -2106,38 +2096,19 @@ (local $4 i32) (local $5 i32) (local $6 i32) - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 4 - i32.le_u - drop - local.get $3 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $4 + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 local.get $1 - local.get $4 + local.get $3 call $~lib/map/Map#find - local.set $5 - local.get $5 + local.set $4 + local.get $4 if i32.const 0 drop - local.get $5 + local.get $4 local.get $2 i32.store offset=4 else @@ -2173,8 +2144,8 @@ local.get $0 i32.load offset=8 call $~lib/rt/pure/__retain - local.set $3 - local.get $3 + local.set $5 + local.get $5 local.get $0 local.get $0 i32.load offset=16 @@ -2186,11 +2157,11 @@ i32.const 12 i32.mul i32.add - local.set $5 - local.get $5 + local.set $4 + local.get $4 local.get $1 i32.store8 - local.get $5 + local.get $4 local.get $2 i32.store offset=4 local.get $0 @@ -2201,7 +2172,7 @@ i32.store offset=20 local.get $0 i32.load - local.get $4 + local.get $3 local.get $0 i32.load offset=4 i32.and @@ -2209,14 +2180,14 @@ i32.mul i32.add local.set $6 - local.get $5 + local.get $4 local.get $6 i32.load i32.store offset=8 local.get $6 - local.get $5 + local.get $4 i32.store - local.get $3 + local.get $5 call $~lib/rt/pure/__release end local.get $0 @@ -2224,33 +2195,13 @@ ) (func $~lib/map/Map#get (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 4 - i32.le_u - drop - local.get $2 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.3 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 384 @@ -2260,7 +2211,7 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $2 i32.load offset=4 ) (func $~lib/map/Map#get:size (param $0 i32) (result i32) @@ -4496,23 +4447,8 @@ local.get $10 i32.load8_s offset=1 i32.store8 offset=1 - block $~lib/util/hash/HASH|inlined.5 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 4 - i32.le_u - drop - local.get $13 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.5 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -4595,38 +4531,19 @@ (local $4 i32) (local $5 i32) (local $6 i32) - block $~lib/util/hash/HASH|inlined.4 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 4 - i32.le_u - drop - local.get $3 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.4 - end - local.set $4 + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 local.get $1 - local.get $4 + local.get $3 call $~lib/map/Map#find - local.set $5 - local.get $5 + local.set $4 + local.get $4 if i32.const 0 drop - local.get $5 + local.get $4 local.get $2 i32.store8 offset=1 else @@ -4662,8 +4579,8 @@ local.get $0 i32.load offset=8 call $~lib/rt/pure/__retain - local.set $3 - local.get $3 + local.set $5 + local.get $5 local.get $0 local.get $0 i32.load offset=16 @@ -4675,11 +4592,11 @@ i32.const 8 i32.mul i32.add - local.set $5 - local.get $5 + local.set $4 + local.get $4 local.get $1 i32.store8 - local.get $5 + local.get $4 local.get $2 i32.store8 offset=1 local.get $0 @@ -4690,7 +4607,7 @@ i32.store offset=20 local.get $0 i32.load - local.get $4 + local.get $3 local.get $0 i32.load offset=4 i32.and @@ -4698,43 +4615,108 @@ i32.mul i32.add local.set $6 - local.get $5 + local.get $4 local.get $6 i32.load i32.store offset=4 local.get $6 - local.get $5 + local.get $4 i32.store - local.get $3 + local.get $5 call $~lib/rt/pure/__release end local.get $0 call $~lib/rt/pure/__retain ) - (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.get $2 + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 4 + i32.const 4 + i32.le_u + drop local.get $0 - i32.load offset=4 - i32.and + local.set $2 i32.const 4 + local.set $1 + i32.const 0 + i32.const 374761393 + i32.add + local.get $1 + i32.add + local.set $3 + local.get $3 + local.get $2 + i32.const -1028477379 i32.mul i32.add - i32.load local.set $3 - loop $while-continue|0 - local.get $3 - local.set $4 - local.get $4 - if - local.get $3 - i32.load offset=8 - local.set $5 - local.get $5 + local.get $3 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 15 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -2048144777 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 13 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -1028477379 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 16 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + return + ) + (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + i32.load + local.get $2 + local.get $0 + i32.load offset=4 + i32.and + i32.const 4 + i32.mul + i32.add + i32.load + local.set $3 + loop $while-continue|0 + local.get $3 + local.set $4 + local.get $4 + if + local.get $3 + i32.load offset=8 + local.set $5 + local.get $5 i32.const 1 i32.and i32.eqz @@ -4836,23 +4818,8 @@ local.get $10 i32.load offset=4 i32.store offset=4 - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 4 - i32.le_u - drop - local.get $13 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.1 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -4935,34 +4902,19 @@ (local $4 i32) (local $5 i32) (local $6 i32) - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 4 - i32.le_u - drop - local.get $3 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.0 - end - local.set $4 + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 local.get $1 - local.get $4 + local.get $3 call $~lib/map/Map#find - local.set $5 - local.get $5 + local.set $4 + local.get $4 if i32.const 0 drop - local.get $5 + local.get $4 local.get $2 i32.store offset=4 else @@ -4998,8 +4950,8 @@ local.get $0 i32.load offset=8 call $~lib/rt/pure/__retain - local.set $3 - local.get $3 + local.set $5 + local.get $5 local.get $0 local.get $0 i32.load offset=16 @@ -5011,11 +4963,11 @@ i32.const 12 i32.mul i32.add - local.set $5 - local.get $5 + local.set $4 + local.get $4 local.get $1 i32.store - local.get $5 + local.get $4 local.get $2 i32.store offset=4 local.get $0 @@ -5026,7 +4978,7 @@ i32.store offset=20 local.get $0 i32.load - local.get $4 + local.get $3 local.get $0 i32.load offset=4 i32.and @@ -5034,14 +4986,14 @@ i32.mul i32.add local.set $6 - local.get $5 + local.get $4 local.get $6 i32.load i32.store offset=8 local.get $6 - local.get $5 + local.get $4 i32.store - local.get $3 + local.get $5 call $~lib/rt/pure/__release end local.get $0 @@ -5062,30 +5014,11 @@ (local $5 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.6 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 4 - i32.le_u - drop - local.get $2 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.6 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 0 @@ -5095,8 +5028,8 @@ drop i32.const 0 drop - local.get $3 - local.get $3 + local.get $2 + local.get $2 i32.load offset=8 i32.const 1 i32.or @@ -5111,16 +5044,16 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.const 1 i32.add i32.const 4 - local.tee $2 + local.tee $4 local.get $0 i32.load offset=20 local.tee $5 - local.get $2 + local.get $4 local.get $5 i32.gt_u select @@ -5140,7 +5073,7 @@ end if local.get $0 - local.get $4 + local.get $3 call $~lib/map/Map#rehash end i32.const 1 @@ -5738,6 +5671,73 @@ i32.store offset=20 local.get $0 ) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 1 + i32.const 4 + i32.le_u + drop + local.get $0 + i32.const 255 + i32.and + local.set $2 + i32.const 1 + local.set $1 + i32.const 0 + i32.const 374761393 + i32.add + local.get $1 + i32.add + local.set $3 + local.get $3 + local.get $2 + i32.const -1028477379 + i32.mul + i32.add + local.set $3 + local.get $3 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 15 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -2048144777 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 13 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -1028477379 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 16 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + return + ) (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) @@ -5791,28 +5791,10 @@ i32.const 0 ) (func $~lib/map/Map#has (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 4 - i32.le_u - drop - local.get $2 - i32.const 255 - i32.and - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.0 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne @@ -5892,23 +5874,8 @@ local.get $10 i32.load offset=4 i32.store offset=4 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 4 - i32.le_u - drop - local.get $13 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -5991,36 +5958,19 @@ (local $4 i32) (local $5 i32) (local $6 i32) - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 4 - i32.le_u - drop - local.get $3 - i32.const 255 - i32.and - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $4 + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 local.get $1 - local.get $4 + local.get $3 call $~lib/map/Map#find - local.set $5 - local.get $5 + local.set $4 + local.get $4 if i32.const 0 drop - local.get $5 + local.get $4 local.get $2 i32.store offset=4 else @@ -6056,8 +6006,8 @@ local.get $0 i32.load offset=8 call $~lib/rt/pure/__retain - local.set $3 - local.get $3 + local.set $5 + local.get $5 local.get $0 local.get $0 i32.load offset=16 @@ -6069,11 +6019,11 @@ i32.const 12 i32.mul i32.add - local.set $5 - local.get $5 + local.set $4 + local.get $4 local.get $1 i32.store8 - local.get $5 + local.get $4 local.get $2 i32.store offset=4 local.get $0 @@ -6084,7 +6034,7 @@ i32.store offset=20 local.get $0 i32.load - local.get $4 + local.get $3 local.get $0 i32.load offset=4 i32.and @@ -6092,14 +6042,14 @@ i32.mul i32.add local.set $6 - local.get $5 + local.get $4 local.get $6 i32.load i32.store offset=8 local.get $6 - local.get $5 + local.get $4 i32.store - local.get $3 + local.get $5 call $~lib/rt/pure/__release end local.get $0 @@ -6107,31 +6057,13 @@ ) (func $~lib/map/Map#get (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 4 - i32.le_u - drop - local.get $2 - i32.const 255 - i32.and - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.3 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 384 @@ -6141,7 +6073,7 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $2 i32.load offset=4 ) (func $~lib/map/Map#get:size (param $0 i32) (result i32) @@ -6621,23 +6553,8 @@ local.get $10 i32.load8_u offset=1 i32.store8 offset=1 - block $~lib/util/hash/HASH|inlined.5 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 4 - i32.le_u - drop - local.get $13 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.5 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -6720,36 +6637,19 @@ (local $4 i32) (local $5 i32) (local $6 i32) - block $~lib/util/hash/HASH|inlined.4 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 4 - i32.le_u - drop - local.get $3 - i32.const 255 - i32.and - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.4 - end - local.set $4 + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 local.get $1 - local.get $4 + local.get $3 call $~lib/map/Map#find - local.set $5 - local.get $5 + local.set $4 + local.get $4 if i32.const 0 drop - local.get $5 + local.get $4 local.get $2 i32.store8 offset=1 else @@ -6785,8 +6685,8 @@ local.get $0 i32.load offset=8 call $~lib/rt/pure/__retain - local.set $3 - local.get $3 + local.set $5 + local.get $5 local.get $0 local.get $0 i32.load offset=16 @@ -6798,11 +6698,11 @@ i32.const 8 i32.mul i32.add - local.set $5 - local.get $5 + local.set $4 + local.get $4 local.get $1 i32.store8 - local.get $5 + local.get $4 local.get $2 i32.store8 offset=1 local.get $0 @@ -6813,7 +6713,7 @@ i32.store offset=20 local.get $0 i32.load - local.get $4 + local.get $3 local.get $0 i32.load offset=4 i32.and @@ -6821,14 +6721,14 @@ i32.mul i32.add local.set $6 - local.get $5 + local.get $4 local.get $6 i32.load i32.store offset=4 local.get $6 - local.get $5 + local.get $4 i32.store - local.get $3 + local.get $5 call $~lib/rt/pure/__release end local.get $0 @@ -6845,28 +6745,11 @@ (local $5 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.6 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 4 - i32.le_u - drop - local.get $2 - i32.const 255 - i32.and - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.6 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 0 @@ -6876,8 +6759,8 @@ drop i32.const 0 drop - local.get $3 - local.get $3 + local.get $2 + local.get $2 i32.load offset=8 i32.const 1 i32.or @@ -6892,16 +6775,16 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.const 1 i32.add i32.const 4 - local.tee $2 + local.tee $4 local.get $0 i32.load offset=20 local.tee $5 - local.get $2 + local.get $4 local.get $5 i32.gt_u select @@ -6921,7 +6804,7 @@ end if local.get $0 - local.get $4 + local.get $3 call $~lib/map/Map#rehash end i32.const 1 @@ -7497,6 +7380,75 @@ i32.store offset=20 local.get $0 ) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 2 + i32.const 4 + i32.le_u + drop + local.get $0 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + local.set $2 + i32.const 2 + local.set $1 + i32.const 0 + i32.const 374761393 + i32.add + local.get $1 + i32.add + local.set $3 + local.get $3 + local.get $2 + i32.const -1028477379 + i32.mul + i32.add + local.set $3 + local.get $3 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 15 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -2048144777 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 13 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -1028477379 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 16 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + return + ) (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) @@ -7552,30 +7504,10 @@ i32.const 0 ) (func $~lib/map/Map#has (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 4 - i32.le_u - drop - local.get $2 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.0 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne @@ -7655,23 +7587,8 @@ local.get $10 i32.load offset=4 i32.store offset=4 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 4 - i32.le_u - drop - local.get $13 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -7754,38 +7671,19 @@ (local $4 i32) (local $5 i32) (local $6 i32) - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 4 - i32.le_u - drop - local.get $3 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $4 + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 local.get $1 - local.get $4 + local.get $3 call $~lib/map/Map#find - local.set $5 - local.get $5 + local.set $4 + local.get $4 if i32.const 0 drop - local.get $5 + local.get $4 local.get $2 i32.store offset=4 else @@ -7821,8 +7719,8 @@ local.get $0 i32.load offset=8 call $~lib/rt/pure/__retain - local.set $3 - local.get $3 + local.set $5 + local.get $5 local.get $0 local.get $0 i32.load offset=16 @@ -7834,11 +7732,11 @@ i32.const 12 i32.mul i32.add - local.set $5 - local.get $5 + local.set $4 + local.get $4 local.get $1 i32.store16 - local.get $5 + local.get $4 local.get $2 i32.store offset=4 local.get $0 @@ -7849,7 +7747,7 @@ i32.store offset=20 local.get $0 i32.load - local.get $4 + local.get $3 local.get $0 i32.load offset=4 i32.and @@ -7857,14 +7755,14 @@ i32.mul i32.add local.set $6 - local.get $5 + local.get $4 local.get $6 i32.load i32.store offset=8 local.get $6 - local.get $5 + local.get $4 i32.store - local.get $3 + local.get $5 call $~lib/rt/pure/__release end local.get $0 @@ -7872,33 +7770,13 @@ ) (func $~lib/map/Map#get (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 4 - i32.le_u - drop - local.get $2 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.3 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 384 @@ -7908,7 +7786,7 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $2 i32.load offset=4 ) (func $~lib/map/Map#get:size (param $0 i32) (result i32) @@ -8390,23 +8268,8 @@ local.get $10 i32.load16_s offset=2 i32.store16 offset=2 - block $~lib/util/hash/HASH|inlined.5 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 4 - i32.le_u - drop - local.get $13 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.5 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -8489,38 +8352,19 @@ (local $4 i32) (local $5 i32) (local $6 i32) - block $~lib/util/hash/HASH|inlined.4 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 4 - i32.le_u - drop - local.get $3 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.4 - end - local.set $4 + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 local.get $1 - local.get $4 + local.get $3 call $~lib/map/Map#find - local.set $5 - local.get $5 + local.set $4 + local.get $4 if i32.const 0 drop - local.get $5 + local.get $4 local.get $2 i32.store16 offset=2 else @@ -8556,8 +8400,8 @@ local.get $0 i32.load offset=8 call $~lib/rt/pure/__retain - local.set $3 - local.get $3 + local.set $5 + local.get $5 local.get $0 local.get $0 i32.load offset=16 @@ -8569,11 +8413,11 @@ i32.const 8 i32.mul i32.add - local.set $5 - local.get $5 + local.set $4 + local.get $4 local.get $1 i32.store16 - local.get $5 + local.get $4 local.get $2 i32.store16 offset=2 local.get $0 @@ -8584,7 +8428,7 @@ i32.store offset=20 local.get $0 i32.load - local.get $4 + local.get $3 local.get $0 i32.load offset=4 i32.and @@ -8592,14 +8436,14 @@ i32.mul i32.add local.set $6 - local.get $5 + local.get $4 local.get $6 i32.load i32.store offset=4 local.get $6 - local.get $5 + local.get $4 i32.store - local.get $3 + local.get $5 call $~lib/rt/pure/__release end local.get $0 @@ -8616,30 +8460,11 @@ (local $5 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.6 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 4 - i32.le_u - drop - local.get $2 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.6 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 0 @@ -8649,8 +8474,8 @@ drop i32.const 0 drop - local.get $3 - local.get $3 + local.get $2 + local.get $2 i32.load offset=8 i32.const 1 i32.or @@ -8665,16 +8490,16 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.const 1 i32.add i32.const 4 - local.tee $2 + local.tee $4 local.get $0 i32.load offset=20 local.tee $5 - local.get $2 + local.get $4 local.get $5 i32.gt_u select @@ -8694,7 +8519,7 @@ end if local.get $0 - local.get $4 + local.get $3 call $~lib/map/Map#rehash end i32.const 1 @@ -9292,6 +9117,73 @@ i32.store offset=20 local.get $0 ) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 2 + i32.const 4 + i32.le_u + drop + local.get $0 + i32.const 65535 + i32.and + local.set $2 + i32.const 2 + local.set $1 + i32.const 0 + i32.const 374761393 + i32.add + local.get $1 + i32.add + local.set $3 + local.get $3 + local.get $2 + i32.const -1028477379 + i32.mul + i32.add + local.set $3 + local.get $3 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 15 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -2048144777 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 13 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -1028477379 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 16 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + return + ) (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) @@ -9345,28 +9237,10 @@ i32.const 0 ) (func $~lib/map/Map#has (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 4 - i32.le_u - drop - local.get $2 - i32.const 65535 - i32.and - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.0 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne @@ -9446,23 +9320,8 @@ local.get $10 i32.load offset=4 i32.store offset=4 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 4 - i32.le_u - drop - local.get $13 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -9545,36 +9404,19 @@ (local $4 i32) (local $5 i32) (local $6 i32) - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 4 - i32.le_u - drop - local.get $3 - i32.const 65535 - i32.and - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $4 + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 local.get $1 - local.get $4 + local.get $3 call $~lib/map/Map#find - local.set $5 - local.get $5 + local.set $4 + local.get $4 if i32.const 0 drop - local.get $5 + local.get $4 local.get $2 i32.store offset=4 else @@ -9610,8 +9452,8 @@ local.get $0 i32.load offset=8 call $~lib/rt/pure/__retain - local.set $3 - local.get $3 + local.set $5 + local.get $5 local.get $0 local.get $0 i32.load offset=16 @@ -9623,11 +9465,11 @@ i32.const 12 i32.mul i32.add - local.set $5 - local.get $5 + local.set $4 + local.get $4 local.get $1 i32.store16 - local.get $5 + local.get $4 local.get $2 i32.store offset=4 local.get $0 @@ -9638,7 +9480,7 @@ i32.store offset=20 local.get $0 i32.load - local.get $4 + local.get $3 local.get $0 i32.load offset=4 i32.and @@ -9646,14 +9488,14 @@ i32.mul i32.add local.set $6 - local.get $5 + local.get $4 local.get $6 i32.load i32.store offset=8 local.get $6 - local.get $5 + local.get $4 i32.store - local.get $3 + local.get $5 call $~lib/rt/pure/__release end local.get $0 @@ -9661,31 +9503,13 @@ ) (func $~lib/map/Map#get (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 4 - i32.le_u - drop - local.get $2 - i32.const 65535 - i32.and - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.3 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 384 @@ -9695,7 +9519,7 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $2 i32.load offset=4 ) (func $~lib/map/Map#get:size (param $0 i32) (result i32) @@ -10175,23 +9999,8 @@ local.get $10 i32.load16_u offset=2 i32.store16 offset=2 - block $~lib/util/hash/HASH|inlined.5 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 4 - i32.le_u - drop - local.get $13 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.5 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -10274,36 +10083,19 @@ (local $4 i32) (local $5 i32) (local $6 i32) - block $~lib/util/hash/HASH|inlined.4 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 4 - i32.le_u - drop - local.get $3 - i32.const 65535 - i32.and - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.4 - end - local.set $4 + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 local.get $1 - local.get $4 + local.get $3 call $~lib/map/Map#find - local.set $5 - local.get $5 + local.set $4 + local.get $4 if i32.const 0 drop - local.get $5 + local.get $4 local.get $2 i32.store16 offset=2 else @@ -10339,8 +10131,8 @@ local.get $0 i32.load offset=8 call $~lib/rt/pure/__retain - local.set $3 - local.get $3 + local.set $5 + local.get $5 local.get $0 local.get $0 i32.load offset=16 @@ -10352,11 +10144,11 @@ i32.const 8 i32.mul i32.add - local.set $5 - local.get $5 + local.set $4 + local.get $4 local.get $1 i32.store16 - local.get $5 + local.get $4 local.get $2 i32.store16 offset=2 local.get $0 @@ -10367,7 +10159,7 @@ i32.store offset=20 local.get $0 i32.load - local.get $4 + local.get $3 local.get $0 i32.load offset=4 i32.and @@ -10375,14 +10167,14 @@ i32.mul i32.add local.set $6 - local.get $5 + local.get $4 local.get $6 i32.load i32.store offset=4 local.get $6 - local.get $5 + local.get $4 i32.store - local.get $3 + local.get $5 call $~lib/rt/pure/__release end local.get $0 @@ -10399,28 +10191,11 @@ (local $5 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.6 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 4 - i32.le_u - drop - local.get $2 - i32.const 65535 - i32.and - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.6 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 0 @@ -10430,8 +10205,8 @@ drop i32.const 0 drop - local.get $3 - local.get $3 + local.get $2 + local.get $2 i32.load offset=8 i32.const 1 i32.or @@ -10446,16 +10221,16 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.const 1 i32.add i32.const 4 - local.tee $2 + local.tee $4 local.get $0 i32.load offset=20 local.tee $5 - local.get $2 + local.get $4 local.get $5 i32.gt_u select @@ -10475,7 +10250,7 @@ end if local.get $0 - local.get $4 + local.get $3 call $~lib/map/Map#rehash end i32.const 1 @@ -11012,55 +10787,23 @@ call $~lib/rt/pure/__release ) (func $~lib/map/Map#has (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 4 - i32.le_u - drop - local.get $2 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne ) (func $~lib/map/Map#get (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 4 - i32.le_u - drop - local.get $2 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.3 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 384 @@ -11070,7 +10813,7 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $2 i32.load offset=4 ) (func $~lib/map/Map#keys (param $0 i32) (result i32) @@ -11214,26 +10957,11 @@ (local $5 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.4 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 4 - i32.le_u - drop - local.get $2 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.4 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 0 @@ -11243,8 +10971,8 @@ drop i32.const 0 drop - local.get $3 - local.get $3 + local.get $2 + local.get $2 i32.load offset=8 i32.const 1 i32.or @@ -11259,16 +10987,16 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.const 1 i32.add i32.const 4 - local.tee $2 + local.tee $4 local.get $0 i32.load offset=20 local.tee $5 - local.get $2 + local.get $4 local.get $5 i32.gt_u select @@ -11288,7 +11016,7 @@ end if local.get $0 - local.get $4 + local.get $3 call $~lib/map/Map#rehash end i32.const 1 @@ -11840,49 +11568,114 @@ i32.store offset=20 local.get $0 ) - (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.get $2 + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 4 + i32.const 4 + i32.le_u + drop local.get $0 - i32.load offset=4 - i32.and + local.set $2 i32.const 4 + local.set $1 + i32.const 0 + i32.const 374761393 + i32.add + local.get $1 + i32.add + local.set $3 + local.get $3 + local.get $2 + i32.const -1028477379 i32.mul i32.add - i32.load local.set $3 - loop $while-continue|0 - local.get $3 - local.set $4 - local.get $4 - if - local.get $3 - i32.load offset=8 - local.set $5 - local.get $5 - i32.const 1 - i32.and - i32.eqz - if (result i32) - local.get $3 - i32.load - local.get $1 - i32.eq - else - i32.const 0 - end - if - local.get $3 - return - end - local.get $5 - i32.const 1 - i32.const -1 - i32.xor + local.get $3 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 15 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -2048144777 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 13 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -1028477379 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 16 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + return + ) + (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + i32.load + local.get $2 + local.get $0 + i32.load offset=4 + i32.and + i32.const 4 + i32.mul + i32.add + i32.load + local.set $3 + loop $while-continue|0 + local.get $3 + local.set $4 + local.get $4 + if + local.get $3 + i32.load offset=8 + local.set $5 + local.get $5 + i32.const 1 + i32.and + i32.eqz + if (result i32) + local.get $3 + i32.load + local.get $1 + i32.eq + else + i32.const 0 + end + if + local.get $3 + return + end + local.get $5 + i32.const 1 + i32.const -1 + i32.xor i32.and local.set $3 br $while-continue|0 @@ -11891,26 +11684,10 @@ i32.const 0 ) (func $~lib/map/Map#has (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 4 - i32.le_u - drop - local.get $2 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.0 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne @@ -11990,23 +11767,8 @@ local.get $10 i32.load offset=4 i32.store offset=4 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 4 - i32.le_u - drop - local.get $13 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -12089,34 +11851,19 @@ (local $4 i32) (local $5 i32) (local $6 i32) - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 4 - i32.le_u - drop - local.get $3 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $4 + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 local.get $1 - local.get $4 + local.get $3 call $~lib/map/Map#find - local.set $5 - local.get $5 + local.set $4 + local.get $4 if i32.const 0 drop - local.get $5 + local.get $4 local.get $2 i32.store offset=4 else @@ -12152,8 +11899,8 @@ local.get $0 i32.load offset=8 call $~lib/rt/pure/__retain - local.set $3 - local.get $3 + local.set $5 + local.get $5 local.get $0 local.get $0 i32.load offset=16 @@ -12165,11 +11912,11 @@ i32.const 12 i32.mul i32.add - local.set $5 - local.get $5 + local.set $4 + local.get $4 local.get $1 i32.store - local.get $5 + local.get $4 local.get $2 i32.store offset=4 local.get $0 @@ -12180,7 +11927,7 @@ i32.store offset=20 local.get $0 i32.load - local.get $4 + local.get $3 local.get $0 i32.load offset=4 i32.and @@ -12188,14 +11935,14 @@ i32.mul i32.add local.set $6 - local.get $5 + local.get $4 local.get $6 i32.load i32.store offset=8 local.get $6 - local.get $5 + local.get $4 i32.store - local.get $3 + local.get $5 call $~lib/rt/pure/__release end local.get $0 @@ -12203,29 +11950,13 @@ ) (func $~lib/map/Map#get (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 4 - i32.le_u - drop - local.get $2 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.3 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 384 @@ -12235,7 +11966,7 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $2 i32.load offset=4 ) (func $~lib/map/Map#get:size (param $0 i32) (result i32) @@ -12713,23 +12444,8 @@ local.get $10 i32.load offset=4 i32.store offset=4 - block $~lib/util/hash/HASH|inlined.5 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 4 - i32.le_u - drop - local.get $13 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.5 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -12812,34 +12528,19 @@ (local $4 i32) (local $5 i32) (local $6 i32) - block $~lib/util/hash/HASH|inlined.4 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 4 - i32.le_u - drop - local.get $3 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.4 - end - local.set $4 + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 local.get $1 - local.get $4 + local.get $3 call $~lib/map/Map#find - local.set $5 - local.get $5 + local.set $4 + local.get $4 if i32.const 0 drop - local.get $5 + local.get $4 local.get $2 i32.store offset=4 else @@ -12875,8 +12576,8 @@ local.get $0 i32.load offset=8 call $~lib/rt/pure/__retain - local.set $3 - local.get $3 + local.set $5 + local.get $5 local.get $0 local.get $0 i32.load offset=16 @@ -12888,11 +12589,11 @@ i32.const 12 i32.mul i32.add - local.set $5 - local.get $5 + local.set $4 + local.get $4 local.get $1 i32.store - local.get $5 + local.get $4 local.get $2 i32.store offset=4 local.get $0 @@ -12903,7 +12604,7 @@ i32.store offset=20 local.get $0 i32.load - local.get $4 + local.get $3 local.get $0 i32.load offset=4 i32.and @@ -12911,14 +12612,14 @@ i32.mul i32.add local.set $6 - local.get $5 + local.get $4 local.get $6 i32.load i32.store offset=8 local.get $6 - local.get $5 + local.get $4 i32.store - local.get $3 + local.get $5 call $~lib/rt/pure/__release end local.get $0 @@ -12935,26 +12636,11 @@ (local $5 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.6 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 4 - i32.le_u - drop - local.get $2 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.6 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 0 @@ -12964,8 +12650,8 @@ drop i32.const 0 drop - local.get $3 - local.get $3 + local.get $2 + local.get $2 i32.load offset=8 i32.const 1 i32.or @@ -12980,16 +12666,16 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.const 1 i32.add i32.const 4 - local.tee $2 + local.tee $4 local.get $0 i32.load offset=20 local.tee $5 - local.get $2 + local.get $4 local.get $5 i32.gt_u select @@ -13009,7 +12695,7 @@ end if local.get $0 - local.get $4 + local.get $3 call $~lib/map/Map#rehash end i32.const 1 @@ -13561,67 +13247,87 @@ i32.store offset=20 local.get $0 ) - (func $~lib/util/hash/hash64 (param $0 i64) (result i32) - (local $1 i32) + (func $~lib/util/hash/HASH (param $0 i64) (result i32) + (local $1 i64) + (local $2 i32) i32.const 0 - i32.const 374761393 - i32.add - local.set $1 - local.get $1 - local.get $0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 8 + i32.const 4 + i32.le_u + drop + i32.const 8 + i32.const 8 + i32.eq + drop + local.get $0 + local.set $1 + i32.const 0 + i32.const 374761393 + i32.add + i32.const 8 + i32.add + local.set $2 + local.get $2 + local.get $1 i32.wrap_i64 i32.const -1028477379 i32.mul i32.add - local.set $1 - local.get $1 + local.set $2 + local.get $2 i32.const 17 i32.rotl i32.const 668265263 i32.mul - local.set $1 + local.set $2 + local.get $2 local.get $1 - local.get $0 i64.const 32 i64.shr_u i32.wrap_i64 i32.const -1028477379 i32.mul i32.add - local.set $1 - local.get $1 + local.set $2 + local.get $2 i32.const 17 i32.rotl i32.const 668265263 i32.mul - local.set $1 - local.get $1 - local.get $1 + local.set $2 + local.get $2 + local.get $2 i32.const 15 i32.shr_u i32.xor - local.set $1 - local.get $1 + local.set $2 + local.get $2 i32.const -2048144777 i32.mul - local.set $1 - local.get $1 - local.get $1 + local.set $2 + local.get $2 + local.get $2 i32.const 13 i32.shr_u i32.xor - local.set $1 - local.get $1 + local.set $2 + local.get $2 i32.const -1028477379 i32.mul - local.set $1 - local.get $1 - local.get $1 + local.set $2 + local.get $2 + local.get $2 i32.const 16 i32.shr_u i32.xor - local.set $1 - local.get $1 + local.set $2 + local.get $2 + return ) (func $~lib/map/Map#find (param $0 i32) (param $1 i64) (param $2 i32) (result i32) (local $3 i32) @@ -13674,30 +13380,10 @@ i32.const 0 ) (func $~lib/map/Map#has (param $0 i32) (param $1 i64) (result i32) - (local $2 i64) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 4 - i32.le_u - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.0 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne @@ -13714,9 +13400,8 @@ (local $10 i32) (local $11 i32) (local $12 i64) - (local $13 i64) + (local $13 i32) (local $14 i32) - (local $15 i32) local.get $1 i32.const 1 i32.add @@ -13778,41 +13463,22 @@ local.get $10 i32.load offset=8 i32.store offset=8 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 4 - i32.le_u - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $13 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and - local.set $14 + local.set $13 local.get $3 - local.get $14 + local.get $13 i32.const 4 i32.mul i32.add - local.set $15 + local.set $14 local.get $11 - local.get $15 + local.get $14 i32.load i32.store offset=12 - local.get $15 + local.get $14 local.get $8 i32.store local.get $8 @@ -13830,28 +13496,28 @@ local.get $0 local.tee $11 local.get $3 - local.tee $14 + local.tee $13 local.get $11 i32.load local.tee $9 i32.ne if - local.get $14 + local.get $13 call $~lib/rt/pure/__retain - local.set $14 + local.set $13 local.get $9 call $~lib/rt/pure/__release end - local.get $14 + local.get $13 i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.tee $15 + local.tee $14 local.get $5 local.tee $9 - local.get $15 + local.get $14 i32.load offset=8 local.tee $11 i32.ne @@ -13877,43 +13543,23 @@ call $~lib/rt/pure/__release ) (func $~lib/map/Map#set (param $0 i32) (param $1 i64) (param $2 i32) (result i32) - (local $3 i64) + (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 4 - i32.le_u - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $3 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $4 + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 local.get $1 - local.get $4 + local.get $3 call $~lib/map/Map#find - local.set $5 - local.get $5 + local.set $4 + local.get $4 if i32.const 0 drop - local.get $5 + local.get $4 local.get $2 i32.store offset=8 else @@ -13949,24 +13595,24 @@ local.get $0 i32.load offset=8 call $~lib/rt/pure/__retain - local.set $6 - local.get $6 + local.set $5 + local.get $5 local.get $0 local.get $0 i32.load offset=16 - local.tee $7 + local.tee $6 i32.const 1 i32.add i32.store offset=16 - local.get $7 + local.get $6 i32.const 16 i32.mul i32.add - local.set $5 - local.get $5 + local.set $4 + local.get $4 local.get $1 i64.store - local.get $5 + local.get $4 local.get $2 i32.store offset=8 local.get $0 @@ -13977,56 +13623,36 @@ i32.store offset=20 local.get $0 i32.load - local.get $4 + local.get $3 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $7 - local.get $5 - local.get $7 + local.set $6 + local.get $4 + local.get $6 i32.load i32.store offset=12 - local.get $7 - local.get $5 - i32.store local.get $6 + local.get $4 + i32.store + local.get $5 call $~lib/rt/pure/__release end local.get $0 call $~lib/rt/pure/__retain ) (func $~lib/map/Map#get (param $0 i32) (param $1 i64) (result i32) - (local $2 i64) - (local $3 i32) + (local $2 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 4 - i32.le_u - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.3 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 384 @@ -14036,7 +13662,7 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $2 i32.load offset=8 ) (func $~lib/map/Map#get:size (param $0 i32) (result i32) @@ -14451,9 +14077,8 @@ (local $10 i32) (local $11 i32) (local $12 i64) - (local $13 i64) + (local $13 i32) (local $14 i32) - (local $15 i32) local.get $1 i32.const 1 i32.add @@ -14515,41 +14140,22 @@ local.get $10 i64.load offset=8 i64.store offset=8 - block $~lib/util/hash/HASH|inlined.5 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 4 - i32.le_u - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $13 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.5 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and - local.set $14 + local.set $13 local.get $3 - local.get $14 + local.get $13 i32.const 4 i32.mul i32.add - local.set $15 + local.set $14 local.get $11 - local.get $15 + local.get $14 i32.load i32.store offset=16 - local.get $15 + local.get $14 local.get $8 i32.store local.get $8 @@ -14567,28 +14173,28 @@ local.get $0 local.tee $11 local.get $3 - local.tee $14 + local.tee $13 local.get $11 i32.load local.tee $9 i32.ne if - local.get $14 + local.get $13 call $~lib/rt/pure/__retain - local.set $14 + local.set $13 local.get $9 call $~lib/rt/pure/__release end - local.get $14 + local.get $13 i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.tee $15 + local.tee $14 local.get $5 local.tee $9 - local.get $15 + local.get $14 i32.load offset=8 local.tee $11 i32.ne @@ -14614,43 +14220,23 @@ call $~lib/rt/pure/__release ) (func $~lib/map/Map#set (param $0 i32) (param $1 i64) (param $2 i64) (result i32) - (local $3 i64) + (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - block $~lib/util/hash/HASH|inlined.4 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 4 - i32.le_u - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $3 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.4 - end - local.set $4 + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 local.get $1 - local.get $4 + local.get $3 call $~lib/map/Map#find - local.set $5 - local.get $5 + local.set $4 + local.get $4 if i32.const 0 drop - local.get $5 + local.get $4 local.get $2 i64.store offset=8 else @@ -14686,24 +14272,24 @@ local.get $0 i32.load offset=8 call $~lib/rt/pure/__retain - local.set $6 - local.get $6 + local.set $5 + local.get $5 local.get $0 local.get $0 i32.load offset=16 - local.tee $7 + local.tee $6 i32.const 1 i32.add i32.store offset=16 - local.get $7 + local.get $6 i32.const 24 i32.mul i32.add - local.set $5 - local.get $5 + local.set $4 + local.get $4 local.get $1 i64.store - local.get $5 + local.get $4 local.get $2 i64.store offset=8 local.get $0 @@ -14714,22 +14300,22 @@ i32.store offset=20 local.get $0 i32.load - local.get $4 + local.get $3 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $7 - local.get $5 - local.get $7 + local.set $6 + local.get $4 + local.get $6 i32.load i32.store offset=16 - local.get $7 - local.get $5 - i32.store local.get $6 + local.get $4 + i32.store + local.get $5 call $~lib/rt/pure/__release end local.get $0 @@ -14740,37 +14326,17 @@ i32.load offset=20 ) (func $~lib/map/Map#delete (param $0 i32) (param $1 i64) (result i32) - (local $2 i64) + (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.6 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 4 - i32.le_u - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.6 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 0 @@ -14780,8 +14346,8 @@ drop i32.const 0 drop - local.get $3 - local.get $3 + local.get $2 + local.get $2 i32.load offset=12 i32.const 1 i32.or @@ -14796,17 +14362,17 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.const 1 i32.add i32.const 4 - local.tee $5 + local.tee $4 local.get $0 i32.load offset=20 - local.tee $6 + local.tee $5 + local.get $4 local.get $5 - local.get $6 i32.gt_u select i32.ge_u @@ -14825,7 +14391,7 @@ end if local.get $0 - local.get $4 + local.get $3 call $~lib/map/Map#rehash end i32.const 1 @@ -15385,6 +14951,88 @@ i32.store offset=20 local.get $0 ) + (func $~lib/util/hash/HASH (param $0 i64) (result i32) + (local $1 i64) + (local $2 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 8 + i32.const 4 + i32.le_u + drop + i32.const 8 + i32.const 8 + i32.eq + drop + local.get $0 + local.set $1 + i32.const 0 + i32.const 374761393 + i32.add + i32.const 8 + i32.add + local.set $2 + local.get $2 + local.get $1 + i32.wrap_i64 + i32.const -1028477379 + i32.mul + i32.add + local.set $2 + local.get $2 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $2 + local.get $2 + local.get $1 + i64.const 32 + i64.shr_u + i32.wrap_i64 + i32.const -1028477379 + i32.mul + i32.add + local.set $2 + local.get $2 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 15 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + i32.const -2048144777 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 13 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + i32.const -1028477379 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 16 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + return + ) (func $~lib/map/Map#find (param $0 i32) (param $1 i64) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) @@ -15436,30 +15084,10 @@ i32.const 0 ) (func $~lib/map/Map#has (param $0 i32) (param $1 i64) (result i32) - (local $2 i64) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 4 - i32.le_u - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.0 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne @@ -15476,9 +15104,8 @@ (local $10 i32) (local $11 i32) (local $12 i64) - (local $13 i64) + (local $13 i32) (local $14 i32) - (local $15 i32) local.get $1 i32.const 1 i32.add @@ -15540,41 +15167,22 @@ local.get $10 i32.load offset=8 i32.store offset=8 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 4 - i32.le_u - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $13 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and - local.set $14 + local.set $13 local.get $3 - local.get $14 + local.get $13 i32.const 4 i32.mul i32.add - local.set $15 + local.set $14 local.get $11 - local.get $15 + local.get $14 i32.load i32.store offset=12 - local.get $15 + local.get $14 local.get $8 i32.store local.get $8 @@ -15592,28 +15200,28 @@ local.get $0 local.tee $11 local.get $3 - local.tee $14 + local.tee $13 local.get $11 i32.load local.tee $9 i32.ne if - local.get $14 + local.get $13 call $~lib/rt/pure/__retain - local.set $14 + local.set $13 local.get $9 call $~lib/rt/pure/__release end - local.get $14 + local.get $13 i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.tee $15 + local.tee $14 local.get $5 local.tee $9 - local.get $15 + local.get $14 i32.load offset=8 local.tee $11 i32.ne @@ -15639,43 +15247,23 @@ call $~lib/rt/pure/__release ) (func $~lib/map/Map#set (param $0 i32) (param $1 i64) (param $2 i32) (result i32) - (local $3 i64) + (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 4 - i32.le_u - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $3 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $4 + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 local.get $1 - local.get $4 + local.get $3 call $~lib/map/Map#find - local.set $5 - local.get $5 + local.set $4 + local.get $4 if i32.const 0 drop - local.get $5 + local.get $4 local.get $2 i32.store offset=8 else @@ -15711,24 +15299,24 @@ local.get $0 i32.load offset=8 call $~lib/rt/pure/__retain - local.set $6 - local.get $6 + local.set $5 + local.get $5 local.get $0 local.get $0 i32.load offset=16 - local.tee $7 + local.tee $6 i32.const 1 i32.add i32.store offset=16 - local.get $7 + local.get $6 i32.const 16 i32.mul i32.add - local.set $5 - local.get $5 + local.set $4 + local.get $4 local.get $1 i64.store - local.get $5 + local.get $4 local.get $2 i32.store offset=8 local.get $0 @@ -15739,56 +15327,36 @@ i32.store offset=20 local.get $0 i32.load - local.get $4 + local.get $3 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $7 - local.get $5 - local.get $7 + local.set $6 + local.get $4 + local.get $6 i32.load i32.store offset=12 - local.get $7 - local.get $5 - i32.store local.get $6 + local.get $4 + i32.store + local.get $5 call $~lib/rt/pure/__release end local.get $0 call $~lib/rt/pure/__retain - ) - (func $~lib/map/Map#get (param $0 i32) (param $1 i64) (result i32) - (local $2 i64) - (local $3 i32) - local.get $0 - local.get $1 - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 4 - i32.le_u - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.3 - end + ) + (func $~lib/map/Map#get (param $0 i32) (param $1 i64) (result i32) + (local $2 i32) + local.get $0 + local.get $1 + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 384 @@ -15798,7 +15366,7 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $2 i32.load offset=8 ) (func $~lib/map/Map#get:size (param $0 i32) (result i32) @@ -16213,9 +15781,8 @@ (local $10 i32) (local $11 i32) (local $12 i64) - (local $13 i64) + (local $13 i32) (local $14 i32) - (local $15 i32) local.get $1 i32.const 1 i32.add @@ -16277,41 +15844,22 @@ local.get $10 i64.load offset=8 i64.store offset=8 - block $~lib/util/hash/HASH|inlined.5 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 4 - i32.le_u - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $13 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.5 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and - local.set $14 + local.set $13 local.get $3 - local.get $14 + local.get $13 i32.const 4 i32.mul i32.add - local.set $15 + local.set $14 local.get $11 - local.get $15 + local.get $14 i32.load i32.store offset=16 - local.get $15 + local.get $14 local.get $8 i32.store local.get $8 @@ -16329,28 +15877,28 @@ local.get $0 local.tee $11 local.get $3 - local.tee $14 + local.tee $13 local.get $11 i32.load local.tee $9 i32.ne if - local.get $14 + local.get $13 call $~lib/rt/pure/__retain - local.set $14 + local.set $13 local.get $9 call $~lib/rt/pure/__release end - local.get $14 + local.get $13 i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.tee $15 + local.tee $14 local.get $5 local.tee $9 - local.get $15 + local.get $14 i32.load offset=8 local.tee $11 i32.ne @@ -16376,43 +15924,23 @@ call $~lib/rt/pure/__release ) (func $~lib/map/Map#set (param $0 i32) (param $1 i64) (param $2 i64) (result i32) - (local $3 i64) + (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - block $~lib/util/hash/HASH|inlined.4 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 4 - i32.le_u - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $3 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.4 - end - local.set $4 + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 local.get $1 - local.get $4 + local.get $3 call $~lib/map/Map#find - local.set $5 - local.get $5 + local.set $4 + local.get $4 if i32.const 0 drop - local.get $5 + local.get $4 local.get $2 i64.store offset=8 else @@ -16448,24 +15976,24 @@ local.get $0 i32.load offset=8 call $~lib/rt/pure/__retain - local.set $6 - local.get $6 + local.set $5 + local.get $5 local.get $0 local.get $0 i32.load offset=16 - local.tee $7 + local.tee $6 i32.const 1 i32.add i32.store offset=16 - local.get $7 + local.get $6 i32.const 24 i32.mul i32.add - local.set $5 - local.get $5 + local.set $4 + local.get $4 local.get $1 i64.store - local.get $5 + local.get $4 local.get $2 i64.store offset=8 local.get $0 @@ -16476,22 +16004,22 @@ i32.store offset=20 local.get $0 i32.load - local.get $4 + local.get $3 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $7 - local.get $5 - local.get $7 + local.set $6 + local.get $4 + local.get $6 i32.load i32.store offset=16 - local.get $7 - local.get $5 - i32.store local.get $6 + local.get $4 + i32.store + local.get $5 call $~lib/rt/pure/__release end local.get $0 @@ -16502,37 +16030,17 @@ i32.load offset=20 ) (func $~lib/map/Map#delete (param $0 i32) (param $1 i64) (result i32) - (local $2 i64) + (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.6 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 4 - i32.le_u - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.6 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 0 @@ -16542,8 +16050,8 @@ drop i32.const 0 drop - local.get $3 - local.get $3 + local.get $2 + local.get $2 i32.load offset=12 i32.const 1 i32.or @@ -16558,17 +16066,17 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.const 1 i32.add i32.const 4 - local.tee $5 + local.tee $4 local.get $0 i32.load offset=20 - local.tee $6 + local.tee $5 + local.get $4 local.get $5 - local.get $6 i32.gt_u select i32.ge_u @@ -16587,7 +16095,7 @@ end if local.get $0 - local.get $4 + local.get $3 call $~lib/map/Map#rehash end i32.const 1 @@ -17147,6 +16655,72 @@ i32.store offset=20 local.get $0 ) + (func $~lib/util/hash/HASH (param $0 f32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 1 + drop + i32.const 4 + i32.const 4 + i32.eq + drop + local.get $0 + i32.reinterpret_f32 + local.set $1 + i32.const 4 + local.set $2 + i32.const 0 + i32.const 374761393 + i32.add + local.get $2 + i32.add + local.set $3 + local.get $3 + local.get $1 + i32.const -1028477379 + i32.mul + i32.add + local.set $3 + local.get $3 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 15 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -2048144777 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 13 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -1028477379 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 16 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + return + ) (func $~lib/map/Map#find (param $0 i32) (param $1 f32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) @@ -17198,27 +16772,10 @@ i32.const 0 ) (func $~lib/map/Map#has (param $0 i32) (param $1 f32) (result i32) - (local $2 f32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.0 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne @@ -17235,9 +16792,8 @@ (local $10 i32) (local $11 i32) (local $12 f32) - (local $13 f32) + (local $13 i32) (local $14 i32) - (local $15 i32) local.get $1 i32.const 1 i32.add @@ -17299,38 +16855,22 @@ local.get $10 i32.load offset=4 i32.store offset=4 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $13 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and - local.set $14 + local.set $13 local.get $3 - local.get $14 + local.get $13 i32.const 4 i32.mul i32.add - local.set $15 + local.set $14 local.get $11 - local.get $15 + local.get $14 i32.load i32.store offset=8 - local.get $15 + local.get $14 local.get $8 i32.store local.get $8 @@ -17348,28 +16888,28 @@ local.get $0 local.tee $11 local.get $3 - local.tee $14 + local.tee $13 local.get $11 i32.load local.tee $9 i32.ne if - local.get $14 + local.get $13 call $~lib/rt/pure/__retain - local.set $14 + local.set $13 local.get $9 call $~lib/rt/pure/__release end - local.get $14 + local.get $13 i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.tee $15 + local.tee $14 local.get $5 local.tee $9 - local.get $15 + local.get $14 i32.load offset=8 local.tee $11 i32.ne @@ -17395,40 +16935,23 @@ call $~lib/rt/pure/__release ) (func $~lib/map/Map#set (param $0 i32) (param $1 f32) (param $2 i32) (result i32) - (local $3 f32) + (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $3 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $4 + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 local.get $1 - local.get $4 + local.get $3 call $~lib/map/Map#find - local.set $5 - local.get $5 + local.set $4 + local.get $4 if i32.const 0 drop - local.get $5 + local.get $4 local.get $2 i32.store offset=4 else @@ -17464,24 +16987,24 @@ local.get $0 i32.load offset=8 call $~lib/rt/pure/__retain - local.set $6 - local.get $6 + local.set $5 + local.get $5 local.get $0 local.get $0 i32.load offset=16 - local.tee $7 + local.tee $6 i32.const 1 i32.add i32.store offset=16 - local.get $7 + local.get $6 i32.const 12 i32.mul i32.add - local.set $5 - local.get $5 + local.set $4 + local.get $4 local.get $1 f32.store - local.get $5 + local.get $4 local.get $2 i32.store offset=4 local.get $0 @@ -17492,53 +17015,36 @@ i32.store offset=20 local.get $0 i32.load - local.get $4 + local.get $3 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $7 - local.get $5 - local.get $7 + local.set $6 + local.get $4 + local.get $6 i32.load i32.store offset=8 - local.get $7 - local.get $5 - i32.store local.get $6 + local.get $4 + i32.store + local.get $5 call $~lib/rt/pure/__release end local.get $0 call $~lib/rt/pure/__retain ) (func $~lib/map/Map#get (param $0 i32) (param $1 f32) (result i32) - (local $2 f32) - (local $3 i32) + (local $2 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.3 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 384 @@ -17548,7 +17054,7 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $2 i32.load offset=4 ) (func $~lib/map/Map#get:size (param $0 i32) (result i32) @@ -17963,9 +17469,8 @@ (local $10 i32) (local $11 i32) (local $12 f32) - (local $13 f32) + (local $13 i32) (local $14 i32) - (local $15 i32) local.get $1 i32.const 1 i32.add @@ -18027,38 +17532,22 @@ local.get $10 f32.load offset=4 f32.store offset=4 - block $~lib/util/hash/HASH|inlined.5 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $13 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.5 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and - local.set $14 + local.set $13 local.get $3 - local.get $14 + local.get $13 i32.const 4 i32.mul i32.add - local.set $15 + local.set $14 local.get $11 - local.get $15 + local.get $14 i32.load i32.store offset=8 - local.get $15 + local.get $14 local.get $8 i32.store local.get $8 @@ -18076,28 +17565,28 @@ local.get $0 local.tee $11 local.get $3 - local.tee $14 + local.tee $13 local.get $11 i32.load local.tee $9 i32.ne if - local.get $14 + local.get $13 call $~lib/rt/pure/__retain - local.set $14 + local.set $13 local.get $9 call $~lib/rt/pure/__release end - local.get $14 + local.get $13 i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.tee $15 + local.tee $14 local.get $5 local.tee $9 - local.get $15 + local.get $14 i32.load offset=8 local.tee $11 i32.ne @@ -18123,40 +17612,23 @@ call $~lib/rt/pure/__release ) (func $~lib/map/Map#set (param $0 i32) (param $1 f32) (param $2 f32) (result i32) - (local $3 f32) + (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - block $~lib/util/hash/HASH|inlined.4 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $3 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.4 - end - local.set $4 + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 local.get $1 - local.get $4 + local.get $3 call $~lib/map/Map#find - local.set $5 - local.get $5 + local.set $4 + local.get $4 if i32.const 0 drop - local.get $5 + local.get $4 local.get $2 f32.store offset=4 else @@ -18192,24 +17664,24 @@ local.get $0 i32.load offset=8 call $~lib/rt/pure/__retain - local.set $6 - local.get $6 + local.set $5 + local.get $5 local.get $0 local.get $0 i32.load offset=16 - local.tee $7 + local.tee $6 i32.const 1 i32.add i32.store offset=16 - local.get $7 + local.get $6 i32.const 12 i32.mul i32.add - local.set $5 - local.get $5 + local.set $4 + local.get $4 local.get $1 f32.store - local.get $5 + local.get $4 local.get $2 f32.store offset=4 local.get $0 @@ -18220,22 +17692,22 @@ i32.store offset=20 local.get $0 i32.load - local.get $4 + local.get $3 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $7 - local.get $5 - local.get $7 + local.set $6 + local.get $4 + local.get $6 i32.load i32.store offset=8 - local.get $7 - local.get $5 - i32.store local.get $6 + local.get $4 + i32.store + local.get $5 call $~lib/rt/pure/__release end local.get $0 @@ -18246,34 +17718,17 @@ i32.load offset=20 ) (func $~lib/map/Map#delete (param $0 i32) (param $1 f32) (result i32) - (local $2 f32) + (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.6 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.6 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 0 @@ -18283,8 +17738,8 @@ drop i32.const 0 drop - local.get $3 - local.get $3 + local.get $2 + local.get $2 i32.load offset=8 i32.const 1 i32.or @@ -18299,17 +17754,17 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.const 1 i32.add i32.const 4 - local.tee $5 + local.tee $4 local.get $0 i32.load offset=20 - local.tee $6 + local.tee $5 + local.get $4 local.get $5 - local.get $6 i32.gt_u select i32.ge_u @@ -18328,7 +17783,7 @@ end if local.get $0 - local.get $4 + local.get $3 call $~lib/map/Map#rehash end i32.const 1 @@ -18888,6 +18343,89 @@ i32.store offset=20 local.get $0 ) + (func $~lib/util/hash/HASH (param $0 f64) (result i32) + (local $1 i64) + (local $2 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 1 + drop + i32.const 8 + i32.const 4 + i32.eq + drop + i32.const 8 + i32.const 8 + i32.eq + drop + local.get $0 + i64.reinterpret_f64 + local.set $1 + i32.const 0 + i32.const 374761393 + i32.add + i32.const 8 + i32.add + local.set $2 + local.get $2 + local.get $1 + i32.wrap_i64 + i32.const -1028477379 + i32.mul + i32.add + local.set $2 + local.get $2 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $2 + local.get $2 + local.get $1 + i64.const 32 + i64.shr_u + i32.wrap_i64 + i32.const -1028477379 + i32.mul + i32.add + local.set $2 + local.get $2 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 15 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + i32.const -2048144777 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 13 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + i32.const -1028477379 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 16 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + return + ) (func $~lib/map/Map#find (param $0 i32) (param $1 f64) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) @@ -18939,31 +18477,10 @@ i32.const 0 ) (func $~lib/map/Map#has (param $0 i32) (param $1 f64) (result i32) - (local $2 f64) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.0 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne @@ -18980,9 +18497,8 @@ (local $10 i32) (local $11 i32) (local $12 f64) - (local $13 f64) + (local $13 i32) (local $14 i32) - (local $15 i32) local.get $1 i32.const 1 i32.add @@ -19044,42 +18560,22 @@ local.get $10 i32.load offset=8 i32.store offset=8 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $13 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and - local.set $14 + local.set $13 local.get $3 - local.get $14 + local.get $13 i32.const 4 i32.mul i32.add - local.set $15 + local.set $14 local.get $11 - local.get $15 + local.get $14 i32.load i32.store offset=12 - local.get $15 + local.get $14 local.get $8 i32.store local.get $8 @@ -19097,28 +18593,28 @@ local.get $0 local.tee $11 local.get $3 - local.tee $14 + local.tee $13 local.get $11 i32.load local.tee $9 i32.ne if - local.get $14 + local.get $13 call $~lib/rt/pure/__retain - local.set $14 + local.set $13 local.get $9 call $~lib/rt/pure/__release end - local.get $14 + local.get $13 i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.tee $15 + local.tee $14 local.get $5 local.tee $9 - local.get $15 + local.get $14 i32.load offset=8 local.tee $11 i32.ne @@ -19144,44 +18640,23 @@ call $~lib/rt/pure/__release ) (func $~lib/map/Map#set (param $0 i32) (param $1 f64) (param $2 i32) (result i32) - (local $3 f64) + (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $3 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $4 + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 local.get $1 - local.get $4 + local.get $3 call $~lib/map/Map#find - local.set $5 - local.get $5 + local.set $4 + local.get $4 if i32.const 0 drop - local.get $5 + local.get $4 local.get $2 i32.store offset=8 else @@ -19217,24 +18692,24 @@ local.get $0 i32.load offset=8 call $~lib/rt/pure/__retain - local.set $6 - local.get $6 + local.set $5 + local.get $5 local.get $0 local.get $0 i32.load offset=16 - local.tee $7 + local.tee $6 i32.const 1 i32.add i32.store offset=16 - local.get $7 + local.get $6 i32.const 16 i32.mul i32.add - local.set $5 - local.get $5 + local.set $4 + local.get $4 local.get $1 f64.store - local.get $5 + local.get $4 local.get $2 i32.store offset=8 local.get $0 @@ -19245,57 +18720,36 @@ i32.store offset=20 local.get $0 i32.load - local.get $4 + local.get $3 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $7 - local.get $5 - local.get $7 + local.set $6 + local.get $4 + local.get $6 i32.load i32.store offset=12 - local.get $7 - local.get $5 - i32.store local.get $6 + local.get $4 + i32.store + local.get $5 call $~lib/rt/pure/__release end local.get $0 call $~lib/rt/pure/__retain ) (func $~lib/map/Map#get (param $0 i32) (param $1 f64) (result i32) - (local $2 f64) - (local $3 i32) + (local $2 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.3 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 384 @@ -19305,7 +18759,7 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $2 i32.load offset=8 ) (func $~lib/map/Map#get:size (param $0 i32) (result i32) @@ -19720,9 +19174,8 @@ (local $10 i32) (local $11 i32) (local $12 f64) - (local $13 f64) + (local $13 i32) (local $14 i32) - (local $15 i32) local.get $1 i32.const 1 i32.add @@ -19784,42 +19237,22 @@ local.get $10 f64.load offset=8 f64.store offset=8 - block $~lib/util/hash/HASH|inlined.5 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $13 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.5 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and - local.set $14 + local.set $13 local.get $3 - local.get $14 + local.get $13 i32.const 4 i32.mul i32.add - local.set $15 + local.set $14 local.get $11 - local.get $15 + local.get $14 i32.load i32.store offset=16 - local.get $15 + local.get $14 local.get $8 i32.store local.get $8 @@ -19837,28 +19270,28 @@ local.get $0 local.tee $11 local.get $3 - local.tee $14 + local.tee $13 local.get $11 i32.load local.tee $9 i32.ne if - local.get $14 + local.get $13 call $~lib/rt/pure/__retain - local.set $14 + local.set $13 local.get $9 call $~lib/rt/pure/__release end - local.get $14 + local.get $13 i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.tee $15 + local.tee $14 local.get $5 local.tee $9 - local.get $15 + local.get $14 i32.load offset=8 local.tee $11 i32.ne @@ -19884,44 +19317,23 @@ call $~lib/rt/pure/__release ) (func $~lib/map/Map#set (param $0 i32) (param $1 f64) (param $2 f64) (result i32) - (local $3 f64) + (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - block $~lib/util/hash/HASH|inlined.4 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $3 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.4 - end - local.set $4 + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 local.get $1 - local.get $4 + local.get $3 call $~lib/map/Map#find - local.set $5 - local.get $5 + local.set $4 + local.get $4 if i32.const 0 drop - local.get $5 + local.get $4 local.get $2 f64.store offset=8 else @@ -19957,24 +19369,24 @@ local.get $0 i32.load offset=8 call $~lib/rt/pure/__retain - local.set $6 - local.get $6 + local.set $5 + local.get $5 local.get $0 local.get $0 i32.load offset=16 - local.tee $7 + local.tee $6 i32.const 1 i32.add i32.store offset=16 - local.get $7 + local.get $6 i32.const 24 i32.mul i32.add - local.set $5 - local.get $5 + local.set $4 + local.get $4 local.get $1 f64.store - local.get $5 + local.get $4 local.get $2 f64.store offset=8 local.get $0 @@ -19985,22 +19397,22 @@ i32.store offset=20 local.get $0 i32.load - local.get $4 + local.get $3 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $7 - local.get $5 - local.get $7 + local.set $6 + local.get $4 + local.get $6 i32.load i32.store offset=16 - local.get $7 - local.get $5 - i32.store local.get $6 + local.get $4 + i32.store + local.get $5 call $~lib/rt/pure/__release end local.get $0 @@ -20011,38 +19423,17 @@ i32.load offset=20 ) (func $~lib/map/Map#delete (param $0 i32) (param $1 f64) (result i32) - (local $2 f64) + (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.6 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.6 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 0 @@ -20052,8 +19443,8 @@ drop i32.const 0 drop - local.get $3 - local.get $3 + local.get $2 + local.get $2 i32.load offset=12 i32.const 1 i32.or @@ -20068,17 +19459,17 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.const 1 i32.add i32.const 4 - local.tee $5 + local.tee $4 local.get $0 i32.load offset=20 - local.tee $6 + local.tee $5 + local.get $4 local.get $5 - local.get $6 i32.gt_u select i32.ge_u @@ -20097,7 +19488,7 @@ end if local.get $0 - local.get $4 + local.get $3 call $~lib/map/Map#rehash end i32.const 1 diff --git a/tests/compiler/std/set.optimized.wat b/tests/compiler/std/set.optimized.wat index 738c644711..bb47cf8f96 100644 --- a/tests/compiler/std/set.optimized.wat +++ b/tests/compiler/std/set.optimized.wat @@ -1,7 +1,7 @@ (module (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $none_=>_none (func)) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) @@ -19,6 +19,8 @@ (type $i32_f32_i32_=>_i32 (func (param i32 f32 i32) (result i32))) (type $i32_f64_i32_=>_i32 (func (param i32 f64 i32) (result i32))) (type $i64_=>_i32 (func (param i64) (result i32))) + (type $f32_=>_i32 (func (param f32) (result i32))) + (type $f64_=>_i32 (func (param f64) (result i32))) (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) @@ -1315,11 +1317,15 @@ i32.store offset=20 local.get $0 ) - (func $~lib/util/hash/hash32 (param $0 i32) (result i32) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) local.get $0 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s i32.const -1028477379 i32.mul - i32.const 374761393 + i32.const 374761394 i32.add i32.const 17 i32.rotl @@ -1392,11 +1398,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/set/Set#find i32.const 0 i32.ne @@ -1458,7 +1460,7 @@ local.get $2 local.get $5 local.get $4 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -1536,11 +1538,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.tee $3 call $~lib/set/Set#find i32.eqz @@ -2222,11 +2220,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/set/Set#find local.tee $1 i32.eqz @@ -2658,13 +2652,43 @@ i32.store offset=20 local.get $0 ) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) + local.get $0 + i32.const 255 + i32.and + i32.const -1028477379 + i32.mul + i32.const 374761394 + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.tee $0 + local.get $0 + i32.const 15 + i32.shr_u + i32.xor + i32.const -2048144777 + i32.mul + local.tee $0 + local.get $0 + i32.const 13 + i32.shr_u + i32.xor + i32.const -1028477379 + i32.mul + local.tee $0 + local.get $0 + i32.const 16 + i32.shr_u + i32.xor + ) (func $~lib/set/Set#has (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 - i32.const 255 - i32.and - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/set/Set#find i32.const 0 i32.ne @@ -2726,7 +2750,7 @@ local.get $2 local.get $5 local.get $4 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -2804,9 +2828,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 255 - i32.and - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.tee $3 call $~lib/set/Set#find i32.eqz @@ -3019,9 +3041,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 255 - i32.and - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/set/Set#find local.tee $1 i32.eqz @@ -3412,6 +3432,40 @@ i32.store offset=20 local.get $0 ) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) + local.get $0 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.const -1028477379 + i32.mul + i32.const 374761395 + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.tee $0 + local.get $0 + i32.const 15 + i32.shr_u + i32.xor + i32.const -2048144777 + i32.mul + local.tee $0 + local.get $0 + i32.const 13 + i32.shr_u + i32.xor + i32.const -1028477379 + i32.mul + local.tee $0 + local.get $0 + i32.const 16 + i32.shr_u + i32.xor + ) (func $~lib/set/Set#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.load @@ -3459,11 +3513,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/set/Set#find i32.const 0 i32.ne @@ -3525,7 +3575,7 @@ local.get $2 local.get $5 local.get $4 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -3603,11 +3653,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.tee $3 call $~lib/set/Set#find i32.eqz @@ -3876,11 +3922,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/set/Set#find local.tee $1 i32.eqz @@ -4279,13 +4321,43 @@ i32.store offset=20 local.get $0 ) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) + local.get $0 + i32.const 65535 + i32.and + i32.const -1028477379 + i32.mul + i32.const 374761395 + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.tee $0 + local.get $0 + i32.const 15 + i32.shr_u + i32.xor + i32.const -2048144777 + i32.mul + local.tee $0 + local.get $0 + i32.const 13 + i32.shr_u + i32.xor + i32.const -1028477379 + i32.mul + local.tee $0 + local.get $0 + i32.const 16 + i32.shr_u + i32.xor + ) (func $~lib/set/Set#has (param $0 i32) (param $1 i32) (result i32) local.get $0 local.get $1 local.get $1 - i32.const 65535 - i32.and - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/set/Set#find i32.const 0 i32.ne @@ -4347,7 +4419,7 @@ local.get $2 local.get $5 local.get $4 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -4425,9 +4497,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 65535 - i32.and - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.tee $3 call $~lib/set/Set#find i32.eqz @@ -4646,9 +4716,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 65535 - i32.and - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/set/Set#find local.tee $1 i32.eqz @@ -5039,6 +5107,36 @@ i32.store offset=20 local.get $0 ) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) + local.get $0 + i32.const -1028477379 + i32.mul + i32.const 374761397 + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.tee $0 + local.get $0 + i32.const 15 + i32.shr_u + i32.xor + i32.const -2048144777 + i32.mul + local.tee $0 + local.get $0 + i32.const 13 + i32.shr_u + i32.xor + i32.const -1028477379 + i32.mul + local.tee $0 + local.get $0 + i32.const 16 + i32.shr_u + i32.xor + ) (func $~lib/set/Set#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.load @@ -5084,7 +5182,7 @@ local.get $0 local.get $1 local.get $1 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/set/Set#find i32.const 0 i32.ne @@ -5146,7 +5244,7 @@ local.get $2 local.get $5 local.get $4 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -5224,7 +5322,7 @@ local.get $0 local.get $1 local.get $1 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.tee $3 call $~lib/set/Set#find i32.eqz @@ -5493,7 +5591,7 @@ local.get $0 local.get $1 local.get $1 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/set/Set#find local.tee $1 i32.eqz @@ -6322,13 +6420,13 @@ i32.store offset=20 local.get $0 ) - (func $~lib/util/hash/hash64 (param $0 i64) (result i32) + (func $~lib/util/hash/HASH (param $0 i64) (result i32) (local $1 i32) local.get $0 i32.wrap_i64 i32.const -1028477379 i32.mul - i32.const 374761393 + i32.const 374761401 i32.add i32.const 17 i32.rotl @@ -6410,7 +6508,7 @@ local.get $0 local.get $1 local.get $1 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH call $~lib/set/Set#find i32.const 0 i32.ne @@ -6473,7 +6571,7 @@ local.get $2 local.get $5 local.get $9 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -6551,7 +6649,7 @@ local.get $0 local.get $1 local.get $1 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH local.tee $3 call $~lib/set/Set#find i32.eqz @@ -6821,7 +6919,7 @@ local.get $0 local.get $1 local.get $1 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH call $~lib/set/Set#find local.tee $2 i32.eqz @@ -7685,6 +7783,38 @@ i32.store offset=20 local.get $0 ) + (func $~lib/util/hash/HASH (param $0 f32) (result i32) + (local $1 i32) + local.get $0 + i32.reinterpret_f32 + i32.const -1028477379 + i32.mul + i32.const 374761397 + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.tee $1 + local.get $1 + i32.const 15 + i32.shr_u + i32.xor + i32.const -2048144777 + i32.mul + local.tee $1 + local.get $1 + i32.const 13 + i32.shr_u + i32.xor + i32.const -1028477379 + i32.mul + local.tee $1 + local.get $1 + i32.const 16 + i32.shr_u + i32.xor + ) (func $~lib/set/Set#find (param $0 i32) (param $1 f32) (param $2 i32) (result i32) local.get $0 i32.load @@ -7730,8 +7860,7 @@ local.get $0 local.get $1 local.get $1 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/set/Set#find i32.const 0 i32.ne @@ -7794,8 +7923,7 @@ local.get $2 local.get $5 local.get $9 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -7873,8 +8001,7 @@ local.get $0 local.get $1 local.get $1 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.tee $3 call $~lib/set/Set#find i32.eqz @@ -8128,8 +8255,7 @@ local.get $0 local.get $1 local.get $1 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/set/Set#find local.tee $2 i32.eqz @@ -8513,6 +8639,52 @@ i32.store offset=20 local.get $0 ) + (func $~lib/util/hash/HASH (param $0 f64) (result i32) + (local $1 i32) + (local $2 i64) + local.get $0 + i64.reinterpret_f64 + local.tee $2 + i32.wrap_i64 + i32.const -1028477379 + i32.mul + i32.const 374761401 + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.get $2 + i64.const 32 + i64.shr_u + i32.wrap_i64 + i32.const -1028477379 + i32.mul + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.tee $1 + local.get $1 + i32.const 15 + i32.shr_u + i32.xor + i32.const -2048144777 + i32.mul + local.tee $1 + local.get $1 + i32.const 13 + i32.shr_u + i32.xor + i32.const -1028477379 + i32.mul + local.tee $1 + local.get $1 + i32.const 16 + i32.shr_u + i32.xor + ) (func $~lib/set/Set#find (param $0 i32) (param $1 f64) (param $2 i32) (result i32) local.get $0 i32.load @@ -8558,8 +8730,7 @@ local.get $0 local.get $1 local.get $1 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH call $~lib/set/Set#find i32.const 0 i32.ne @@ -8622,8 +8793,7 @@ local.get $2 local.get $5 local.get $9 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -8701,8 +8871,7 @@ local.get $0 local.get $1 local.get $1 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH local.tee $3 call $~lib/set/Set#find i32.eqz @@ -8956,8 +9125,7 @@ local.get $0 local.get $1 local.get $1 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH call $~lib/set/Set#find local.tee $2 i32.eqz diff --git a/tests/compiler/std/set.untouched.wat b/tests/compiler/std/set.untouched.wat index 7d72adcacb..313dcf76e5 100644 --- a/tests/compiler/std/set.untouched.wat +++ b/tests/compiler/std/set.untouched.wat @@ -14,12 +14,14 @@ (type $i32_i32_f32_=>_none (func (param i32 i32 f32))) (type $i32_i32_f64_=>_none (func (param i32 i32 f64))) (type $i32_i64_i32_=>_i32 (func (param i32 i64 i32) (result i32))) + (type $i64_=>_i32 (func (param i64) (result i32))) (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_f32_i32_=>_i32 (func (param i32 f32 i32) (result i32))) (type $i32_f64_i32_=>_i32 (func (param i32 f64 i32) (result i32))) - (type $i64_=>_i32 (func (param i64) (result i32))) + (type $f32_=>_i32 (func (param f32) (result i32))) + (type $f64_=>_i32 (func (param f64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) (data (i32.const 12) "(\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00(\00\00\00a\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00") @@ -1798,51 +1800,74 @@ i32.store offset=20 local.get $0 ) - (func $~lib/util/hash/hash32 (param $0 i32) (result i32) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) (local $1 i32) + (local $2 i32) + (local $3 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 1 + i32.const 4 + i32.le_u + drop + local.get $0 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + local.set $2 + i32.const 1 + local.set $1 i32.const 0 i32.const 374761393 i32.add - local.set $1 local.get $1 - local.get $0 + i32.add + local.set $3 + local.get $3 + local.get $2 i32.const -1028477379 i32.mul i32.add - local.set $1 - local.get $1 + local.set $3 + local.get $3 i32.const 17 i32.rotl i32.const 668265263 i32.mul - local.set $1 - local.get $1 - local.get $1 + local.set $3 + local.get $3 + local.get $3 i32.const 15 i32.shr_u i32.xor - local.set $1 - local.get $1 + local.set $3 + local.get $3 i32.const -2048144777 i32.mul - local.set $1 - local.get $1 - local.get $1 + local.set $3 + local.get $3 + local.get $3 i32.const 13 i32.shr_u i32.xor - local.set $1 - local.get $1 + local.set $3 + local.get $3 i32.const -1028477379 i32.mul - local.set $1 - local.get $1 - local.get $1 + local.set $3 + local.get $3 + local.get $3 i32.const 16 i32.shr_u i32.xor - local.set $1 - local.get $1 + local.set $3 + local.get $3 + return ) (func $~lib/set/Set#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -1899,30 +1924,10 @@ i32.const 0 ) (func $~lib/set/Set#has (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 4 - i32.le_u - drop - local.get $2 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.0 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find i32.const 0 i32.ne @@ -1998,23 +2003,8 @@ local.get $11 local.get $12 i32.store8 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 4 - i32.le_u - drop - local.get $13 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -2096,34 +2086,15 @@ (local $2 i32) (local $3 i32) (local $4 i32) - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 4 - i32.le_u - drop - local.get $2 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $3 + local.get $1 + call $~lib/util/hash/HASH + local.set $2 local.get $0 local.get $1 - local.get $3 + local.get $2 call $~lib/set/Set#find - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.eqz if local.get $0 @@ -2160,16 +2131,16 @@ local.get $0 local.get $0 i32.load offset=16 - local.tee $2 + local.tee $4 i32.const 1 i32.add i32.store offset=16 - local.get $2 + local.get $4 i32.const 8 i32.mul i32.add - local.set $4 - local.get $4 + local.set $3 + local.get $3 local.get $1 i32.store8 local.get $0 @@ -2180,20 +2151,20 @@ i32.store offset=20 local.get $0 i32.load - local.get $3 + local.get $2 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $2 + local.set $4 + local.get $3 local.get $4 - local.get $2 i32.load i32.store offset=4 - local.get $2 local.get $4 + local.get $3 i32.store end local.get $0 @@ -3993,30 +3964,11 @@ (local $5 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 4 - i32.le_u - drop - local.get $2 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.3 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 0 @@ -4024,8 +3976,8 @@ end i32.const 0 drop - local.get $3 - local.get $3 + local.get $2 + local.get $2 i32.load offset=4 i32.const 1 i32.or @@ -4040,16 +3992,16 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.const 1 i32.add i32.const 4 - local.tee $2 + local.tee $4 local.get $0 i32.load offset=20 local.tee $5 - local.get $2 + local.get $4 local.get $5 i32.gt_u select @@ -4069,7 +4021,7 @@ end if local.get $0 - local.get $4 + local.get $3 call $~lib/set/Set#rehash end i32.const 1 @@ -4514,6 +4466,73 @@ i32.store offset=20 local.get $0 ) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 1 + i32.const 4 + i32.le_u + drop + local.get $0 + i32.const 255 + i32.and + local.set $2 + i32.const 1 + local.set $1 + i32.const 0 + i32.const 374761393 + i32.add + local.get $1 + i32.add + local.set $3 + local.get $3 + local.get $2 + i32.const -1028477379 + i32.mul + i32.add + local.set $3 + local.get $3 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 15 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -2048144777 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 13 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -1028477379 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 16 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + return + ) (func $~lib/set/Set#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) @@ -4567,28 +4586,10 @@ i32.const 0 ) (func $~lib/set/Set#has (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 4 - i32.le_u - drop - local.get $2 - i32.const 255 - i32.and - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.0 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find i32.const 0 i32.ne @@ -4664,23 +4665,8 @@ local.get $11 local.get $12 i32.store8 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 4 - i32.le_u - drop - local.get $13 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -4762,32 +4748,15 @@ (local $2 i32) (local $3 i32) (local $4 i32) - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 4 - i32.le_u - drop - local.get $2 - i32.const 255 - i32.and - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $3 + local.get $1 + call $~lib/util/hash/HASH + local.set $2 local.get $0 local.get $1 - local.get $3 + local.get $2 call $~lib/set/Set#find - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.eqz if local.get $0 @@ -4824,16 +4793,16 @@ local.get $0 local.get $0 i32.load offset=16 - local.tee $2 + local.tee $4 i32.const 1 i32.add i32.store offset=16 - local.get $2 + local.get $4 i32.const 8 i32.mul i32.add - local.set $4 - local.get $4 + local.set $3 + local.get $3 local.get $1 i32.store8 local.get $0 @@ -4844,20 +4813,20 @@ i32.store offset=20 local.get $0 i32.load - local.get $3 + local.get $2 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $2 + local.set $4 + local.get $3 local.get $4 - local.get $2 i32.load i32.store offset=4 - local.get $2 local.get $4 + local.get $3 i32.store end local.get $0 @@ -5115,28 +5084,11 @@ (local $5 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 4 - i32.le_u - drop - local.get $2 - i32.const 255 - i32.and - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.3 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 0 @@ -5144,8 +5096,8 @@ end i32.const 0 drop - local.get $3 - local.get $3 + local.get $2 + local.get $2 i32.load offset=4 i32.const 1 i32.or @@ -5160,16 +5112,16 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.const 1 i32.add i32.const 4 - local.tee $2 + local.tee $4 local.get $0 i32.load offset=20 local.tee $5 - local.get $2 + local.get $4 local.get $5 i32.gt_u select @@ -5189,7 +5141,7 @@ end if local.get $0 - local.get $4 + local.get $3 call $~lib/set/Set#rehash end i32.const 1 @@ -5626,6 +5578,75 @@ i32.store offset=20 local.get $0 ) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 2 + i32.const 4 + i32.le_u + drop + local.get $0 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + local.set $2 + i32.const 2 + local.set $1 + i32.const 0 + i32.const 374761393 + i32.add + local.get $1 + i32.add + local.set $3 + local.get $3 + local.get $2 + i32.const -1028477379 + i32.mul + i32.add + local.set $3 + local.get $3 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 15 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -2048144777 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 13 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -1028477379 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 16 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + return + ) (func $~lib/set/Set#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) @@ -5681,30 +5702,10 @@ i32.const 0 ) (func $~lib/set/Set#has (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 4 - i32.le_u - drop - local.get $2 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.0 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find i32.const 0 i32.ne @@ -5780,23 +5781,8 @@ local.get $11 local.get $12 i32.store16 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 4 - i32.le_u - drop - local.get $13 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -5878,34 +5864,15 @@ (local $2 i32) (local $3 i32) (local $4 i32) - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 4 - i32.le_u - drop - local.get $2 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $3 + local.get $1 + call $~lib/util/hash/HASH + local.set $2 local.get $0 local.get $1 - local.get $3 + local.get $2 call $~lib/set/Set#find - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.eqz if local.get $0 @@ -5942,16 +5909,16 @@ local.get $0 local.get $0 i32.load offset=16 - local.tee $2 + local.tee $4 i32.const 1 i32.add i32.store offset=16 - local.get $2 + local.get $4 i32.const 8 i32.mul i32.add - local.set $4 - local.get $4 + local.set $3 + local.get $3 local.get $1 i32.store16 local.get $0 @@ -5962,20 +5929,20 @@ i32.store offset=20 local.get $0 i32.load - local.get $3 + local.get $2 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $2 + local.set $4 + local.get $3 local.get $4 - local.get $2 i32.load i32.store offset=4 - local.get $2 local.get $4 + local.get $3 i32.store end local.get $0 @@ -6233,30 +6200,11 @@ (local $5 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 4 - i32.le_u - drop - local.get $2 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.3 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 0 @@ -6264,8 +6212,8 @@ end i32.const 0 drop - local.get $3 - local.get $3 + local.get $2 + local.get $2 i32.load offset=4 i32.const 1 i32.or @@ -6280,16 +6228,16 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.const 1 i32.add i32.const 4 - local.tee $2 + local.tee $4 local.get $0 i32.load offset=20 local.tee $5 - local.get $2 + local.get $4 local.get $5 i32.gt_u select @@ -6309,7 +6257,7 @@ end if local.get $0 - local.get $4 + local.get $3 call $~lib/set/Set#rehash end i32.const 1 @@ -6754,19 +6702,86 @@ i32.store offset=20 local.get $0 ) - (func $~lib/set/Set#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.get $2 - local.get $0 - i32.load offset=4 - i32.and - i32.const 4 - i32.mul - i32.add + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 2 + i32.const 4 + i32.le_u + drop + local.get $0 + i32.const 65535 + i32.and + local.set $2 + i32.const 2 + local.set $1 + i32.const 0 + i32.const 374761393 + i32.add + local.get $1 + i32.add + local.set $3 + local.get $3 + local.get $2 + i32.const -1028477379 + i32.mul + i32.add + local.set $3 + local.get $3 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 15 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -2048144777 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 13 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -1028477379 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 16 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + return + ) + (func $~lib/set/Set#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + i32.load + local.get $2 + local.get $0 + i32.load offset=4 + i32.and + i32.const 4 + i32.mul + i32.add i32.load local.set $3 loop $while-continue|0 @@ -6807,28 +6822,10 @@ i32.const 0 ) (func $~lib/set/Set#has (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 4 - i32.le_u - drop - local.get $2 - i32.const 65535 - i32.and - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.0 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find i32.const 0 i32.ne @@ -6904,23 +6901,8 @@ local.get $11 local.get $12 i32.store16 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 4 - i32.le_u - drop - local.get $13 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -7002,32 +6984,15 @@ (local $2 i32) (local $3 i32) (local $4 i32) - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 4 - i32.le_u - drop - local.get $2 - i32.const 65535 - i32.and - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $3 + local.get $1 + call $~lib/util/hash/HASH + local.set $2 local.get $0 local.get $1 - local.get $3 + local.get $2 call $~lib/set/Set#find - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.eqz if local.get $0 @@ -7064,16 +7029,16 @@ local.get $0 local.get $0 i32.load offset=16 - local.tee $2 + local.tee $4 i32.const 1 i32.add i32.store offset=16 - local.get $2 + local.get $4 i32.const 8 i32.mul i32.add - local.set $4 - local.get $4 + local.set $3 + local.get $3 local.get $1 i32.store16 local.get $0 @@ -7084,20 +7049,20 @@ i32.store offset=20 local.get $0 i32.load - local.get $3 + local.get $2 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $2 + local.set $4 + local.get $3 local.get $4 - local.get $2 i32.load i32.store offset=4 - local.get $2 local.get $4 + local.get $3 i32.store end local.get $0 @@ -7355,28 +7320,11 @@ (local $5 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 4 - i32.le_u - drop - local.get $2 - i32.const 65535 - i32.and - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.3 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 0 @@ -7384,8 +7332,8 @@ end i32.const 0 drop - local.get $3 - local.get $3 + local.get $2 + local.get $2 i32.load offset=4 i32.const 1 i32.or @@ -7400,16 +7348,16 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.const 1 i32.add i32.const 4 - local.tee $2 + local.tee $4 local.get $0 i32.load offset=20 local.tee $5 - local.get $2 + local.get $4 local.get $5 i32.gt_u select @@ -7429,7 +7377,7 @@ end if local.get $0 - local.get $4 + local.get $3 call $~lib/set/Set#rehash end i32.const 1 @@ -7866,6 +7814,71 @@ i32.store offset=20 local.get $0 ) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 4 + i32.const 4 + i32.le_u + drop + local.get $0 + local.set $2 + i32.const 4 + local.set $1 + i32.const 0 + i32.const 374761393 + i32.add + local.get $1 + i32.add + local.set $3 + local.get $3 + local.get $2 + i32.const -1028477379 + i32.mul + i32.add + local.set $3 + local.get $3 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 15 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -2048144777 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 13 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -1028477379 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 16 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + return + ) (func $~lib/set/Set#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) @@ -7917,26 +7930,10 @@ i32.const 0 ) (func $~lib/set/Set#has (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 4 - i32.le_u - drop - local.get $2 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.0 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find i32.const 0 i32.ne @@ -8012,23 +8009,8 @@ local.get $11 local.get $12 i32.store - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 4 - i32.le_u - drop - local.get $13 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -8110,30 +8092,15 @@ (local $2 i32) (local $3 i32) (local $4 i32) - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 4 - i32.le_u - drop - local.get $2 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $3 + local.get $1 + call $~lib/util/hash/HASH + local.set $2 local.get $0 local.get $1 - local.get $3 + local.get $2 call $~lib/set/Set#find - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.eqz if local.get $0 @@ -8170,16 +8137,16 @@ local.get $0 local.get $0 i32.load offset=16 - local.tee $2 + local.tee $4 i32.const 1 i32.add i32.store offset=16 - local.get $2 + local.get $4 i32.const 8 i32.mul i32.add - local.set $4 - local.get $4 + local.set $3 + local.get $3 local.get $1 i32.store local.get $0 @@ -8190,20 +8157,20 @@ i32.store offset=20 local.get $0 i32.load - local.get $3 + local.get $2 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $2 + local.set $4 + local.get $3 local.get $4 - local.get $2 i32.load i32.store offset=4 - local.get $2 local.get $4 + local.get $3 i32.store end local.get $0 @@ -8461,26 +8428,11 @@ (local $5 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 4 - i32.le_u - drop - local.get $2 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.3 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 0 @@ -8488,8 +8440,8 @@ end i32.const 0 drop - local.get $3 - local.get $3 + local.get $2 + local.get $2 i32.load offset=4 i32.const 1 i32.or @@ -8504,16 +8456,16 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.const 1 i32.add i32.const 4 - local.tee $2 + local.tee $4 local.get $0 i32.load offset=20 local.tee $5 - local.get $2 + local.get $4 local.get $5 i32.gt_u select @@ -8533,7 +8485,7 @@ end if local.get $0 - local.get $4 + local.get $3 call $~lib/set/Set#rehash end i32.const 1 @@ -8958,6 +8910,71 @@ i32.store offset=20 local.get $0 ) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 4 + i32.const 4 + i32.le_u + drop + local.get $0 + local.set $2 + i32.const 4 + local.set $1 + i32.const 0 + i32.const 374761393 + i32.add + local.get $1 + i32.add + local.set $3 + local.get $3 + local.get $2 + i32.const -1028477379 + i32.mul + i32.add + local.set $3 + local.get $3 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 15 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -2048144777 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 13 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -1028477379 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 16 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + return + ) (func $~lib/set/Set#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) @@ -9009,26 +9026,10 @@ i32.const 0 ) (func $~lib/set/Set#has (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 4 - i32.le_u - drop - local.get $2 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.0 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find i32.const 0 i32.ne @@ -9104,23 +9105,8 @@ local.get $11 local.get $12 i32.store - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 4 - i32.le_u - drop - local.get $13 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -9202,30 +9188,15 @@ (local $2 i32) (local $3 i32) (local $4 i32) - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 4 - i32.le_u - drop - local.get $2 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $3 + local.get $1 + call $~lib/util/hash/HASH + local.set $2 local.get $0 local.get $1 - local.get $3 + local.get $2 call $~lib/set/Set#find - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.eqz if local.get $0 @@ -9262,16 +9233,16 @@ local.get $0 local.get $0 i32.load offset=16 - local.tee $2 + local.tee $4 i32.const 1 i32.add i32.store offset=16 - local.get $2 + local.get $4 i32.const 8 i32.mul i32.add - local.set $4 - local.get $4 + local.set $3 + local.get $3 local.get $1 i32.store local.get $0 @@ -9282,20 +9253,20 @@ i32.store offset=20 local.get $0 i32.load - local.get $3 + local.get $2 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $2 + local.set $4 + local.get $3 local.get $4 - local.get $2 i32.load i32.store offset=4 - local.get $2 local.get $4 + local.get $3 i32.store end local.get $0 @@ -9553,26 +9524,11 @@ (local $5 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 4 - i32.le_u - drop - local.get $2 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.3 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 0 @@ -9580,8 +9536,8 @@ end i32.const 0 drop - local.get $3 - local.get $3 + local.get $2 + local.get $2 i32.load offset=4 i32.const 1 i32.or @@ -9596,16 +9552,16 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.const 1 i32.add i32.const 4 - local.tee $2 + local.tee $4 local.get $0 i32.load offset=20 local.tee $5 - local.get $2 + local.get $4 local.get $5 i32.gt_u select @@ -9625,7 +9581,7 @@ end if local.get $0 - local.get $4 + local.get $3 call $~lib/set/Set#rehash end i32.const 1 @@ -10050,67 +10006,87 @@ i32.store offset=20 local.get $0 ) - (func $~lib/util/hash/hash64 (param $0 i64) (result i32) - (local $1 i32) + (func $~lib/util/hash/HASH (param $0 i64) (result i32) + (local $1 i64) + (local $2 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 8 + i32.const 4 + i32.le_u + drop + i32.const 8 + i32.const 8 + i32.eq + drop + local.get $0 + local.set $1 i32.const 0 i32.const 374761393 i32.add - local.set $1 + i32.const 8 + i32.add + local.set $2 + local.get $2 local.get $1 - local.get $0 i32.wrap_i64 i32.const -1028477379 i32.mul i32.add - local.set $1 - local.get $1 + local.set $2 + local.get $2 i32.const 17 i32.rotl i32.const 668265263 i32.mul - local.set $1 + local.set $2 + local.get $2 local.get $1 - local.get $0 i64.const 32 i64.shr_u i32.wrap_i64 i32.const -1028477379 i32.mul i32.add - local.set $1 - local.get $1 + local.set $2 + local.get $2 i32.const 17 i32.rotl i32.const 668265263 i32.mul - local.set $1 - local.get $1 - local.get $1 + local.set $2 + local.get $2 + local.get $2 i32.const 15 i32.shr_u i32.xor - local.set $1 - local.get $1 + local.set $2 + local.get $2 i32.const -2048144777 i32.mul - local.set $1 - local.get $1 - local.get $1 + local.set $2 + local.get $2 + local.get $2 i32.const 13 i32.shr_u i32.xor - local.set $1 - local.get $1 + local.set $2 + local.get $2 i32.const -1028477379 i32.mul - local.set $1 - local.get $1 - local.get $1 + local.set $2 + local.get $2 + local.get $2 i32.const 16 i32.shr_u i32.xor - local.set $1 - local.get $1 + local.set $2 + local.get $2 + return ) (func $~lib/set/Set#find (param $0 i32) (param $1 i64) (param $2 i32) (result i32) (local $3 i32) @@ -10163,30 +10139,10 @@ i32.const 0 ) (func $~lib/set/Set#has (param $0 i32) (param $1 i64) (result i32) - (local $2 i64) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 4 - i32.le_u - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.0 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find i32.const 0 i32.ne @@ -10203,9 +10159,8 @@ (local $10 i32) (local $11 i32) (local $12 i64) - (local $13 i64) + (local $13 i32) (local $14 i32) - (local $15 i32) local.get $1 i32.const 1 i32.add @@ -10263,41 +10218,22 @@ local.get $11 local.get $12 i64.store - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 4 - i32.le_u - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $13 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and - local.set $14 + local.set $13 local.get $3 - local.get $14 + local.get $13 i32.const 4 i32.mul i32.add - local.set $15 + local.set $14 local.get $11 - local.get $15 + local.get $14 i32.load i32.store offset=8 - local.get $15 + local.get $14 local.get $8 i32.store local.get $8 @@ -10315,28 +10251,28 @@ local.get $0 local.tee $11 local.get $3 - local.tee $14 + local.tee $13 local.get $11 i32.load local.tee $9 i32.ne if - local.get $14 + local.get $13 call $~lib/rt/pure/__retain - local.set $14 + local.set $13 local.get $9 call $~lib/rt/pure/__release end - local.get $14 + local.get $13 i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.tee $15 + local.tee $14 local.get $5 local.tee $9 - local.get $15 + local.get $14 i32.load offset=8 local.tee $11 i32.ne @@ -10362,38 +10298,18 @@ call $~lib/rt/pure/__release ) (func $~lib/set/Set#add (param $0 i32) (param $1 i64) (result i32) - (local $2 i64) + (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 4 - i32.le_u - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $3 + local.get $1 + call $~lib/util/hash/HASH + local.set $2 local.get $0 local.get $1 - local.get $3 + local.get $2 call $~lib/set/Set#find - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.eqz if local.get $0 @@ -10430,16 +10346,16 @@ local.get $0 local.get $0 i32.load offset=16 - local.tee $5 + local.tee $4 i32.const 1 i32.add i32.store offset=16 - local.get $5 + local.get $4 i32.const 16 i32.mul i32.add - local.set $4 - local.get $4 + local.set $3 + local.get $3 local.get $1 i64.store local.get $0 @@ -10450,20 +10366,20 @@ i32.store offset=20 local.get $0 i32.load - local.get $3 + local.get $2 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $5 + local.set $4 + local.get $3 local.get $4 - local.get $5 i32.load i32.store offset=8 - local.get $5 local.get $4 + local.get $3 i32.store end local.get $0 @@ -10715,37 +10631,17 @@ local.get $2 ) (func $~lib/set/Set#delete (param $0 i32) (param $1 i64) (result i32) - (local $2 i64) + (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 4 - i32.le_u - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.3 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 0 @@ -10753,8 +10649,8 @@ end i32.const 0 drop - local.get $3 - local.get $3 + local.get $2 + local.get $2 i32.load offset=8 i32.const 1 i32.or @@ -10769,17 +10665,17 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.const 1 i32.add i32.const 4 - local.tee $5 + local.tee $4 local.get $0 i32.load offset=20 - local.tee $6 + local.tee $5 + local.get $4 local.get $5 - local.get $6 i32.gt_u select i32.ge_u @@ -10798,7 +10694,7 @@ end if local.get $0 - local.get $4 + local.get $3 call $~lib/set/Set#rehash end i32.const 1 @@ -11224,6 +11120,88 @@ i32.store offset=20 local.get $0 ) + (func $~lib/util/hash/HASH (param $0 i64) (result i32) + (local $1 i64) + (local $2 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 8 + i32.const 4 + i32.le_u + drop + i32.const 8 + i32.const 8 + i32.eq + drop + local.get $0 + local.set $1 + i32.const 0 + i32.const 374761393 + i32.add + i32.const 8 + i32.add + local.set $2 + local.get $2 + local.get $1 + i32.wrap_i64 + i32.const -1028477379 + i32.mul + i32.add + local.set $2 + local.get $2 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $2 + local.get $2 + local.get $1 + i64.const 32 + i64.shr_u + i32.wrap_i64 + i32.const -1028477379 + i32.mul + i32.add + local.set $2 + local.get $2 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 15 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + i32.const -2048144777 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 13 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + i32.const -1028477379 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 16 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + return + ) (func $~lib/set/Set#find (param $0 i32) (param $1 i64) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) @@ -11270,35 +11248,15 @@ i32.and local.set $3 br $while-continue|0 - end - end - i32.const 0 - ) - (func $~lib/set/Set#has (param $0 i32) (param $1 i64) (result i32) - (local $2 i64) - local.get $0 - local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 4 - i32.le_u - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.0 + end end + i32.const 0 + ) + (func $~lib/set/Set#has (param $0 i32) (param $1 i64) (result i32) + local.get $0 + local.get $1 + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find i32.const 0 i32.ne @@ -11315,9 +11273,8 @@ (local $10 i32) (local $11 i32) (local $12 i64) - (local $13 i64) + (local $13 i32) (local $14 i32) - (local $15 i32) local.get $1 i32.const 1 i32.add @@ -11375,41 +11332,22 @@ local.get $11 local.get $12 i64.store - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 4 - i32.le_u - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $13 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and - local.set $14 + local.set $13 local.get $3 - local.get $14 + local.get $13 i32.const 4 i32.mul i32.add - local.set $15 + local.set $14 local.get $11 - local.get $15 + local.get $14 i32.load i32.store offset=8 - local.get $15 + local.get $14 local.get $8 i32.store local.get $8 @@ -11427,28 +11365,28 @@ local.get $0 local.tee $11 local.get $3 - local.tee $14 + local.tee $13 local.get $11 i32.load local.tee $9 i32.ne if - local.get $14 + local.get $13 call $~lib/rt/pure/__retain - local.set $14 + local.set $13 local.get $9 call $~lib/rt/pure/__release end - local.get $14 + local.get $13 i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.tee $15 + local.tee $14 local.get $5 local.tee $9 - local.get $15 + local.get $14 i32.load offset=8 local.tee $11 i32.ne @@ -11474,38 +11412,18 @@ call $~lib/rt/pure/__release ) (func $~lib/set/Set#add (param $0 i32) (param $1 i64) (result i32) - (local $2 i64) + (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 4 - i32.le_u - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $3 + local.get $1 + call $~lib/util/hash/HASH + local.set $2 local.get $0 local.get $1 - local.get $3 + local.get $2 call $~lib/set/Set#find - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.eqz if local.get $0 @@ -11542,16 +11460,16 @@ local.get $0 local.get $0 i32.load offset=16 - local.tee $5 + local.tee $4 i32.const 1 i32.add i32.store offset=16 - local.get $5 + local.get $4 i32.const 16 i32.mul i32.add - local.set $4 - local.get $4 + local.set $3 + local.get $3 local.get $1 i64.store local.get $0 @@ -11562,20 +11480,20 @@ i32.store offset=20 local.get $0 i32.load - local.get $3 + local.get $2 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $5 + local.set $4 + local.get $3 local.get $4 - local.get $5 i32.load i32.store offset=8 - local.get $5 local.get $4 + local.get $3 i32.store end local.get $0 @@ -11827,37 +11745,17 @@ local.get $2 ) (func $~lib/set/Set#delete (param $0 i32) (param $1 i64) (result i32) - (local $2 i64) + (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 4 - i32.le_u - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.3 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 0 @@ -11865,8 +11763,8 @@ end i32.const 0 drop - local.get $3 - local.get $3 + local.get $2 + local.get $2 i32.load offset=8 i32.const 1 i32.or @@ -11881,17 +11779,17 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.const 1 i32.add i32.const 4 - local.tee $5 + local.tee $4 local.get $0 i32.load offset=20 - local.tee $6 + local.tee $5 + local.get $4 local.get $5 - local.get $6 i32.gt_u select i32.ge_u @@ -11910,7 +11808,7 @@ end if local.get $0 - local.get $4 + local.get $3 call $~lib/set/Set#rehash end i32.const 1 @@ -12336,6 +12234,72 @@ i32.store offset=20 local.get $0 ) + (func $~lib/util/hash/HASH (param $0 f32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 1 + drop + i32.const 4 + i32.const 4 + i32.eq + drop + local.get $0 + i32.reinterpret_f32 + local.set $1 + i32.const 4 + local.set $2 + i32.const 0 + i32.const 374761393 + i32.add + local.get $2 + i32.add + local.set $3 + local.get $3 + local.get $1 + i32.const -1028477379 + i32.mul + i32.add + local.set $3 + local.get $3 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 15 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -2048144777 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 13 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -1028477379 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 16 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + return + ) (func $~lib/set/Set#find (param $0 i32) (param $1 f32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) @@ -12387,27 +12351,10 @@ i32.const 0 ) (func $~lib/set/Set#has (param $0 i32) (param $1 f32) (result i32) - (local $2 f32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.0 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find i32.const 0 i32.ne @@ -12424,9 +12371,8 @@ (local $10 i32) (local $11 i32) (local $12 f32) - (local $13 f32) + (local $13 i32) (local $14 i32) - (local $15 i32) local.get $1 i32.const 1 i32.add @@ -12484,38 +12430,22 @@ local.get $11 local.get $12 f32.store - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $13 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and - local.set $14 + local.set $13 local.get $3 - local.get $14 + local.get $13 i32.const 4 i32.mul i32.add - local.set $15 + local.set $14 local.get $11 - local.get $15 + local.get $14 i32.load i32.store offset=4 - local.get $15 + local.get $14 local.get $8 i32.store local.get $8 @@ -12533,28 +12463,28 @@ local.get $0 local.tee $11 local.get $3 - local.tee $14 + local.tee $13 local.get $11 i32.load local.tee $9 i32.ne if - local.get $14 + local.get $13 call $~lib/rt/pure/__retain - local.set $14 + local.set $13 local.get $9 call $~lib/rt/pure/__release end - local.get $14 + local.get $13 i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.tee $15 + local.tee $14 local.get $5 local.tee $9 - local.get $15 + local.get $14 i32.load offset=8 local.tee $11 i32.ne @@ -12580,35 +12510,18 @@ call $~lib/rt/pure/__release ) (func $~lib/set/Set#add (param $0 i32) (param $1 f32) (result i32) - (local $2 f32) + (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $3 + local.get $1 + call $~lib/util/hash/HASH + local.set $2 local.get $0 local.get $1 - local.get $3 + local.get $2 call $~lib/set/Set#find - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.eqz if local.get $0 @@ -12645,16 +12558,16 @@ local.get $0 local.get $0 i32.load offset=16 - local.tee $5 + local.tee $4 i32.const 1 i32.add i32.store offset=16 - local.get $5 + local.get $4 i32.const 8 i32.mul i32.add - local.set $4 - local.get $4 + local.set $3 + local.get $3 local.get $1 f32.store local.get $0 @@ -12665,20 +12578,20 @@ i32.store offset=20 local.get $0 i32.load - local.get $3 + local.get $2 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $5 + local.set $4 + local.get $3 local.get $4 - local.get $5 i32.load i32.store offset=4 - local.get $5 local.get $4 + local.get $3 i32.store end local.get $0 @@ -12930,34 +12843,17 @@ local.get $2 ) (func $~lib/set/Set#delete (param $0 i32) (param $1 f32) (result i32) - (local $2 f32) + (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.3 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 0 @@ -12965,8 +12861,8 @@ end i32.const 0 drop - local.get $3 - local.get $3 + local.get $2 + local.get $2 i32.load offset=4 i32.const 1 i32.or @@ -12981,17 +12877,17 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.const 1 i32.add i32.const 4 - local.tee $5 + local.tee $4 local.get $0 i32.load offset=20 - local.tee $6 + local.tee $5 + local.get $4 local.get $5 - local.get $6 i32.gt_u select i32.ge_u @@ -13010,7 +12906,7 @@ end if local.get $0 - local.get $4 + local.get $3 call $~lib/set/Set#rehash end i32.const 1 @@ -13436,6 +13332,89 @@ i32.store offset=20 local.get $0 ) + (func $~lib/util/hash/HASH (param $0 f64) (result i32) + (local $1 i64) + (local $2 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 1 + drop + i32.const 8 + i32.const 4 + i32.eq + drop + i32.const 8 + i32.const 8 + i32.eq + drop + local.get $0 + i64.reinterpret_f64 + local.set $1 + i32.const 0 + i32.const 374761393 + i32.add + i32.const 8 + i32.add + local.set $2 + local.get $2 + local.get $1 + i32.wrap_i64 + i32.const -1028477379 + i32.mul + i32.add + local.set $2 + local.get $2 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $2 + local.get $2 + local.get $1 + i64.const 32 + i64.shr_u + i32.wrap_i64 + i32.const -1028477379 + i32.mul + i32.add + local.set $2 + local.get $2 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 15 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + i32.const -2048144777 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 13 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + i32.const -1028477379 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 16 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + return + ) (func $~lib/set/Set#find (param $0 i32) (param $1 f64) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) @@ -13487,31 +13466,10 @@ i32.const 0 ) (func $~lib/set/Set#has (param $0 i32) (param $1 f64) (result i32) - (local $2 f64) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.0 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find i32.const 0 i32.ne @@ -13528,9 +13486,8 @@ (local $10 i32) (local $11 i32) (local $12 f64) - (local $13 f64) + (local $13 i32) (local $14 i32) - (local $15 i32) local.get $1 i32.const 1 i32.add @@ -13588,42 +13545,22 @@ local.get $11 local.get $12 f64.store - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $13 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and - local.set $14 + local.set $13 local.get $3 - local.get $14 + local.get $13 i32.const 4 i32.mul i32.add - local.set $15 + local.set $14 local.get $11 - local.get $15 + local.get $14 i32.load i32.store offset=8 - local.get $15 + local.get $14 local.get $8 i32.store local.get $8 @@ -13641,28 +13578,28 @@ local.get $0 local.tee $11 local.get $3 - local.tee $14 + local.tee $13 local.get $11 i32.load local.tee $9 i32.ne if - local.get $14 + local.get $13 call $~lib/rt/pure/__retain - local.set $14 + local.set $13 local.get $9 call $~lib/rt/pure/__release end - local.get $14 + local.get $13 i32.store local.get $0 local.get $1 i32.store offset=4 local.get $0 - local.tee $15 + local.tee $14 local.get $5 local.tee $9 - local.get $15 + local.get $14 i32.load offset=8 local.tee $11 i32.ne @@ -13688,39 +13625,18 @@ call $~lib/rt/pure/__release ) (func $~lib/set/Set#add (param $0 i32) (param $1 f64) (result i32) - (local $2 f64) + (local $2 i32) (local $3 i32) (local $4 i32) - (local $5 i32) - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $3 + local.get $1 + call $~lib/util/hash/HASH + local.set $2 local.get $0 local.get $1 - local.get $3 + local.get $2 call $~lib/set/Set#find - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.eqz if local.get $0 @@ -13757,16 +13673,16 @@ local.get $0 local.get $0 i32.load offset=16 - local.tee $5 + local.tee $4 i32.const 1 i32.add i32.store offset=16 - local.get $5 + local.get $4 i32.const 16 i32.mul i32.add - local.set $4 - local.get $4 + local.set $3 + local.get $3 local.get $1 f64.store local.get $0 @@ -13777,20 +13693,20 @@ i32.store offset=20 local.get $0 i32.load - local.get $3 + local.get $2 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $5 + local.set $4 + local.get $3 local.get $4 - local.get $5 i32.load i32.store offset=8 - local.get $5 local.get $4 + local.get $3 i32.store end local.get $0 @@ -14042,38 +13958,17 @@ local.get $2 ) (func $~lib/set/Set#delete (param $0 i32) (param $1 f64) (result i32) - (local $2 f64) + (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.3 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 0 @@ -14081,8 +13976,8 @@ end i32.const 0 drop - local.get $3 - local.get $3 + local.get $2 + local.get $2 i32.load offset=8 i32.const 1 i32.or @@ -14097,17 +13992,17 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.const 1 i32.add i32.const 4 - local.tee $5 + local.tee $4 local.get $0 i32.load offset=20 - local.tee $6 + local.tee $5 + local.get $4 local.get $5 - local.get $6 i32.gt_u select i32.ge_u @@ -14126,7 +14021,7 @@ end if local.get $0 - local.get $4 + local.get $3 call $~lib/set/Set#rehash end i32.const 1 diff --git a/tests/compiler/std/symbol.optimized.wat b/tests/compiler/std/symbol.optimized.wat index 1cf179cebe..3d0ca956e2 100644 --- a/tests/compiler/std/symbol.optimized.wat +++ b/tests/compiler/std/symbol.optimized.wat @@ -343,7 +343,7 @@ call $~lib/memory/memory.fill local.get $1 ) - (func $~lib/util/hash/hashStr (param $0 i32) (result i32) + (func $~lib/util/hash/HASH<~lib/string/String> (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -353,188 +353,194 @@ (local $7 i32) (local $8 i32) local.get $0 - i32.eqz - if - i32.const 0 - return - end - local.get $0 - i32.const 20 - i32.sub - i32.load offset=16 - i32.const 1 - i32.shr_u - i32.const 1 - i32.shl - local.tee $2 - i32.const 16 - i32.ge_s if (result i32) - i32.const 606290984 - local.set $1 - i32.const -2048144777 - local.set $5 - i32.const 1640531535 - local.set $6 - local.get $2 - i32.const 16 + local.get $0 + i32.const 20 i32.sub - local.set $7 - loop $while-continue|0 + i32.load offset=16 + i32.const 1 + i32.shr_u + i32.const 1 + i32.shl + local.tee $3 + i32.const 16 + i32.ge_s + if + i32.const 606290984 + local.set $2 + i32.const -2048144777 + local.set $4 + i32.const 1640531535 + local.set $5 local.get $3 + i32.const 16 + i32.sub + local.set $7 + loop $while-continue|0 + local.get $1 + local.get $7 + i32.le_s + if + local.get $2 + local.get $0 + local.get $1 + i32.add + local.tee $6 + i32.load + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $2 + local.get $4 + local.get $6 + i32.load offset=4 + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $4 + local.get $8 + local.get $6 + i32.load offset=8 + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $8 + local.get $5 + local.get $6 + i32.load offset=12 + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $5 + local.get $1 + i32.const 16 + i32.add + local.set $1 + br $while-continue|0 + end + end + local.get $3 + local.get $2 + i32.const 1 + i32.rotl + local.get $4 + i32.const 7 + i32.rotl + i32.add + local.get $8 + i32.const 12 + i32.rotl + i32.add + local.get $5 + i32.const 18 + i32.rotl + i32.add + i32.add + local.set $2 local.get $7 + local.get $1 + i32.sub + local.set $3 + else + local.get $3 + i32.const 374761393 + i32.add + local.set $2 + end + i32.const 0 + local.set $1 + local.get $3 + i32.const 4 + i32.sub + local.set $3 + loop $while-continue|1 + local.get $1 + local.get $3 i32.le_s if - local.get $1 + local.get $2 local.get $0 - local.get $3 + local.get $1 i32.add - local.tee $2 i32.load - i32.const -2048144777 + i32.const -1028477379 i32.mul i32.add - i32.const 13 + i32.const 17 i32.rotl - i32.const -1640531535 - i32.mul - local.set $1 - local.get $5 - local.get $2 - i32.load offset=4 - i32.const -2048144777 + i32.const 668265263 i32.mul + local.set $2 + local.get $1 + i32.const 4 i32.add - i32.const 13 - i32.rotl - i32.const -1640531535 - i32.mul - local.set $5 - local.get $8 + local.set $1 + br $while-continue|1 + end + end + loop $while-continue|2 + local.get $1 + local.get $3 + i32.lt_s + if local.get $2 - i32.load offset=8 - i32.const -2048144777 - i32.mul + local.get $0 + local.get $1 i32.add - i32.const 13 - i32.rotl - i32.const -1640531535 - i32.mul - local.set $8 - local.get $6 - local.get $2 - i32.load offset=12 - i32.const -2048144777 + i32.load8_u + i32.const 374761393 i32.mul i32.add - i32.const 13 + i32.const 11 i32.rotl i32.const -1640531535 i32.mul - local.set $6 - local.get $3 - i32.const 16 + local.set $2 + local.get $1 + i32.const 1 i32.add - local.set $3 - br $while-continue|0 + local.set $1 + br $while-continue|2 end end - local.get $7 - local.get $3 - i32.sub - local.set $2 - local.get $1 - i32.const 1 - i32.rotl - local.get $5 - i32.const 7 - i32.rotl - i32.add - local.get $8 - i32.const 12 - i32.rotl - i32.add - local.get $6 - i32.const 18 - i32.rotl - i32.add + local.get $2 + local.get $2 + i32.const 15 + i32.shr_u + i32.xor + i32.const -2048144777 + i32.mul + local.tee $0 + local.get $0 + i32.const 13 + i32.shr_u + i32.xor + i32.const -1028477379 + i32.mul + local.tee $0 + local.get $0 + i32.const 16 + i32.shr_u + i32.xor else - i32.const 374761393 - end - local.set $1 - local.get $2 - i32.const 4 - i32.sub - local.set $3 - loop $while-continue|1 - local.get $3 - local.get $4 - i32.ge_s - if - local.get $1 - local.get $0 - local.get $4 - i32.add - i32.load - i32.const -1028477379 - i32.mul - i32.add - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $1 - local.get $4 - i32.const 4 - i32.add - local.set $4 - br $while-continue|1 - end - end - loop $while-continue|2 - local.get $3 - local.get $4 - i32.gt_s - if - local.get $1 - local.get $0 - local.get $4 - i32.add - i32.load8_u - i32.const 374761393 - i32.mul - i32.add - i32.const 11 - i32.rotl - i32.const -1640531535 - i32.mul - local.set $1 - local.get $4 - i32.const 1 - i32.add - local.set $4 - br $while-continue|2 - end + i32.const 0 end - local.get $1 - local.get $1 - i32.const 15 - i32.shr_u - i32.xor - i32.const -2048144777 - i32.mul - local.tee $0 - local.get $0 - i32.const 13 - i32.shr_u - i32.xor - i32.const -1028477379 - i32.mul - local.tee $0 - local.get $0 - i32.const 16 - i32.shr_u - i32.xor ) (func $~lib/string/String.__eq (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -751,7 +757,7 @@ local.get $2 local.get $4 local.get $7 - call $~lib/util/hash/hashStr + call $~lib/util/hash/HASH<~lib/string/String> local.get $1 i32.and i32.const 2 @@ -804,11 +810,11 @@ i32.load offset=20 i32.store offset=16 ) - (func $~lib/util/hash/hash32 (param $0 i32) (result i32) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) local.get $0 i32.const -1028477379 i32.mul - i32.const 374761393 + i32.const 374761397 i32.add i32.const 17 i32.rotl @@ -935,7 +941,7 @@ local.get $2 local.get $4 local.get $7 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -995,7 +1001,7 @@ local.get $0 local.get $1 local.get $1 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.tee $3 call $~lib/map/Map#find local.tee $2 @@ -1092,12 +1098,12 @@ if global.get $~lib/symbol/stringToId i32.const 1056 - call $~lib/util/hash/hashStr + call $~lib/util/hash/HASH<~lib/string/String> call $~lib/map/Map<~lib/string/String,usize>#find if global.get $~lib/symbol/stringToId i32.const 1056 - call $~lib/util/hash/hashStr + call $~lib/util/hash/HASH<~lib/string/String> call $~lib/map/Map<~lib/string/String,usize>#find local.tee $0 i32.eqz @@ -1178,7 +1184,7 @@ global.get $~lib/symbol/stringToId local.tee $1 i32.const 1056 - call $~lib/util/hash/hashStr + call $~lib/util/hash/HASH<~lib/string/String> local.tee $3 call $~lib/map/Map<~lib/string/String,usize>#find local.tee $2 @@ -1267,7 +1273,7 @@ local.get $0 local.get $1 local.get $1 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne @@ -1276,7 +1282,7 @@ local.get $0 local.get $1 local.get $1 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/map/Map#find local.tee $0 i32.eqz diff --git a/tests/compiler/std/symbol.untouched.wat b/tests/compiler/std/symbol.untouched.wat index 620afb0b4d..89ce6346be 100644 --- a/tests/compiler/std/symbol.untouched.wat +++ b/tests/compiler/std/symbol.untouched.wat @@ -554,7 +554,7 @@ i32.const 1 i32.shr_u ) - (func $~lib/util/hash/hashStr (param $0 i32) (result i32) + (func $~lib/util/hash/HASH<~lib/string/String> (param $0 i32) (result i32) (local $1 i32) (local $2 i32) (local $3 i32) @@ -569,250 +569,269 @@ local.get $0 call $~lib/rt/stub/__retain local.set $0 - local.get $0 - i32.const 0 - i32.eq - if - i32.const 0 - local.set $1 - local.get $0 - call $~lib/rt/stub/__release - local.get $1 - return - end - i32.const 0 - i32.const 374761393 - i32.add - local.set $2 - local.get $0 - call $~lib/string/String#get:length i32.const 1 - i32.shl - local.set $3 - local.get $3 - i32.const 16 - i32.ge_s - if - i32.const 0 - i32.const -1640531535 - i32.add - i32.const -2048144777 - i32.add + drop + block $~lib/util/hash/hashStr|inlined.0 (result i32) + local.get $0 + call $~lib/rt/stub/__retain local.set $1 + local.get $1 i32.const 0 - i32.const -2048144777 - i32.add - local.set $4 - i32.const 0 - local.set $5 - i32.const 0 - i32.const -1640531535 - i32.sub - local.set $6 - i32.const 0 - local.set $7 - local.get $3 - i32.const 16 - i32.sub + i32.eq + if + i32.const 0 + local.set $2 + local.get $1 + call $~lib/rt/stub/__release + local.get $2 + br $~lib/util/hash/hashStr|inlined.0 + end + local.get $1 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.set $2 + local.get $2 local.set $3 - loop $while-continue|0 + local.get $2 + i32.const 16 + i32.ge_s + if + i32.const 0 + i32.const -1640531535 + i32.add + i32.const -2048144777 + i32.add + local.set $4 + i32.const 0 + i32.const -2048144777 + i32.add + local.set $5 + i32.const 0 + local.set $6 + i32.const 0 + i32.const -1640531535 + i32.sub + local.set $7 + i32.const 0 + local.set $8 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + loop $while-continue|0 + local.get $8 + local.get $2 + i32.le_s + local.set $9 + local.get $9 + if + local.get $4 + local.set $11 + local.get $1 + local.get $8 + i32.add + i32.load + local.set $10 + local.get $11 + local.get $10 + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $4 + local.get $5 + local.set $11 + local.get $1 + local.get $8 + i32.add + i32.load offset=4 + local.set $10 + local.get $11 + local.get $10 + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $5 + local.get $6 + local.set $11 + local.get $1 + local.get $8 + i32.add + i32.load offset=8 + local.set $10 + local.get $11 + local.get $10 + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $6 + local.get $7 + local.set $11 + local.get $1 + local.get $8 + i32.add + i32.load offset=12 + local.set $10 + local.get $11 + local.get $10 + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $7 + local.get $8 + i32.const 16 + i32.add + local.set $8 + br $while-continue|0 + end + end + local.get $3 + local.get $4 + i32.const 1 + i32.rotl + local.get $5 + i32.const 7 + i32.rotl + i32.add + local.get $6 + i32.const 12 + i32.rotl + i32.add local.get $7 + i32.const 18 + i32.rotl + i32.add + i32.add + local.set $3 + local.get $2 + local.get $8 + i32.sub + local.set $2 + else local.get $3 - i32.le_s - local.set $8 + i32.const 0 + i32.const 374761393 + i32.add + i32.add + local.set $3 + end + i32.const 0 + local.set $8 + local.get $2 + i32.const 4 + i32.sub + local.set $2 + loop $while-continue|1 local.get $8 + local.get $2 + i32.le_s + local.set $7 + local.get $7 if + local.get $3 local.get $1 - local.set $10 - local.get $0 - local.get $7 + local.get $8 i32.add i32.load - local.set $9 - local.get $10 - local.get $9 - i32.const -2048144777 + i32.const -1028477379 i32.mul i32.add - i32.const 13 - i32.rotl - i32.const -1640531535 - i32.mul - local.set $1 - local.get $4 - local.set $10 - local.get $0 - local.get $7 - i32.add - i32.load offset=4 - local.set $9 - local.get $10 - local.get $9 - i32.const -2048144777 - i32.mul - i32.add - i32.const 13 + local.set $3 + local.get $3 + i32.const 17 i32.rotl - i32.const -1640531535 - i32.mul - local.set $4 - local.get $5 - local.set $10 - local.get $0 - local.get $7 - i32.add - i32.load offset=8 - local.set $9 - local.get $10 - local.get $9 - i32.const -2048144777 + i32.const 668265263 i32.mul + local.set $3 + local.get $8 + i32.const 4 i32.add - i32.const 13 - i32.rotl - i32.const -1640531535 - i32.mul - local.set $5 - local.get $6 - local.set $10 - local.get $0 - local.get $7 + local.set $8 + br $while-continue|1 + end + end + loop $while-continue|2 + local.get $8 + local.get $2 + i32.lt_s + local.set $7 + local.get $7 + if + local.get $3 + local.get $1 + local.get $8 i32.add - i32.load offset=12 - local.set $9 - local.get $10 - local.get $9 - i32.const -2048144777 + i32.load8_u + i32.const 374761393 i32.mul i32.add - i32.const 13 + local.set $3 + local.get $3 + i32.const 11 i32.rotl i32.const -1640531535 i32.mul - local.set $6 - local.get $7 - i32.const 16 + local.set $3 + local.get $8 + i32.const 1 i32.add - local.set $7 - br $while-continue|0 + local.set $8 + br $while-continue|2 end end - local.get $1 - i32.const 1 - i32.rotl - local.get $4 - i32.const 7 - i32.rotl - i32.add - local.get $5 - i32.const 12 - i32.rotl - i32.add - local.get $6 - i32.const 18 - i32.rotl - i32.add - local.set $2 local.get $3 - local.get $7 - i32.sub + local.get $3 + i32.const 15 + i32.shr_u + i32.xor local.set $3 - end - i32.const 0 - local.set $11 - local.get $3 - i32.const 4 - i32.sub - local.set $3 - loop $while-continue|1 - local.get $11 local.get $3 - i32.le_s - local.set $7 - local.get $7 - if - local.get $2 - local.get $0 - local.get $11 - i32.add - i32.load - i32.const -1028477379 - i32.mul - i32.add - local.set $2 - local.get $2 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $2 - local.get $11 - i32.const 4 - i32.add - local.set $11 - br $while-continue|1 - end - end - loop $while-continue|2 - local.get $11 + i32.const -2048144777 + i32.mul + local.set $3 local.get $3 - i32.lt_s - local.set $7 - local.get $7 - if - local.get $2 - local.get $0 - local.get $11 - i32.add - i32.load8_u - i32.const 374761393 - i32.mul - i32.add - local.set $2 - local.get $2 - i32.const 11 - i32.rotl - i32.const -1640531535 - i32.mul - local.set $2 - local.get $11 - i32.const 1 - i32.add - local.set $11 - br $while-continue|2 - end - end - local.get $2 - local.get $2 - i32.const 15 - i32.shr_u - i32.xor - local.set $2 - local.get $2 - i32.const -2048144777 - i32.mul - local.set $2 - local.get $2 - local.get $2 - i32.const 13 - i32.shr_u - i32.xor - local.set $2 - local.get $2 - i32.const -1028477379 - i32.mul - local.set $2 - local.get $2 - local.get $2 - i32.const 16 - i32.shr_u - i32.xor - local.set $2 - local.get $2 - local.set $7 + local.get $3 + i32.const 13 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -1028477379 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 16 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + local.set $7 + local.get $1 + call $~lib/rt/stub/__release + local.get $7 + end + local.set $8 local.get $0 call $~lib/rt/stub/__release - local.get $7 + local.get $8 + return ) (func $~lib/util/string/compareImpl (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) (local $5 i32) @@ -1077,26 +1096,13 @@ ) (func $~lib/map/Map<~lib/string/String,usize>#has (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) local.get $1 call $~lib/rt/stub/__retain local.set $1 local.get $0 local.get $1 - block $~lib/util/hash/HASH<~lib/string/String>|inlined.0 (result i32) - local.get $1 - call $~lib/rt/stub/__retain - local.set $2 - i32.const 1 - drop - local.get $2 - call $~lib/util/hash/hashStr - local.set $3 - local.get $2 - call $~lib/rt/stub/__release - local.get $3 - br $~lib/util/hash/HASH<~lib/string/String>|inlined.0 - end + local.get $1 + call $~lib/util/hash/HASH<~lib/string/String> call $~lib/map/Map<~lib/string/String,usize>#find i32.const 0 i32.ne @@ -1108,29 +1114,16 @@ (func $~lib/map/Map<~lib/string/String,usize>#get (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - (local $4 i32) local.get $1 call $~lib/rt/stub/__retain local.set $1 local.get $0 local.get $1 - block $~lib/util/hash/HASH<~lib/string/String>|inlined.1 (result i32) - local.get $1 - call $~lib/rt/stub/__retain - local.set $2 - i32.const 1 - drop - local.get $2 - call $~lib/util/hash/hashStr - local.set $3 - local.get $2 - call $~lib/rt/stub/__release - local.get $3 - br $~lib/util/hash/HASH<~lib/string/String>|inlined.1 - end + local.get $1 + call $~lib/util/hash/HASH<~lib/string/String> call $~lib/map/Map<~lib/string/String,usize>#find - local.set $4 - local.get $4 + local.set $2 + local.get $2 i32.eqz if i32.const 224 @@ -1140,12 +1133,12 @@ call $~lib/builtins/abort unreachable end - local.get $4 + local.get $2 i32.load offset=4 - local.set $2 + local.set $3 local.get $1 call $~lib/rt/stub/__release - local.get $2 + local.get $3 ) (func $~lib/map/Map<~lib/string/String,usize>#rehash (param $0 i32) (param $1 i32) (local $2 i32) @@ -1223,20 +1216,8 @@ local.get $10 i32.load offset=4 i32.store offset=4 - block $~lib/util/hash/HASH<~lib/string/String>|inlined.3 (result i32) - local.get $12 - call $~lib/rt/stub/__retain - local.set $13 - i32.const 1 - drop - local.get $13 - call $~lib/util/hash/hashStr - local.set $14 - local.get $13 - call $~lib/rt/stub/__release - local.get $14 - br $~lib/util/hash/HASH<~lib/string/String>|inlined.3 - end + local.get $12 + call $~lib/util/hash/HASH<~lib/string/String> local.get $1 i32.and local.set $13 @@ -1324,31 +1305,19 @@ local.get $1 call $~lib/rt/stub/__retain local.set $1 - block $~lib/util/hash/HASH<~lib/string/String>|inlined.2 (result i32) - local.get $1 - call $~lib/rt/stub/__retain - local.set $3 - i32.const 1 - drop - local.get $3 - call $~lib/util/hash/hashStr - local.set $4 - local.get $3 - call $~lib/rt/stub/__release - local.get $4 - br $~lib/util/hash/HASH<~lib/string/String>|inlined.2 - end - local.set $5 + local.get $1 + call $~lib/util/hash/HASH<~lib/string/String> + local.set $3 local.get $0 local.get $1 - local.get $5 + local.get $3 call $~lib/map/Map<~lib/string/String,usize>#find - local.set $6 - local.get $6 + local.set $4 + local.get $4 if i32.const 0 drop - local.get $6 + local.get $4 local.get $2 i32.store offset=4 else @@ -1384,25 +1353,25 @@ local.get $0 i32.load offset=8 call $~lib/rt/stub/__retain - local.set $3 - local.get $3 + local.set $5 + local.get $5 local.get $0 local.get $0 i32.load offset=16 - local.tee $4 + local.tee $6 i32.const 1 i32.add i32.store offset=16 - local.get $4 + local.get $6 i32.const 12 i32.mul i32.add - local.set $6 - local.get $6 + local.set $4 + local.get $4 local.get $1 call $~lib/rt/stub/__retain i32.store - local.get $6 + local.get $4 local.get $2 i32.store offset=4 local.get $0 @@ -1413,76 +1382,95 @@ i32.store offset=20 local.get $0 i32.load - local.get $5 + local.get $3 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $4 - local.get $6 + local.set $6 local.get $4 + local.get $6 i32.load i32.store offset=8 - local.get $4 local.get $6 + local.get $4 i32.store - local.get $3 + local.get $5 call $~lib/rt/stub/__release end local.get $0 call $~lib/rt/stub/__retain - local.set $4 + local.set $6 local.get $1 call $~lib/rt/stub/__release - local.get $4 + local.get $6 ) - (func $~lib/util/hash/hash32 (param $0 i32) (result i32) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) (local $1 i32) + (local $2 i32) + (local $3 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 4 + i32.const 4 + i32.le_u + drop + local.get $0 + local.set $2 + i32.const 4 + local.set $1 i32.const 0 i32.const 374761393 i32.add - local.set $1 local.get $1 - local.get $0 + i32.add + local.set $3 + local.get $3 + local.get $2 i32.const -1028477379 i32.mul i32.add - local.set $1 - local.get $1 + local.set $3 + local.get $3 i32.const 17 i32.rotl i32.const 668265263 i32.mul - local.set $1 - local.get $1 - local.get $1 + local.set $3 + local.get $3 + local.get $3 i32.const 15 i32.shr_u i32.xor - local.set $1 - local.get $1 + local.set $3 + local.get $3 i32.const -2048144777 i32.mul - local.set $1 - local.get $1 - local.get $1 + local.set $3 + local.get $3 + local.get $3 i32.const 13 i32.shr_u i32.xor - local.set $1 - local.get $1 + local.set $3 + local.get $3 i32.const -1028477379 i32.mul - local.set $1 - local.get $1 - local.get $1 + local.set $3 + local.get $3 + local.get $3 i32.const 16 i32.shr_u i32.xor - local.set $1 - local.get $1 + local.set $3 + local.get $3 + return ) (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -1609,23 +1597,8 @@ local.get $10 i32.load offset=4 i32.store offset=4 - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 4 - i32.le_u - drop - local.get $13 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.1 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -1711,45 +1684,30 @@ local.get $2 call $~lib/rt/stub/__retain local.set $2 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 4 - i32.le_u - drop - local.get $3 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.0 - end - local.set $4 + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 local.get $1 - local.get $4 + local.get $3 call $~lib/map/Map#find - local.set $5 - local.get $5 + local.set $4 + local.get $4 if i32.const 1 drop - local.get $5 + local.get $4 i32.load offset=4 - local.set $3 + local.set $5 local.get $2 - local.get $3 + local.get $5 i32.ne if - local.get $5 + local.get $4 local.get $2 call $~lib/rt/stub/__retain i32.store offset=4 - local.get $3 + local.get $5 call $~lib/rt/stub/__release end else @@ -1785,8 +1743,8 @@ local.get $0 i32.load offset=8 call $~lib/rt/stub/__retain - local.set $3 - local.get $3 + local.set $5 + local.get $5 local.get $0 local.get $0 i32.load offset=16 @@ -1798,11 +1756,11 @@ i32.const 12 i32.mul i32.add - local.set $5 - local.get $5 + local.set $4 + local.get $4 local.get $1 i32.store - local.get $5 + local.get $4 local.get $2 call $~lib/rt/stub/__retain i32.store offset=4 @@ -1814,7 +1772,7 @@ i32.store offset=20 local.get $0 i32.load - local.get $4 + local.get $3 local.get $0 i32.load offset=4 i32.and @@ -1822,14 +1780,14 @@ i32.mul i32.add local.set $6 - local.get $5 + local.get $4 local.get $6 i32.load i32.store offset=8 local.get $6 - local.get $5 + local.get $4 i32.store - local.get $3 + local.get $5 call $~lib/rt/stub/__release end local.get $0 @@ -1906,55 +1864,23 @@ local.get $1 ) (func $~lib/map/Map#has (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 4 - i32.le_u - drop - local.get $2 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne ) (func $~lib/map/Map#get (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) local.get $0 local.get $1 - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 4 - i32.le_u - drop - local.get $2 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.3 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 224 @@ -1964,7 +1890,7 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $2 i32.load offset=4 call $~lib/rt/stub/__retain ) From 93b68bd8c7ba78f53f3ce8b41e892c1efc4c39fc Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Fri, 18 Dec 2020 03:00:09 +0200 Subject: [PATCH 05/14] update fixtures --- tests/compiler/std/hash.optimized.wat | 6 ++++++ tests/compiler/std/hash.untouched.wat | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/tests/compiler/std/hash.optimized.wat b/tests/compiler/std/hash.optimized.wat index a52e475fba..70e7cc5cde 100644 --- a/tests/compiler/std/hash.optimized.wat +++ b/tests/compiler/std/hash.optimized.wat @@ -6,6 +6,12 @@ (data (i32.const 1068) "\1c\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00a") (data (i32.const 1100) "\1c\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\04\00\00\00a\00b") (data (i32.const 1132) "\1c\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\06\00\00\00a\00b\00c") + (data (i32.const 1164) "\1c\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\08\00\00\00a\00b\00c\00d") + (data (i32.const 1196) "\1c\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00a\00b\00c\00d\00e") + (data (i32.const 1228) "\1c\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\0c\00\00\00a\00b\00c\00d\00e\00f") + (data (i32.const 1260) ",\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\0e\00\00\00a\00b\00c\00d\00e\00f\00g") + (data (i32.const 1308) ",\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\10\00\00\00a\00b\00c\00d\00e\00f\00g\00h") + (data (i32.const 1356) ",\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\12\00\00\00a\00b\00c\00d\00e\00f\00g\00h\00i") (export "memory" (memory $0)) (start $~start) (func $~lib/util/hash/HASH<~lib/string/String|null> (param $0 i32) diff --git a/tests/compiler/std/hash.untouched.wat b/tests/compiler/std/hash.untouched.wat index fd834b8f30..2340b01588 100644 --- a/tests/compiler/std/hash.untouched.wat +++ b/tests/compiler/std/hash.untouched.wat @@ -9,6 +9,12 @@ (data (i32.const 44) "\1c\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00a\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 76) "\1c\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\04\00\00\00a\00b\00\00\00\00\00\00\00\00\00") (data (i32.const 108) "\1c\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\06\00\00\00a\00b\00c\00\00\00\00\00\00\00") + (data (i32.const 140) "\1c\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\08\00\00\00a\00b\00c\00d\00\00\00\00\00") + (data (i32.const 172) "\1c\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00a\00b\00c\00d\00e\00\00\00") + (data (i32.const 204) "\1c\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\0c\00\00\00a\00b\00c\00d\00e\00f\00") + (data (i32.const 236) ",\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\0e\00\00\00a\00b\00c\00d\00e\00f\00g\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 284) ",\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\10\00\00\00a\00b\00c\00d\00e\00f\00g\00h\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 332) ",\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\12\00\00\00a\00b\00c\00d\00e\00f\00g\00h\00i\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) (export "memory" (memory $0)) (start $~start) From cd308a4250bd4cc39f1270e077601bfde641400a Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Sat, 6 Feb 2021 19:33:50 +0200 Subject: [PATCH 06/14] update --- tests/compiler/std/hash.optimized.wat | 159 +- tests/compiler/std/hash.untouched.wat | 954 +-- tests/compiler/std/map.optimized.wat | 2318 +----- tests/compiler/std/map.untouched.wat | 9916 +++++------------------ tests/compiler/std/set.optimized.wat | 1781 +--- tests/compiler/std/set.untouched.wat | 8148 +++++-------------- tests/compiler/std/symbol.optimized.wat | 679 +- tests/compiler/std/symbol.untouched.wat | 1715 ++-- 8 files changed, 6025 insertions(+), 19645 deletions(-) diff --git a/tests/compiler/std/hash.optimized.wat b/tests/compiler/std/hash.optimized.wat index 17d9dcc97c..0d439f79d0 100644 --- a/tests/compiler/std/hash.optimized.wat +++ b/tests/compiler/std/hash.optimized.wat @@ -4,29 +4,6 @@ (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) -<<<<<<< HEAD - (data (i32.const 1036) "\1c\00\00\00\01\00\00\00\00\00\00\00\01") - (data (i32.const 1068) "\1c\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00a") - (data (i32.const 1100) "\1c\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\04\00\00\00a\00b") - (data (i32.const 1132) "\1c\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\06\00\00\00a\00b\00c") - (data (i32.const 1164) "\1c\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\08\00\00\00a\00b\00c\00d") - (data (i32.const 1196) "\1c\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00a\00b\00c\00d\00e") - (data (i32.const 1228) "\1c\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\0c\00\00\00a\00b\00c\00d\00e\00f") - (data (i32.const 1260) ",\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\0e\00\00\00a\00b\00c\00d\00e\00f\00g") - (data (i32.const 1308) ",\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\10\00\00\00a\00b\00c\00d\00e\00f\00g\00h") - (data (i32.const 1356) ",\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\12\00\00\00a\00b\00c\00d\00e\00f\00g\00h\00i") - (export "memory" (memory $0)) - (start $~start) - (func $~lib/util/hash/HASH<~lib/string/String|null> (param $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) -======= (data (i32.const 1036) "\1c") (data (i32.const 1048) "\01") (data (i32.const 1068) "\1c") @@ -35,93 +12,62 @@ (data (i32.const 1112) "\01\00\00\00\04\00\00\00a\00b") (data (i32.const 1132) "\1c") (data (i32.const 1144) "\01\00\00\00\06\00\00\00a\00b\00c") - (global $~lib/memory/__stack_pointer (mut i32) (i32.const 17548)) + (data (i32.const 1164) "\1c") + (data (i32.const 1176) "\01\00\00\00\08\00\00\00a\00b\00c\00d") + (data (i32.const 1196) "\1c") + (data (i32.const 1208) "\01\00\00\00\n\00\00\00a\00b\00c\00d\00e") + (data (i32.const 1228) "\1c") + (data (i32.const 1240) "\01\00\00\00\0c\00\00\00a\00b\00c\00d\00e\00f") + (data (i32.const 1260) ",") + (data (i32.const 1272) "\01\00\00\00\0e\00\00\00a\00b\00c\00d\00e\00f\00g") + (data (i32.const 1308) ",") + (data (i32.const 1320) "\01\00\00\00\10\00\00\00a\00b\00c\00d\00e\00f\00g\00h") + (data (i32.const 1356) ",") + (data (i32.const 1368) "\01\00\00\00\12\00\00\00a\00b\00c\00d\00e\00f\00g\00h\00i") + (global $~lib/memory/__stack_pointer (mut i32) (i32.const 17788)) (export "memory" (memory $0)) (start $~start) (func $~start - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i64.const 0 - i64.store - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - i32.const 0 - call $~lib/util/hash/hashStr - global.get $~lib/memory/__stack_pointer - i32.const 1056 - i32.store offset=4 - global.get $~lib/memory/__stack_pointer - i32.const 1056 - i32.store - i32.const 1056 - call $~lib/util/hash/hashStr - global.get $~lib/memory/__stack_pointer - i32.const 1088 - i32.store offset=4 - global.get $~lib/memory/__stack_pointer - i32.const 1088 - i32.store - i32.const 1088 - call $~lib/util/hash/hashStr - global.get $~lib/memory/__stack_pointer - i32.const 1120 - i32.store offset=4 - global.get $~lib/memory/__stack_pointer - i32.const 1120 - i32.store - i32.const 1120 - call $~lib/util/hash/hashStr - global.get $~lib/memory/__stack_pointer - i32.const 1152 - i32.store offset=4 - global.get $~lib/memory/__stack_pointer - i32.const 1152 - i32.store - i32.const 1152 - call $~lib/util/hash/hashStr - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer + call $start:std/hash ) (func $~stack_check global.get $~lib/memory/__stack_pointer - i32.const 1164 + i32.const 1404 i32.lt_s if - i32.const 17568 - i32.const 17616 + i32.const 17808 + i32.const 17856 i32.const 1 i32.const 1 call $~lib/builtins/abort unreachable end ) - (func $~lib/util/hash/hashStr (param $0 i32) + (func $~lib/util/hash/HASH<~lib/string/String|null> (param $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + (local $8 i32) global.get $~lib/memory/__stack_pointer - i32.const 4 + i32.const 8 i32.sub global.set $~lib/memory/__stack_pointer call $~stack_check global.get $~lib/memory/__stack_pointer - i32.const 0 + i64.const 0 + i64.store + global.get $~lib/memory/__stack_pointer + local.get $0 i32.store - i32.const -2128831035 - local.set $2 ->>>>>>> master local.get $0 if global.get $~lib/memory/__stack_pointer local.get $0 - i32.store + i32.store offset=4 local.get $0 i32.const 20 i32.sub @@ -288,40 +234,79 @@ end end end -<<<<<<< HEAD + global.get $~lib/memory/__stack_pointer + i32.const 8 + i32.add + global.set $~lib/memory/__stack_pointer ) - (func $~start + (func $start:std/hash (local $0 f32) (local $1 i32) (local $2 f64) (local $3 i64) + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i32.const 0 + i32.store i32.const 0 call $~lib/util/hash/HASH<~lib/string/String|null> + global.get $~lib/memory/__stack_pointer + i32.const 1056 + i32.store i32.const 1056 call $~lib/util/hash/HASH<~lib/string/String|null> + global.get $~lib/memory/__stack_pointer + i32.const 1088 + i32.store i32.const 1088 call $~lib/util/hash/HASH<~lib/string/String|null> + global.get $~lib/memory/__stack_pointer + i32.const 1120 + i32.store i32.const 1120 call $~lib/util/hash/HASH<~lib/string/String|null> + global.get $~lib/memory/__stack_pointer + i32.const 1152 + i32.store i32.const 1152 call $~lib/util/hash/HASH<~lib/string/String|null> + global.get $~lib/memory/__stack_pointer + i32.const 1184 + i32.store i32.const 1184 call $~lib/util/hash/HASH<~lib/string/String|null> + global.get $~lib/memory/__stack_pointer + i32.const 1216 + i32.store i32.const 1216 call $~lib/util/hash/HASH<~lib/string/String|null> + global.get $~lib/memory/__stack_pointer + i32.const 1248 + i32.store i32.const 1248 call $~lib/util/hash/HASH<~lib/string/String|null> + global.get $~lib/memory/__stack_pointer + i32.const 1280 + i32.store i32.const 1280 call $~lib/util/hash/HASH<~lib/string/String|null> + global.get $~lib/memory/__stack_pointer + i32.const 1328 + i32.store i32.const 1328 call $~lib/util/hash/HASH<~lib/string/String|null> + global.get $~lib/memory/__stack_pointer + i32.const 1376 + i32.store i32.const 1376 call $~lib/util/hash/HASH<~lib/string/String|null> -======= global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer ->>>>>>> master ) ) diff --git a/tests/compiler/std/hash.untouched.wat b/tests/compiler/std/hash.untouched.wat index 2c30ef9e4d..295b409a17 100644 --- a/tests/compiler/std/hash.untouched.wat +++ b/tests/compiler/std/hash.untouched.wat @@ -1,46 +1,27 @@ (module (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_none (func)) -<<<<<<< HEAD - (type $i32_=>_none (func (param i32))) + (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $f32_=>_i32 (func (param f32) (result i32))) (type $f64_=>_i32 (func (param f64) (result i32))) - (memory $0 1) - (data (i32.const 12) "\1c\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 44) "\1c\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00a\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 76) "\1c\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\04\00\00\00a\00b\00\00\00\00\00\00\00\00\00") - (data (i32.const 108) "\1c\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\06\00\00\00a\00b\00c\00\00\00\00\00\00\00") - (data (i32.const 140) "\1c\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\08\00\00\00a\00b\00c\00d\00\00\00\00\00") - (data (i32.const 172) "\1c\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00a\00b\00c\00d\00e\00\00\00") - (data (i32.const 204) "\1c\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\0c\00\00\00a\00b\00c\00d\00e\00f\00") - (data (i32.const 236) ",\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\0e\00\00\00a\00b\00c\00d\00e\00f\00g\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 284) ",\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\10\00\00\00a\00b\00c\00d\00e\00f\00g\00h\00\00\00\00\00\00\00\00\00\00\00\00\00") - (data (i32.const 332) ",\00\00\00\01\00\00\00\00\00\00\00\01\00\00\00\12\00\00\00a\00b\00c\00d\00e\00f\00g\00h\00i\00\00\00\00\00\00\00\00\00\00\00") -======= - (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) - (type $i64_=>_i32 (func (param i64) (result i32))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) (data (i32.const 12) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 44) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\02\00\00\00a\00\00\00\00\00\00\00\00\00\00\00") (data (i32.const 76) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\04\00\00\00a\00b\00\00\00\00\00\00\00\00\00") (data (i32.const 108) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\06\00\00\00a\00b\00c\00\00\00\00\00\00\00") ->>>>>>> master + (data (i32.const 140) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\08\00\00\00a\00b\00c\00d\00\00\00\00\00") + (data (i32.const 172) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\n\00\00\00a\00b\00c\00d\00e\00\00\00") + (data (i32.const 204) "\1c\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\0c\00\00\00a\00b\00c\00d\00e\00f\00") + (data (i32.const 236) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\0e\00\00\00a\00b\00c\00d\00e\00f\00g\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 284) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\10\00\00\00a\00b\00c\00d\00e\00f\00g\00h\00\00\00\00\00\00\00\00\00\00\00\00\00") + (data (i32.const 332) ",\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00\12\00\00\00a\00b\00c\00d\00e\00f\00g\00h\00i\00\00\00\00\00\00\00\00\00\00\00") (table $0 1 funcref) - (global $~lib/memory/__data_end i32 (i32.const 140)) - (global $~lib/memory/__stack_pointer (mut i32) (i32.const 16524)) - (global $~lib/memory/__heap_base i32 (i32.const 16524)) + (global $~lib/memory/__data_end i32 (i32.const 380)) + (global $~lib/memory/__stack_pointer (mut i32) (i32.const 16764)) + (global $~lib/memory/__heap_base i32 (i32.const 16764)) (export "memory" (memory $0)) (start $~start) -<<<<<<< HEAD - (func $~lib/rt/stub/__retain (param $0 i32) (result i32) - local.get $0 - ) - (func $~lib/rt/stub/__release (param $0 i32) - nop - ) -======= ->>>>>>> master (func $~lib/string/String#get:length (param $0 i32) (result i32) local.get $0 i32.const 20 @@ -49,7 +30,174 @@ i32.const 1 i32.shr_u ) -<<<<<<< HEAD + (func $std/hash/check (param $0 i32) (result i32) + i32.const 1 + ) + (func $~lib/util/hash/HASH (param $0 f32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 1 + drop + i32.const 4 + i32.const 4 + i32.eq + drop + local.get $0 + i32.reinterpret_f32 + local.set $1 + i32.const 4 + local.set $2 + i32.const 0 + i32.const 374761393 + i32.add + local.get $2 + i32.add + local.set $3 + local.get $3 + local.get $1 + i32.const -1028477379 + i32.mul + i32.add + local.set $3 + local.get $3 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 15 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -2048144777 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 13 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -1028477379 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 16 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + return + ) + (func $~lib/util/hash/HASH (param $0 f64) (result i32) + (local $1 i64) + (local $2 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 1 + drop + i32.const 8 + i32.const 4 + i32.eq + drop + i32.const 8 + i32.const 8 + i32.eq + drop + local.get $0 + i64.reinterpret_f64 + local.set $1 + i32.const 0 + i32.const 374761393 + i32.add + i32.const 8 + i32.add + local.set $2 + local.get $2 + local.get $1 + i32.wrap_i64 + i32.const -1028477379 + i32.mul + i32.add + local.set $2 + local.get $2 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $2 + local.get $2 + local.get $1 + i64.const 32 + i64.shr_u + i32.wrap_i64 + i32.const -1028477379 + i32.mul + i32.add + local.set $2 + local.get $2 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 15 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + i32.const -2048144777 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 13 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + i32.const -1028477379 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 16 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + return + ) + (func $~start + call $start:std/hash + ) + (func $~stack_check + global.get $~lib/memory/__stack_pointer + global.get $~lib/memory/__data_end + i32.lt_s + if + i32.const 16784 + i32.const 16832 + i32.const 1 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + ) (func $~lib/util/hash/HASH<~lib/string/String|null> (param $0 i32) (result i32) (local $1 i32) (local $2 i32) @@ -62,27 +210,35 @@ (local $9 i32) (local $10 i32) (local $11 i32) - local.get $0 - call $~lib/rt/stub/__retain - local.set $0 + (local $12 i32) + global.get $~lib/memory/__stack_pointer + i32.const 8 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store i32.const 1 drop block $~lib/util/hash/hashStr|inlined.0 (result i32) + global.get $~lib/memory/__stack_pointer local.get $0 - call $~lib/rt/stub/__retain - local.set $1 + local.tee $1 + i32.store local.get $1 i32.const 0 i32.eq if i32.const 0 - local.set $2 - local.get $1 - call $~lib/rt/stub/__release - local.get $2 br $~lib/util/hash/hashStr|inlined.0 end local.get $1 + local.set $12 + global.get $~lib/memory/__stack_pointer + local.get $12 + i32.store offset=4 + local.get $12 call $~lib/string/String#get:length i32.const 1 i32.shl @@ -318,22 +474,15 @@ i32.xor local.set $3 local.get $3 - local.set $7 - local.get $1 - call $~lib/rt/stub/__release - local.get $7 end - local.set $8 - local.get $0 - call $~lib/rt/stub/__release - local.get $8 + local.set $12 + global.get $~lib/memory/__stack_pointer + i32.const 8 + i32.add + global.set $~lib/memory/__stack_pointer + local.get $12 return ) -======= ->>>>>>> master - (func $std/hash/check (param $0 i32) (result i32) - i32.const 1 - ) (func $~lib/util/hash/HASH<~lib/string/String> (param $0 i32) (result i32) (local $1 i32) (local $2 i32) @@ -346,27 +495,35 @@ (local $9 i32) (local $10 i32) (local $11 i32) - local.get $0 - call $~lib/rt/stub/__retain - local.set $0 + (local $12 i32) + global.get $~lib/memory/__stack_pointer + i32.const 8 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store i32.const 1 drop block $~lib/util/hash/hashStr|inlined.1 (result i32) + global.get $~lib/memory/__stack_pointer local.get $0 - call $~lib/rt/stub/__retain - local.set $1 + local.tee $1 + i32.store local.get $1 i32.const 0 i32.eq if i32.const 0 - local.set $2 - local.get $1 - call $~lib/rt/stub/__release - local.get $2 br $~lib/util/hash/hashStr|inlined.1 end local.get $1 + local.set $12 + global.get $~lib/memory/__stack_pointer + local.get $12 + i32.store offset=4 + local.get $12 call $~lib/string/String#get:length i32.const 1 i32.shl @@ -602,289 +759,116 @@ i32.xor local.set $3 local.get $3 - local.set $7 - local.get $1 - call $~lib/rt/stub/__release - local.get $7 end - local.set $8 - local.get $0 - call $~lib/rt/stub/__release - local.get $8 + local.set $12 + global.get $~lib/memory/__stack_pointer + i32.const 8 + i32.add + global.set $~lib/memory/__stack_pointer + local.get $12 return ) - (func $~lib/util/hash/HASH (param $0 f32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) + (func $start:std/hash + (local $0 i32) + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer i32.const 0 - drop + i32.store i32.const 0 + call $~lib/util/hash/HASH<~lib/string/String|null> + call $std/hash/check drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq + i32.const 32 + local.set $0 + global.get $~lib/memory/__stack_pointer + local.get $0 + i32.store + local.get $0 + call $~lib/util/hash/HASH<~lib/string/String> + call $std/hash/check drop + i32.const 64 + local.set $0 + global.get $~lib/memory/__stack_pointer local.get $0 - i32.reinterpret_f32 - local.set $1 - i32.const 4 - local.set $2 - i32.const 0 - i32.const 374761393 - i32.add - local.get $2 - i32.add - local.set $3 - local.get $3 - local.get $1 - i32.const -1028477379 - i32.mul - i32.add - local.set $3 - local.get $3 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 15 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -2048144777 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 13 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -1028477379 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 16 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - return - ) - (func $~lib/util/hash/HASH (param $0 f64) (result i32) - (local $1 i64) - (local $2 i32) - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $0 - i64.reinterpret_f64 - local.set $1 - i32.const 0 - i32.const 374761393 - i32.add - i32.const 8 - i32.add - local.set $2 - local.get $2 - local.get $1 - i32.wrap_i64 - i32.const -1028477379 - i32.mul - i32.add - local.set $2 - local.get $2 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $2 - local.get $2 - local.get $1 - i64.const 32 - i64.shr_u - i32.wrap_i64 - i32.const -1028477379 - i32.mul - i32.add - local.set $2 - local.get $2 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $2 - local.get $2 - local.get $2 - i32.const 15 - i32.shr_u - i32.xor - local.set $2 - local.get $2 - i32.const -2048144777 - i32.mul - local.set $2 - local.get $2 - local.get $2 - i32.const 13 - i32.shr_u - i32.xor - local.set $2 - local.get $2 - i32.const -1028477379 - i32.mul - local.set $2 - local.get $2 - local.get $2 - i32.const 16 - i32.shr_u - i32.xor - local.set $2 - local.get $2 - return - ) - (func $~start - call $start:std/hash - ) - (func $~stack_check - global.get $~lib/memory/__stack_pointer - global.get $~lib/memory/__data_end - i32.lt_s - if - i32.const 16544 - i32.const 16592 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - ) - (func $~lib/util/hash/hashStr (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 i32.store - i32.const -2128831035 - local.set $1 local.get $0 - i32.const 0 - i32.ne - if - i32.const 0 - local.set $2 - local.get $0 - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.store - local.get $5 - call $~lib/string/String#get:length - i32.const 1 - i32.shl - local.set $3 - loop $for-loop|0 - local.get $2 - local.get $3 - i32.lt_u - local.set $4 - local.get $4 - if - local.get $1 - local.get $0 - local.get $2 - i32.add - i32.load8_u - i32.xor - i32.const 16777619 - i32.mul - local.set $1 - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $for-loop|0 - end - end - end - local.get $1 - local.set $5 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $5 - ) - (func $start:std/hash -<<<<<<< HEAD - i32.const 0 - call $~lib/util/hash/HASH<~lib/string/String|null> - call $std/hash/check - drop - i32.const 32 - call $~lib/util/hash/HASH<~lib/string/String> - call $std/hash/check - drop - i32.const 64 call $~lib/util/hash/HASH<~lib/string/String> call $std/hash/check drop i32.const 96 + local.set $0 + global.get $~lib/memory/__stack_pointer + local.get $0 + i32.store + local.get $0 call $~lib/util/hash/HASH<~lib/string/String> call $std/hash/check drop i32.const 128 + local.set $0 + global.get $~lib/memory/__stack_pointer + local.get $0 + i32.store + local.get $0 call $~lib/util/hash/HASH<~lib/string/String> call $std/hash/check drop i32.const 160 + local.set $0 + global.get $~lib/memory/__stack_pointer + local.get $0 + i32.store + local.get $0 call $~lib/util/hash/HASH<~lib/string/String> call $std/hash/check drop i32.const 192 + local.set $0 + global.get $~lib/memory/__stack_pointer + local.get $0 + i32.store + local.get $0 call $~lib/util/hash/HASH<~lib/string/String> call $std/hash/check drop i32.const 224 + local.set $0 + global.get $~lib/memory/__stack_pointer + local.get $0 + i32.store + local.get $0 call $~lib/util/hash/HASH<~lib/string/String> call $std/hash/check drop i32.const 256 + local.set $0 + global.get $~lib/memory/__stack_pointer + local.get $0 + i32.store + local.get $0 call $~lib/util/hash/HASH<~lib/string/String> call $std/hash/check drop i32.const 304 + local.set $0 + global.get $~lib/memory/__stack_pointer + local.get $0 + i32.store + local.get $0 call $~lib/util/hash/HASH<~lib/string/String> call $std/hash/check drop i32.const 352 + local.set $0 + global.get $~lib/memory/__stack_pointer + local.get $0 + i32.store + local.get $0 call $~lib/util/hash/HASH<~lib/string/String> call $std/hash/check drop @@ -934,374 +918,10 @@ drop f64.const nan:0x8000000000000 call $~lib/util/hash/HASH -======= - (local $0 i32) - (local $1 f32) - (local $2 f64) - (local $3 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i64.const 0 - i64.store - block $~lib/util/hash/HASH<~lib/string/String|null>|inlined.0 (result i32) - i32.const 0 - local.set $0 - i32.const 1 - drop - local.get $0 - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store - local.get $3 - call $~lib/util/hash/hashStr - br $~lib/util/hash/HASH<~lib/string/String|null>|inlined.0 - end - call $std/hash/check - drop - block $~lib/util/hash/HASH<~lib/string/String>|inlined.0 (result i32) - global.get $~lib/memory/__stack_pointer - i32.const 32 - local.tee $0 - i32.store offset=4 - i32.const 1 - drop - local.get $0 - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store - local.get $3 - call $~lib/util/hash/hashStr - br $~lib/util/hash/HASH<~lib/string/String>|inlined.0 - end - call $std/hash/check - drop - block $~lib/util/hash/HASH<~lib/string/String>|inlined.1 (result i32) - global.get $~lib/memory/__stack_pointer - i32.const 64 - local.tee $0 - i32.store offset=4 - i32.const 1 - drop - local.get $0 - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store - local.get $3 - call $~lib/util/hash/hashStr - br $~lib/util/hash/HASH<~lib/string/String>|inlined.1 - end - call $std/hash/check - drop - block $~lib/util/hash/HASH<~lib/string/String>|inlined.2 (result i32) - global.get $~lib/memory/__stack_pointer - i32.const 96 - local.tee $0 - i32.store offset=4 - i32.const 1 - drop - local.get $0 - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store - local.get $3 - call $~lib/util/hash/hashStr - br $~lib/util/hash/HASH<~lib/string/String>|inlined.2 - end - call $std/hash/check - drop - block $~lib/util/hash/HASH<~lib/string/String>|inlined.3 (result i32) - global.get $~lib/memory/__stack_pointer - i32.const 128 - local.tee $0 - i32.store offset=4 - i32.const 1 - drop - local.get $0 - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store - local.get $3 - call $~lib/util/hash/hashStr - br $~lib/util/hash/HASH<~lib/string/String>|inlined.3 - end - call $std/hash/check - drop - block $~lib/util/hash/HASH|inlined.0 (result i32) - f32.const 0 - local.set $1 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $1 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.0 - end - call $std/hash/check - drop - block $~lib/util/hash/HASH|inlined.1 (result i32) - f32.const 1 - local.set $1 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $1 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.1 - end - call $std/hash/check - drop - block $~lib/util/hash/HASH|inlined.2 (result i32) - f32.const 1.100000023841858 - local.set $1 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $1 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end - call $std/hash/check - drop - block $~lib/util/hash/HASH|inlined.3 (result i32) - f32.const 0 - local.set $1 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $1 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.3 - end - call $std/hash/check - drop - block $~lib/util/hash/HASH|inlined.4 (result i32) - f32.const inf - local.set $1 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $1 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.4 - end - call $std/hash/check - drop - block $~lib/util/hash/HASH|inlined.5 (result i32) - f32.const nan:0x400000 - local.set $1 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $1 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.5 - end - call $std/hash/check - drop - block $~lib/util/hash/HASH|inlined.0 (result i32) - f64.const 0 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.0 - end - call $std/hash/check - drop - block $~lib/util/hash/HASH|inlined.1 (result i32) - f64.const 1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.1 - end - call $std/hash/check - drop - block $~lib/util/hash/HASH|inlined.2 (result i32) - f64.const 1.1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.2 - end - call $std/hash/check - drop - block $~lib/util/hash/HASH|inlined.3 (result i32) - f64.const 0 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.3 - end - call $std/hash/check - drop - block $~lib/util/hash/HASH|inlined.4 (result i32) - f64.const inf - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.4 - end - call $std/hash/check - drop - block $~lib/util/hash/HASH|inlined.5 (result i32) - f64.const nan:0x8000000000000 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.5 - end ->>>>>>> master call $std/hash/check drop global.get $~lib/memory/__stack_pointer - i32.const 8 + i32.const 4 i32.add global.set $~lib/memory/__stack_pointer ) diff --git a/tests/compiler/std/map.optimized.wat b/tests/compiler/std/map.optimized.wat index 9150625c55..cc0385aa42 100644 --- a/tests/compiler/std/map.optimized.wat +++ b/tests/compiler/std/map.optimized.wat @@ -1,7 +1,7 @@ (module (type $i32_i32_=>_none (func (param i32 i32))) - (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_i32 (func (param i32) (result i32))) + (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $none_=>_none (func)) (type $i32_=>_none (func (param i32))) @@ -23,14 +23,10 @@ (type $i32_f64_i32_=>_none (func (param i32 f64 i32))) (type $i32_f64_f64_=>_none (func (param i32 f64 f64))) (type $i64_=>_i32 (func (param i64) (result i32))) -<<<<<<< HEAD (type $f32_=>_i32 (func (param f32) (result i32))) (type $f64_=>_i32 (func (param f64) (result i32))) - (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) -======= (type $i32_f32_i32_=>_i32 (func (param i32 f32 i32) (result i32))) (type $i32_f64_i32_=>_i32 (func (param i32 f64 i32) (result i32))) ->>>>>>> master (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) (data (i32.const 1036) "<") @@ -1911,18 +1907,6 @@ end i32.const 0 ) -<<<<<<< HEAD - (func $~lib/map/Map#has (param $0 i32) (param $1 i32) (result i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/map/Map#find - i32.const 0 - i32.ne - ) -======= ->>>>>>> master (func $~lib/map/Map#rehash (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) @@ -1993,20 +1977,10 @@ i32.load offset=4 i32.store offset=4 local.get $2 -<<<<<<< HEAD - local.get $5 local.get $6 + local.get $7 call $~lib/util/hash/HASH local.get $1 -======= - local.get $6 - local.get $1 - local.get $7 - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul ->>>>>>> master i32.and i32.const 2 i32.shl @@ -2045,164 +2019,10 @@ local.get $0 i32.load offset=20 i32.store offset=16 -<<<<<<< HEAD - local.get $5 - call $~lib/rt/pure/__release - local.get $3 - call $~lib/rt/pure/__release - ) - (func $~lib/map/Map#set (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - local.tee $5 - call $~lib/map/Map#find - local.tee $3 - if - local.get $3 - local.get $2 - i32.store offset=4 - else - local.get $0 - i32.load offset=16 - local.get $0 - i32.load offset=12 - i32.eq - if - local.get $0 - local.get $0 - i32.load offset=20 - local.get $0 - i32.load offset=12 - i32.const 3 - i32.mul - i32.const 4 - i32.div_s - i32.lt_s - if (result i32) - local.get $0 - i32.load offset=4 - else - local.get $0 - i32.load offset=4 - i32.const 1 - i32.shl - i32.const 1 - i32.or - end - call $~lib/map/Map#rehash - end - local.get $0 - i32.load offset=8 - call $~lib/rt/pure/__retain - local.set $4 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $3 - i32.const 1 - i32.add - i32.store offset=16 - local.get $4 - local.get $3 - i32.const 12 - i32.mul - i32.add - local.tee $3 - local.get $1 - i32.store8 - local.get $3 - local.get $2 - i32.store offset=4 - local.get $0 - local.get $0 - i32.load offset=20 - i32.const 1 - i32.add - i32.store offset=20 - local.get $3 - local.get $0 - i32.load - local.get $5 - local.get $0 - i32.load offset=4 - i32.and - i32.const 2 - i32.shl - i32.add - local.tee $1 - i32.load - i32.store offset=8 - local.get $1 - local.get $3 - i32.store - local.get $4 - call $~lib/rt/pure/__release - end - local.get $0 - call $~lib/rt/pure/__retain - ) - (func $~lib/map/Map#get (param $0 i32) (param $1 i32) (result i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/map/Map#find - local.tee $0 - i32.eqz - if - i32.const 1408 - i32.const 1472 - i32.const 105 - i32.const 17 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load offset=4 - ) - (func $~lib/rt/tlsf/checkUsedBlock (param $0 i32) (result i32) - (local $1 i32) - local.get $0 - i32.const 4 - i32.sub - local.set $1 - local.get $0 - i32.const 15 - i32.and - i32.eqz - i32.const 0 - local.get $0 - select - if (result i32) - local.get $1 - i32.load - i32.const 1 - i32.and - i32.eqz - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 1184 - i32.const 563 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $1 -======= global.get $~lib/memory/__stack_pointer i32.const 8 i32.add global.set $~lib/memory/__stack_pointer ->>>>>>> master ) (func $~lib/memory/memory.copy (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) @@ -2584,12 +2404,9 @@ i32.store8 offset=1 local.get $2 local.get $6 - local.get $1 local.get $7 - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/HASH + local.get $1 i32.and i32.const 2 i32.shl @@ -2633,36 +2450,35 @@ i32.add global.set $~lib/memory/__stack_pointer ) - (func $~lib/util/hash/hash32 (param $0 i32) (result i32) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) local.get $0 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 + i32.const -1028477379 + i32.mul + i32.const 374761397 + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 i32.mul + local.tee $0 local.get $0 - i32.const 8 + i32.const 15 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 + i32.const -2048144777 i32.mul + local.tee $0 local.get $0 - i32.const 16 + i32.const 13 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 + i32.const -1028477379 i32.mul + local.tee $0 local.get $0 - i32.const 24 + i32.const 16 i32.shr_u i32.xor - i32.const 16777619 - i32.mul ) (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 @@ -2777,7 +2593,7 @@ local.get $2 local.get $6 local.get $7 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -2844,6 +2660,38 @@ i32.const 0 i32.store offset=20 ) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) + local.get $0 + i32.const 255 + i32.and + i32.const -1028477379 + i32.mul + i32.const 374761394 + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.tee $0 + local.get $0 + i32.const 15 + i32.shr_u + i32.xor + i32.const -2048144777 + i32.mul + local.tee $0 + local.get $0 + i32.const 13 + i32.shr_u + i32.xor + i32.const -1028477379 + i32.mul + local.tee $0 + local.get $0 + i32.const 16 + i32.shr_u + i32.xor + ) (func $~lib/map/Map#rehash (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) @@ -2915,12 +2763,9 @@ i32.store offset=4 local.get $2 local.get $6 - local.get $1 local.get $7 - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/HASH + local.get $1 i32.and i32.const 2 i32.shl @@ -3035,12 +2880,9 @@ i32.store8 offset=1 local.get $2 local.get $6 - local.get $1 local.get $7 - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/HASH + local.get $1 i32.and i32.const 2 i32.shl @@ -3084,20 +2926,39 @@ i32.add global.set $~lib/memory/__stack_pointer ) - (func $~lib/util/hash/hash16 (param $0 i32) (result i32) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) local.get $0 - i32.const 255 - i32.and - i32.const -2128831035 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.const -1028477379 + i32.mul + i32.const 374761395 + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.tee $0 + local.get $0 + i32.const 15 + i32.shr_u i32.xor - i32.const 16777619 + i32.const -2048144777 i32.mul + local.tee $0 local.get $0 - i32.const 8 + i32.const 13 i32.shr_u i32.xor - i32.const 16777619 + i32.const -1028477379 i32.mul + local.tee $0 + local.get $0 + i32.const 16 + i32.shr_u + i32.xor ) (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 @@ -3214,7 +3075,7 @@ local.get $2 local.get $6 local.get $7 - call $~lib/util/hash/hash16 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -3340,7 +3201,7 @@ local.get $2 local.get $6 local.get $7 - call $~lib/util/hash/hash16 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -3385,6 +3246,38 @@ i32.add global.set $~lib/memory/__stack_pointer ) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) + local.get $0 + i32.const 65535 + i32.and + i32.const -1028477379 + i32.mul + i32.const 374761395 + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.tee $0 + local.get $0 + i32.const 15 + i32.shr_u + i32.xor + i32.const -2048144777 + i32.mul + local.tee $0 + local.get $0 + i32.const 13 + i32.shr_u + i32.xor + i32.const -1028477379 + i32.mul + local.tee $0 + local.get $0 + i32.const 16 + i32.shr_u + i32.xor + ) (func $~lib/map/Map#rehash (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) @@ -3457,7 +3350,7 @@ local.get $2 local.get $6 local.get $7 - call $~lib/util/hash/hash16 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -3574,7 +3467,7 @@ local.get $2 local.get $6 local.get $7 - call $~lib/util/hash/hash16 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -3732,7 +3625,7 @@ local.get $2 local.get $6 local.get $7 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -3849,7 +3742,7 @@ local.get $2 local.get $6 local.get $7 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -3894,71 +3787,48 @@ i32.add global.set $~lib/memory/__stack_pointer ) - (func $~lib/util/hash/hash64 (param $0 i64) (result i32) + (func $~lib/util/hash/HASH (param $0 i64) (result i32) (local $1 i32) local.get $0 i32.wrap_i64 - local.tee $1 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 8 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 16 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 + i32.const -1028477379 i32.mul - local.get $1 - i32.const 24 - i32.shr_u - i32.xor - i32.const 16777619 + i32.const 374761401 + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 i32.mul local.get $0 i64.const 32 i64.shr_u i32.wrap_i64 - local.tee $1 - i32.const 255 - i32.and - i32.xor - i32.const 16777619 + i32.const -1028477379 + i32.mul + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 i32.mul + local.tee $1 local.get $1 - i32.const 8 + i32.const 15 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 + i32.const -2048144777 i32.mul + local.tee $1 local.get $1 - i32.const 16 + i32.const 13 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 + i32.const -1028477379 i32.mul + local.tee $1 local.get $1 - i32.const 24 + i32.const 16 i32.shr_u i32.xor - i32.const 16777619 - i32.mul ) (func $~lib/map/Map#find (param $0 i32) (param $1 i64) (param $2 i32) (result i32) local.get $0 @@ -4074,7 +3944,7 @@ local.get $2 local.get $8 local.get $5 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -4201,7 +4071,7 @@ local.get $2 local.get $8 local.get $5 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -4382,7 +4252,7 @@ local.get $2 local.get $8 local.get $5 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -4500,7 +4370,7 @@ local.get $2 local.get $8 local.get $5 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -4545,6 +4415,38 @@ i32.add global.set $~lib/memory/__stack_pointer ) + (func $~lib/util/hash/HASH (param $0 f32) (result i32) + (local $1 i32) + local.get $0 + i32.reinterpret_f32 + i32.const -1028477379 + i32.mul + i32.const 374761397 + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.tee $1 + local.get $1 + i32.const 15 + i32.shr_u + i32.xor + i32.const -2048144777 + i32.mul + local.tee $1 + local.get $1 + i32.const 13 + i32.shr_u + i32.xor + i32.const -1028477379 + i32.mul + local.tee $1 + local.get $1 + i32.const 16 + i32.shr_u + i32.xor + ) (func $~lib/map/Map#find (param $0 i32) (param $1 f32) (param $2 i32) (result i32) local.get $0 i32.load @@ -4659,8 +4561,7 @@ local.get $2 local.get $8 local.get $5 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -4778,8 +4679,7 @@ local.get $2 local.get $8 local.get $5 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -4824,6 +4724,52 @@ i32.add global.set $~lib/memory/__stack_pointer ) + (func $~lib/util/hash/HASH (param $0 f64) (result i32) + (local $1 i32) + (local $2 i64) + local.get $0 + i64.reinterpret_f64 + local.tee $2 + i32.wrap_i64 + i32.const -1028477379 + i32.mul + i32.const 374761401 + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.get $2 + i64.const 32 + i64.shr_u + i32.wrap_i64 + i32.const -1028477379 + i32.mul + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.tee $1 + local.get $1 + i32.const 15 + i32.shr_u + i32.xor + i32.const -2048144777 + i32.mul + local.tee $1 + local.get $1 + i32.const 13 + i32.shr_u + i32.xor + i32.const -1028477379 + i32.mul + local.tee $1 + local.get $1 + i32.const 16 + i32.shr_u + i32.xor + ) (func $~lib/map/Map#find (param $0 i32) (param $1 f64) (param $2 i32) (result i32) local.get $0 i32.load @@ -4938,8 +4884,7 @@ local.get $2 local.get $8 local.get $5 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -5057,13 +5002,7 @@ local.get $2 local.get $8 local.get $5 -<<<<<<< HEAD - local.get $6 - call $~lib/util/hash/HASH -======= - i64.reinterpret_f64 - call $~lib/util/hash/hash64 ->>>>>>> master + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -5230,14 +5169,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne @@ -5250,15 +5182,6 @@ (local $3 i32) (local $4 i32) (local $5 i32) -<<<<<<< HEAD - local.get $1 - local.tee $3 - call $~lib/util/hash/HASH - local.set $5 - local.get $0 - i32.load - local.get $5 -======= global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -5267,24 +5190,15 @@ global.get $~lib/memory/__stack_pointer i64.const 0 i64.store + local.get $1 + call $~lib/util/hash/HASH + local.set $4 global.get $~lib/memory/__stack_pointer local.get $0 i32.store - local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.tee $3 - local.set $4 ->>>>>>> master local.get $0 local.get $1 - local.get $3 + local.get $4 call $~lib/map/Map#find local.tee $3 if @@ -5375,39 +5289,6 @@ i32.add global.set $~lib/memory/__stack_pointer ) -<<<<<<< HEAD - (func $~lib/util/hash/HASH (param $0 i32) (result i32) - local.get $0 - i32.const -1028477379 - i32.mul - i32.const 374761397 - i32.add - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.tee $0 - local.get $0 - i32.const 15 - i32.shr_u - i32.xor - i32.const -2048144777 - i32.mul - local.tee $0 - local.get $0 - i32.const 13 - i32.shr_u - i32.xor - i32.const -1028477379 - i32.mul - local.tee $0 - local.get $0 - i32.const 16 - i32.shr_u - i32.xor - ) - (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) -======= (func $~lib/map/Map#get (param $0 i32) (param $1 i32) (result i32) global.get $~lib/memory/__stack_pointer i32.const 4 @@ -5423,14 +5304,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/HASH call $~lib/map/Map#find local.tee $0 i32.eqz @@ -5566,7 +5440,6 @@ local.tee $3 i32.store offset=4 local.get $3 ->>>>>>> master local.get $0 call $~lib/memory/memory.fill local.get $2 @@ -5734,10 +5607,6 @@ local.get $0 local.get $1 local.get $5 -<<<<<<< HEAD - local.get $6 - call $~lib/util/hash/HASH -======= i32.load offset=4 call $~lib/array/Array#__set local.get $1 @@ -5776,22 +5645,17 @@ global.get $~lib/memory/__stack_pointer i64.const 0 i64.store + local.get $1 + call $~lib/util/hash/HASH + local.set $5 global.get $~lib/memory/__stack_pointer local.get $0 i32.store + local.get $1 + local.set $3 local.get $0 i32.load - local.get $1 - local.tee $3 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.tee $5 + local.get $5 local.get $0 i32.load offset=4 i32.and @@ -5804,7 +5668,6 @@ loop $while-continue|0 local.get $1 if ->>>>>>> master local.get $1 i32.load offset=4 local.tee $4 @@ -5933,11 +5796,7 @@ i64.const 0 i64.store local.get $1 -<<<<<<< HEAD call $~lib/util/hash/HASH - local.tee $5 -======= - call $~lib/util/hash/hash32 local.set $4 global.get $~lib/memory/__stack_pointer local.get $0 @@ -5945,7 +5804,6 @@ local.get $0 local.get $1 local.get $4 ->>>>>>> master call $~lib/map/Map#find local.tee $3 if @@ -6731,187 +6589,17 @@ call $~lib/map/Map#delete global.get $~lib/memory/__stack_pointer local.get $0 -<<<<<<< HEAD -======= i32.store offset=4 local.get $0 ->>>>>>> master local.get $2 call $~lib/map/Map#has if i32.const 0 -<<<<<<< HEAD - i32.const 1360 -======= i32.const 1568 ->>>>>>> master i32.const 54 i32.const 5 call $~lib/builtins/abort unreachable -<<<<<<< HEAD - end - local.get $2 - i32.const 1 - i32.add - local.set $2 - br $for-loop|8 - end - end - local.get $0 - i32.load offset=20 - i32.const 50 - i32.ne - if - i32.const 0 - i32.const 1360 - i32.const 56 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - call $~lib/map/Map#clear - local.get $0 - i32.load offset=20 - if - i32.const 0 - i32.const 1360 - i32.const 60 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $4 - call $~lib/rt/pure/__release - local.get $6 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - local.get $5 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - ) - (func $~lib/util/hash/HASH (param $0 i32) (result i32) - local.get $0 - i32.const 255 - i32.and - i32.const -1028477379 - i32.mul - i32.const 374761394 - i32.add - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.tee $0 - local.get $0 - i32.const 15 - i32.shr_u - i32.xor - i32.const -2048144777 - i32.mul - local.tee $0 - local.get $0 - i32.const 13 - i32.shr_u - i32.xor - i32.const -1028477379 - i32.mul - local.tee $0 - local.get $0 - i32.const 16 - i32.shr_u - i32.xor - ) - (func $~lib/map/Map#has (param $0 i32) (param $1 i32) (result i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/map/Map#find - i32.const 0 - i32.ne - ) - (func $~lib/map/Map#rehash (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - local.get $1 - i32.const 1 - i32.add - local.tee $3 - i32.const 2 - i32.shl - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 - local.get $3 - i32.const 3 - i32.shl - i32.const 3 - i32.div_s - local.tee $7 - i32.const 12 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $3 - local.get $0 - i32.load offset=8 - local.tee $4 - local.get $0 - i32.load offset=16 - i32.const 12 - i32.mul - i32.add - local.set $8 - local.get $3 - local.set $2 - loop $while-continue|0 - local.get $4 - local.get $8 - i32.ne - if - local.get $4 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $2 - local.get $4 - i32.load8_u - local.tee $6 - i32.store8 - local.get $2 - local.get $4 - i32.load offset=4 - i32.store offset=4 - local.get $2 - local.get $5 - local.get $6 - call $~lib/util/hash/HASH - local.get $1 - i32.and - i32.const 2 - i32.shl - i32.add - local.tee $6 - i32.load - i32.store offset=8 - local.get $6 - local.get $2 - i32.store - local.get $2 - i32.const 12 - i32.add - local.set $2 -======= ->>>>>>> master end local.get $2 i32.const 1 @@ -6973,12 +6661,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne @@ -6991,8 +6674,6 @@ (local $3 i32) (local $4 i32) (local $5 i32) -<<<<<<< HEAD -======= global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -7001,24 +6682,15 @@ global.get $~lib/memory/__stack_pointer i64.const 0 i64.store + local.get $1 + call $~lib/util/hash/HASH + local.set $4 global.get $~lib/memory/__stack_pointer local.get $0 i32.store - local.get $1 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.tee $3 - local.set $4 ->>>>>>> master local.get $0 local.get $1 - local.get $1 - call $~lib/util/hash/HASH - local.tee $5 + local.get $4 call $~lib/map/Map#find local.tee $3 if @@ -7247,28 +6919,6 @@ if global.get $~lib/memory/__stack_pointer local.get $2 -<<<<<<< HEAD - local.get $4 - i32.load8_u - local.tee $6 - i32.store8 - local.get $2 - local.get $4 - i32.load8_u offset=1 - i32.store8 offset=1 - local.get $2 - local.get $5 - local.get $6 - call $~lib/util/hash/HASH - local.get $1 - i32.and - i32.const 2 - i32.shl - i32.add - local.tee $6 - i32.load -======= ->>>>>>> master i32.store offset=4 local.get $2 local.get $1 @@ -7303,8 +6953,6 @@ (local $3 i32) (local $4 i32) (local $5 i32) -<<<<<<< HEAD -======= global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -7313,16 +6961,14 @@ global.get $~lib/memory/__stack_pointer i64.const 0 i64.store + local.get $1 + call $~lib/util/hash/HASH + local.set $5 global.get $~lib/memory/__stack_pointer local.get $0 i32.store - local.get $0 - i32.load ->>>>>>> master local.get $1 - local.tee $3 - call $~lib/util/hash/HASH - local.set $5 + local.set $3 local.get $0 i32.load local.get $5 @@ -8178,65 +7824,8 @@ call $~lib/builtins/abort unreachable end -<<<<<<< HEAD - local.get $4 - call $~lib/rt/pure/__release - local.get $6 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - local.get $5 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - ) - (func $~lib/util/hash/HASH (param $0 i32) (result i32) - local.get $0 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.const -1028477379 - i32.mul - i32.const 374761395 - i32.add - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.tee $0 - local.get $0 - i32.const 15 - i32.shr_u - i32.xor - i32.const -2048144777 - i32.mul - local.tee $0 - local.get $0 - i32.const 13 - i32.shr_u - i32.xor - i32.const -1028477379 - i32.mul - local.tee $0 - local.get $0 - i32.const 16 - i32.shr_u - i32.xor - ) - (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - local.get $0 - i32.load - local.get $2 - local.get $0 - i32.load offset=4 - i32.and - i32.const 2 - i32.shl -======= global.get $~lib/memory/__stack_pointer i32.const 24 ->>>>>>> master i32.add global.set $~lib/memory/__stack_pointer ) @@ -8262,106 +7851,7 @@ global.get $~lib/memory/__stack_pointer i32.const 4 i32.add -<<<<<<< HEAD - local.set $8 - local.get $3 - local.set $2 - loop $while-continue|0 - local.get $4 - local.get $8 - i32.ne - if - local.get $4 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $2 - local.get $4 - i32.load16_s - local.tee $6 - i32.store16 - local.get $2 - local.get $4 - i32.load offset=4 - i32.store offset=4 - local.get $2 - local.get $5 - local.get $6 - call $~lib/util/hash/HASH - local.get $1 - i32.and - i32.const 2 - i32.shl - i32.add - local.tee $6 - i32.load - i32.store offset=8 - local.get $6 - local.get $2 - i32.store - local.get $2 - i32.const 12 - i32.add - local.set $2 - end - local.get $4 - i32.const 12 - i32.add - local.set $4 - br $while-continue|0 - end - end - local.get $5 - local.tee $4 - local.get $0 - i32.load - local.tee $2 - i32.ne - if - local.get $4 - call $~lib/rt/pure/__retain - local.set $4 - local.get $2 - call $~lib/rt/pure/__release - end - local.get $0 - local.get $4 - i32.store - local.get $0 - local.get $1 - i32.store offset=4 - local.get $3 - local.tee $1 - local.get $0 - i32.load offset=8 - local.tee $4 - i32.ne - if - local.get $1 - call $~lib/rt/pure/__retain - local.set $1 - local.get $4 - call $~lib/rt/pure/__release - end - local.get $0 - local.get $1 - i32.store offset=8 - local.get $0 - local.get $7 - i32.store offset=12 - local.get $0 - local.get $0 - i32.load offset=20 - i32.store offset=16 - local.get $5 - call $~lib/rt/pure/__release - local.get $3 - call $~lib/rt/pure/__release -======= global.set $~lib/memory/__stack_pointer ->>>>>>> master ) (func $~lib/map/Map#set (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) @@ -8376,15 +7866,7 @@ i64.const 0 i64.store local.get $1 -<<<<<<< HEAD call $~lib/util/hash/HASH - local.tee $5 -======= - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/util/hash/hash16 local.set $4 global.get $~lib/memory/__stack_pointer local.get $0 @@ -8392,7 +7874,6 @@ local.get $0 local.get $1 local.get $4 ->>>>>>> master call $~lib/map/Map#find local.tee $3 if @@ -8693,43 +8174,6 @@ end local.get $4 i32.const 1 -<<<<<<< HEAD - i32.and - i32.eqz - if - local.get $2 - local.get $4 - i32.load16_s - local.tee $6 - i32.store16 - local.get $2 - local.get $4 - i32.load16_s offset=2 - i32.store16 offset=2 - local.get $2 - local.get $5 - local.get $6 - call $~lib/util/hash/HASH - local.get $1 - i32.and - i32.const 2 - i32.shl - i32.add - local.tee $6 - i32.load - i32.store offset=4 - local.get $6 - local.get $2 - i32.store - local.get $2 - i32.const 8 - i32.add - local.set $2 - end - local.get $4 - i32.const 8 -======= ->>>>>>> master i32.add local.set $4 br $for-loop|0 @@ -8760,16 +8204,7 @@ i64.const 0 i64.store local.get $1 -<<<<<<< HEAD - local.tee $3 call $~lib/util/hash/HASH -======= - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/util/hash/hash16 ->>>>>>> master local.set $5 global.get $~lib/memory/__stack_pointer local.get $0 @@ -9624,74 +9059,54 @@ end global.get $~lib/memory/__stack_pointer local.get $0 -<<<<<<< HEAD + i32.store offset=4 + local.get $0 i32.load offset=20 i32.const 50 i32.ne if i32.const 0 - i32.const 1360 + i32.const 1568 i32.const 56 i32.const 3 call $~lib/builtins/abort unreachable end + global.get $~lib/memory/__stack_pointer + local.get $0 + i32.store offset=4 local.get $0 call $~lib/map/Map#clear + global.get $~lib/memory/__stack_pointer + local.get $0 + i32.store offset=4 local.get $0 i32.load offset=20 if i32.const 0 - i32.const 1360 + i32.const 1568 i32.const 60 i32.const 3 call $~lib/builtins/abort unreachable end - local.get $4 - call $~lib/rt/pure/__release - local.get $6 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - local.get $5 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - ) - (func $~lib/util/hash/HASH (param $0 i32) (result i32) - local.get $0 - i32.const 65535 - i32.and - i32.const -1028477379 - i32.mul - i32.const 374761395 + global.get $~lib/memory/__stack_pointer + i32.const 24 i32.add - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.tee $0 - local.get $0 - i32.const 15 - i32.shr_u - i32.xor - i32.const -2048144777 - i32.mul - local.tee $0 - local.get $0 - i32.const 13 - i32.shr_u - i32.xor - i32.const -1028477379 - i32.mul - local.tee $0 - local.get $0 - i32.const 16 - i32.shr_u - i32.xor + global.set $~lib/memory/__stack_pointer ) (func $~lib/map/Map#has (param $0 i32) (param $1 i32) (result i32) + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i32.const 0 + i32.store + global.get $~lib/memory/__stack_pointer + local.get $0 + i32.store local.get $0 local.get $1 local.get $1 @@ -9699,200 +9114,44 @@ call $~lib/map/Map#find i32.const 0 i32.ne + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.add + global.set $~lib/memory/__stack_pointer ) - (func $~lib/map/Map#rehash (param $0 i32) (param $1 i32) - (local $2 i32) + (func $~lib/map/Map#set (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) + global.get $~lib/memory/__stack_pointer + i32.const 8 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store local.get $1 - i32.const 1 - i32.add - local.tee $3 - i32.const 2 - i32.shl - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 - local.get $3 - i32.const 3 - i32.shl - i32.const 3 - i32.div_s - local.tee $7 - i32.const 12 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $3 + call $~lib/util/hash/HASH + local.set $4 + global.get $~lib/memory/__stack_pointer local.get $0 - i32.load offset=8 - local.tee $4 + i32.store local.get $0 - i32.load offset=16 - i32.const 12 - i32.mul - i32.add - local.set $8 - local.get $3 - local.set $2 - loop $while-continue|0 - local.get $4 - local.get $8 - i32.ne - if - local.get $4 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $2 - local.get $4 - i32.load16_u - local.tee $6 - i32.store16 - local.get $2 - local.get $4 - i32.load offset=4 - i32.store offset=4 - local.get $2 - local.get $5 - local.get $6 - call $~lib/util/hash/HASH - local.get $1 - i32.and - i32.const 2 - i32.shl - i32.add - local.tee $6 - i32.load - i32.store offset=8 - local.get $6 - local.get $2 - i32.store - local.get $2 - i32.const 12 - i32.add - local.set $2 - end - local.get $4 - i32.const 12 - i32.add - local.set $4 - br $while-continue|0 - end - end - local.get $5 - local.tee $4 - local.get $0 - i32.load - local.tee $2 -======= - i32.store offset=4 - local.get $0 - i32.load offset=20 - i32.const 50 ->>>>>>> master - i32.ne - if - i32.const 0 - i32.const 1568 - i32.const 56 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=4 - local.get $0 - call $~lib/map/Map#clear - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=4 - local.get $0 - i32.load offset=20 - if - i32.const 0 - i32.const 1568 - i32.const 60 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - i32.const 24 - i32.add - global.set $~lib/memory/__stack_pointer - ) - (func $~lib/map/Map#has (param $0 i32) (param $1 i32) (result i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store - local.get $0 - local.get $1 - local.get $1 - i32.const 65535 - i32.and - call $~lib/util/hash/hash16 - call $~lib/map/Map#find - i32.const 0 - i32.ne - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - ) - (func $~lib/map/Map#set (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i64.const 0 - i64.store - local.get $1 -<<<<<<< HEAD - call $~lib/util/hash/HASH - local.tee $5 -======= - i32.const 65535 - i32.and - call $~lib/util/hash/hash16 - local.set $4 - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store - local.get $0 - local.get $1 - local.get $4 ->>>>>>> master - call $~lib/map/Map#find - local.tee $3 - if - local.get $3 - local.get $2 - i32.store offset=4 - else - local.get $0 - i32.load offset=16 - local.get $0 - i32.load offset=12 - i32.eq + local.get $1 + local.get $4 + call $~lib/map/Map#find + local.tee $3 + if + local.get $3 + local.get $2 + i32.store offset=4 + else + local.get $0 + i32.load offset=16 + local.get $0 + i32.load offset=12 + i32.eq if global.get $~lib/memory/__stack_pointer local.get $0 @@ -10113,108 +9372,11 @@ i32.and i32.eqz if -<<<<<<< HEAD - local.get $0 - local.get $1 - local.get $3 - i32.load16_u - call $~lib/array/Array#__set - local.get $1 - i32.const 1 - i32.add - local.set $1 - end - local.get $9 - i32.const 1 - i32.add - local.set $9 - br $for-loop|0 - end - end - local.get $0 - local.get $1 - call $~lib/array/Array#set:length - local.get $0 - ) - (func $~lib/map/Map#rehash (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - local.get $1 - i32.const 1 - i32.add - local.tee $3 - i32.const 2 - i32.shl - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 - local.get $3 - i32.const 3 - i32.shl - i32.const 3 - i32.div_s - local.tee $7 - i32.const 3 - i32.shl - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $3 - local.get $0 - i32.load offset=8 - local.tee $4 - local.get $0 - i32.load offset=16 - i32.const 3 - i32.shl - i32.add - local.set $8 - local.get $3 - local.set $2 - loop $while-continue|0 - local.get $4 - local.get $8 - i32.ne - if - local.get $4 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - if - local.get $2 - local.get $4 - i32.load16_u - local.tee $6 - i32.store16 - local.get $2 - local.get $4 - i32.load16_u offset=2 - i32.store16 offset=2 - local.get $2 - local.get $5 - local.get $6 - call $~lib/util/hash/HASH - local.get $1 - i32.and - i32.const 2 - i32.shl - i32.add - local.tee $6 - i32.load - i32.store offset=4 - local.get $6 - local.get $2 - i32.store -======= global.get $~lib/memory/__stack_pointer local.get $0 i32.store offset=4 local.get $0 local.get $1 ->>>>>>> master local.get $2 i32.load16_u call $~lib/array/Array#__set @@ -10255,14 +9417,7 @@ i64.const 0 i64.store local.get $1 -<<<<<<< HEAD - local.tee $3 call $~lib/util/hash/HASH -======= - i32.const 65535 - i32.and - call $~lib/util/hash/hash16 ->>>>>>> master local.set $5 global.get $~lib/memory/__stack_pointer local.get $0 @@ -11887,7 +11042,7 @@ local.get $0 local.get $1 local.get $1 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne @@ -11909,7 +11064,7 @@ i64.const 0 i64.store local.get $1 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.set $4 global.get $~lib/memory/__stack_pointer local.get $0 @@ -12022,7 +11177,7 @@ local.get $0 local.get $1 local.get $1 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/map/Map#find local.tee $0 i32.eqz @@ -12194,7 +11349,7 @@ i64.const 0 i64.store local.get $1 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.set $4 global.get $~lib/memory/__stack_pointer local.get $0 @@ -12308,7 +11463,7 @@ local.get $0 local.get $1 local.get $1 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/map/Map#find local.tee $1 i32.eqz @@ -12997,257 +12152,27 @@ call $~lib/builtins/abort unreachable end -<<<<<<< HEAD - local.get $4 - call $~lib/rt/pure/__release - local.get $6 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - local.get $5 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release + global.get $~lib/memory/__stack_pointer + i32.const 24 + i32.add + global.set $~lib/memory/__stack_pointer ) - (func $~lib/util/hash/HASH (param $0 i64) (result i32) - (local $1 i32) - local.get $0 - i32.wrap_i64 - i32.const -1028477379 - i32.mul - i32.const 374761401 - i32.add - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.get $0 - i64.const 32 - i64.shr_u - i32.wrap_i64 - i32.const -1028477379 - i32.mul - i32.add - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.tee $1 - local.get $1 - i32.const 15 - i32.shr_u - i32.xor - i32.const -2048144777 - i32.mul - local.tee $1 - local.get $1 - i32.const 13 - i32.shr_u - i32.xor - i32.const -1028477379 - i32.mul - local.tee $1 - local.get $1 - i32.const 16 - i32.shr_u - i32.xor - ) - (func $~lib/map/Map#find (param $0 i32) (param $1 i64) (param $2 i32) (result i32) - local.get $0 - i32.load - local.get $2 - local.get $0 - i32.load offset=4 - i32.and - i32.const 2 - i32.shl - i32.add - i32.load - local.set $0 - loop $while-continue|0 - local.get $0 - if - local.get $0 - i32.load offset=12 - local.tee $2 - i32.const 1 - i32.and - if (result i32) - i32.const 0 - else - local.get $1 - local.get $0 - i64.load - i64.eq - end - if - local.get $0 - return - end - local.get $2 - i32.const -2 - i32.and - local.set $0 - br $while-continue|0 - end - end - i32.const 0 - ) - (func $~lib/map/Map#has (param $0 i32) (param $1 i64) (result i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/map/Map#find - i32.const 0 - i32.ne - ) - (func $~lib/map/Map#rehash (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i64) - (local $9 i32) - local.get $1 - i32.const 1 - i32.add - local.tee $3 - i32.const 2 - i32.shl - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 - local.get $3 - i32.const 3 - i32.shl - i32.const 3 - i32.div_s - local.tee $6 - i32.const 4 - i32.shl - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $3 - local.get $0 - i32.load offset=8 - local.tee $4 - local.get $0 - i32.load offset=16 - i32.const 4 - i32.shl - i32.add - local.set $7 - local.get $3 - local.set $2 - loop $while-continue|0 - local.get $4 - local.get $7 - i32.ne - if - local.get $4 - i32.load offset=12 - i32.const 1 - i32.and - i32.eqz - if - local.get $2 - local.get $4 - i64.load - local.tee $8 - i64.store - local.get $2 - local.get $4 - i32.load offset=8 - i32.store offset=8 - local.get $2 - local.get $5 - local.get $8 - call $~lib/util/hash/HASH - local.get $1 - i32.and - i32.const 2 - i32.shl - i32.add - local.tee $9 - i32.load - i32.store offset=12 - local.get $9 - local.get $2 - i32.store - local.get $2 - i32.const 16 - i32.add - local.set $2 - end - local.get $4 - i32.const 16 - i32.add - local.set $4 - br $while-continue|0 - end - end - local.get $5 - local.tee $4 - local.get $0 - i32.load - local.tee $2 - i32.ne - if - local.get $4 - call $~lib/rt/pure/__retain - local.set $4 - local.get $2 - call $~lib/rt/pure/__release - end - local.get $0 - local.get $4 - i32.store - local.get $0 - local.get $1 - i32.store offset=4 - local.get $3 - local.tee $1 - local.get $0 - i32.load offset=8 - local.tee $4 - i32.ne - if - local.get $1 - call $~lib/rt/pure/__retain - local.set $1 - local.get $4 - call $~lib/rt/pure/__release - end - local.get $0 - local.get $1 - i32.store offset=8 - local.get $0 - local.get $6 - i32.store offset=12 -======= - global.get $~lib/memory/__stack_pointer - i32.const 24 - i32.add - global.set $~lib/memory/__stack_pointer - ) - (func $~lib/map/Map#has (param $0 i32) (param $1 i64) (result i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - global.get $~lib/memory/__stack_pointer ->>>>>>> master + (func $~lib/map/Map#has (param $0 i32) (param $1 i64) (result i32) + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i32.const 0 + i32.store + global.get $~lib/memory/__stack_pointer local.get $0 i32.store local.get $0 local.get $1 local.get $1 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne @@ -13269,11 +12194,7 @@ i64.const 0 i64.store local.get $1 -<<<<<<< HEAD call $~lib/util/hash/HASH - local.tee $5 -======= - call $~lib/util/hash/hash64 local.set $4 global.get $~lib/memory/__stack_pointer local.get $0 @@ -13281,7 +12202,6 @@ local.get $0 local.get $1 local.get $4 ->>>>>>> master call $~lib/map/Map#find local.tee $3 if @@ -13645,13 +12565,8 @@ local.get $0 local.get $1 local.get $5 -<<<<<<< HEAD - local.get $8 - call $~lib/util/hash/HASH -======= i32.load offset=8 call $~lib/array/Array#__set ->>>>>>> master local.get $1 i32.const 1 i32.add @@ -13689,16 +12604,11 @@ i64.const 0 i64.store local.get $1 -<<<<<<< HEAD call $~lib/util/hash/HASH - local.set $4 -======= - call $~lib/util/hash/hash64 local.set $5 global.get $~lib/memory/__stack_pointer local.get $0 i32.store ->>>>>>> master local.get $0 i32.load local.get $5 @@ -14561,7 +13471,7 @@ local.get $0 local.get $1 local.get $1 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne @@ -14583,7 +13493,7 @@ i64.const 0 i64.store local.get $1 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH local.set $4 global.get $~lib/memory/__stack_pointer local.get $0 @@ -14696,7 +13606,7 @@ local.get $0 local.get $1 local.get $1 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH call $~lib/map/Map#find local.tee $0 i32.eqz @@ -14868,7 +13778,7 @@ i64.const 0 i64.store local.get $1 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH local.set $5 global.get $~lib/memory/__stack_pointer local.get $0 @@ -15018,7 +13928,7 @@ local.get $0 local.get $1 local.get $1 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH call $~lib/map/Map#find local.tee $2 i32.eqz @@ -15697,223 +14607,28 @@ call $~lib/builtins/abort unreachable end -<<<<<<< HEAD - local.get $1 + global.get $~lib/memory/__stack_pointer + local.get $0 + i32.store offset=4 + local.get $0 call $~lib/map/Map#clear - local.get $1 + global.get $~lib/memory/__stack_pointer + local.get $0 + i32.store offset=4 + local.get $0 i32.load offset=20 if i32.const 0 - i32.const 1360 + i32.const 1568 i32.const 60 i32.const 3 call $~lib/builtins/abort unreachable end - local.get $5 - call $~lib/rt/pure/__release - local.get $7 - call $~lib/rt/pure/__release - local.get $2 - call $~lib/rt/pure/__release - local.get $6 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - ) - (func $~lib/util/hash/HASH (param $0 f32) (result i32) - (local $1 i32) - local.get $0 - i32.reinterpret_f32 - i32.const -1028477379 - i32.mul - i32.const 374761397 - i32.add - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.tee $1 - local.get $1 - i32.const 15 - i32.shr_u - i32.xor - i32.const -2048144777 - i32.mul - local.tee $1 - local.get $1 - i32.const 13 - i32.shr_u - i32.xor - i32.const -1028477379 - i32.mul - local.tee $1 - local.get $1 - i32.const 16 - i32.shr_u - i32.xor - ) - (func $~lib/map/Map#find (param $0 i32) (param $1 f32) (param $2 i32) (result i32) - local.get $0 - i32.load - local.get $2 - local.get $0 - i32.load offset=4 - i32.and - i32.const 2 - i32.shl - i32.add - i32.load - local.set $0 - loop $while-continue|0 - local.get $0 - if - local.get $0 - i32.load offset=8 - local.tee $2 - i32.const 1 - i32.and - if (result i32) - i32.const 0 - else - local.get $1 - local.get $0 - f32.load - f32.eq - end - if - local.get $0 - return - end - local.get $2 - i32.const -2 - i32.and - local.set $0 - br $while-continue|0 - end - end - i32.const 0 - ) - (func $~lib/map/Map#has (param $0 i32) (param $1 f32) (result i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/map/Map#find - i32.const 0 - i32.ne - ) - (func $~lib/map/Map#rehash (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 f32) - (local $9 i32) - local.get $1 - i32.const 1 - i32.add - local.tee $3 - i32.const 2 - i32.shl - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 - local.get $3 - i32.const 3 - i32.shl - i32.const 3 - i32.div_s - local.tee $6 - i32.const 12 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $3 - local.get $0 - i32.load offset=8 - local.tee $4 - local.get $0 - i32.load offset=16 - i32.const 12 - i32.mul - i32.add - local.set $7 - local.get $3 - local.set $2 - loop $while-continue|0 - local.get $4 - local.get $7 - i32.ne - if - local.get $4 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $2 - local.get $4 - f32.load - local.tee $8 - f32.store - local.get $2 - local.get $4 - i32.load offset=4 - i32.store offset=4 - local.get $2 - local.get $5 - local.get $8 - call $~lib/util/hash/HASH - local.get $1 - i32.and - i32.const 2 - i32.shl - i32.add - local.tee $9 - i32.load - i32.store offset=8 - local.get $9 - local.get $2 - i32.store - local.get $2 - i32.const 12 - i32.add - local.set $2 - end - local.get $4 - i32.const 12 - i32.add - local.set $4 - br $while-continue|0 - end - end - local.get $5 - local.tee $4 -======= - global.get $~lib/memory/__stack_pointer ->>>>>>> master - local.get $0 - i32.store offset=4 - local.get $0 - call $~lib/map/Map#clear - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=4 - local.get $0 - i32.load offset=20 - if - i32.const 0 - i32.const 1568 - i32.const 60 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - i32.const 24 - i32.add - global.set $~lib/memory/__stack_pointer + global.get $~lib/memory/__stack_pointer + i32.const 24 + i32.add + global.set $~lib/memory/__stack_pointer ) (func $~lib/map/Map#has (param $0 i32) (param $1 f32) (result i32) global.get $~lib/memory/__stack_pointer @@ -15930,8 +14645,7 @@ local.get $0 local.get $1 local.get $1 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne @@ -15953,12 +14667,7 @@ i64.const 0 i64.store local.get $1 -<<<<<<< HEAD call $~lib/util/hash/HASH - local.tee $5 -======= - i32.reinterpret_f32 - call $~lib/util/hash/hash32 local.set $4 global.get $~lib/memory/__stack_pointer local.get $0 @@ -15966,7 +14675,6 @@ local.get $0 local.get $1 local.get $4 ->>>>>>> master call $~lib/map/Map#find local.tee $3 if @@ -16263,43 +14971,6 @@ end local.get $4 i32.const 1 -<<<<<<< HEAD - i32.and - i32.eqz - if - local.get $2 - local.get $4 - f32.load - local.tee $8 - f32.store - local.get $2 - local.get $4 - f32.load offset=4 - f32.store offset=4 - local.get $2 - local.get $5 - local.get $8 - call $~lib/util/hash/HASH - local.get $1 - i32.and - i32.const 2 - i32.shl - i32.add - local.tee $9 - i32.load - i32.store offset=8 - local.get $9 - local.get $2 - i32.store - local.get $2 - i32.const 12 - i32.add - local.set $2 - end - local.get $4 - i32.const 12 -======= ->>>>>>> master i32.add local.set $4 br $for-loop|0 @@ -16330,12 +15001,7 @@ i64.const 0 i64.store local.get $1 -<<<<<<< HEAD call $~lib/util/hash/HASH - local.tee $4 -======= - i32.reinterpret_f32 - call $~lib/util/hash/hash32 local.set $4 global.get $~lib/memory/__stack_pointer local.get $0 @@ -16343,7 +15009,6 @@ local.get $0 local.get $1 local.get $4 ->>>>>>> master call $~lib/map/Map#find local.tee $3 if @@ -17130,216 +15795,7 @@ call $~lib/builtins/abort unreachable end -<<<<<<< HEAD - local.get $1 - call $~lib/map/Map#clear - local.get $1 - i32.load offset=20 - if - i32.const 0 - i32.const 1360 - i32.const 60 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $4 - call $~lib/rt/pure/__release - local.get $7 - call $~lib/rt/pure/__release - local.get $2 - call $~lib/rt/pure/__release - local.get $6 - call $~lib/rt/pure/__release - local.get $1 - call $~lib/rt/pure/__release - ) - (func $~lib/util/hash/HASH (param $0 f64) (result i32) - (local $1 i32) - (local $2 i64) - local.get $0 - i64.reinterpret_f64 - local.tee $2 - i32.wrap_i64 - i32.const -1028477379 - i32.mul - i32.const 374761401 - i32.add - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.get $2 - i64.const 32 - i64.shr_u - i32.wrap_i64 - i32.const -1028477379 - i32.mul - i32.add - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.tee $1 - local.get $1 - i32.const 15 - i32.shr_u - i32.xor - i32.const -2048144777 - i32.mul - local.tee $1 - local.get $1 - i32.const 13 - i32.shr_u - i32.xor - i32.const -1028477379 - i32.mul - local.tee $1 - local.get $1 - i32.const 16 - i32.shr_u - i32.xor - ) - (func $~lib/map/Map#find (param $0 i32) (param $1 f64) (param $2 i32) (result i32) - local.get $0 - i32.load - local.get $2 - local.get $0 - i32.load offset=4 - i32.and - i32.const 2 - i32.shl - i32.add - i32.load - local.set $0 - loop $while-continue|0 - local.get $0 - if - local.get $0 - i32.load offset=12 - local.tee $2 - i32.const 1 - i32.and - if (result i32) - i32.const 0 - else - local.get $1 - local.get $0 - f64.load - f64.eq - end - if - local.get $0 - return - end - local.get $2 - i32.const -2 - i32.and - local.set $0 - br $while-continue|0 - end - end - i32.const 0 - ) - (func $~lib/map/Map#has (param $0 i32) (param $1 f64) (result i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/map/Map#find - i32.const 0 - i32.ne - ) - (func $~lib/map/Map#rehash (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 f64) - (local $9 i32) - local.get $1 - i32.const 1 - i32.add - local.tee $3 - i32.const 2 - i32.shl - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 - local.get $3 - i32.const 3 - i32.shl - i32.const 3 - i32.div_s - local.tee $6 - i32.const 4 - i32.shl - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $3 - local.get $0 - i32.load offset=8 - local.tee $4 - local.get $0 - i32.load offset=16 - i32.const 4 - i32.shl - i32.add - local.set $7 - local.get $3 - local.set $2 - loop $while-continue|0 - local.get $4 - local.get $7 - i32.ne - if - local.get $4 - i32.load offset=12 - i32.const 1 - i32.and - i32.eqz - if - local.get $2 - local.get $4 - f64.load - local.tee $8 - f64.store - local.get $2 - local.get $4 - i32.load offset=8 - i32.store offset=8 - local.get $2 - local.get $5 - local.get $8 - call $~lib/util/hash/HASH - local.get $1 - i32.and - i32.const 2 - i32.shl - i32.add - local.tee $9 - i32.load - i32.store offset=12 - local.get $9 - local.get $2 - i32.store - local.get $2 - i32.const 16 - i32.add - local.set $2 - end - local.get $4 - i32.const 16 - i32.add - local.set $4 - br $while-continue|0 - end - end - local.get $5 - local.tee $4 -======= global.get $~lib/memory/__stack_pointer ->>>>>>> master local.get $0 i32.store offset=4 local.get $0 @@ -17377,8 +15833,7 @@ local.get $0 local.get $1 local.get $1 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne @@ -17400,12 +15855,7 @@ i64.const 0 i64.store local.get $1 -<<<<<<< HEAD call $~lib/util/hash/HASH - local.tee $5 -======= - i64.reinterpret_f64 - call $~lib/util/hash/hash64 local.set $4 global.get $~lib/memory/__stack_pointer local.get $0 @@ -17413,7 +15863,6 @@ local.get $0 local.get $1 local.get $4 ->>>>>>> master call $~lib/map/Map#find local.tee $3 if @@ -17710,83 +16159,10 @@ end local.get $4 i32.const 1 -<<<<<<< HEAD - i32.and - i32.eqz - if - local.get $2 - local.get $4 - f64.load - local.tee $8 - f64.store - local.get $2 - local.get $4 - f64.load offset=8 - f64.store offset=8 - local.get $2 - local.get $5 - local.get $8 - call $~lib/util/hash/HASH - local.get $1 - i32.and - i32.const 2 - i32.shl - i32.add - local.tee $9 - i32.load - i32.store offset=16 - local.get $9 - local.get $2 - i32.store - local.get $2 - i32.const 24 - i32.add - local.set $2 - end - local.get $4 - i32.const 24 - i32.add - local.set $4 - br $while-continue|0 - end - end - local.get $5 - local.tee $4 - local.get $0 - i32.load - local.tee $2 - i32.ne - if - local.get $4 - call $~lib/rt/pure/__retain - local.set $4 - local.get $2 - call $~lib/rt/pure/__release - end - local.get $0 - local.get $4 - i32.store - local.get $0 - local.get $1 - i32.store offset=4 - local.get $3 - local.tee $1 - local.get $0 - i32.load offset=8 - local.tee $4 - i32.ne - if - local.get $1 - call $~lib/rt/pure/__retain - local.set $1 - local.get $4 - call $~lib/rt/pure/__release -======= i32.add local.set $4 br $for-loop|0 end ->>>>>>> master end global.get $~lib/memory/__stack_pointer local.get $0 @@ -17813,17 +16189,11 @@ i64.const 0 i64.store local.get $1 -<<<<<<< HEAD call $~lib/util/hash/HASH - local.set $4 -======= - i64.reinterpret_f64 - call $~lib/util/hash/hash64 local.set $5 global.get $~lib/memory/__stack_pointer local.get $0 i32.store ->>>>>>> master local.get $0 i32.load local.get $5 diff --git a/tests/compiler/std/map.untouched.wat b/tests/compiler/std/map.untouched.wat index 2db40f77c2..9ee9e571ab 100644 --- a/tests/compiler/std/map.untouched.wat +++ b/tests/compiler/std/map.untouched.wat @@ -18,26 +18,17 @@ (type $i32_f64_i32_=>_i32 (func (param i32 f64 i32) (result i32))) (type $i32_i32_f32_=>_none (func (param i32 i32 f32))) (type $i32_i32_f64_=>_none (func (param i32 i32 f64))) - (type $i32_i64_i64_=>_i32 (func (param i32 i64 i64) (result i32))) -<<<<<<< HEAD (type $i64_=>_i32 (func (param i64) (result i32))) - (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) - (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) -======= + (type $i32_i64_i64_=>_i32 (func (param i32 i64 i64) (result i32))) (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) ->>>>>>> master (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $none_=>_i32 (func (result i32))) - (type $i64_=>_i32 (func (param i64) (result i32))) - (type $i32_f32_f32_=>_i32 (func (param i32 f32 f32) (result i32))) - (type $i32_f64_f64_=>_i32 (func (param i32 f64 f64) (result i32))) -<<<<<<< HEAD (type $f32_=>_i32 (func (param f32) (result i32))) (type $f64_=>_i32 (func (param f64) (result i32))) -======= + (type $i32_f32_f32_=>_i32 (func (param i32 f32 f32) (result i32))) + (type $i32_f64_f64_=>_i32 (func (param i32 f64 f64) (result i32))) (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) ->>>>>>> master (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) (data (i32.const 12) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00(\00\00\00A\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00\00\00\00\00") @@ -1660,197 +1651,8 @@ call $~lib/builtins/abort unreachable end -<<<<<<< HEAD - local.get $1 - i32.const 0 - call $~lib/rt/pure/__new - local.set $2 - local.get $2 - i32.const 0 - local.get $1 - call $~lib/memory/memory.fill - local.get $2 - call $~lib/rt/pure/__retain - local.set $3 - local.get $0 - call $~lib/rt/pure/__release - local.get $3 - ) - (func $~lib/map/Map#constructor (param $0 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 24 - i32.const 3 - call $~lib/rt/pure/__new - call $~lib/rt/pure/__retain - local.set $0 - end - local.get $0 - i32.const 0 - i32.const 4 - i32.const 4 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - i32.store - local.get $0 - i32.const 4 - i32.const 1 - i32.sub - i32.store offset=4 - local.get $0 - i32.const 0 - i32.const 4 - i32.const 12 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - i32.store offset=8 - local.get $0 - i32.const 4 - i32.store offset=12 - local.get $0 - i32.const 0 - i32.store offset=16 - local.get $0 - i32.const 0 - i32.store offset=20 - local.get $0 - ) - (func $~lib/util/hash/HASH (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 4 - i32.le_u - drop - local.get $0 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - local.set $2 - i32.const 1 - local.set $1 - i32.const 0 - i32.const 374761393 - i32.add - local.get $1 - i32.add - local.set $3 - local.get $3 - local.get $2 - i32.const -1028477379 - i32.mul - i32.add - local.set $3 - local.get $3 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 15 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -2048144777 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 13 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -1028477379 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 16 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - return - ) - (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.get $2 - local.get $0 - i32.load offset=4 - i32.and - i32.const 4 - i32.mul - i32.add - i32.load - local.set $3 - loop $while-continue|0 - local.get $3 - local.set $4 - local.get $4 - if - local.get $3 - i32.load offset=8 - local.set $5 - local.get $5 - i32.const 1 - i32.and - i32.eqz - if (result i32) - local.get $3 - i32.load8_s - local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.eq - else - i32.const 0 - end - if - local.get $3 - return - end - local.get $5 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 - br $while-continue|0 - end - end - i32.const 0 - ) - (func $~lib/map/Map#has (param $0 i32) (param $1 i32) (result i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/map/Map#find - i32.const 0 - i32.ne -======= local.get $0 call $~lib/rt/tlsf/computeSize ->>>>>>> master ) (func $~lib/rt/tlsf/searchBlock (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -1878,54 +1680,11 @@ if (result i32) local.get $1 i32.const 1 -<<<<<<< HEAD - i32.and - i32.eqz - if - local.get $8 - local.set $11 - local.get $10 - i32.load8_s - local.set $12 - local.get $11 - local.get $12 - i32.store8 - local.get $11 - local.get $10 - i32.load offset=4 - i32.store offset=4 - local.get $12 - call $~lib/util/hash/HASH - local.get $1 - i32.and - local.set $13 - local.get $3 - local.get $13 - i32.const 4 - i32.mul - i32.add - local.set $14 - local.get $11 - local.get $14 - i32.load - i32.store offset=8 - local.get $14 - local.get $8 - i32.store - local.get $8 - i32.const 12 - i32.add - local.set $8 - end - local.get $6 - i32.const 12 -======= i32.const 27 local.get $1 i32.clz i32.sub i32.shl ->>>>>>> master i32.add i32.const 1 i32.sub @@ -1969,42 +1728,6 @@ end i32.eqz if -<<<<<<< HEAD - local.get $14 - call $~lib/rt/pure/__retain - local.set $14 - local.get $11 - call $~lib/rt/pure/__release - end - local.get $14 - i32.store offset=8 - local.get $0 - local.get $4 - i32.store offset=12 - local.get $0 - local.get $0 - i32.load offset=20 - i32.store offset=16 - local.get $3 - call $~lib/rt/pure/__release - local.get $5 - call $~lib/rt/pure/__release - ) - (func $~lib/map/Map#set (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $1 - call $~lib/util/hash/HASH - local.set $3 - local.get $0 - local.get $1 - local.get $3 - call $~lib/map/Map#find - local.set $4 - local.get $4 -======= i32.const 0 i32.const 368 i32.const 334 @@ -2033,18 +1756,12 @@ local.set $7 local.get $6 i32.eqz ->>>>>>> master if local.get $0 i32.load i32.const 0 -<<<<<<< HEAD - drop - local.get $4 -======= i32.const -1 i32.xor ->>>>>>> master local.get $2 i32.const 1 i32.add @@ -2104,42 +1821,6 @@ end else local.get $0 -<<<<<<< HEAD - i32.load offset=8 - call $~lib/rt/pure/__retain - local.set $5 - local.get $5 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $6 - i32.const 1 - i32.add - i32.store offset=16 - local.get $6 - i32.const 12 - i32.mul - i32.add - local.set $4 - local.get $4 - local.get $1 - i32.store8 - local.get $4 - local.get $2 - i32.store offset=4 - local.get $0 - local.get $0 - i32.load offset=20 - i32.const 1 - i32.add - i32.store offset=20 - local.get $0 - i32.load - local.get $3 - local.get $0 - i32.load offset=4 - i32.and -======= local.set $9 local.get $2 local.set $8 @@ -2148,44 +1829,20 @@ local.set $4 local.get $9 local.get $8 ->>>>>>> master i32.const 4 i32.shl local.get $4 i32.add -<<<<<<< HEAD - local.set $6 - local.get $4 - local.get $6 - i32.load - i32.store offset=8 - local.get $6 - local.get $4 - i32.store - local.get $5 - call $~lib/rt/pure/__release -======= i32.const 2 i32.shl i32.add i32.load offset=96 local.set $7 ->>>>>>> master end local.get $7 ) (func $~lib/rt/tlsf/growMemory (param $0 i32) (param $1 i32) (local $2 i32) -<<<<<<< HEAD - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/map/Map#find - local.set $2 - local.get $2 - i32.eqz -======= (local $3 i32) (local $4 i32) (local $5 i32) @@ -2249,7 +1906,6 @@ memory.grow i32.const 0 i32.lt_s ->>>>>>> master if local.get $4 memory.grow @@ -2259,15 +1915,8 @@ unreachable end end -<<<<<<< HEAD - local.get $2 - i32.load offset=4 - ) - (func $~lib/map/Map#get:size (param $0 i32) (result i32) -======= memory.size local.set $7 ->>>>>>> master local.get $0 local.get $2 i32.const 16 @@ -2835,12 +2484,74 @@ local.get $1 i32.store offset=20 ) - (func $~lib/util/hash/hash8 (param $0 i32) (result i32) - i32.const -2128831035 + (func $~lib/util/hash/HASH (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 1 + i32.const 4 + i32.le_u + drop local.get $0 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + local.set $2 + i32.const 1 + local.set $1 + i32.const 0 + i32.const 374761393 + i32.add + local.get $1 + i32.add + local.set $3 + local.get $3 + local.get $2 + i32.const -1028477379 + i32.mul + i32.add + local.set $3 + local.get $3 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 15 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -2048144777 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 13 + i32.shr_u i32.xor - i32.const 16777619 + local.set $3 + local.get $3 + i32.const -1028477379 i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 16 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + return ) (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -2998,23 +2709,8 @@ local.get $10 i32.load offset=4 call $~lib/map/MapEntry#set:value - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 1 - i32.eq - drop - local.get $13 - call $~lib/util/hash/hash8 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -4810,23 +4506,8 @@ local.get $10 i32.load8_s offset=1 call $~lib/map/MapEntry#set:value - block $~lib/util/hash/HASH|inlined.5 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 1 - i32.eq - drop - local.get $13 - call $~lib/util/hash/hash8 - br $~lib/util/hash/HASH|inlined.5 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -4876,47 +4557,70 @@ i32.add global.set $~lib/memory/__stack_pointer ) - (func $~lib/util/hash/hash32 (param $0 i32) (result i32) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) (local $1 i32) - i32.const -2128831035 - local.set $1 - local.get $1 + (local $2 i32) + (local $3 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 4 + i32.const 4 + i32.le_u + drop local.get $0 - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul + local.set $2 + i32.const 4 local.set $1 + i32.const 0 + i32.const 374761393 + i32.add local.get $1 - local.get $0 - i32.const 8 + i32.add + local.set $3 + local.get $3 + local.get $2 + i32.const -1028477379 + i32.mul + i32.add + local.set $3 + local.get $3 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 15 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 + local.set $3 + local.get $3 + i32.const -2048144777 i32.mul - local.set $1 - local.get $1 - local.get $0 - i32.const 16 + local.set $3 + local.get $3 + local.get $3 + i32.const 13 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 + local.set $3 + local.get $3 + i32.const -1028477379 i32.mul - local.set $1 - local.get $1 - local.get $0 - i32.const 24 + local.set $3 + local.get $3 + local.get $3 + i32.const 16 i32.shr_u i32.xor - i32.const 16777619 - i32.mul - local.set $1 - local.get $1 + local.set $3 + local.get $3 + return ) (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -5070,31 +4774,8 @@ local.get $10 i32.load offset=4 call $~lib/map/MapEntry#set:value - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $13 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.1 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -5220,22 +4901,89 @@ local.get $1 i32.store offset=20 ) - (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.get $2 + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 1 + i32.const 4 + i32.le_u + drop local.get $0 - i32.load offset=4 + i32.const 255 i32.and - i32.const 4 - i32.mul - i32.add - i32.load - local.set $3 - loop $while-continue|0 + local.set $2 + i32.const 1 + local.set $1 + i32.const 0 + i32.const 374761393 + i32.add + local.get $1 + i32.add + local.set $3 + local.get $3 + local.get $2 + i32.const -1028477379 + i32.mul + i32.add + local.set $3 + local.get $3 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 15 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -2048144777 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 13 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -1028477379 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 16 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + return + ) + (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + i32.load + local.get $2 + local.get $0 + i32.load offset=4 + i32.and + i32.const 4 + i32.mul + i32.add + i32.load + local.set $3 + loop $while-continue|0 local.get $3 local.set $4 local.get $4 @@ -5374,23 +5122,8 @@ local.get $10 i32.load offset=4 call $~lib/map/MapEntry#set:value - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 1 - i32.eq - drop - local.get $13 - call $~lib/util/hash/hash8 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -5711,23 +5444,8 @@ local.get $10 i32.load8_u offset=1 call $~lib/map/MapEntry#set:value - block $~lib/util/hash/HASH|inlined.5 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 1 - i32.eq - drop - local.get $13 - call $~lib/util/hash/hash8 - br $~lib/util/hash/HASH|inlined.5 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -5849,27 +5567,74 @@ local.get $1 i32.store offset=20 ) - (func $~lib/util/hash/hash16 (param $0 i32) (result i32) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) (local $1 i32) - i32.const -2128831035 + (local $2 i32) + (local $3 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 2 + i32.const 4 + i32.le_u + drop + local.get $0 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + local.set $2 + i32.const 2 local.set $1 + i32.const 0 + i32.const 374761393 + i32.add local.get $1 - local.get $0 - i32.const 255 - i32.and + i32.add + local.set $3 + local.get $3 + local.get $2 + i32.const -1028477379 + i32.mul + i32.add + local.set $3 + local.get $3 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 15 + i32.shr_u i32.xor - i32.const 16777619 + local.set $3 + local.get $3 + i32.const -2048144777 i32.mul - local.set $1 - local.get $1 - local.get $0 - i32.const 8 + local.set $3 + local.get $3 + local.get $3 + i32.const 13 i32.shr_u i32.xor - i32.const 16777619 + local.set $3 + local.get $3 + i32.const -1028477379 i32.mul - local.set $1 - local.get $1 + local.set $3 + local.get $3 + local.get $3 + i32.const 16 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + return ) (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -6027,27 +5792,8 @@ local.get $10 i32.load offset=4 call $~lib/map/MapEntry#set:value - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq - drop - local.get $13 - call $~lib/util/hash/hash16 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -6370,27 +6116,8 @@ local.get $10 i32.load16_s offset=2 call $~lib/map/MapEntry#set:value - block $~lib/util/hash/HASH|inlined.5 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq - drop - local.get $13 - call $~lib/util/hash/hash16 - br $~lib/util/hash/HASH|inlined.5 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -6512,6 +6239,73 @@ local.get $1 i32.store offset=20 ) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 2 + i32.const 4 + i32.le_u + drop + local.get $0 + i32.const 65535 + i32.and + local.set $2 + i32.const 2 + local.set $1 + i32.const 0 + i32.const 374761393 + i32.add + local.get $1 + i32.add + local.set $3 + local.get $3 + local.get $2 + i32.const -1028477379 + i32.mul + i32.add + local.set $3 + local.get $3 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 15 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -2048144777 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 13 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -1028477379 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 16 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + return + ) (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) @@ -6666,27 +6460,8 @@ local.get $10 i32.load offset=4 call $~lib/map/MapEntry#set:value - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq - drop - local.get $13 - call $~lib/util/hash/hash16 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -7007,27 +6782,8 @@ local.get $10 i32.load16_u offset=2 call $~lib/map/MapEntry#set:value - block $~lib/util/hash/HASH|inlined.5 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq - drop - local.get $13 - call $~lib/util/hash/hash16 - br $~lib/util/hash/HASH|inlined.5 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -7183,6 +6939,71 @@ local.get $1 i32.store offset=20 ) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 4 + i32.const 4 + i32.le_u + drop + local.get $0 + local.set $2 + i32.const 4 + local.set $1 + i32.const 0 + i32.const 374761393 + i32.add + local.get $1 + i32.add + local.set $3 + local.get $3 + local.get $2 + i32.const -1028477379 + i32.mul + i32.add + local.set $3 + local.get $3 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 15 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -2048144777 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 13 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -1028477379 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 16 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + return + ) (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) @@ -7335,31 +7156,8 @@ local.get $10 i32.load offset=4 call $~lib/map/MapEntry#set:value - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $13 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -7678,31 +7476,8 @@ local.get $10 i32.load offset=4 call $~lib/map/MapEntry#set:value - block $~lib/util/hash/HASH|inlined.5 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $13 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.5 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -7824,93 +7599,87 @@ local.get $1 i32.store offset=20 ) - (func $~lib/util/hash/hash64 (param $0 i64) (result i32) - (local $1 i32) + (func $~lib/util/hash/HASH (param $0 i64) (result i32) + (local $1 i64) (local $2 i32) - (local $3 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 8 + i32.const 4 + i32.le_u + drop + i32.const 8 + i32.const 8 + i32.eq + drop local.get $0 - i32.wrap_i64 local.set $1 - local.get $0 - i64.const 32 - i64.shr_u - i32.wrap_i64 + i32.const 0 + i32.const 374761393 + i32.add + i32.const 8 + i32.add local.set $2 - i32.const -2128831035 - local.set $3 - local.get $3 - local.get $1 - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.set $3 - local.get $3 + local.get $2 local.get $1 - i32.const 8 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 + i32.wrap_i64 + i32.const -1028477379 i32.mul - local.set $3 - local.get $3 - local.get $1 - i32.const 16 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 + i32.add + local.set $2 + local.get $2 + i32.const 17 + i32.rotl + i32.const 668265263 i32.mul - local.set $3 - local.get $3 + local.set $2 + local.get $2 local.get $1 - i32.const 24 - i32.shr_u - i32.xor - i32.const 16777619 + i64.const 32 + i64.shr_u + i32.wrap_i64 + i32.const -1028477379 i32.mul - local.set $3 - local.get $3 + i32.add + local.set $2 local.get $2 - i32.const 255 - i32.and - i32.xor - i32.const 16777619 + i32.const 17 + i32.rotl + i32.const 668265263 i32.mul - local.set $3 - local.get $3 + local.set $2 local.get $2 - i32.const 8 + local.get $2 + i32.const 15 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 + local.set $2 + local.get $2 + i32.const -2048144777 i32.mul - local.set $3 - local.get $3 + local.set $2 local.get $2 - i32.const 16 + local.get $2 + i32.const 13 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 + local.set $2 + local.get $2 + i32.const -1028477379 i32.mul - local.set $3 - local.get $3 + local.set $2 local.get $2 - i32.const 24 + local.get $2 + i32.const 16 i32.shr_u i32.xor - i32.const 16777619 - i32.mul - local.set $3 - local.get $3 + local.set $2 + local.get $2 + return ) (func $~lib/map/Map#find (param $0 i32) (param $1 i64) (param $2 i32) (result i32) (local $3 i32) @@ -7989,9 +7758,8 @@ (local $10 i32) (local $11 i32) (local $12 i64) - (local $13 i64) + (local $13 i32) (local $14 i32) - (local $15 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -8065,49 +7833,22 @@ local.get $10 i32.load offset=8 call $~lib/map/MapEntry#set:value - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $13 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and - local.set $14 + local.set $13 local.get $3 - local.get $14 + local.get $13 i32.const 4 i32.mul i32.add - local.set $15 + local.set $14 local.get $11 - local.get $15 + local.get $14 i32.load call $~lib/map/MapEntry#set:taggedNext - local.get $15 + local.get $14 local.get $8 i32.store local.get $8 @@ -8337,9 +8078,8 @@ (local $10 i32) (local $11 i32) (local $12 i64) - (local $13 i64) + (local $13 i32) (local $14 i32) - (local $15 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -8413,49 +8153,22 @@ local.get $10 i64.load offset=8 call $~lib/map/MapEntry#set:value - block $~lib/util/hash/HASH|inlined.5 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $13 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.5 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and - local.set $14 + local.set $13 local.get $3 - local.get $14 + local.get $13 i32.const 4 i32.mul i32.add - local.set $15 + local.set $14 local.get $11 - local.get $15 + local.get $14 i32.load call $~lib/map/MapEntry#set:taggedNext - local.get $15 + local.get $14 local.get $8 i32.store local.get $8 @@ -8563,6 +8276,88 @@ local.get $1 i32.store offset=20 ) + (func $~lib/util/hash/HASH (param $0 i64) (result i32) + (local $1 i64) + (local $2 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 8 + i32.const 4 + i32.le_u + drop + i32.const 8 + i32.const 8 + i32.eq + drop + local.get $0 + local.set $1 + i32.const 0 + i32.const 374761393 + i32.add + i32.const 8 + i32.add + local.set $2 + local.get $2 + local.get $1 + i32.wrap_i64 + i32.const -1028477379 + i32.mul + i32.add + local.set $2 + local.get $2 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $2 + local.get $2 + local.get $1 + i64.const 32 + i64.shr_u + i32.wrap_i64 + i32.const -1028477379 + i32.mul + i32.add + local.set $2 + local.get $2 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 15 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + i32.const -2048144777 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 13 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + i32.const -1028477379 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 16 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + return + ) (func $~lib/map/Map#find (param $0 i32) (param $1 i64) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) @@ -8640,9 +8435,8 @@ (local $10 i32) (local $11 i32) (local $12 i64) - (local $13 i64) + (local $13 i32) (local $14 i32) - (local $15 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -8716,49 +8510,22 @@ local.get $10 i32.load offset=8 call $~lib/map/MapEntry#set:value - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $13 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and - local.set $14 + local.set $13 local.get $3 - local.get $14 + local.get $13 i32.const 4 i32.mul i32.add - local.set $15 + local.set $14 local.get $11 - local.get $15 + local.get $14 i32.load call $~lib/map/MapEntry#set:taggedNext - local.get $15 + local.get $14 local.get $8 i32.store local.get $8 @@ -8988,9 +8755,8 @@ (local $10 i32) (local $11 i32) (local $12 i64) - (local $13 i64) + (local $13 i32) (local $14 i32) - (local $15 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -9064,49 +8830,22 @@ local.get $10 i64.load offset=8 call $~lib/map/MapEntry#set:value - block $~lib/util/hash/HASH|inlined.5 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $13 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.5 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and - local.set $14 + local.set $13 local.get $3 - local.get $14 + local.get $13 i32.const 4 i32.mul i32.add - local.set $15 + local.set $14 local.get $11 - local.get $15 + local.get $14 i32.load call $~lib/map/MapEntry#set:taggedNext - local.get $15 + local.get $14 local.get $8 i32.store local.get $8 @@ -9214,6 +8953,72 @@ local.get $1 i32.store offset=20 ) + (func $~lib/util/hash/HASH (param $0 f32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 1 + drop + i32.const 4 + i32.const 4 + i32.eq + drop + local.get $0 + i32.reinterpret_f32 + local.set $1 + i32.const 4 + local.set $2 + i32.const 0 + i32.const 374761393 + i32.add + local.get $2 + i32.add + local.set $3 + local.get $3 + local.get $1 + i32.const -1028477379 + i32.mul + i32.add + local.set $3 + local.get $3 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 15 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -2048144777 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 13 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -1028477379 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 16 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + return + ) (func $~lib/map/Map#find (param $0 i32) (param $1 f32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) @@ -9291,9 +9096,8 @@ (local $10 i32) (local $11 i32) (local $12 f32) - (local $13 f32) + (local $13 i32) (local $14 i32) - (local $15 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -9367,38 +9171,22 @@ local.get $10 i32.load offset=4 call $~lib/map/MapEntry#set:value - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $13 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and - local.set $14 + local.set $13 local.get $3 - local.get $14 + local.get $13 i32.const 4 i32.mul i32.add - local.set $15 + local.set $14 local.get $11 - local.get $15 + local.get $14 i32.load call $~lib/map/MapEntry#set:taggedNext - local.get $15 + local.get $14 local.get $8 i32.store local.get $8 @@ -9628,9 +9416,8 @@ (local $10 i32) (local $11 i32) (local $12 f32) - (local $13 f32) + (local $13 i32) (local $14 i32) - (local $15 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -9704,38 +9491,22 @@ local.get $10 f32.load offset=4 call $~lib/map/MapEntry#set:value - block $~lib/util/hash/HASH|inlined.5 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $13 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.5 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and - local.set $14 + local.set $13 local.get $3 - local.get $14 + local.get $13 i32.const 4 i32.mul i32.add - local.set $15 + local.set $14 local.get $11 - local.get $15 + local.get $14 i32.load call $~lib/map/MapEntry#set:taggedNext - local.get $15 + local.get $14 local.get $8 i32.store local.get $8 @@ -9843,11 +9614,94 @@ local.get $1 i32.store offset=20 ) - (func $~lib/map/Map#find (param $0 i32) (param $1 f64) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 + (func $~lib/util/hash/HASH (param $0 f64) (result i32) + (local $1 i64) + (local $2 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 1 + drop + i32.const 8 + i32.const 4 + i32.eq + drop + i32.const 8 + i32.const 8 + i32.eq + drop + local.get $0 + i64.reinterpret_f64 + local.set $1 + i32.const 0 + i32.const 374761393 + i32.add + i32.const 8 + i32.add + local.set $2 + local.get $2 + local.get $1 + i32.wrap_i64 + i32.const -1028477379 + i32.mul + i32.add + local.set $2 + local.get $2 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $2 + local.get $2 + local.get $1 + i64.const 32 + i64.shr_u + i32.wrap_i64 + i32.const -1028477379 + i32.mul + i32.add + local.set $2 + local.get $2 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 15 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + i32.const -2048144777 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 13 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + i32.const -1028477379 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 16 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + return + ) + (func $~lib/map/Map#find (param $0 i32) (param $1 f64) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 i32.load local.get $2 local.get $0 @@ -9920,9 +9774,8 @@ (local $10 i32) (local $11 i32) (local $12 f64) - (local $13 f64) + (local $13 i32) (local $14 i32) - (local $15 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -9996,42 +9849,22 @@ local.get $10 i32.load offset=8 call $~lib/map/MapEntry#set:value - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $13 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and - local.set $14 + local.set $13 local.get $3 - local.get $14 + local.get $13 i32.const 4 i32.mul i32.add - local.set $15 + local.set $14 local.get $11 - local.get $15 + local.get $14 i32.load call $~lib/map/MapEntry#set:taggedNext - local.get $15 + local.get $14 local.get $8 i32.store local.get $8 @@ -10261,9 +10094,8 @@ (local $10 i32) (local $11 i32) (local $12 f64) - (local $13 f64) + (local $13 i32) (local $14 i32) - (local $15 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -10337,42 +10169,22 @@ local.get $10 f64.load offset=8 call $~lib/map/MapEntry#set:value - block $~lib/util/hash/HASH|inlined.5 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $13 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.5 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and - local.set $14 + local.set $13 local.get $3 - local.get $14 + local.get $13 i32.const 4 i32.mul i32.add - local.set $15 + local.set $14 local.get $11 - local.get $15 + local.get $14 i32.load call $~lib/map/MapEntry#set:taggedNext - local.get $15 + local.get $14 local.get $8 i32.store local.get $8 @@ -11364,7 +11176,6 @@ ) (func $~lib/map/Map#has (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -11372,132 +11183,31 @@ call $~stack_check global.get $~lib/memory/__stack_pointer i32.const 0 -<<<<<<< HEAD - local.get $4 - i32.const 8 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 - local.get $0 - i32.load offset=8 - local.set $6 - local.get $6 - local.get $0 - i32.load offset=16 - i32.const 8 - i32.mul - i32.add - local.set $7 - local.get $5 - local.set $8 - loop $while-continue|0 - local.get $6 - local.get $7 - i32.ne - local.set $9 - local.get $9 - if - local.get $6 - local.set $10 - local.get $10 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $11 - local.get $10 - i32.load8_s - local.set $12 - local.get $11 - local.get $12 - i32.store8 - local.get $11 - local.get $10 - i32.load8_s offset=1 - i32.store8 offset=1 - local.get $12 - call $~lib/util/hash/HASH - local.get $1 - i32.and - local.set $13 - local.get $3 - local.get $13 - i32.const 4 - i32.mul - i32.add - local.set $14 - local.get $11 - local.get $14 - i32.load - i32.store offset=4 - local.get $14 - local.get $8 - i32.store - local.get $8 - i32.const 8 - i32.add - local.set $8 - end - local.get $6 - i32.const 8 - i32.add - local.set $6 - br $while-continue|0 - end - end -======= i32.store ->>>>>>> master local.get $0 - local.set $3 + local.set $2 global.get $~lib/memory/__stack_pointer - local.get $3 + local.get $2 i32.store - local.get $3 + local.get $2 local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 1 - i32.eq - drop - local.get $2 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/util/hash/hash8 - br $~lib/util/hash/HASH|inlined.0 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne - local.set $3 + local.set $2 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $3 + local.get $2 ) (func $~lib/map/Map#set (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) -<<<<<<< HEAD - local.get $1 - call $~lib/util/hash/HASH - local.set $3 -======= (local $7 i32) global.get $~lib/memory/__stack_pointer i32.const 8 @@ -11507,55 +11217,24 @@ global.get $~lib/memory/__stack_pointer i64.const 0 i64.store - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 1 - i32.eq - drop - local.get $3 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/util/hash/hash8 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $4 ->>>>>>> master - local.get $0 - local.set $7 - global.get $~lib/memory/__stack_pointer - local.get $7 - i32.store - local.get $7 - local.get $1 -<<<<<<< HEAD - local.get $3 - call $~lib/map/Map#find - local.set $4 - local.get $4 - if - i32.const 0 - drop - local.get $4 -======= - local.get $4 - call $~lib/map/Map#find - local.set $5 - local.get $5 - if - local.get $5 ->>>>>>> master - local.get $2 - call $~lib/map/MapEntry#set:value + local.get $1 + call $~lib/util/hash/HASH + local.set $3 + local.get $0 + local.set $7 + global.get $~lib/memory/__stack_pointer + local.get $7 + i32.store + local.get $7 + local.get $1 + local.get $3 + call $~lib/map/Map#find + local.set $4 + local.get $4 + if + local.get $4 + local.get $2 + call $~lib/map/MapEntry#set:value i32.const 0 drop else @@ -11596,15 +11275,9 @@ global.get $~lib/memory/__stack_pointer local.get $0 i32.load offset=8 -<<<<<<< HEAD - call $~lib/rt/pure/__retain - local.set $5 - local.get $5 -======= - local.tee $3 + local.tee $5 i32.store offset=4 - local.get $3 ->>>>>>> master + local.get $5 local.get $0 local.get $0 i32.load offset=16 @@ -11619,15 +11292,10 @@ local.set $4 local.get $4 local.get $1 -<<<<<<< HEAD - i32.store8 - local.get $4 -======= call $~lib/map/MapEntry#set:key i32.const 0 drop - local.get $5 ->>>>>>> master + local.get $4 local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -11655,11 +11323,6 @@ local.get $6 local.get $4 i32.store -<<<<<<< HEAD - local.get $5 - call $~lib/rt/pure/__release -======= ->>>>>>> master end local.get $0 local.set $7 @@ -11669,76 +11332,9 @@ global.set $~lib/memory/__stack_pointer local.get $7 ) -<<<<<<< HEAD - (func $~lib/util/hash/HASH (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 4 - i32.le_u - drop - local.get $0 - local.set $2 - i32.const 4 - local.set $1 - i32.const 0 - i32.const 374761393 - i32.add - local.get $1 - i32.add - local.set $3 - local.get $3 - local.get $2 - i32.const -1028477379 - i32.mul - i32.add - local.set $3 - local.get $3 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 15 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -2048144777 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 13 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -1028477379 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 16 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - return -======= (func $~lib/map/Map#get (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - (local $4 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -11748,36 +11344,17 @@ i32.const 0 i32.store local.get $0 - local.set $4 + local.set $3 global.get $~lib/memory/__stack_pointer - local.get $4 + local.get $3 i32.store - local.get $4 + local.get $3 local.get $1 - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 1 - i32.eq - drop - local.get $2 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/util/hash/hash8 - br $~lib/util/hash/HASH|inlined.3 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 592 @@ -11787,14 +11364,14 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $2 i32.load offset=4 - local.set $4 + local.set $3 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $4 + local.get $3 ) (func $~lib/array/Array#__set (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) @@ -11847,7 +11424,6 @@ i32.const 4 i32.add global.set $~lib/memory/__stack_pointer ->>>>>>> master ) (func $~lib/map/Map#keys (param $0 i32) (result i32) (local $1 i32) @@ -12046,26 +11622,6 @@ i32.and i32.eqz if -<<<<<<< HEAD - local.get $8 - local.set $11 - local.get $10 - i32.load - local.set $12 - local.get $11 - local.get $12 - i32.store - local.get $11 - local.get $10 - i32.load offset=4 - i32.store offset=4 - local.get $12 - call $~lib/util/hash/HASH - local.get $1 - i32.and - local.set $13 -======= ->>>>>>> master local.get $3 local.set $9 global.get $~lib/memory/__stack_pointer @@ -12119,28 +11675,9 @@ global.get $~lib/memory/__stack_pointer i64.const 0 i64.store - block $~lib/util/hash/HASH|inlined.4 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 1 - i32.eq - drop - local.get $3 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/util/hash/hash8 - br $~lib/util/hash/HASH|inlined.4 - end - local.set $4 + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 local.set $7 global.get $~lib/memory/__stack_pointer @@ -12148,12 +11685,12 @@ i32.store local.get $7 local.get $1 - local.get $4 + local.get $3 call $~lib/map/Map#find - local.set $5 - local.get $5 + local.set $4 + local.get $4 if - local.get $5 + local.get $4 local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -12196,9 +11733,9 @@ global.get $~lib/memory/__stack_pointer local.get $0 i32.load offset=8 - local.tee $3 + local.tee $5 i32.store offset=4 - local.get $3 + local.get $5 local.get $0 local.get $0 i32.load offset=16 @@ -12210,13 +11747,13 @@ i32.const 8 i32.mul i32.add - local.set $5 - local.get $5 + local.set $4 + local.get $4 local.get $1 call $~lib/map/MapEntry#set:key i32.const 0 drop - local.get $5 + local.get $4 local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -12229,7 +11766,7 @@ call $~lib/map/Map#set:entriesCount local.get $0 i32.load - local.get $4 + local.get $3 local.get $0 i32.load offset=4 i32.and @@ -12237,12 +11774,12 @@ i32.mul i32.add local.set $6 - local.get $5 + local.get $4 local.get $6 i32.load call $~lib/map/MapEntry#set:taggedNext local.get $6 - local.get $5 + local.get $4 i32.store end local.get $0 @@ -12258,11 +11795,6 @@ (local $4 i32) (local $5 i32) (local $6 i32) -<<<<<<< HEAD - local.get $1 - call $~lib/util/hash/HASH - local.set $3 -======= (local $7 i32) global.get $~lib/memory/__stack_pointer i32.const 8 @@ -12272,33 +11804,9 @@ global.get $~lib/memory/__stack_pointer i64.const 0 i64.store - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $3 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.0 - end - local.set $4 ->>>>>>> master + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 local.set $7 global.get $~lib/memory/__stack_pointer @@ -12311,13 +11819,7 @@ local.set $4 local.get $4 if -<<<<<<< HEAD - i32.const 0 - drop local.get $4 -======= - local.get $5 ->>>>>>> master local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -12360,15 +11862,9 @@ global.get $~lib/memory/__stack_pointer local.get $0 i32.load offset=8 -<<<<<<< HEAD - call $~lib/rt/pure/__retain - local.set $5 - local.get $5 -======= - local.tee $3 + local.tee $5 i32.store offset=4 - local.get $3 ->>>>>>> master + local.get $5 local.get $0 local.get $0 i32.load offset=16 @@ -12383,15 +11879,10 @@ local.set $4 local.get $4 local.get $1 -<<<<<<< HEAD - i32.store - local.get $4 -======= call $~lib/map/MapEntry#set:key i32.const 0 drop - local.get $5 ->>>>>>> master + local.get $4 local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -12419,11 +11910,6 @@ local.get $6 local.get $4 i32.store -<<<<<<< HEAD - local.get $5 - call $~lib/rt/pure/__release -======= ->>>>>>> master end local.get $0 local.set $7 @@ -12470,17 +11956,8 @@ local.get $6 return end -<<<<<<< HEAD - i32.const 0 - drop - i32.const 0 - drop local.get $2 local.get $2 -======= - local.get $3 - local.get $3 ->>>>>>> master i32.load offset=8 i32.const 1 i32.or @@ -12524,16 +12001,12 @@ end if local.get $0 -<<<<<<< HEAD - local.get $3 -======= local.set $6 global.get $~lib/memory/__stack_pointer local.get $6 i32.store local.get $6 - local.get $4 ->>>>>>> master + local.get $3 call $~lib/map/Map#rehash end i32.const 1 @@ -13040,28 +12513,37 @@ i32.shr_s i32.add i32.eq -<<<<<<< HEAD i32.eqz if i32.const 0 - i32.const 336 + i32.const 544 i32.const 42 i32.const 5 call $~lib/builtins/abort unreachable end local.get $0 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 local.get $7 call $~lib/map/Map#delete drop local.get $0 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 local.get $7 call $~lib/map/Map#has i32.eqz i32.eqz if i32.const 0 - i32.const 336 + i32.const 544 i32.const 44 i32.const 5 call $~lib/builtins/abort @@ -13075,13 +12557,18 @@ end end local.get $0 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 call $~lib/map/Map#get:size i32.const 50 i32.eq i32.eqz if i32.const 0 - i32.const 336 + i32.const 544 i32.const 46 i32.const 3 call $~lib/builtins/abort @@ -13101,19 +12588,29 @@ local.get $9 if local.get $0 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 local.get $7 call $~lib/map/Map#has i32.eqz i32.eqz if i32.const 0 - i32.const 336 + i32.const 544 i32.const 50 i32.const 5 call $~lib/builtins/abort unreachable end local.get $0 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 local.get $7 i32.const 10 local.get $7 @@ -13123,31 +12620,46 @@ i32.shr_s i32.add call $~lib/map/Map#set - call $~lib/rt/pure/__release + drop local.get $0 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 local.get $7 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 336 + i32.const 544 i32.const 52 i32.const 5 call $~lib/builtins/abort unreachable end local.get $0 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 local.get $7 call $~lib/map/Map#delete drop local.get $0 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 local.get $7 call $~lib/map/Map#has i32.eqz i32.eqz if i32.const 0 - i32.const 336 + i32.const 544 i32.const 54 i32.const 5 call $~lib/builtins/abort @@ -13161,583 +12673,122 @@ end end local.get $0 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 call $~lib/map/Map#get:size i32.const 50 i32.eq i32.eqz if i32.const 0 - i32.const 336 + i32.const 544 i32.const 56 i32.const 3 call $~lib/builtins/abort unreachable end local.get $0 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 call $~lib/map/Map#clear local.get $0 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 call $~lib/map/Map#get:size i32.const 0 i32.eq i32.eqz if i32.const 0 - i32.const 336 + i32.const 544 i32.const 60 i32.const 3 call $~lib/builtins/abort unreachable end - local.get $1 - call $~lib/rt/pure/__release - local.get $4 - call $~lib/rt/pure/__release - local.get $5 - call $~lib/rt/pure/__release - local.get $6 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release + global.get $~lib/memory/__stack_pointer + i32.const 24 + i32.add + global.set $~lib/memory/__stack_pointer ) - (func $~lib/map/Map#constructor (param $0 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 24 - i32.const 8 - call $~lib/rt/pure/__new - call $~lib/rt/pure/__retain - local.set $0 - end - local.get $0 - i32.const 0 - i32.const 4 - i32.const 4 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - i32.store - local.get $0 + (func $~lib/map/Map#has (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + global.get $~lib/memory/__stack_pointer i32.const 4 - i32.const 1 i32.sub - i32.store offset=4 - local.get $0 - i32.const 0 - i32.const 4 - i32.const 12 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - i32.store offset=8 - local.get $0 - i32.const 4 - i32.store offset=12 - local.get $0 - i32.const 0 - i32.store offset=16 - local.get $0 - i32.const 0 - i32.store offset=20 - local.get $0 - ) - (func $~lib/util/hash/HASH (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - i32.const 0 - drop - i32.const 0 - drop + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer i32.const 0 - drop - i32.const 1 - i32.const 4 - i32.le_u - drop + i32.store local.get $0 - i32.const 255 - i32.and local.set $2 - i32.const 1 - local.set $1 - i32.const 0 - i32.const 374761393 - i32.add + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + local.get $1 local.get $1 + call $~lib/util/hash/HASH + call $~lib/map/Map#find + i32.const 0 + i32.ne + local.set $2 + global.get $~lib/memory/__stack_pointer + i32.const 4 i32.add - local.set $3 - local.get $3 + global.set $~lib/memory/__stack_pointer local.get $2 - i32.const -1028477379 - i32.mul - i32.add - local.set $3 - local.get $3 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 15 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -2048144777 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 13 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -1028477379 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 16 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - return ) - (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/map/Map#set (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) - local.get $0 - i32.load - local.get $2 - local.get $0 - i32.load offset=4 - i32.and - i32.const 4 - i32.mul - i32.add - i32.load + (local $6 i32) + (local $7 i32) + global.get $~lib/memory/__stack_pointer + i32.const 8 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store + local.get $1 + call $~lib/util/hash/HASH local.set $3 - loop $while-continue|0 - local.get $3 - local.set $4 + local.get $0 + local.set $7 + global.get $~lib/memory/__stack_pointer + local.get $7 + i32.store + local.get $7 + local.get $1 + local.get $3 + call $~lib/map/Map#find + local.set $4 + local.get $4 + if local.get $4 - if - local.get $3 - i32.load offset=8 - local.set $5 - local.get $5 - i32.const 1 - i32.and -======= ->>>>>>> master - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 42 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - local.get $7 - call $~lib/map/Map#delete - drop - local.get $0 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - local.get $7 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 44 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $7 - i32.const 1 - i32.add - local.set $7 - br $for-loop|6 - end - end -<<<<<<< HEAD - i32.const 0 - ) - (func $~lib/map/Map#has (param $0 i32) (param $1 i32) (result i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/map/Map#find - i32.const 0 - i32.ne - ) - (func $~lib/map/Map#rehash (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - local.get $1 - i32.const 1 - i32.add - local.set $2 - i32.const 0 - local.get $2 - i32.const 4 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $3 - local.get $2 - i32.const 8 - i32.mul - i32.const 3 - i32.div_s - local.set $4 -======= - local.get $0 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - call $~lib/map/Map#get:size - i32.const 50 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 46 - i32.const 3 - call $~lib/builtins/abort - unreachable - end ->>>>>>> master - i32.const 0 - local.set $7 - loop $for-loop|8 - local.get $7 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.const 50 - i32.lt_s - local.set $9 - local.get $9 - if - local.get $0 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - local.get $7 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if -<<<<<<< HEAD - local.get $8 - local.set $11 - local.get $10 - i32.load8_u - local.set $12 - local.get $11 - local.get $12 - i32.store8 - local.get $11 - local.get $10 - i32.load offset=4 - i32.store offset=4 - local.get $12 - call $~lib/util/hash/HASH - local.get $1 - i32.and - local.set $13 - local.get $3 - local.get $13 - i32.const 4 - i32.mul - i32.add - local.set $14 - local.get $11 - local.get $14 - i32.load - i32.store offset=8 - local.get $14 - local.get $8 - i32.store - local.get $8 - i32.const 12 - i32.add - local.set $8 -======= - i32.const 0 - i32.const 544 - i32.const 50 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - local.get $7 - i32.const 10 - local.get $7 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.add - call $~lib/map/Map#set - drop - local.get $0 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - local.get $7 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 52 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - local.get $7 - call $~lib/map/Map#delete - drop - local.get $0 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - local.get $7 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 54 - i32.const 5 - call $~lib/builtins/abort - unreachable ->>>>>>> master - end - local.get $7 - i32.const 1 - i32.add - local.set $7 - br $for-loop|8 - end - end - local.get $0 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - call $~lib/map/Map#get:size - i32.const 50 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 56 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - call $~lib/map/Map#clear - local.get $0 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - call $~lib/map/Map#get:size - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 60 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - i32.const 24 - i32.add - global.set $~lib/memory/__stack_pointer - ) - (func $~lib/map/Map#has (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - local.get $0 - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store - local.get $3 - local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 1 - i32.eq - drop - local.get $2 - i32.const 255 - i32.and - call $~lib/util/hash/hash8 - br $~lib/util/hash/HASH|inlined.0 - end - call $~lib/map/Map#find - i32.const 0 - i32.ne - local.set $3 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $3 - ) - (func $~lib/map/Map#set (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) -<<<<<<< HEAD - local.get $1 - call $~lib/util/hash/HASH - local.set $3 -======= - (local $7 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i64.const 0 - i64.store - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 1 - i32.eq - drop - local.get $3 - i32.const 255 - i32.and - call $~lib/util/hash/hash8 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $4 ->>>>>>> master - local.get $0 - local.set $7 - global.get $~lib/memory/__stack_pointer - local.get $7 - i32.store - local.get $7 - local.get $1 - local.get $3 - call $~lib/map/Map#find - local.set $4 - local.get $4 - if -<<<<<<< HEAD - i32.const 0 - drop - local.get $4 -======= - local.get $5 ->>>>>>> master - local.get $2 - call $~lib/map/MapEntry#set:value - i32.const 0 - drop - else - local.get $0 - i32.load offset=16 - local.get $0 - i32.load offset=12 - i32.eq + local.get $2 + call $~lib/map/MapEntry#set:value + i32.const 0 + drop + else + local.get $0 + i32.load offset=16 + local.get $0 + i32.load offset=12 + i32.eq if local.get $0 local.set $7 @@ -13770,15 +12821,9 @@ global.get $~lib/memory/__stack_pointer local.get $0 i32.load offset=8 -<<<<<<< HEAD - call $~lib/rt/pure/__retain - local.set $5 - local.get $5 -======= - local.tee $3 + local.tee $5 i32.store offset=4 - local.get $3 ->>>>>>> master + local.get $5 local.get $0 local.get $0 i32.load offset=16 @@ -13793,15 +12838,10 @@ local.set $4 local.get $4 local.get $1 -<<<<<<< HEAD - i32.store8 - local.get $4 -======= call $~lib/map/MapEntry#set:key i32.const 0 drop - local.get $5 ->>>>>>> master + local.get $4 local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -13829,11 +12869,6 @@ local.get $6 local.get $4 i32.store -<<<<<<< HEAD - local.get $5 - call $~lib/rt/pure/__release -======= ->>>>>>> master end local.get $0 local.set $7 @@ -13845,10 +12880,7 @@ ) (func $~lib/map/Map#get (param $0 i32) (param $1 i32) (result i32) (local $2 i32) -<<<<<<< HEAD -======= (local $3 i32) - (local $4 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -13857,13 +12889,12 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store ->>>>>>> master local.get $0 - local.set $4 + local.set $3 global.get $~lib/memory/__stack_pointer - local.get $4 + local.get $3 i32.store - local.get $4 + local.get $3 local.get $1 local.get $1 call $~lib/util/hash/HASH @@ -13881,12 +12912,12 @@ end local.get $2 i32.load offset=4 - local.set $4 + local.set $3 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $4 + local.get $3 ) (func $~lib/array/Array#__set (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) @@ -14085,26 +13116,6 @@ i32.and i32.eqz if -<<<<<<< HEAD - local.get $8 - local.set $11 - local.get $10 - i32.load8_u - local.set $12 - local.get $11 - local.get $12 - i32.store8 - local.get $11 - local.get $10 - i32.load8_u offset=1 - i32.store8 offset=1 - local.get $12 - call $~lib/util/hash/HASH - local.get $1 - i32.and - local.set $13 -======= ->>>>>>> master local.get $3 local.set $9 global.get $~lib/memory/__stack_pointer @@ -14149,11 +13160,6 @@ (local $4 i32) (local $5 i32) (local $6 i32) -<<<<<<< HEAD - local.get $1 - call $~lib/util/hash/HASH - local.set $3 -======= (local $7 i32) global.get $~lib/memory/__stack_pointer i32.const 8 @@ -14163,27 +13169,9 @@ global.get $~lib/memory/__stack_pointer i64.const 0 i64.store - block $~lib/util/hash/HASH|inlined.4 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 1 - i32.eq - drop - local.get $3 - i32.const 255 - i32.and - call $~lib/util/hash/hash8 - br $~lib/util/hash/HASH|inlined.4 - end - local.set $4 ->>>>>>> master + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 local.set $7 global.get $~lib/memory/__stack_pointer @@ -14196,13 +13184,7 @@ local.set $4 local.get $4 if -<<<<<<< HEAD - i32.const 0 - drop local.get $4 -======= - local.get $5 ->>>>>>> master local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -14245,15 +13227,9 @@ global.get $~lib/memory/__stack_pointer local.get $0 i32.load offset=8 -<<<<<<< HEAD - call $~lib/rt/pure/__retain - local.set $5 - local.get $5 -======= - local.tee $3 + local.tee $5 i32.store offset=4 - local.get $3 ->>>>>>> master + local.get $5 local.get $0 local.get $0 i32.load offset=16 @@ -14268,15 +13244,10 @@ local.set $4 local.get $4 local.get $1 -<<<<<<< HEAD - i32.store8 - local.get $4 -======= call $~lib/map/MapEntry#set:key i32.const 0 drop - local.get $5 ->>>>>>> master + local.get $4 local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -14304,11 +13275,6 @@ local.get $6 local.get $4 i32.store -<<<<<<< HEAD - local.get $5 - call $~lib/rt/pure/__release -======= ->>>>>>> master end local.get $0 local.set $7 @@ -14355,17 +13321,8 @@ local.get $6 return end -<<<<<<< HEAD - i32.const 0 - drop - i32.const 0 - drop local.get $2 local.get $2 -======= - local.get $3 - local.get $3 ->>>>>>> master i32.load offset=8 i32.const 1 i32.or @@ -14409,16 +13366,12 @@ end if local.get $0 -<<<<<<< HEAD - local.get $3 -======= local.set $6 global.get $~lib/memory/__stack_pointer local.get $6 i32.store local.get $6 - local.get $4 ->>>>>>> master + local.get $3 call $~lib/map/Map#rehash end i32.const 1 @@ -14728,508 +13681,154 @@ i32.const 0 call $~lib/map/Map#constructor local.tee $6 - i32.store offset=20 - i32.const 0 - local.set $7 - loop $for-loop|4 - local.get $7 - local.get $1 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - call $~lib/array/Array#get:length - i32.lt_s - local.set $8 - local.get $8 - if - local.get $1 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - local.get $7 - call $~lib/array/Array#__get - local.set $9 - local.get $4 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - local.get $7 - call $~lib/array/Array#__get - local.set $10 - local.get $0 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - local.get $9 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 31 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - local.get $10 - i32.const 20 - i32.sub - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 32 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $5 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - local.get $9 - local.get $9 - call $~lib/map/Map#set - drop - local.get $6 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - local.get $10 - i32.const 20 - i32.sub - local.get $10 - i32.const 20 - i32.sub - call $~lib/map/Map#set - drop - local.get $7 - i32.const 1 - i32.add - local.set $7 - br $for-loop|4 - end - end - local.get $5 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - call $~lib/map/Map#get:size - i32.const 100 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 36 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $6 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - call $~lib/map/Map#get:size - i32.const 100 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 37 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - local.set $7 - loop $for-loop|6 - local.get $7 - i32.const 255 - i32.and - i32.const 50 - i32.lt_u - local.set $10 - local.get $10 - if - local.get $0 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - local.get $7 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 41 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - local.get $7 - call $~lib/map/Map#get - i32.const 20 - local.get $7 - i32.const 255 - i32.and - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 42 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - local.get $7 - call $~lib/map/Map#delete - drop - local.get $0 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - local.get $7 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 44 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $7 - i32.const 1 - i32.add - local.set $7 - br $for-loop|6 - end - end - local.get $0 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - call $~lib/map/Map#get:size - i32.const 50 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 46 - i32.const 3 - call $~lib/builtins/abort - unreachable - end + i32.store offset=20 i32.const 0 local.set $7 - loop $for-loop|8 + loop $for-loop|4 local.get $7 - i32.const 255 - i32.and - i32.const 50 - i32.lt_u - local.set $9 - local.get $9 + local.get $1 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 + call $~lib/array/Array#get:length + i32.lt_s + local.set $8 + local.get $8 if - local.get $0 + local.get $1 local.set $11 global.get $~lib/memory/__stack_pointer local.get $11 i32.store offset=4 local.get $11 local.get $7 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 50 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 -<<<<<<< HEAD -======= + call $~lib/array/Array#__get + local.set $9 + local.get $4 local.set $11 global.get $~lib/memory/__stack_pointer local.get $11 i32.store offset=4 local.get $11 ->>>>>>> master local.get $7 - i32.const 10 - local.get $7 - i32.const 255 -<<<<<<< HEAD - i32.and - i32.add - call $~lib/map/Map#set - call $~lib/rt/pure/__release + call $~lib/array/Array#__get + local.set $10 local.get $0 - local.get $7 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 + local.get $9 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 336 - i32.const 52 + i32.const 544 + i32.const 31 i32.const 5 call $~lib/builtins/abort unreachable end local.get $0 - local.get $7 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $7 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 + local.get $10 + i32.const 20 + i32.sub call $~lib/map/Map#has i32.eqz - i32.eqz if i32.const 0 - i32.const 336 - i32.const 54 + i32.const 544 + i32.const 32 i32.const 5 call $~lib/builtins/abort unreachable end + local.get $5 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 + local.get $9 + local.get $9 + call $~lib/map/Map#set + drop + local.get $6 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 + local.get $10 + i32.const 20 + i32.sub + local.get $10 + i32.const 20 + i32.sub + call $~lib/map/Map#set + drop local.get $7 i32.const 1 i32.add local.set $7 - br $for-loop|8 + br $for-loop|4 end end - local.get $0 - call $~lib/map/Map#get:size - i32.const 50 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 336 - i32.const 56 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - call $~lib/map/Map#clear - local.get $0 - call $~lib/map/Map#get:size - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 336 - i32.const 60 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $1 - call $~lib/rt/pure/__release - local.get $4 - call $~lib/rt/pure/__release local.get $5 - call $~lib/rt/pure/__release - local.get $6 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - ) - (func $~lib/map/Map#constructor (param $0 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 24 - i32.const 11 - call $~lib/rt/pure/__new - call $~lib/rt/pure/__retain - local.set $0 - end - local.get $0 - i32.const 0 - i32.const 4 - i32.const 4 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - i32.store - local.get $0 - i32.const 4 - i32.const 1 - i32.sub + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 i32.store offset=4 - local.get $0 - i32.const 0 - i32.const 4 - i32.const 12 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - i32.store offset=8 - local.get $0 - i32.const 4 - i32.store offset=12 - local.get $0 - i32.const 0 - i32.store offset=16 - local.get $0 - i32.const 0 - i32.store offset=20 - local.get $0 - ) - (func $~lib/util/hash/HASH (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 4 - i32.le_u - drop - local.get $0 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - local.set $2 - i32.const 2 - local.set $1 - i32.const 0 - i32.const 374761393 - i32.add - local.get $1 - i32.add - local.set $3 - local.get $3 - local.get $2 - i32.const -1028477379 - i32.mul - i32.add - local.set $3 - local.get $3 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 15 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -2048144777 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 13 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -1028477379 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 16 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - return - ) - (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.get $2 - local.get $0 - i32.load offset=4 - i32.and - i32.const 4 - i32.mul - i32.add - i32.load - local.set $3 - loop $while-continue|0 - local.get $3 - local.set $4 - local.get $4 + local.get $11 + call $~lib/map/Map#get:size + i32.const 100 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 544 + i32.const 36 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $6 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 + call $~lib/map/Map#get:size + i32.const 100 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 544 + i32.const 37 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + local.set $7 + loop $for-loop|6 + local.get $7 + i32.const 255 + i32.and + i32.const 50 + i32.lt_u + local.set $10 + local.get $10 if - local.get $3 - i32.load offset=8 - local.set $5 - local.get $5 - i32.const 1 -======= ->>>>>>> master - i32.and - i32.add - call $~lib/map/Map#set - drop local.get $0 local.set $11 global.get $~lib/memory/__stack_pointer @@ -15242,7 +13841,30 @@ if i32.const 0 i32.const 544 - i32.const 52 + i32.const 41 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 + local.get $7 + call $~lib/map/Map#get + i32.const 20 + local.get $7 + i32.const 255 + i32.and + i32.add + i32.eq + i32.eqz + if + i32.const 0 + i32.const 544 + i32.const 42 i32.const 5 call $~lib/builtins/abort unreachable @@ -15269,7 +13891,7 @@ if i32.const 0 i32.const 544 - i32.const 54 + i32.const 44 i32.const 5 call $~lib/builtins/abort unreachable @@ -15278,7 +13900,7 @@ i32.const 1 i32.add local.set $7 - br $for-loop|8 + br $for-loop|6 end end local.get $0 @@ -15294,235 +13916,187 @@ if i32.const 0 i32.const 544 - i32.const 56 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - call $~lib/map/Map#clear - local.get $0 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - call $~lib/map/Map#get:size - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 60 + i32.const 46 i32.const 3 call $~lib/builtins/abort unreachable end - global.get $~lib/memory/__stack_pointer - i32.const 24 - i32.add - global.set $~lib/memory/__stack_pointer - ) - (func $~lib/map/Map#has (param $0 i32) (param $1 i32) (result i32) -<<<<<<< HEAD -======= - (local $2 i32) - (local $3 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store ->>>>>>> master - local.get $0 - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store - local.get $3 - local.get $1 -<<<<<<< HEAD - local.get $1 - call $~lib/util/hash/HASH - call $~lib/map/Map#find - i32.const 0 - i32.ne - ) - (func $~lib/map/Map#rehash (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - local.get $1 - i32.const 1 - i32.add - local.set $2 - i32.const 0 - local.get $2 - i32.const 4 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $3 - local.get $2 - i32.const 8 - i32.mul - i32.const 3 - i32.div_s - local.set $4 i32.const 0 - local.get $4 - i32.const 12 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 - local.get $0 - i32.load offset=8 - local.set $6 - local.get $6 - local.get $0 - i32.load offset=16 - i32.const 12 - i32.mul - i32.add local.set $7 - local.get $5 - local.set $8 - loop $while-continue|0 - local.get $6 + loop $for-loop|8 local.get $7 - i32.ne + i32.const 255 + i32.and + i32.const 50 + i32.lt_u local.set $9 local.get $9 if - local.get $6 - local.set $10 - local.get $10 - i32.load offset=8 - i32.const 1 + local.get $0 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 + local.get $7 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 544 + i32.const 50 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 + local.get $7 + i32.const 10 + local.get $7 + i32.const 255 i32.and + i32.add + call $~lib/map/Map#set + drop + local.get $0 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 + local.get $7 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 544 + i32.const 52 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 + local.get $7 + call $~lib/map/Map#delete + drop + local.get $0 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 + local.get $7 + call $~lib/map/Map#has + i32.eqz i32.eqz if - local.get $8 - local.set $11 - local.get $10 - i32.load16_s - local.set $12 - local.get $11 - local.get $12 - i32.store16 - local.get $11 - local.get $10 - i32.load offset=4 - i32.store offset=4 - local.get $12 - call $~lib/util/hash/HASH - local.get $1 - i32.and - local.set $13 - local.get $3 - local.get $13 - i32.const 4 - i32.mul - i32.add - local.set $14 - local.get $11 - local.get $14 - i32.load - i32.store offset=8 - local.get $14 - local.get $8 - i32.store - local.get $8 - i32.const 12 - i32.add - local.set $8 + i32.const 0 + i32.const 544 + i32.const 54 + i32.const 5 + call $~lib/builtins/abort + unreachable end - local.get $6 - i32.const 12 + local.get $7 + i32.const 1 i32.add - local.set $6 - br $while-continue|0 + local.set $7 + br $for-loop|8 end end local.get $0 - local.tee $11 - local.get $3 - local.tee $12 + local.set $11 + global.get $~lib/memory/__stack_pointer local.get $11 - i32.load - local.tee $9 - i32.ne + i32.store offset=4 + local.get $11 + call $~lib/map/Map#get:size + i32.const 50 + i32.eq + i32.eqz if - local.get $12 - call $~lib/rt/pure/__retain - local.set $12 - local.get $9 - call $~lib/rt/pure/__release -======= - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 i32.const 0 - drop - i32.const 0 - drop + i32.const 544 + i32.const 56 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 + call $~lib/map/Map#clear + local.get $0 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 + call $~lib/map/Map#get:size + i32.const 0 + i32.eq + i32.eqz + if i32.const 0 - drop - i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq - drop - local.get $2 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/util/hash/hash16 - br $~lib/util/hash/HASH|inlined.0 ->>>>>>> master + i32.const 544 + i32.const 60 + i32.const 3 + call $~lib/builtins/abort + unreachable end + global.get $~lib/memory/__stack_pointer + i32.const 24 + i32.add + global.set $~lib/memory/__stack_pointer + ) + (func $~lib/map/Map#has (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i32.const 0 + i32.store + local.get $0 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + local.get $1 + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne - local.set $3 + local.set $2 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $3 + local.get $2 ) (func $~lib/map/Map#set (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) -<<<<<<< HEAD - local.get $1 - call $~lib/util/hash/HASH - local.set $3 -======= (local $7 i32) global.get $~lib/memory/__stack_pointer i32.const 8 @@ -15532,33 +14106,9 @@ global.get $~lib/memory/__stack_pointer i64.const 0 i64.store - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq - drop - local.get $3 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/util/hash/hash16 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $4 ->>>>>>> master + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 local.set $7 global.get $~lib/memory/__stack_pointer @@ -15571,13 +14121,7 @@ local.set $4 local.get $4 if -<<<<<<< HEAD - i32.const 0 - drop local.get $4 -======= - local.get $5 ->>>>>>> master local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -15620,15 +14164,9 @@ global.get $~lib/memory/__stack_pointer local.get $0 i32.load offset=8 -<<<<<<< HEAD - call $~lib/rt/pure/__retain - local.set $5 - local.get $5 -======= - local.tee $3 + local.tee $5 i32.store offset=4 - local.get $3 ->>>>>>> master + local.get $5 local.get $0 local.get $0 i32.load offset=16 @@ -15643,15 +14181,10 @@ local.set $4 local.get $4 local.get $1 -<<<<<<< HEAD - i32.store16 - local.get $4 -======= call $~lib/map/MapEntry#set:key i32.const 0 drop - local.get $5 ->>>>>>> master + local.get $4 local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -15679,11 +14212,6 @@ local.get $6 local.get $4 i32.store -<<<<<<< HEAD - local.get $5 - call $~lib/rt/pure/__release -======= ->>>>>>> master end local.get $0 local.set $7 @@ -15695,10 +14223,7 @@ ) (func $~lib/map/Map#get (param $0 i32) (param $1 i32) (result i32) (local $2 i32) -<<<<<<< HEAD -======= (local $3 i32) - (local $4 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -15707,13 +14232,12 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store ->>>>>>> master local.get $0 - local.set $4 + local.set $3 global.get $~lib/memory/__stack_pointer - local.get $4 + local.get $3 i32.store - local.get $4 + local.get $3 local.get $1 local.get $1 call $~lib/util/hash/HASH @@ -15731,12 +14255,12 @@ end local.get $2 i32.load offset=4 - local.set $4 + local.set $3 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $4 + local.get $3 ) (func $~lib/array/Array#__set (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) @@ -15935,39 +14459,10 @@ i32.and i32.eqz if -<<<<<<< HEAD - local.get $8 - local.set $11 - local.get $10 - i32.load16_s - local.set $12 - local.get $11 - local.get $12 - i32.store16 - local.get $11 - local.get $10 - i32.load16_s offset=2 - i32.store16 offset=2 - local.get $12 - call $~lib/util/hash/HASH - local.get $1 - i32.and - local.set $13 - local.get $3 - local.get $13 - i32.const 4 - i32.mul - i32.add - local.set $14 - local.get $11 - local.get $14 - i32.load -======= local.get $3 local.set $9 global.get $~lib/memory/__stack_pointer local.get $9 ->>>>>>> master i32.store offset=4 local.get $9 local.get $4 @@ -16001,54 +14496,25 @@ i32.const 8 i32.add global.set $~lib/memory/__stack_pointer - local.get $9 - ) - (func $~lib/map/Map#set (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) -<<<<<<< HEAD - local.get $1 - call $~lib/util/hash/HASH - local.set $3 -======= - (local $7 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i64.const 0 - i64.store - block $~lib/util/hash/HASH|inlined.4 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq - drop - local.get $3 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/util/hash/hash16 - br $~lib/util/hash/HASH|inlined.4 - end - local.set $4 ->>>>>>> master + local.get $9 + ) + (func $~lib/map/Map#set (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + global.get $~lib/memory/__stack_pointer + i32.const 8 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 local.set $7 global.get $~lib/memory/__stack_pointer @@ -16061,13 +14527,7 @@ local.set $4 local.get $4 if -<<<<<<< HEAD - i32.const 0 - drop local.get $4 -======= - local.get $5 ->>>>>>> master local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -16110,15 +14570,9 @@ global.get $~lib/memory/__stack_pointer local.get $0 i32.load offset=8 -<<<<<<< HEAD - call $~lib/rt/pure/__retain - local.set $5 - local.get $5 -======= - local.tee $3 + local.tee $5 i32.store offset=4 - local.get $3 ->>>>>>> master + local.get $5 local.get $0 local.get $0 i32.load offset=16 @@ -16133,15 +14587,10 @@ local.set $4 local.get $4 local.get $1 -<<<<<<< HEAD - i32.store16 - local.get $4 -======= call $~lib/map/MapEntry#set:key i32.const 0 drop - local.get $5 ->>>>>>> master + local.get $4 local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -16169,11 +14618,6 @@ local.get $6 local.get $4 i32.store -<<<<<<< HEAD - local.get $5 - call $~lib/rt/pure/__release -======= ->>>>>>> master end local.get $0 local.set $7 @@ -16220,17 +14664,8 @@ local.get $6 return end -<<<<<<< HEAD - i32.const 0 - drop - i32.const 0 - drop local.get $2 local.get $2 -======= - local.get $3 - local.get $3 ->>>>>>> master i32.load offset=8 i32.const 1 i32.or @@ -16274,16 +14709,12 @@ end if local.get $0 -<<<<<<< HEAD - local.get $3 -======= local.set $6 global.get $~lib/memory/__stack_pointer local.get $6 i32.store local.get $6 - local.get $4 ->>>>>>> master + local.get $3 call $~lib/map/Map#rehash end i32.const 1 @@ -16615,464 +15046,149 @@ local.get $1 local.set $11 global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - call $~lib/array/Array#get:length - i32.lt_s - local.set $8 - local.get $8 - if - local.get $1 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - local.get $7 - call $~lib/array/Array#__get - local.set $9 - local.get $4 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - local.get $7 - call $~lib/array/Array#__get - local.set $10 - local.get $0 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - local.get $9 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 31 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - local.get $10 - i32.const 20 - i32.sub - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 32 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $5 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - local.get $9 - local.get $9 - call $~lib/map/Map#set - drop - local.get $6 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - local.get $10 - i32.const 20 - i32.sub - local.get $10 - i32.const 20 - i32.sub - call $~lib/map/Map#set - drop - local.get $7 - i32.const 1 - i32.add - local.set $7 - br $for-loop|4 - end - end - local.get $5 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - call $~lib/map/Map#get:size - i32.const 100 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 36 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $6 - local.set $11 - global.get $~lib/memory/__stack_pointer - local.get $11 - i32.store offset=4 - local.get $11 - call $~lib/map/Map#get:size - i32.const 100 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 37 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - local.set $7 - loop $for-loop|6 - local.get $7 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.const 50 - i32.lt_s - local.set $10 - local.get $10 - if - local.get $0 -<<<<<<< HEAD - local.get $7 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 336 - i32.const 41 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $7 - call $~lib/map/Map#get - i32.const 20 - local.get $7 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 336 - i32.const 42 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $7 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $7 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 336 - i32.const 44 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $7 - i32.const 1 - i32.add - local.set $7 - br $for-loop|6 - end - end - local.get $0 - call $~lib/map/Map#get:size - i32.const 50 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 336 - i32.const 46 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - local.set $7 - loop $for-loop|8 - local.get $7 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.const 50 + local.get $11 + i32.store offset=4 + local.get $11 + call $~lib/array/Array#get:length i32.lt_s - local.set $9 - local.get $9 + local.set $8 + local.get $8 if - local.get $0 - local.get $7 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 336 - i32.const 50 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 + local.get $1 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 local.get $7 - i32.const 10 + call $~lib/array/Array#__get + local.set $9 + local.get $4 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 local.get $7 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.add - call $~lib/map/Map#set - call $~lib/rt/pure/__release + call $~lib/array/Array#__get + local.set $10 local.get $0 - local.get $7 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 + local.get $9 call $~lib/map/Map#has i32.eqz if i32.const 0 - i32.const 336 - i32.const 52 + i32.const 544 + i32.const 31 i32.const 5 call $~lib/builtins/abort unreachable end local.get $0 - local.get $7 - call $~lib/map/Map#delete - drop - local.get $0 - local.get $7 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 + local.get $10 + i32.const 20 + i32.sub call $~lib/map/Map#has i32.eqz - i32.eqz if i32.const 0 - i32.const 336 - i32.const 54 + i32.const 544 + i32.const 32 i32.const 5 call $~lib/builtins/abort unreachable end + local.get $5 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 + local.get $9 + local.get $9 + call $~lib/map/Map#set + drop + local.get $6 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 + local.get $10 + i32.const 20 + i32.sub + local.get $10 + i32.const 20 + i32.sub + call $~lib/map/Map#set + drop local.get $7 i32.const 1 i32.add local.set $7 - br $for-loop|8 + br $for-loop|4 end end - local.get $0 - call $~lib/map/Map#get:size - i32.const 50 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 336 - i32.const 56 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - call $~lib/map/Map#clear - local.get $0 - call $~lib/map/Map#get:size - i32.const 0 + local.get $5 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 + call $~lib/map/Map#get:size + i32.const 100 i32.eq i32.eqz if i32.const 0 - i32.const 336 - i32.const 60 + i32.const 544 + i32.const 36 i32.const 3 call $~lib/builtins/abort unreachable end - local.get $1 - call $~lib/rt/pure/__release - local.get $4 - call $~lib/rt/pure/__release - local.get $5 - call $~lib/rt/pure/__release local.get $6 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - ) - (func $~lib/map/Map#constructor (param $0 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 24 - i32.const 14 - call $~lib/rt/pure/__new - call $~lib/rt/pure/__retain - local.set $0 - end - local.get $0 - i32.const 0 - i32.const 4 - i32.const 4 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - i32.store - local.get $0 - i32.const 4 - i32.const 1 - i32.sub - i32.store offset=4 - local.get $0 - i32.const 0 - i32.const 4 - i32.const 12 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - i32.store offset=8 - local.get $0 - i32.const 4 - i32.store offset=12 - local.get $0 - i32.const 0 - i32.store offset=16 - local.get $0 - i32.const 0 - i32.store offset=20 - local.get $0 - ) - (func $~lib/util/hash/HASH (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 4 - i32.le_u - drop - local.get $0 - i32.const 65535 - i32.and - local.set $2 - i32.const 2 - local.set $1 - i32.const 0 - i32.const 374761393 - i32.add - local.get $1 - i32.add - local.set $3 - local.get $3 - local.get $2 - i32.const -1028477379 - i32.mul - i32.add - local.set $3 - local.get $3 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 15 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -2048144777 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 13 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -1028477379 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 16 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - return - ) - (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.get $2 - local.get $0 - i32.load offset=4 - i32.and - i32.const 4 - i32.mul - i32.add - i32.load - local.set $3 - loop $while-continue|0 - local.get $3 - local.set $4 - local.get $4 + local.set $11 + global.get $~lib/memory/__stack_pointer + local.get $11 + i32.store offset=4 + local.get $11 + call $~lib/map/Map#get:size + i32.const 100 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 544 + i32.const 37 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + i32.const 0 + local.set $7 + loop $for-loop|6 + local.get $7 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.const 50 + i32.lt_s + local.set $10 + local.get $10 if - local.get $3 - i32.load offset=8 - local.set $5 - local.get $5 - i32.const 1 - i32.and -======= + local.get $0 local.set $11 global.get $~lib/memory/__stack_pointer local.get $11 @@ -17080,7 +15196,6 @@ local.get $11 local.get $7 call $~lib/map/Map#has ->>>>>>> master i32.eqz if i32.const 0 @@ -17149,49 +15264,6 @@ br $for-loop|6 end end -<<<<<<< HEAD - i32.const 0 - ) - (func $~lib/map/Map#has (param $0 i32) (param $1 i32) (result i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/map/Map#find - i32.const 0 - i32.ne - ) - (func $~lib/map/Map#rehash (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - local.get $1 - i32.const 1 - i32.add - local.set $2 - i32.const 0 - local.get $2 - i32.const 4 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $3 - local.get $2 - i32.const 8 - i32.mul - i32.const 3 - i32.div_s - local.set $4 -======= local.get $0 local.set $11 global.get $~lib/memory/__stack_pointer @@ -17210,7 +15282,6 @@ call $~lib/builtins/abort unreachable end ->>>>>>> master i32.const 0 local.set $7 loop $for-loop|8 @@ -17235,42 +15306,6 @@ i32.eqz i32.eqz if -<<<<<<< HEAD - local.get $8 - local.set $11 - local.get $10 - i32.load16_u - local.set $12 - local.get $11 - local.get $12 - i32.store16 - local.get $11 - local.get $10 - i32.load offset=4 - i32.store offset=4 - local.get $12 - call $~lib/util/hash/HASH - local.get $1 - i32.and - local.set $13 - local.get $3 - local.get $13 - i32.const 4 - i32.mul - i32.add - local.set $14 - local.get $11 - local.get $14 - i32.load - i32.store offset=8 - local.get $14 - local.get $8 - i32.store - local.get $8 - i32.const 12 - i32.add - local.set $8 -======= i32.const 0 i32.const 544 i32.const 50 @@ -17310,7 +15345,6 @@ i32.const 5 call $~lib/builtins/abort unreachable ->>>>>>> master end local.get $0 local.set $11 @@ -17396,7 +15430,6 @@ ) (func $~lib/map/Map#has (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -17406,55 +15439,29 @@ i32.const 0 i32.store local.get $0 - local.set $3 + local.set $2 global.get $~lib/memory/__stack_pointer - local.get $3 + local.get $2 i32.store - local.get $3 + local.get $2 local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq - drop - local.get $2 - i32.const 65535 - i32.and - call $~lib/util/hash/hash16 - br $~lib/util/hash/HASH|inlined.0 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne - local.set $3 + local.set $2 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $3 + local.get $2 ) (func $~lib/map/Map#set (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) -<<<<<<< HEAD - local.get $1 - call $~lib/util/hash/HASH - local.set $3 -======= (local $7 i32) global.get $~lib/memory/__stack_pointer i32.const 8 @@ -17464,31 +15471,9 @@ global.get $~lib/memory/__stack_pointer i64.const 0 i64.store - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq - drop - local.get $3 - i32.const 65535 - i32.and - call $~lib/util/hash/hash16 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $4 ->>>>>>> master + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 local.set $7 global.get $~lib/memory/__stack_pointer @@ -17501,13 +15486,7 @@ local.set $4 local.get $4 if -<<<<<<< HEAD - i32.const 0 - drop local.get $4 -======= - local.get $5 ->>>>>>> master local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -17550,15 +15529,9 @@ global.get $~lib/memory/__stack_pointer local.get $0 i32.load offset=8 -<<<<<<< HEAD - call $~lib/rt/pure/__retain - local.set $5 - local.get $5 -======= - local.tee $3 + local.tee $5 i32.store offset=4 - local.get $3 ->>>>>>> master + local.get $5 local.get $0 local.get $0 i32.load offset=16 @@ -17573,15 +15546,10 @@ local.set $4 local.get $4 local.get $1 -<<<<<<< HEAD - i32.store16 - local.get $4 -======= call $~lib/map/MapEntry#set:key i32.const 0 drop - local.get $5 ->>>>>>> master + local.get $4 local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -17609,11 +15577,6 @@ local.get $6 local.get $4 i32.store -<<<<<<< HEAD - local.get $5 - call $~lib/rt/pure/__release -======= ->>>>>>> master end local.get $0 local.set $7 @@ -17625,10 +15588,7 @@ ) (func $~lib/map/Map#get (param $0 i32) (param $1 i32) (result i32) (local $2 i32) -<<<<<<< HEAD -======= (local $3 i32) - (local $4 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -17637,13 +15597,12 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store ->>>>>>> master local.get $0 - local.set $4 + local.set $3 global.get $~lib/memory/__stack_pointer - local.get $4 + local.get $3 i32.store - local.get $4 + local.get $3 local.get $1 local.get $1 call $~lib/util/hash/HASH @@ -17652,98 +15611,21 @@ local.get $2 i32.eqz if - i32.const 592 - i32.const 656 - i32.const 105 - i32.const 17 - call $~lib/builtins/abort - unreachable -<<<<<<< HEAD - end - local.get $2 - i32.load offset=4 - ) - (func $~lib/map/Map#get:size (param $0 i32) (result i32) - local.get $0 - i32.load offset=20 - ) - (func $~lib/array/Array#constructor (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $0 - i32.eqz - if - i32.const 16 - i32.const 15 - call $~lib/rt/pure/__new - call $~lib/rt/pure/__retain - local.set $0 - end - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $0 - i32.const 0 - i32.store offset=12 - local.get $1 - i32.const 1073741820 - i32.const 1 - i32.shr_u - i32.gt_u - if - i32.const 224 - i32.const 496 - i32.const 57 - i32.const 60 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i32.const 1 - i32.shl - local.set $2 - local.get $2 - i32.const 0 - call $~lib/rt/pure/__new - local.set $3 - local.get $3 - i32.const 0 - local.get $2 - call $~lib/memory/memory.fill - local.get $0 - local.tee $4 - local.get $3 - local.tee $5 - local.get $4 - i32.load - local.tee $6 - i32.ne - if - local.get $5 - call $~lib/rt/pure/__retain - local.set $5 - local.get $6 - call $~lib/rt/pure/__release -======= ->>>>>>> master + i32.const 592 + i32.const 656 + i32.const 105 + i32.const 17 + call $~lib/builtins/abort + unreachable end - local.get $3 + local.get $2 i32.load offset=4 - local.set $4 + local.set $3 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $4 + local.get $3 ) (func $~lib/array/Array#__set (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) @@ -17942,26 +15824,6 @@ i32.and i32.eqz if -<<<<<<< HEAD - local.get $8 - local.set $11 - local.get $10 - i32.load16_u - local.set $12 - local.get $11 - local.get $12 - i32.store16 - local.get $11 - local.get $10 - i32.load16_u offset=2 - i32.store16 offset=2 - local.get $12 - call $~lib/util/hash/HASH - local.get $1 - i32.and - local.set $13 -======= ->>>>>>> master local.get $3 local.set $9 global.get $~lib/memory/__stack_pointer @@ -18006,11 +15868,6 @@ (local $4 i32) (local $5 i32) (local $6 i32) -<<<<<<< HEAD - local.get $1 - call $~lib/util/hash/HASH - local.set $3 -======= (local $7 i32) global.get $~lib/memory/__stack_pointer i32.const 8 @@ -18020,31 +15877,9 @@ global.get $~lib/memory/__stack_pointer i64.const 0 i64.store - block $~lib/util/hash/HASH|inlined.4 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq - drop - local.get $3 - i32.const 65535 - i32.and - call $~lib/util/hash/hash16 - br $~lib/util/hash/HASH|inlined.4 - end - local.set $4 ->>>>>>> master + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 local.set $7 global.get $~lib/memory/__stack_pointer @@ -18057,13 +15892,7 @@ local.set $4 local.get $4 if -<<<<<<< HEAD - i32.const 0 - drop local.get $4 -======= - local.get $5 ->>>>>>> master local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -18106,15 +15935,9 @@ global.get $~lib/memory/__stack_pointer local.get $0 i32.load offset=8 -<<<<<<< HEAD - call $~lib/rt/pure/__retain - local.set $5 - local.get $5 -======= - local.tee $3 + local.tee $5 i32.store offset=4 - local.get $3 ->>>>>>> master + local.get $5 local.get $0 local.get $0 i32.load offset=16 @@ -18129,15 +15952,10 @@ local.set $4 local.get $4 local.get $1 -<<<<<<< HEAD - i32.store16 - local.get $4 -======= call $~lib/map/MapEntry#set:key i32.const 0 drop - local.get $5 ->>>>>>> master + local.get $4 local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -18165,11 +15983,6 @@ local.get $6 local.get $4 i32.store -<<<<<<< HEAD - local.get $5 - call $~lib/rt/pure/__release -======= ->>>>>>> master end local.get $0 local.set $7 @@ -18216,17 +16029,8 @@ local.get $6 return end -<<<<<<< HEAD - i32.const 0 - drop - i32.const 0 - drop local.get $2 local.get $2 -======= - local.get $3 - local.get $3 ->>>>>>> master i32.load offset=8 i32.const 1 i32.or @@ -18270,40 +16074,14 @@ end if local.get $0 -<<<<<<< HEAD - local.get $3 - call $~lib/map/Map#rehash - end - i32.const 1 - ) - (func $~lib/map/Map#clear (param $0 i32) - (local $1 i32) - (local $2 i32) - local.get $0 - local.tee $1 - i32.const 0 - i32.const 4 - i32.const 4 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $2 - local.get $1 - i32.load - call $~lib/rt/pure/__release - local.get $2 - i32.store - local.get $0 - i32.const 4 -======= local.set $6 global.get $~lib/memory/__stack_pointer local.get $6 i32.store local.get $6 - local.get $4 + local.get $3 call $~lib/map/Map#rehash end ->>>>>>> master i32.const 1 local.set $6 global.get $~lib/memory/__stack_pointer @@ -18994,20 +16772,7 @@ global.set $~lib/memory/__stack_pointer ) (func $~lib/map/Map#has (param $0 i32) (param $1 i32) (result i32) -<<<<<<< HEAD - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/map/Map#find - i32.const 0 - i32.ne - ) - (func $~lib/map/Map#get (param $0 i32) (param $1 i32) (result i32) (local $2 i32) -======= - (local $2 i32) - (local $3 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -19016,88 +16781,28 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store ->>>>>>> master local.get $0 - local.set $3 + local.set $2 global.get $~lib/memory/__stack_pointer - local.get $3 + local.get $2 i32.store - local.get $3 + local.get $2 local.get $1 -<<<<<<< HEAD local.get $1 call $~lib/util/hash/HASH call $~lib/map/Map#find - local.set $2 - local.get $2 - i32.eqz - if - i32.const 384 - i32.const 448 - i32.const 105 - i32.const 17 - call $~lib/builtins/abort - unreachable - end - local.get $2 - i32.load offset=4 - ) - (func $~lib/map/Map#keys (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) - (local $8 i32) - local.get $0 - i32.load offset=8 - local.set $1 - local.get $0 - i32.load offset=16 - local.set $2 -======= - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end - call $~lib/map/Map#find ->>>>>>> master i32.const 0 i32.ne - local.set $3 + local.set $2 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $3 + local.get $2 ) (func $~lib/map/Map#get (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - (local $4 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -19107,119 +16812,34 @@ i32.const 0 i32.store local.get $0 - local.set $4 - global.get $~lib/memory/__stack_pointer - local.get $4 - i32.store - local.get $4 - local.get $1 -<<<<<<< HEAD - local.get $1 - call $~lib/util/hash/HASH -======= - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.3 - end ->>>>>>> master - call $~lib/map/Map#find - local.set $2 - local.get $2 - i32.eqz - if -<<<<<<< HEAD - i32.const 0 - return - end - i32.const 0 - drop - i32.const 0 - drop - local.get $2 - local.get $2 - i32.load offset=8 - i32.const 1 - i32.or - i32.store offset=8 - local.get $0 - local.get $0 - i32.load offset=20 - i32.const 1 - i32.sub - i32.store offset=20 - local.get $0 - i32.load offset=4 - i32.const 1 - i32.shr_u local.set $3 - local.get $3 - i32.const 1 - i32.add - i32.const 4 - local.tee $4 - local.get $0 - i32.load offset=20 - local.tee $5 - local.get $4 - local.get $5 - i32.gt_u - select - i32.ge_u - if (result i32) - local.get $0 - i32.load offset=20 - local.get $0 - i32.load offset=12 - i32.const 3 - i32.mul - i32.const 4 - i32.div_s - i32.lt_s - else - i32.const 0 - end + global.get $~lib/memory/__stack_pointer + local.get $3 + i32.store + local.get $3 + local.get $1 + local.get $1 + call $~lib/util/hash/HASH + call $~lib/map/Map#find + local.set $2 + local.get $2 + i32.eqz if - local.get $0 - local.get $3 - call $~lib/map/Map#rehash -======= i32.const 592 i32.const 656 i32.const 105 i32.const 17 call $~lib/builtins/abort unreachable ->>>>>>> master end - local.get $3 + local.get $2 i32.load offset=4 - local.set $4 + local.set $3 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $4 + local.get $3 ) (func $~lib/map/Map#keys (param $0 i32) (result i32) (local $1 i32) @@ -19426,34 +17046,11 @@ i32.store local.get $6 local.get $1 - block $~lib/util/hash/HASH|inlined.4 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.4 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 0 @@ -19465,8 +17062,8 @@ local.get $6 return end - local.get $3 - local.get $3 + local.get $2 + local.get $2 i32.load offset=8 i32.const 1 i32.or @@ -19481,16 +17078,16 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.const 1 i32.add i32.const 4 - local.tee $2 + local.tee $4 local.get $0 i32.load offset=20 local.tee $5 - local.get $2 + local.get $4 local.get $5 i32.gt_u select @@ -19515,7 +17112,7 @@ local.get $6 i32.store local.get $6 - local.get $4 + local.get $3 call $~lib/map/Map#rehash end i32.const 1 @@ -19810,98 +17407,6 @@ call $~lib/map/Map#constructor local.tee $4 i32.store offset=20 -<<<<<<< HEAD - local.get $0 - ) - (func $~lib/util/hash/HASH (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 4 - i32.le_u - drop - local.get $0 - local.set $2 - i32.const 4 - local.set $1 - i32.const 0 - i32.const 374761393 - i32.add - local.get $1 - i32.add - local.set $3 - local.get $3 - local.get $2 - i32.const -1028477379 - i32.mul - i32.add - local.set $3 - local.get $3 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 15 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -2048144777 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 13 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -1028477379 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 16 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - return - ) - (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.get $2 - local.get $0 - i32.load offset=4 - i32.and - i32.const 4 - i32.mul - i32.add - i32.load - local.set $3 - loop $while-continue|0 - local.get $3 - local.set $4 - local.get $4 - if - local.get $3 - i32.load offset=8 - local.set $5 -======= i32.const 0 local.set $5 loop $for-loop|2 @@ -19923,7 +17428,6 @@ local.get $9 i32.store offset=4 local.get $9 ->>>>>>> master local.get $5 call $~lib/array/Array#__get local.set $7 @@ -20003,49 +17507,6 @@ br $for-loop|2 end end -<<<<<<< HEAD - i32.const 0 - ) - (func $~lib/map/Map#has (param $0 i32) (param $1 i32) (result i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/map/Map#find - i32.const 0 - i32.ne - ) - (func $~lib/map/Map#rehash (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - local.get $1 - i32.const 1 - i32.add - local.set $2 - i32.const 0 - local.get $2 - i32.const 4 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $3 - local.get $2 - i32.const 8 - i32.mul - i32.const 3 - i32.div_s - local.set $4 -======= local.get $3 local.set $9 global.get $~lib/memory/__stack_pointer @@ -20082,7 +17543,6 @@ call $~lib/builtins/abort unreachable end ->>>>>>> master i32.const 0 local.set $5 loop $for-loop|3 @@ -20102,42 +17562,6 @@ call $~lib/map/Map#has i32.eqz if -<<<<<<< HEAD - local.get $8 - local.set $11 - local.get $10 - i32.load - local.set $12 - local.get $11 - local.get $12 - i32.store - local.get $11 - local.get $10 - i32.load offset=4 - i32.store offset=4 - local.get $12 - call $~lib/util/hash/HASH - local.get $1 - i32.and - local.set $13 - local.get $3 - local.get $13 - i32.const 4 - i32.mul - i32.add - local.set $14 - local.get $11 - local.get $14 - i32.load - i32.store offset=8 - local.get $14 - local.get $8 - i32.store - local.get $8 - i32.const 12 - i32.add - local.set $8 -======= i32.const 0 i32.const 544 i32.const 41 @@ -20192,7 +17616,6 @@ i32.const 5 call $~lib/builtins/abort unreachable ->>>>>>> master end local.get $5 i32.const 1 @@ -20208,58 +17631,10 @@ i32.store offset=4 local.get $9 call $~lib/map/Map#get:size - i32.const 50 - i32.eq - i32.eqz - if -<<<<<<< HEAD - local.get $14 - call $~lib/rt/pure/__retain - local.set $14 - local.get $11 - call $~lib/rt/pure/__release - end - local.get $14 - i32.store offset=8 - local.get $0 - local.get $4 - i32.store offset=12 - local.get $0 - local.get $0 - i32.load offset=20 - i32.store offset=16 - local.get $3 - call $~lib/rt/pure/__release - local.get $5 - call $~lib/rt/pure/__release - ) - (func $~lib/map/Map#set (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $1 - call $~lib/util/hash/HASH - local.set $3 - local.get $0 - local.get $1 - local.get $3 - call $~lib/map/Map#find - local.set $4 - local.get $4 + i32.const 50 + i32.eq + i32.eqz if - i32.const 0 - drop - local.get $4 - local.get $2 - i32.store offset=4 - else - local.get $0 - i32.load offset=16 - local.get $0 - i32.load offset=12 - i32.eq -======= i32.const 0 i32.const 544 i32.const 46 @@ -20275,7 +17650,6 @@ i32.lt_s local.set $6 local.get $6 ->>>>>>> master if local.get $0 local.set $9 @@ -20357,57 +17731,6 @@ local.set $5 br $for-loop|4 end -<<<<<<< HEAD - local.get $0 - i32.load offset=8 - call $~lib/rt/pure/__retain - local.set $5 - local.get $5 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $6 - i32.const 1 - i32.add - i32.store offset=16 - local.get $6 - i32.const 12 - i32.mul - i32.add - local.set $4 - local.get $4 - local.get $1 - i32.store - local.get $4 - local.get $2 - i32.store offset=4 - local.get $0 - local.get $0 - i32.load offset=20 - i32.const 1 - i32.add - i32.store offset=20 - local.get $0 - i32.load - local.get $3 - local.get $0 - i32.load offset=4 - i32.and - i32.const 4 - i32.mul - i32.add - local.set $6 - local.get $4 - local.get $6 - i32.load - i32.store offset=8 - local.get $6 - local.get $4 - i32.store - local.get $5 - call $~lib/rt/pure/__release -======= ->>>>>>> master end local.get $0 local.set $9 @@ -20459,9 +17782,6 @@ ) (func $~lib/map/Map#has (param $0 i32) (param $1 i32) (result i32) (local $2 i32) -<<<<<<< HEAD -======= - (local $3 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -20470,71 +17790,24 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store ->>>>>>> master local.get $0 - local.set $3 + local.set $2 global.get $~lib/memory/__stack_pointer - local.get $3 + local.get $2 i32.store - local.get $3 + local.get $2 local.get $1 -<<<<<<< HEAD local.get $1 call $~lib/util/hash/HASH call $~lib/map/Map#find - local.set $2 - local.get $2 - i32.eqz - if - i32.const 384 - i32.const 448 - i32.const 105 - i32.const 17 - call $~lib/builtins/abort - unreachable - end - local.get $2 - i32.load offset=4 - ) - (func $~lib/map/Map#get:size (param $0 i32) (result i32) - local.get $0 - i32.load offset=20 -======= - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.0 - end - call $~lib/map/Map#find i32.const 0 i32.ne - local.set $3 + local.set $2 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $3 ->>>>>>> master + local.get $2 ) (func $~lib/map/Map#set (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -20550,32 +17823,9 @@ global.get $~lib/memory/__stack_pointer i64.const 0 i64.store - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $3 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $4 + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 local.set $7 global.get $~lib/memory/__stack_pointer @@ -20583,12 +17833,12 @@ i32.store local.get $7 local.get $1 - local.get $4 + local.get $3 call $~lib/map/Map#find - local.set $5 - local.get $5 + local.set $4 + local.get $4 if - local.get $5 + local.get $4 local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -20631,9 +17881,9 @@ global.get $~lib/memory/__stack_pointer local.get $0 i32.load offset=8 - local.tee $3 + local.tee $5 i32.store offset=4 - local.get $3 + local.get $5 local.get $0 local.get $0 i32.load offset=16 @@ -20645,13 +17895,13 @@ i32.const 12 i32.mul i32.add - local.set $5 - local.get $5 + local.set $4 + local.get $4 local.get $1 call $~lib/map/MapEntry#set:key i32.const 0 drop - local.get $5 + local.get $4 local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -20664,7 +17914,7 @@ call $~lib/map/Map#set:entriesCount local.get $0 i32.load - local.get $4 + local.get $3 local.get $0 i32.load offset=4 i32.and @@ -20672,12 +17922,12 @@ i32.mul i32.add local.set $6 - local.get $5 + local.get $4 local.get $6 i32.load call $~lib/map/MapEntry#set:taggedNext local.get $6 - local.get $5 + local.get $4 i32.store end local.get $0 @@ -20691,7 +17941,6 @@ (func $~lib/map/Map#get (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - (local $4 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -20701,40 +17950,17 @@ i32.const 0 i32.store local.get $0 - local.set $4 + local.set $3 global.get $~lib/memory/__stack_pointer - local.get $4 + local.get $3 i32.store - local.get $4 + local.get $3 local.get $1 - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.3 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 592 @@ -20744,14 +17970,14 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $2 i32.load offset=4 - local.set $4 + local.set $3 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $4 + local.get $3 ) (func $~lib/array/Array#__set (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) @@ -20950,26 +18176,6 @@ i32.and i32.eqz if -<<<<<<< HEAD - local.get $8 - local.set $11 - local.get $10 - i32.load - local.set $12 - local.get $11 - local.get $12 - i32.store - local.get $11 - local.get $10 - i32.load offset=4 - i32.store offset=4 - local.get $12 - call $~lib/util/hash/HASH - local.get $1 - i32.and - local.set $13 -======= ->>>>>>> master local.get $3 local.set $9 global.get $~lib/memory/__stack_pointer @@ -21009,52 +18215,23 @@ global.set $~lib/memory/__stack_pointer local.get $9 ) - (func $~lib/map/Map#set (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) -<<<<<<< HEAD - local.get $1 - call $~lib/util/hash/HASH - local.set $3 -======= - (local $7 i32) - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i64.const 0 - i64.store - block $~lib/util/hash/HASH|inlined.4 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $3 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.4 - end - local.set $4 ->>>>>>> master + (func $~lib/map/Map#set (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) + global.get $~lib/memory/__stack_pointer + i32.const 8 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 local.set $7 global.get $~lib/memory/__stack_pointer @@ -21067,13 +18244,7 @@ local.set $4 local.get $4 if -<<<<<<< HEAD - i32.const 0 - drop local.get $4 -======= - local.get $5 ->>>>>>> master local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -21116,15 +18287,9 @@ global.get $~lib/memory/__stack_pointer local.get $0 i32.load offset=8 -<<<<<<< HEAD - call $~lib/rt/pure/__retain - local.set $5 - local.get $5 -======= - local.tee $3 + local.tee $5 i32.store offset=4 - local.get $3 ->>>>>>> master + local.get $5 local.get $0 local.get $0 i32.load offset=16 @@ -21139,15 +18304,10 @@ local.set $4 local.get $4 local.get $1 -<<<<<<< HEAD - i32.store - local.get $4 -======= call $~lib/map/MapEntry#set:key i32.const 0 drop - local.get $5 ->>>>>>> master + local.get $4 local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -21175,11 +18335,6 @@ local.get $6 local.get $4 i32.store -<<<<<<< HEAD - local.get $5 - call $~lib/rt/pure/__release -======= ->>>>>>> master end local.get $0 local.set $7 @@ -21226,17 +18381,8 @@ local.get $6 return end -<<<<<<< HEAD - i32.const 0 - drop - i32.const 0 - drop local.get $2 local.get $2 -======= - local.get $3 - local.get $3 ->>>>>>> master i32.load offset=8 i32.const 1 i32.or @@ -21280,16 +18426,12 @@ end if local.get $0 -<<<<<<< HEAD - local.get $3 -======= local.set $6 global.get $~lib/memory/__stack_pointer local.get $6 i32.store local.get $6 - local.get $4 ->>>>>>> master + local.get $3 call $~lib/map/Map#rehash end i32.const 1 @@ -21611,237 +18753,25 @@ local.get $2 local.set $9 global.get $~lib/memory/__stack_pointer - local.get $9 - i32.store offset=4 - local.get $9 - local.get $5 - call $~lib/array/Array#__get - local.set $8 - local.get $0 - local.set $9 - global.get $~lib/memory/__stack_pointer - local.get $9 - i32.store offset=4 - local.get $9 - local.get $7 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 31 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $9 - global.get $~lib/memory/__stack_pointer - local.get $9 - i32.store offset=4 - local.get $9 - local.get $8 - i32.const 20 - i32.sub - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 32 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $3 - local.set $9 - global.get $~lib/memory/__stack_pointer - local.get $9 - i32.store offset=4 - local.get $9 - local.get $7 - local.get $7 - call $~lib/map/Map#set - drop - local.get $4 - local.set $9 - global.get $~lib/memory/__stack_pointer - local.get $9 - i32.store offset=4 - local.get $9 - local.get $8 - i32.const 20 - i32.sub - local.get $8 - i32.const 20 - i32.sub - call $~lib/map/Map#set - drop - local.get $5 - i32.const 1 - i32.add - local.set $5 - br $for-loop|2 - end - end - local.get $3 - local.set $9 - global.get $~lib/memory/__stack_pointer - local.get $9 - i32.store offset=4 - local.get $9 - call $~lib/map/Map#get:size - i32.const 100 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 36 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $4 - local.set $9 - global.get $~lib/memory/__stack_pointer - local.get $9 - i32.store offset=4 - local.get $9 - call $~lib/map/Map#get:size - i32.const 100 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 37 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - local.set $5 - loop $for-loop|3 - local.get $5 - i32.const 50 - i32.lt_u - local.set $6 - local.get $6 - if - local.get $0 - local.set $9 - global.get $~lib/memory/__stack_pointer - local.get $9 - i32.store offset=4 - local.get $9 - local.get $5 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 41 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $9 - global.get $~lib/memory/__stack_pointer - local.get $9 - i32.store offset=4 - local.get $9 - local.get $5 - call $~lib/map/Map#get - i32.const 20 - local.get $5 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 42 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $9 - global.get $~lib/memory/__stack_pointer - local.get $9 - i32.store offset=4 - local.get $9 - local.get $5 - call $~lib/map/Map#delete - drop - local.get $0 - local.set $9 - global.get $~lib/memory/__stack_pointer - local.get $9 - i32.store offset=4 - local.get $9 - local.get $5 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 44 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $5 - i32.const 1 - i32.add - local.set $5 - br $for-loop|3 - end - end - local.get $0 - local.set $9 - global.get $~lib/memory/__stack_pointer - local.get $9 - i32.store offset=4 - local.get $9 - call $~lib/map/Map#get:size - i32.const 50 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 46 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - i32.const 0 - local.set $5 - loop $for-loop|4 - local.get $5 - i32.const 50 - i32.lt_u - local.set $6 - local.get $6 - if + local.get $9 + i32.store offset=4 + local.get $9 + local.get $5 + call $~lib/array/Array#__get + local.set $8 local.get $0 local.set $9 global.get $~lib/memory/__stack_pointer local.get $9 i32.store offset=4 local.get $9 - local.get $5 + local.get $7 call $~lib/map/Map#has i32.eqz - i32.eqz if i32.const 0 i32.const 544 - i32.const 50 + i32.const 31 i32.const 5 call $~lib/builtins/abort unreachable @@ -21852,238 +18782,129 @@ local.get $9 i32.store offset=4 local.get $9 - local.get $5 - i32.const 10 - local.get $5 - i32.add - call $~lib/map/Map#set - drop - local.get $0 - local.set $9 - global.get $~lib/memory/__stack_pointer - local.get $9 - i32.store offset=4 - local.get $9 - local.get $5 + local.get $8 + i32.const 20 + i32.sub call $~lib/map/Map#has i32.eqz -<<<<<<< HEAD - i32.eqz if i32.const 0 - i32.const 336 - i32.const 54 + i32.const 544 + i32.const 32 i32.const 5 call $~lib/builtins/abort unreachable end + local.get $3 + local.set $9 + global.get $~lib/memory/__stack_pointer + local.get $9 + i32.store offset=4 + local.get $9 + local.get $7 + local.get $7 + call $~lib/map/Map#set + drop + local.get $4 + local.set $9 + global.get $~lib/memory/__stack_pointer + local.get $9 + i32.store offset=4 + local.get $9 + local.get $8 + i32.const 20 + i32.sub + local.get $8 + i32.const 20 + i32.sub + call $~lib/map/Map#set + drop local.get $5 i32.const 1 i32.add local.set $5 - br $for-loop|4 + br $for-loop|2 end end - local.get $0 - call $~lib/map/Map#get:size - i32.const 50 + local.get $3 + local.set $9 + global.get $~lib/memory/__stack_pointer + local.get $9 + i32.store offset=4 + local.get $9 + call $~lib/map/Map#get:size + i32.const 100 i32.eq i32.eqz if i32.const 0 - i32.const 336 - i32.const 56 + i32.const 544 + i32.const 36 i32.const 3 call $~lib/builtins/abort unreachable end - local.get $0 - call $~lib/map/Map#clear - local.get $0 - call $~lib/map/Map#get:size - i32.const 0 + local.get $4 + local.set $9 + global.get $~lib/memory/__stack_pointer + local.get $9 + i32.store offset=4 + local.get $9 + call $~lib/map/Map#get:size + i32.const 100 i32.eq i32.eqz if i32.const 0 - i32.const 336 - i32.const 60 + i32.const 544 + i32.const 37 i32.const 3 call $~lib/builtins/abort unreachable end - local.get $1 - call $~lib/rt/pure/__release - local.get $2 - call $~lib/rt/pure/__release - local.get $3 - call $~lib/rt/pure/__release - local.get $4 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - ) - (func $~lib/map/Map#constructor (param $0 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 24 - i32.const 20 - call $~lib/rt/pure/__new - call $~lib/rt/pure/__retain - local.set $0 - end - local.get $0 - i32.const 0 - i32.const 4 - i32.const 4 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - i32.store - local.get $0 - i32.const 4 - i32.const 1 - i32.sub - i32.store offset=4 - local.get $0 - i32.const 0 - i32.const 4 - i32.const 16 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - i32.store offset=8 - local.get $0 - i32.const 4 - i32.store offset=12 - local.get $0 - i32.const 0 - i32.store offset=16 - local.get $0 - i32.const 0 - i32.store offset=20 - local.get $0 - ) - (func $~lib/util/hash/HASH (param $0 i64) (result i32) - (local $1 i64) - (local $2 i32) - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 4 - i32.le_u - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $0 - local.set $1 i32.const 0 - i32.const 374761393 - i32.add - i32.const 8 - i32.add - local.set $2 - local.get $2 - local.get $1 - i32.wrap_i64 - i32.const -1028477379 - i32.mul - i32.add - local.set $2 - local.get $2 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $2 - local.get $2 - local.get $1 - i64.const 32 - i64.shr_u - i32.wrap_i64 - i32.const -1028477379 - i32.mul - i32.add - local.set $2 - local.get $2 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $2 - local.get $2 - local.get $2 - i32.const 15 - i32.shr_u - i32.xor - local.set $2 - local.get $2 - i32.const -2048144777 - i32.mul - local.set $2 - local.get $2 - local.get $2 - i32.const 13 - i32.shr_u - i32.xor - local.set $2 - local.get $2 - i32.const -1028477379 - i32.mul - local.set $2 - local.get $2 - local.get $2 - i32.const 16 - i32.shr_u - i32.xor - local.set $2 - local.get $2 - return - ) - (func $~lib/map/Map#find (param $0 i32) (param $1 i64) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.get $2 - local.get $0 - i32.load offset=4 - i32.and - i32.const 4 - i32.mul - i32.add - i32.load - local.set $3 - loop $while-continue|0 - local.get $3 - local.set $4 - local.get $4 + local.set $5 + loop $for-loop|3 + local.get $5 + i32.const 50 + i32.lt_u + local.set $6 + local.get $6 if - local.get $3 - i32.load offset=12 - local.set $5 + local.get $0 + local.set $9 + global.get $~lib/memory/__stack_pointer + local.get $9 + i32.store offset=4 + local.get $9 + local.get $5 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 544 + i32.const 41 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.set $9 + global.get $~lib/memory/__stack_pointer + local.get $9 + i32.store offset=4 + local.get $9 local.get $5 - i32.const 1 - i32.and + call $~lib/map/Map#get + i32.const 20 + local.get $5 + i32.add + i32.eq i32.eqz - if (result i32) - local.get $3 - i64.load - local.get $1 - i64.eq - else -======= if ->>>>>>> master i32.const 0 i32.const 544 - i32.const 52 + i32.const 42 i32.const 5 call $~lib/builtins/abort unreachable @@ -22110,7 +18931,7 @@ if i32.const 0 i32.const 544 - i32.const 54 + i32.const 44 i32.const 5 call $~lib/builtins/abort unreachable @@ -22119,7 +18940,7 @@ i32.const 1 i32.add local.set $5 - br $for-loop|4 + br $for-loop|3 end end local.get $0 @@ -22135,261 +18956,184 @@ if i32.const 0 i32.const 544 - i32.const 56 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $9 - global.get $~lib/memory/__stack_pointer - local.get $9 - i32.store offset=4 - local.get $9 - call $~lib/map/Map#clear - local.get $0 - local.set $9 - global.get $~lib/memory/__stack_pointer - local.get $9 - i32.store offset=4 - local.get $9 - call $~lib/map/Map#get:size - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 60 + i32.const 46 i32.const 3 call $~lib/builtins/abort unreachable end - global.get $~lib/memory/__stack_pointer - i32.const 24 - i32.add - global.set $~lib/memory/__stack_pointer - ) - (func $~lib/map/Map#has (param $0 i32) (param $1 i64) (result i32) -<<<<<<< HEAD -======= - (local $2 i64) - (local $3 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store ->>>>>>> master - local.get $0 - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store - local.get $3 - local.get $1 -<<<<<<< HEAD - local.get $1 - call $~lib/util/hash/HASH - call $~lib/map/Map#find - i32.const 0 - i32.ne - ) - (func $~lib/map/Map#rehash (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i64) - (local $13 i32) - (local $14 i32) - local.get $1 - i32.const 1 - i32.add - local.set $2 - i32.const 0 - local.get $2 - i32.const 4 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $3 - local.get $2 - i32.const 8 - i32.mul - i32.const 3 - i32.div_s - local.set $4 i32.const 0 - local.get $4 - i32.const 16 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor local.set $5 - local.get $0 - i32.load offset=8 - local.set $6 - local.get $6 - local.get $0 - i32.load offset=16 - i32.const 16 - i32.mul - i32.add - local.set $7 - local.get $5 - local.set $8 - loop $while-continue|0 + loop $for-loop|4 + local.get $5 + i32.const 50 + i32.lt_u + local.set $6 local.get $6 - local.get $7 - i32.ne - local.set $9 - local.get $9 if - local.get $6 - local.set $10 - local.get $10 - i32.load offset=12 - i32.const 1 - i32.and + local.get $0 + local.set $9 + global.get $~lib/memory/__stack_pointer + local.get $9 + i32.store offset=4 + local.get $9 + local.get $5 + call $~lib/map/Map#has + i32.eqz i32.eqz if - local.get $8 - local.set $11 - local.get $10 - i64.load - local.set $12 - local.get $11 - local.get $12 - i64.store - local.get $11 - local.get $10 - i32.load offset=8 - i32.store offset=8 - local.get $12 - call $~lib/util/hash/HASH - local.get $1 - i32.and - local.set $13 - local.get $3 - local.get $13 - i32.const 4 - i32.mul - i32.add - local.set $14 - local.get $11 - local.get $14 - i32.load - i32.store offset=12 - local.get $14 - local.get $8 - i32.store - local.get $8 - i32.const 16 - i32.add - local.set $8 + i32.const 0 + i32.const 544 + i32.const 50 + i32.const 5 + call $~lib/builtins/abort + unreachable end - local.get $6 - i32.const 16 + local.get $0 + local.set $9 + global.get $~lib/memory/__stack_pointer + local.get $9 + i32.store offset=4 + local.get $9 + local.get $5 + i32.const 10 + local.get $5 i32.add - local.set $6 - br $while-continue|0 + call $~lib/map/Map#set + drop + local.get $0 + local.set $9 + global.get $~lib/memory/__stack_pointer + local.get $9 + i32.store offset=4 + local.get $9 + local.get $5 + call $~lib/map/Map#has + i32.eqz + if + i32.const 0 + i32.const 544 + i32.const 52 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.set $9 + global.get $~lib/memory/__stack_pointer + local.get $9 + i32.store offset=4 + local.get $9 + local.get $5 + call $~lib/map/Map#delete + drop + local.get $0 + local.set $9 + global.get $~lib/memory/__stack_pointer + local.get $9 + i32.store offset=4 + local.get $9 + local.get $5 + call $~lib/map/Map#has + i32.eqz + i32.eqz + if + i32.const 0 + i32.const 544 + i32.const 54 + i32.const 5 + call $~lib/builtins/abort + unreachable + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $for-loop|4 end end local.get $0 - local.tee $11 - local.get $3 - local.tee $13 - local.get $11 - i32.load - local.tee $9 - i32.ne + local.set $9 + global.get $~lib/memory/__stack_pointer + local.get $9 + i32.store offset=4 + local.get $9 + call $~lib/map/Map#get:size + i32.const 50 + i32.eq + i32.eqz if - local.get $13 - call $~lib/rt/pure/__retain - local.set $13 - local.get $9 - call $~lib/rt/pure/__release + i32.const 0 + i32.const 544 + i32.const 56 + i32.const 3 + call $~lib/builtins/abort + unreachable end - local.get $13 - i32.store local.get $0 - local.get $1 + local.set $9 + global.get $~lib/memory/__stack_pointer + local.get $9 i32.store offset=4 + local.get $9 + call $~lib/map/Map#clear local.get $0 - local.tee $14 - local.get $5 - local.tee $9 - local.get $14 - i32.load offset=8 - local.tee $11 - i32.ne + local.set $9 + global.get $~lib/memory/__stack_pointer + local.get $9 + i32.store offset=4 + local.get $9 + call $~lib/map/Map#get:size + i32.const 0 + i32.eq + i32.eqz if - local.get $9 - call $~lib/rt/pure/__retain - local.set $9 - local.get $11 - call $~lib/rt/pure/__release -======= - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop i32.const 0 - drop - i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.0 ->>>>>>> master + i32.const 544 + i32.const 60 + i32.const 3 + call $~lib/builtins/abort + unreachable end + global.get $~lib/memory/__stack_pointer + i32.const 24 + i32.add + global.set $~lib/memory/__stack_pointer + ) + (func $~lib/map/Map#has (param $0 i32) (param $1 i64) (result i32) + (local $2 i32) + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i32.const 0 + i32.store + local.get $0 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + local.get $1 + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne - local.set $3 + local.set $2 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $3 + local.get $2 ) (func $~lib/map/Map#set (param $0 i32) (param $1 i64) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) -<<<<<<< HEAD - local.get $1 - call $~lib/util/hash/HASH - local.set $3 -======= (local $7 i32) - (local $8 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -22398,56 +19142,22 @@ global.get $~lib/memory/__stack_pointer i64.const 0 i64.store - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $3 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $4 ->>>>>>> master + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 - local.set $8 + local.set $7 global.get $~lib/memory/__stack_pointer - local.get $8 + local.get $7 i32.store - local.get $8 + local.get $7 local.get $1 local.get $3 call $~lib/map/Map#find local.set $4 local.get $4 if -<<<<<<< HEAD - i32.const 0 - drop local.get $4 -======= - local.get $5 ->>>>>>> master local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -22460,11 +19170,11 @@ i32.eq if local.get $0 - local.set $8 + local.set $7 global.get $~lib/memory/__stack_pointer - local.get $8 + local.get $7 i32.store - local.get $8 + local.get $7 local.get $0 i32.load offset=20 local.get $0 @@ -22490,43 +19200,27 @@ global.get $~lib/memory/__stack_pointer local.get $0 i32.load offset=8 -<<<<<<< HEAD - call $~lib/rt/pure/__retain - local.set $5 - local.get $5 -======= - local.tee $6 + local.tee $5 i32.store offset=4 - local.get $6 ->>>>>>> master + local.get $5 local.get $0 local.get $0 i32.load offset=16 local.tee $6 i32.const 1 i32.add -<<<<<<< HEAD - i32.store offset=16 - local.get $6 -======= call $~lib/map/Map#set:entriesOffset - local.get $7 ->>>>>>> master + local.get $6 i32.const 16 i32.mul i32.add local.set $4 local.get $4 local.get $1 -<<<<<<< HEAD - i64.store - local.get $4 -======= call $~lib/map/MapEntry#set:key i32.const 0 drop - local.get $5 ->>>>>>> master + local.get $4 local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -22550,35 +19244,22 @@ local.get $4 local.get $6 i32.load -<<<<<<< HEAD - i32.store offset=12 + call $~lib/map/MapEntry#set:taggedNext local.get $6 local.get $4 i32.store - local.get $5 - call $~lib/rt/pure/__release -======= - call $~lib/map/MapEntry#set:taggedNext - local.get $7 - local.get $5 - i32.store ->>>>>>> master end local.get $0 - local.set $8 + local.set $7 global.get $~lib/memory/__stack_pointer i32.const 8 i32.add global.set $~lib/memory/__stack_pointer - local.get $8 + local.get $7 ) (func $~lib/map/Map#get (param $0 i32) (param $1 i64) (result i32) -<<<<<<< HEAD (local $2 i32) -======= - (local $2 i64) (local $3 i32) - (local $4 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -22587,13 +19268,12 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store ->>>>>>> master local.get $0 - local.set $4 + local.set $3 global.get $~lib/memory/__stack_pointer - local.get $4 + local.get $3 i32.store - local.get $4 + local.get $3 local.get $1 local.get $1 call $~lib/util/hash/HASH @@ -22611,12 +19291,12 @@ end local.get $2 i32.load offset=8 - local.set $4 + local.set $3 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $4 + local.get $3 ) (func $~lib/array/Array#__set (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) @@ -22772,16 +19452,6 @@ (local $7 i32) (local $8 i32) (local $9 i32) -<<<<<<< HEAD - (local $10 i32) - (local $11 i32) - (local $12 i64) - (local $13 i32) - (local $14 i32) - local.get $1 - i32.const 1 - i32.add -======= global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -22795,7 +19465,6 @@ local.set $1 local.get $0 i32.load offset=16 ->>>>>>> master local.set $2 global.get $~lib/memory/__stack_pointer i32.const 0 @@ -22826,38 +19495,6 @@ i32.and i32.eqz if -<<<<<<< HEAD - local.get $8 - local.set $11 - local.get $10 - i64.load - local.set $12 - local.get $11 - local.get $12 - i64.store - local.get $11 - local.get $10 - i64.load offset=8 - i64.store offset=8 - local.get $12 - call $~lib/util/hash/HASH - local.get $1 - i32.and - local.set $13 - local.get $3 - local.get $13 - i32.const 4 - i32.mul - i32.add - local.set $14 - local.get $11 - local.get $14 - i32.load - i32.store offset=16 - local.get $14 - local.get $8 - i32.store -======= local.get $3 local.set $9 global.get $~lib/memory/__stack_pointer @@ -22867,61 +19504,25 @@ local.get $4 local.tee $8 i32.const 1 - i32.add - local.set $4 ->>>>>>> master - local.get $8 - local.get $7 - i32.load offset=8 - call $~lib/array/Array#__set - end - local.get $5 - i32.const 1 - i32.add - local.set $5 - br $for-loop|0 - end - end - local.get $3 -<<<<<<< HEAD - local.tee $13 - local.get $11 - i32.load - local.tee $9 - i32.ne - if - local.get $13 - call $~lib/rt/pure/__retain - local.set $13 - local.get $9 - call $~lib/rt/pure/__release - end - local.get $13 - i32.store - local.get $0 - local.get $1 - i32.store offset=4 - local.get $0 - local.tee $14 - local.get $5 - local.tee $9 - local.get $14 - i32.load offset=8 - local.tee $11 - i32.ne - if - local.get $9 - call $~lib/rt/pure/__retain - local.set $9 - local.get $11 - call $~lib/rt/pure/__release + i32.add + local.set $4 + local.get $8 + local.get $7 + i32.load offset=8 + call $~lib/array/Array#__set + end + local.get $5 + i32.const 1 + i32.add + local.set $5 + br $for-loop|0 + end end -======= + local.get $3 local.set $9 global.get $~lib/memory/__stack_pointer local.get $9 i32.store offset=4 ->>>>>>> master local.get $9 local.get $4 call $~lib/array/Array#set:length @@ -22938,13 +19539,7 @@ (local $4 i32) (local $5 i32) (local $6 i32) -<<<<<<< HEAD - local.get $1 - call $~lib/util/hash/HASH - local.set $3 -======= (local $7 i32) - (local $8 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -22953,56 +19548,22 @@ global.get $~lib/memory/__stack_pointer i64.const 0 i64.store - block $~lib/util/hash/HASH|inlined.4 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $3 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.4 - end - local.set $4 ->>>>>>> master + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 - local.set $8 + local.set $7 global.get $~lib/memory/__stack_pointer - local.get $8 + local.get $7 i32.store - local.get $8 + local.get $7 local.get $1 local.get $3 call $~lib/map/Map#find local.set $4 local.get $4 if -<<<<<<< HEAD - i32.const 0 - drop local.get $4 -======= - local.get $5 ->>>>>>> master local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -23015,11 +19576,11 @@ i32.eq if local.get $0 - local.set $8 + local.set $7 global.get $~lib/memory/__stack_pointer - local.get $8 + local.get $7 i32.store - local.get $8 + local.get $7 local.get $0 i32.load offset=20 local.get $0 @@ -23045,43 +19606,27 @@ global.get $~lib/memory/__stack_pointer local.get $0 i32.load offset=8 -<<<<<<< HEAD - call $~lib/rt/pure/__retain - local.set $5 - local.get $5 -======= - local.tee $6 + local.tee $5 i32.store offset=4 - local.get $6 ->>>>>>> master + local.get $5 local.get $0 local.get $0 i32.load offset=16 local.tee $6 i32.const 1 i32.add -<<<<<<< HEAD - i32.store offset=16 - local.get $6 -======= call $~lib/map/Map#set:entriesOffset - local.get $7 ->>>>>>> master + local.get $6 i32.const 24 i32.mul i32.add local.set $4 local.get $4 local.get $1 -<<<<<<< HEAD - i64.store - local.get $4 -======= call $~lib/map/MapEntry#set:key i32.const 0 drop - local.get $5 ->>>>>>> master + local.get $4 local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -23105,37 +19650,25 @@ local.get $4 local.get $6 i32.load -<<<<<<< HEAD - i32.store offset=16 + call $~lib/map/MapEntry#set:taggedNext local.get $6 local.get $4 i32.store - local.get $5 - call $~lib/rt/pure/__release -======= - call $~lib/map/MapEntry#set:taggedNext - local.get $7 - local.get $5 - i32.store ->>>>>>> master end local.get $0 - local.set $8 + local.set $7 global.get $~lib/memory/__stack_pointer i32.const 8 i32.add global.set $~lib/memory/__stack_pointer - local.get $8 + local.get $7 ) (func $~lib/map/Map#delete (param $0 i32) (param $1 i64) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) -<<<<<<< HEAD -======= (local $6 i32) - (local $7 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -23144,13 +19677,12 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store ->>>>>>> master local.get $0 - local.set $7 + local.set $6 global.get $~lib/memory/__stack_pointer - local.get $7 + local.get $6 i32.store - local.get $7 + local.get $6 local.get $1 local.get $1 call $~lib/util/hash/HASH @@ -23160,25 +19692,16 @@ i32.eqz if i32.const 0 - local.set $7 + local.set $6 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $7 + local.get $6 return end -<<<<<<< HEAD - i32.const 0 - drop - i32.const 0 - drop local.get $2 local.get $2 -======= - local.get $3 - local.get $3 ->>>>>>> master i32.load offset=12 i32.const 1 i32.or @@ -23192,194 +19715,51 @@ local.get $0 i32.load offset=4 i32.const 1 - i32.shr_u - local.set $3 - local.get $3 - i32.const 1 - i32.add - i32.const 4 - local.tee $4 - local.get $0 - i32.load offset=20 - local.tee $5 - local.get $4 - local.get $5 - i32.gt_u - select - i32.ge_u - if (result i32) - local.get $0 - i32.load offset=20 - local.get $0 - i32.load offset=12 - i32.const 3 - i32.mul - i32.const 4 - i32.div_s - i32.lt_s - else - i32.const 0 - end - if - local.get $0 -<<<<<<< HEAD - local.get $3 - call $~lib/map/Map#rehash - end - i32.const 1 - ) - (func $~lib/map/Map#clear (param $0 i32) - (local $1 i32) - (local $2 i32) - local.get $0 - local.tee $1 - i32.const 0 - i32.const 4 - i32.const 4 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $2 - local.get $1 - i32.load - call $~lib/rt/pure/__release - local.get $2 - i32.store - local.get $0 - i32.const 4 - i32.const 1 - i32.sub - i32.store offset=4 - local.get $0 - local.tee $2 - i32.const 0 - i32.const 4 - i32.const 16 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $1 - local.get $2 - i32.load offset=8 - call $~lib/rt/pure/__release - local.get $1 - i32.store offset=8 - local.get $0 - i32.const 4 - i32.store offset=12 - local.get $0 - i32.const 0 - i32.store offset=16 - local.get $0 - i32.const 0 - i32.store offset=20 - ) - (func $std/map/testNumeric - (local $0 i32) - (local $1 i64) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - i32.const 0 - call $~lib/map/Map#constructor - local.set $0 - i64.const 0 - local.set $1 - loop $for-loop|0 - local.get $1 - i64.const 100 - i64.lt_s - local.set $2 - local.get $2 - if - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 336 - i32.const 6 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - i32.const 10 - local.get $1 - i32.wrap_i64 - i32.add - call $~lib/map/Map#set - call $~lib/rt/pure/__release - local.get $0 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if - i32.const 0 - i32.const 336 - i32.const 8 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.wrap_i64 - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 336 - i32.const 9 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $1 - i64.const 1 - i64.add - local.set $1 - br $for-loop|0 - end - end + i32.shr_u + local.set $3 + local.get $3 + i32.const 1 + i32.add + i32.const 4 + local.tee $4 local.get $0 - call $~lib/map/Map#get:size - i32.const 100 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 336 - i32.const 11 + i32.load offset=20 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_u + select + i32.ge_u + if (result i32) + local.get $0 + i32.load offset=20 + local.get $0 + i32.load offset=12 i32.const 3 - call $~lib/builtins/abort - unreachable -======= - local.set $7 + i32.mul + i32.const 4 + i32.div_s + i32.lt_s + else + i32.const 0 + end + if + local.get $0 + local.set $6 global.get $~lib/memory/__stack_pointer - local.get $7 + local.get $6 i32.store - local.get $7 - local.get $4 + local.get $6 + local.get $3 call $~lib/map/Map#rehash ->>>>>>> master end i32.const 1 - local.set $7 + local.set $6 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $7 + local.get $6 ) (func $std/map/testNumeric (local $0 i32) @@ -23665,174 +20045,7 @@ call $~lib/map/Map#constructor local.tee $4 i32.store offset=16 -<<<<<<< HEAD - local.get $0 - i32.const 0 - i32.store offset=20 - local.get $0 - ) - (func $~lib/util/hash/HASH (param $0 i64) (result i32) - (local $1 i64) - (local $2 i32) - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 4 - i32.le_u - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $0 - local.set $1 - i32.const 0 - i32.const 374761393 - i32.add - i32.const 8 - i32.add - local.set $2 - local.get $2 - local.get $1 - i32.wrap_i64 - i32.const -1028477379 - i32.mul - i32.add - local.set $2 - local.get $2 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $2 - local.get $2 - local.get $1 - i64.const 32 - i64.shr_u - i32.wrap_i64 - i32.const -1028477379 - i32.mul - i32.add - local.set $2 - local.get $2 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $2 - local.get $2 - local.get $2 - i32.const 15 - i32.shr_u - i32.xor - local.set $2 - local.get $2 - i32.const -2048144777 - i32.mul - local.set $2 - local.get $2 - local.get $2 - i32.const 13 - i32.shr_u - i32.xor - local.set $2 - local.get $2 - i32.const -1028477379 - i32.mul - local.set $2 - local.get $2 - local.get $2 - i32.const 16 - i32.shr_u - i32.xor - local.set $2 - local.get $2 - return - ) - (func $~lib/map/Map#find (param $0 i32) (param $1 i64) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.get $2 - local.get $0 - i32.load offset=4 - i32.and - i32.const 4 - i32.mul - i32.add - i32.load - local.set $3 - loop $while-continue|0 - local.get $3 - local.set $4 - local.get $4 - if - local.get $3 - i32.load offset=12 - local.set $5 - local.get $5 - i32.const 1 - i32.and - i32.eqz - if (result i32) - local.get $3 - i64.load - local.get $1 - i64.eq - else - i32.const 0 - end - if - local.get $3 - return - end - local.get $5 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 - br $while-continue|0 - end - end - i32.const 0 - ) - (func $~lib/map/Map#has (param $0 i32) (param $1 i64) (result i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/map/Map#find - i32.const 0 - i32.ne - ) - (func $~lib/map/Map#rehash (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i64) - (local $13 i32) - (local $14 i32) - local.get $1 - i32.const 1 - i32.add - local.set $2 -======= global.get $~lib/memory/__stack_pointer ->>>>>>> master i32.const 0 call $~lib/map/Map#constructor local.tee $5 @@ -23869,53 +20082,17 @@ local.get $9 local.get $6 call $~lib/array/Array#__get - local.set $8 - local.get $0 - local.set $9 - global.get $~lib/memory/__stack_pointer - local.get $9 - i32.store offset=4 - local.get $9 - local.get $1 - call $~lib/map/Map#has - i32.eqz - if -<<<<<<< HEAD - local.get $8 - local.set $11 - local.get $10 - i64.load - local.set $12 - local.get $11 - local.get $12 - i64.store - local.get $11 - local.get $10 - i32.load offset=8 - i32.store offset=8 - local.get $12 - call $~lib/util/hash/HASH - local.get $1 - i32.and - local.set $13 - local.get $3 - local.get $13 - i32.const 4 - i32.mul - i32.add - local.set $14 - local.get $11 - local.get $14 - i32.load - i32.store offset=12 - local.get $14 - local.get $8 - i32.store - local.get $8 - i32.const 16 - i32.add - local.set $8 -======= + local.set $8 + local.get $0 + local.set $9 + global.get $~lib/memory/__stack_pointer + local.get $9 + i32.store offset=4 + local.get $9 + local.get $1 + call $~lib/map/Map#has + i32.eqz + if i32.const 0 i32.const 544 i32.const 31 @@ -23942,7 +20119,6 @@ i32.const 5 call $~lib/builtins/abort unreachable ->>>>>>> master end local.get $4 local.set $9 @@ -23975,25 +20151,6 @@ br $for-loop|2 end end -<<<<<<< HEAD - local.get $0 - local.tee $11 - local.get $3 - local.tee $13 - local.get $11 - i32.load - local.tee $9 - i32.ne - if - local.get $13 - call $~lib/rt/pure/__retain - local.set $13 - local.get $9 - call $~lib/rt/pure/__release - end - local.get $13 - i32.store -======= local.get $4 local.set $9 global.get $~lib/memory/__stack_pointer @@ -24112,69 +20269,11 @@ br $for-loop|3 end end ->>>>>>> master local.get $0 local.set $9 global.get $~lib/memory/__stack_pointer local.get $9 i32.store offset=4 -<<<<<<< HEAD - local.get $0 - local.tee $14 - local.get $5 - local.tee $9 - local.get $14 - i32.load offset=8 - local.tee $11 - i32.ne - if - local.get $9 - call $~lib/rt/pure/__retain - local.set $9 - local.get $11 - call $~lib/rt/pure/__release - end - local.get $9 - i32.store offset=8 - local.get $0 - local.get $4 - i32.store offset=12 - local.get $0 - local.get $0 - i32.load offset=20 - i32.store offset=16 - local.get $3 - call $~lib/rt/pure/__release - local.get $5 - call $~lib/rt/pure/__release - ) - (func $~lib/map/Map#set (param $0 i32) (param $1 i64) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $1 - call $~lib/util/hash/HASH - local.set $3 - local.get $0 - local.get $1 - local.get $3 - call $~lib/map/Map#find - local.set $4 - local.get $4 - if - i32.const 0 - drop - local.get $4 - local.get $2 - i32.store offset=8 - else - local.get $0 - i32.load offset=16 - local.get $0 - i32.load offset=12 - i32.eq -======= local.get $9 call $~lib/map/Map#get:size i32.const 50 @@ -24196,7 +20295,6 @@ i64.lt_s local.set $6 local.get $6 ->>>>>>> master if local.get $0 local.set $9 @@ -24279,57 +20377,6 @@ local.set $1 br $for-loop|4 end -<<<<<<< HEAD - local.get $0 - i32.load offset=8 - call $~lib/rt/pure/__retain - local.set $5 - local.get $5 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $6 - i32.const 1 - i32.add - i32.store offset=16 - local.get $6 - i32.const 16 - i32.mul - i32.add - local.set $4 - local.get $4 - local.get $1 - i64.store - local.get $4 - local.get $2 - i32.store offset=8 - local.get $0 - local.get $0 - i32.load offset=20 - i32.const 1 - i32.add - i32.store offset=20 - local.get $0 - i32.load - local.get $3 - local.get $0 - i32.load offset=4 - i32.and - i32.const 4 - i32.mul - i32.add - local.set $6 - local.get $4 - local.get $6 - i32.load - i32.store offset=12 - local.get $6 - local.get $4 - i32.store - local.get $5 - call $~lib/rt/pure/__release -======= ->>>>>>> master end local.get $0 local.set $9 @@ -24379,13 +20426,8 @@ i32.add global.set $~lib/memory/__stack_pointer ) -<<<<<<< HEAD - (func $~lib/map/Map#get (param $0 i32) (param $1 i64) (result i32) - (local $2 i32) -======= (func $~lib/map/Map#has (param $0 i32) (param $1 i64) (result i32) - (local $2 i64) - (local $3 i32) + (local $2 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -24394,83 +20436,31 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store ->>>>>>> master local.get $0 - local.set $3 + local.set $2 global.get $~lib/memory/__stack_pointer - local.get $3 + local.get $2 i32.store - local.get $3 + local.get $2 local.get $1 -<<<<<<< HEAD local.get $1 call $~lib/util/hash/HASH call $~lib/map/Map#find - local.set $2 - local.get $2 - i32.eqz - if - i32.const 384 - i32.const 448 - i32.const 105 - i32.const 17 - call $~lib/builtins/abort - unreachable - end - local.get $2 - i32.load offset=8 - ) - (func $~lib/map/Map#get:size (param $0 i32) (result i32) - local.get $0 - i32.load offset=20 -======= - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.0 - end - call $~lib/map/Map#find i32.const 0 i32.ne - local.set $3 + local.set $2 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $3 ->>>>>>> master + local.get $2 ) (func $~lib/map/Map#set (param $0 i32) (param $1 i64) (param $2 i32) (result i32) - (local $3 i64) + (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -24479,49 +20469,22 @@ global.get $~lib/memory/__stack_pointer i64.const 0 i64.store - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $3 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $4 + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 - local.set $8 + local.set $7 global.get $~lib/memory/__stack_pointer - local.get $8 + local.get $7 i32.store - local.get $8 + local.get $7 local.get $1 - local.get $4 + local.get $3 call $~lib/map/Map#find - local.set $5 - local.get $5 + local.set $4 + local.get $4 if - local.get $5 + local.get $4 local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -24534,11 +20497,11 @@ i32.eq if local.get $0 - local.set $8 + local.set $7 global.get $~lib/memory/__stack_pointer - local.get $8 + local.get $7 i32.store - local.get $8 + local.get $7 local.get $0 i32.load offset=20 local.get $0 @@ -24564,27 +20527,27 @@ global.get $~lib/memory/__stack_pointer local.get $0 i32.load offset=8 - local.tee $6 + local.tee $5 i32.store offset=4 - local.get $6 + local.get $5 local.get $0 local.get $0 i32.load offset=16 - local.tee $7 + local.tee $6 i32.const 1 i32.add call $~lib/map/Map#set:entriesOffset - local.get $7 + local.get $6 i32.const 16 i32.mul i32.add - local.set $5 - local.get $5 + local.set $4 + local.get $4 local.get $1 call $~lib/map/MapEntry#set:key i32.const 0 drop - local.get $5 + local.get $4 local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -24597,34 +20560,33 @@ call $~lib/map/Map#set:entriesCount local.get $0 i32.load - local.get $4 + local.get $3 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $7 - local.get $5 - local.get $7 + local.set $6 + local.get $4 + local.get $6 i32.load call $~lib/map/MapEntry#set:taggedNext - local.get $7 - local.get $5 + local.get $6 + local.get $4 i32.store end local.get $0 - local.set $8 + local.set $7 global.get $~lib/memory/__stack_pointer i32.const 8 i32.add global.set $~lib/memory/__stack_pointer - local.get $8 + local.get $7 ) (func $~lib/map/Map#get (param $0 i32) (param $1 i64) (result i32) - (local $2 i64) + (local $2 i32) (local $3 i32) - (local $4 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -24634,44 +20596,17 @@ i32.const 0 i32.store local.get $0 - local.set $4 + local.set $3 global.get $~lib/memory/__stack_pointer - local.get $4 + local.get $3 i32.store - local.get $4 + local.get $3 local.get $1 - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.3 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 592 @@ -24681,14 +20616,14 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $2 i32.load offset=8 - local.set $4 + local.set $3 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $4 + local.get $3 ) (func $~lib/array/Array#__set (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) @@ -24844,16 +20779,6 @@ (local $7 i32) (local $8 i32) (local $9 i32) -<<<<<<< HEAD - (local $10 i32) - (local $11 i32) - (local $12 i64) - (local $13 i32) - (local $14 i32) - local.get $1 - i32.const 1 - i32.add -======= global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -24867,7 +20792,6 @@ local.set $1 local.get $0 i32.load offset=16 ->>>>>>> master local.set $2 global.get $~lib/memory/__stack_pointer i32.const 0 @@ -24898,38 +20822,6 @@ i32.and i32.eqz if -<<<<<<< HEAD - local.get $8 - local.set $11 - local.get $10 - i64.load - local.set $12 - local.get $11 - local.get $12 - i64.store - local.get $11 - local.get $10 - i64.load offset=8 - i64.store offset=8 - local.get $12 - call $~lib/util/hash/HASH - local.get $1 - i32.and - local.set $13 - local.get $3 - local.get $13 - i32.const 4 - i32.mul - i32.add - local.set $14 - local.get $11 - local.get $14 - i32.load - i32.store offset=16 - local.get $14 - local.get $8 - i32.store -======= local.get $3 local.set $9 global.get $~lib/memory/__stack_pointer @@ -24941,7 +20833,6 @@ i32.const 1 i32.add local.set $4 ->>>>>>> master local.get $8 local.get $7 i32.load offset=8 @@ -24955,45 +20846,10 @@ end end local.get $3 -<<<<<<< HEAD - local.tee $13 - local.get $11 - i32.load - local.tee $9 - i32.ne - if - local.get $13 - call $~lib/rt/pure/__retain - local.set $13 - local.get $9 - call $~lib/rt/pure/__release - end - local.get $13 - i32.store - local.get $0 - local.get $1 - i32.store offset=4 - local.get $0 - local.tee $14 - local.get $5 - local.tee $9 - local.get $14 - i32.load offset=8 - local.tee $11 - i32.ne - if - local.get $9 - call $~lib/rt/pure/__retain - local.set $9 - local.get $11 - call $~lib/rt/pure/__release - end -======= local.set $9 global.get $~lib/memory/__stack_pointer local.get $9 i32.store offset=4 ->>>>>>> master local.get $9 local.get $4 call $~lib/array/Array#set:length @@ -25010,13 +20866,7 @@ (local $4 i32) (local $5 i32) (local $6 i32) -<<<<<<< HEAD - local.get $1 - call $~lib/util/hash/HASH - local.set $3 -======= (local $7 i32) - (local $8 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -25025,56 +20875,22 @@ global.get $~lib/memory/__stack_pointer i64.const 0 i64.store - block $~lib/util/hash/HASH|inlined.4 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $3 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.4 - end - local.set $4 ->>>>>>> master + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 - local.set $8 + local.set $7 global.get $~lib/memory/__stack_pointer - local.get $8 + local.get $7 i32.store - local.get $8 + local.get $7 local.get $1 local.get $3 call $~lib/map/Map#find local.set $4 local.get $4 if -<<<<<<< HEAD - i32.const 0 - drop local.get $4 -======= - local.get $5 ->>>>>>> master local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -25087,11 +20903,11 @@ i32.eq if local.get $0 - local.set $8 + local.set $7 global.get $~lib/memory/__stack_pointer - local.get $8 + local.get $7 i32.store - local.get $8 + local.get $7 local.get $0 i32.load offset=20 local.get $0 @@ -25117,43 +20933,27 @@ global.get $~lib/memory/__stack_pointer local.get $0 i32.load offset=8 -<<<<<<< HEAD - call $~lib/rt/pure/__retain - local.set $5 - local.get $5 -======= - local.tee $6 + local.tee $5 i32.store offset=4 - local.get $6 ->>>>>>> master + local.get $5 local.get $0 local.get $0 i32.load offset=16 local.tee $6 i32.const 1 i32.add -<<<<<<< HEAD - i32.store offset=16 - local.get $6 -======= call $~lib/map/Map#set:entriesOffset - local.get $7 ->>>>>>> master + local.get $6 i32.const 24 i32.mul i32.add local.set $4 local.get $4 local.get $1 -<<<<<<< HEAD - i64.store - local.get $4 -======= call $~lib/map/MapEntry#set:key i32.const 0 drop - local.get $5 ->>>>>>> master + local.get $4 local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -25177,37 +20977,25 @@ local.get $4 local.get $6 i32.load -<<<<<<< HEAD - i32.store offset=16 + call $~lib/map/MapEntry#set:taggedNext local.get $6 local.get $4 i32.store - local.get $5 - call $~lib/rt/pure/__release -======= - call $~lib/map/MapEntry#set:taggedNext - local.get $7 - local.get $5 - i32.store ->>>>>>> master end local.get $0 - local.set $8 + local.set $7 global.get $~lib/memory/__stack_pointer i32.const 8 i32.add global.set $~lib/memory/__stack_pointer - local.get $8 + local.get $7 ) (func $~lib/map/Map#delete (param $0 i32) (param $1 i64) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) -<<<<<<< HEAD -======= (local $6 i32) - (local $7 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -25216,13 +21004,12 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store ->>>>>>> master local.get $0 - local.set $7 + local.set $6 global.get $~lib/memory/__stack_pointer - local.get $7 + local.get $6 i32.store - local.get $7 + local.get $6 local.get $1 local.get $1 call $~lib/util/hash/HASH @@ -25232,25 +21019,16 @@ i32.eqz if i32.const 0 - local.set $7 + local.set $6 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $7 + local.get $6 return end -<<<<<<< HEAD - i32.const 0 - drop - i32.const 0 - drop local.get $2 local.get $2 -======= - local.get $3 - local.get $3 ->>>>>>> master i32.load offset=12 i32.const 1 i32.or @@ -25294,25 +21072,21 @@ end if local.get $0 -<<<<<<< HEAD - local.get $3 -======= - local.set $7 + local.set $6 global.get $~lib/memory/__stack_pointer - local.get $7 + local.get $6 i32.store - local.get $7 - local.get $4 ->>>>>>> master + local.get $6 + local.get $3 call $~lib/map/Map#rehash end i32.const 1 - local.set $7 + local.set $6 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $7 + local.get $6 ) (func $std/map/testNumeric (local $0 i32) @@ -25980,8 +21754,7 @@ global.set $~lib/memory/__stack_pointer ) (func $~lib/map/Map#has (param $0 i32) (param $1 f32) (result i32) - (local $2 f32) - (local $3 i32) + (local $2 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -25991,47 +21764,30 @@ i32.const 0 i32.store local.get $0 - local.set $3 + local.set $2 global.get $~lib/memory/__stack_pointer - local.get $3 + local.get $2 i32.store - local.get $3 + local.get $2 local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.0 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne - local.set $3 + local.set $2 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $3 + local.get $2 ) (func $~lib/map/Map#set (param $0 i32) (param $1 f32) (param $2 i32) (result i32) - (local $3 f32) + (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -26040,38 +21796,22 @@ global.get $~lib/memory/__stack_pointer i64.const 0 i64.store - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $3 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $4 + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 - local.set $8 + local.set $7 global.get $~lib/memory/__stack_pointer - local.get $8 + local.get $7 i32.store - local.get $8 + local.get $7 local.get $1 - local.get $4 + local.get $3 call $~lib/map/Map#find - local.set $5 - local.get $5 + local.set $4 + local.get $4 if - local.get $5 + local.get $4 local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -26084,11 +21824,11 @@ i32.eq if local.get $0 - local.set $8 + local.set $7 global.get $~lib/memory/__stack_pointer - local.get $8 + local.get $7 i32.store - local.get $8 + local.get $7 local.get $0 i32.load offset=20 local.get $0 @@ -26114,27 +21854,27 @@ global.get $~lib/memory/__stack_pointer local.get $0 i32.load offset=8 - local.tee $6 + local.tee $5 i32.store offset=4 - local.get $6 + local.get $5 local.get $0 local.get $0 i32.load offset=16 - local.tee $7 + local.tee $6 i32.const 1 i32.add call $~lib/map/Map#set:entriesOffset - local.get $7 + local.get $6 i32.const 12 i32.mul i32.add - local.set $5 - local.get $5 + local.set $4 + local.get $4 local.get $1 call $~lib/map/MapEntry#set:key i32.const 0 drop - local.get $5 + local.get $4 local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -26147,104 +21887,33 @@ call $~lib/map/Map#set:entriesCount local.get $0 i32.load - local.get $4 + local.get $3 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $7 - local.get $5 - local.get $7 + local.set $6 + local.get $4 + local.get $6 i32.load call $~lib/map/MapEntry#set:taggedNext - local.get $7 - local.get $5 + local.get $6 + local.get $4 i32.store end local.get $0 - local.set $8 + local.set $7 global.get $~lib/memory/__stack_pointer i32.const 8 i32.add global.set $~lib/memory/__stack_pointer - local.get $8 - ) -<<<<<<< HEAD - (func $~lib/util/hash/HASH (param $0 f32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $0 - i32.reinterpret_f32 - local.set $1 - i32.const 4 - local.set $2 - i32.const 0 - i32.const 374761393 - i32.add - local.get $2 - i32.add - local.set $3 - local.get $3 - local.get $1 - i32.const -1028477379 - i32.mul - i32.add - local.set $3 - local.get $3 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 15 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -2048144777 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 13 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -1028477379 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 16 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - return + local.get $7 ) - (func $~lib/map/Map#find (param $0 i32) (param $1 f32) (param $2 i32) (result i32) -======= (func $~lib/map/Map#get (param $0 i32) (param $1 f32) (result i32) - (local $2 f32) ->>>>>>> master + (local $2 i32) (local $3 i32) - (local $4 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -26252,45 +21921,19 @@ call $~stack_check global.get $~lib/memory/__stack_pointer i32.const 0 -<<<<<<< HEAD - ) - (func $~lib/map/Map#has (param $0 i32) (param $1 f32) (result i32) -======= i32.store ->>>>>>> master local.get $0 - local.set $4 + local.set $3 global.get $~lib/memory/__stack_pointer - local.get $4 + local.get $3 i32.store - local.get $4 + local.get $3 local.get $1 -<<<<<<< HEAD local.get $1 call $~lib/util/hash/HASH -======= - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.3 - end ->>>>>>> master call $~lib/map/Map#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 592 @@ -26300,14 +21943,14 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $2 i32.load offset=4 - local.set $4 + local.set $3 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $4 + local.get $3 ) (func $~lib/array/Array#__set (param $0 i32) (param $1 i32) (param $2 f32) (local $3 i32) @@ -26371,16 +22014,6 @@ (local $7 i32) (local $8 i32) (local $9 i32) -<<<<<<< HEAD - (local $10 i32) - (local $11 i32) - (local $12 f32) - (local $13 i32) - (local $14 i32) - local.get $1 - i32.const 1 - i32.add -======= global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -26394,7 +22027,6 @@ local.set $1 local.get $0 i32.load offset=16 ->>>>>>> master local.set $2 global.get $~lib/memory/__stack_pointer i32.const 0 @@ -26517,38 +22149,6 @@ i32.and i32.eqz if -<<<<<<< HEAD - local.get $8 - local.set $11 - local.get $10 - f32.load - local.set $12 - local.get $11 - local.get $12 - f32.store - local.get $11 - local.get $10 - i32.load offset=4 - i32.store offset=4 - local.get $12 - call $~lib/util/hash/HASH - local.get $1 - i32.and - local.set $13 - local.get $3 - local.get $13 - i32.const 4 - i32.mul - i32.add - local.set $14 - local.get $11 - local.get $14 - i32.load - i32.store offset=8 - local.get $14 - local.get $8 - i32.store -======= local.get $3 local.set $9 global.get $~lib/memory/__stack_pointer @@ -26560,7 +22160,6 @@ i32.const 1 i32.add local.set $4 ->>>>>>> master local.get $8 local.get $7 i32.load offset=4 @@ -26574,67 +22173,12 @@ end end local.get $3 -<<<<<<< HEAD - local.tee $13 - local.get $11 - i32.load - local.tee $9 - i32.ne - if - local.get $13 - call $~lib/rt/pure/__retain - local.set $13 - local.get $9 - call $~lib/rt/pure/__release - end - local.get $13 - i32.store - local.get $0 - local.get $1 - i32.store offset=4 - local.get $0 - local.tee $14 - local.get $5 - local.tee $9 - local.get $14 - i32.load offset=8 - local.tee $11 - i32.ne - if - local.get $9 - call $~lib/rt/pure/__retain - local.set $9 - local.get $11 - call $~lib/rt/pure/__release - end -======= local.set $9 global.get $~lib/memory/__stack_pointer local.get $9 i32.store offset=4 ->>>>>>> master local.get $9 local.get $4 -<<<<<<< HEAD - i32.store offset=12 - local.get $0 - local.get $0 - i32.load offset=20 - i32.store offset=16 - local.get $3 - call $~lib/rt/pure/__release - local.get $5 - call $~lib/rt/pure/__release - ) - (func $~lib/map/Map#set (param $0 i32) (param $1 f32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $1 - call $~lib/util/hash/HASH - local.set $3 -======= call $~lib/array/Array#set:length local.get $3 local.set $9 @@ -26645,12 +22189,11 @@ local.get $9 ) (func $~lib/map/Map#set (param $0 i32) (param $1 f32) (param $2 f32) (result i32) - (local $3 f32) + (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -26659,50 +22202,22 @@ global.get $~lib/memory/__stack_pointer i64.const 0 i64.store - block $~lib/util/hash/HASH|inlined.4 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $3 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.4 - end - local.set $4 ->>>>>>> master + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 - local.set $8 + local.set $7 global.get $~lib/memory/__stack_pointer - local.get $8 + local.get $7 i32.store - local.get $8 + local.get $7 local.get $1 -<<<<<<< HEAD local.get $3 - call $~lib/map/Map#find + call $~lib/map/Map#find local.set $4 local.get $4 if - i32.const 0 - drop local.get $4 -======= - local.get $4 - call $~lib/map/Map#find - local.set $5 - local.get $5 - if - local.get $5 ->>>>>>> master local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -26715,11 +22230,11 @@ i32.eq if local.get $0 - local.set $8 + local.set $7 global.get $~lib/memory/__stack_pointer - local.get $8 + local.get $7 i32.store - local.get $8 + local.get $7 local.get $0 i32.load offset=20 local.get $0 @@ -26745,43 +22260,27 @@ global.get $~lib/memory/__stack_pointer local.get $0 i32.load offset=8 -<<<<<<< HEAD - call $~lib/rt/pure/__retain - local.set $5 - local.get $5 -======= - local.tee $6 + local.tee $5 i32.store offset=4 - local.get $6 ->>>>>>> master + local.get $5 local.get $0 local.get $0 i32.load offset=16 local.tee $6 i32.const 1 i32.add -<<<<<<< HEAD - i32.store offset=16 - local.get $6 -======= call $~lib/map/Map#set:entriesOffset - local.get $7 ->>>>>>> master + local.get $6 i32.const 12 i32.mul i32.add local.set $4 local.get $4 local.get $1 -<<<<<<< HEAD - f32.store - local.get $4 -======= call $~lib/map/MapEntry#set:key i32.const 0 drop - local.get $5 ->>>>>>> master + local.get $4 local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -26805,39 +22304,25 @@ local.get $4 local.get $6 i32.load -<<<<<<< HEAD - i32.store offset=8 + call $~lib/map/MapEntry#set:taggedNext local.get $6 local.get $4 i32.store - local.get $5 - call $~lib/rt/pure/__release -======= - call $~lib/map/MapEntry#set:taggedNext - local.get $7 - local.get $5 - i32.store ->>>>>>> master end local.get $0 - local.set $8 + local.set $7 global.get $~lib/memory/__stack_pointer i32.const 8 i32.add global.set $~lib/memory/__stack_pointer - local.get $8 + local.get $7 ) -<<<<<<< HEAD - (func $~lib/map/Map#get (param $0 i32) (param $1 f32) (result i32) - (local $2 i32) -======= (func $~lib/map/Map#delete (param $0 i32) (param $1 f32) (result i32) - (local $2 f32) + (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -26846,109 +22331,31 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store ->>>>>>> master local.get $0 - local.set $7 + local.set $6 global.get $~lib/memory/__stack_pointer - local.get $7 + local.get $6 i32.store - local.get $7 + local.get $6 local.get $1 -<<<<<<< HEAD local.get $1 call $~lib/util/hash/HASH -======= - block $~lib/util/hash/HASH|inlined.6 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.6 - end ->>>>>>> master call $~lib/map/Map#find local.set $2 local.get $2 i32.eqz if -<<<<<<< HEAD - i32.const 384 - i32.const 448 - i32.const 105 - i32.const 17 - call $~lib/builtins/abort - unreachable - end - local.get $2 - i32.load offset=4 - ) - (func $~lib/map/Map#get:size (param $0 i32) (result i32) - local.get $0 - i32.load offset=20 - ) - (func $~lib/array/Array#constructor (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $0 - i32.eqz - if - i32.const 16 - i32.const 27 - call $~lib/rt/pure/__new - call $~lib/rt/pure/__retain - local.set $0 - end - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $0 - i32.const 0 - i32.store offset=12 - local.get $1 - i32.const 1073741820 - i32.const 2 - i32.shr_u - i32.gt_u - if - i32.const 224 - i32.const 496 - i32.const 57 - i32.const 60 - call $~lib/builtins/abort - unreachable -======= i32.const 0 - local.set $7 + local.set $6 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $7 + local.get $6 return ->>>>>>> master end - local.get $3 - local.get $3 + local.get $2 + local.get $2 i32.load offset=8 i32.const 1 i32.or @@ -26963,17 +22370,17 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.const 1 i32.add i32.const 4 - local.tee $5 + local.tee $4 local.get $0 i32.load offset=20 - local.tee $6 + local.tee $5 + local.get $4 local.get $5 - local.get $6 i32.gt_u select i32.ge_u @@ -26992,21 +22399,21 @@ end if local.get $0 - local.set $7 + local.set $6 global.get $~lib/memory/__stack_pointer - local.get $7 + local.get $6 i32.store - local.get $7 - local.get $4 + local.get $6 + local.get $3 call $~lib/map/Map#rehash end i32.const 1 - local.set $7 + local.set $6 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $7 + local.get $6 ) (func $std/map/testNumeric (local $0 i32) @@ -27516,47 +22923,6 @@ br $for-loop|3 end end -<<<<<<< HEAD - i32.const 0 - ) - (func $~lib/map/Map#rehash (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 f32) - (local $13 i32) - (local $14 i32) - local.get $1 - i32.const 1 - i32.add - local.set $2 - i32.const 0 - local.get $2 - i32.const 4 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $3 - local.get $2 - i32.const 8 - i32.mul - i32.const 3 - i32.div_s - local.set $4 - i32.const 0 - local.get $4 - i32.const 12 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 -======= ->>>>>>> master local.get $0 local.set $9 global.get $~lib/memory/__stack_pointer @@ -27595,49 +22961,12 @@ i32.eqz i32.eqz if -<<<<<<< HEAD - local.get $8 - local.set $11 - local.get $10 - f32.load - local.set $12 - local.get $11 - local.get $12 - f32.store - local.get $11 - local.get $10 - f32.load offset=4 - f32.store offset=4 - local.get $12 - call $~lib/util/hash/HASH - local.get $1 - i32.and - local.set $13 - local.get $3 - local.get $13 - i32.const 4 - i32.mul - i32.add - local.set $14 - local.get $11 - local.get $14 - i32.load - i32.store offset=8 - local.get $14 - local.get $8 - i32.store - local.get $8 - i32.const 12 - i32.add - local.set $8 -======= i32.const 0 i32.const 544 i32.const 50 i32.const 5 call $~lib/builtins/abort unreachable ->>>>>>> master end local.get $0 local.set $9 @@ -27704,24 +23033,6 @@ end end local.get $0 -<<<<<<< HEAD - local.tee $11 - local.get $3 - local.tee $13 - local.get $11 - i32.load - local.tee $9 - i32.ne - if - local.get $13 - call $~lib/rt/pure/__retain - local.set $13 - local.get $9 - call $~lib/rt/pure/__release - end - local.get $13 - i32.store -======= local.set $9 global.get $~lib/memory/__stack_pointer local.get $9 @@ -27739,7 +23050,6 @@ call $~lib/builtins/abort unreachable end ->>>>>>> master local.get $0 local.set $9 global.get $~lib/memory/__stack_pointer @@ -27748,15 +23058,6 @@ local.get $9 call $~lib/map/Map#clear local.get $0 -<<<<<<< HEAD - local.tee $14 - local.get $5 - local.tee $9 - local.get $14 - i32.load offset=8 - local.tee $11 - i32.ne -======= local.set $9 global.get $~lib/memory/__stack_pointer local.get $9 @@ -27766,7 +23067,6 @@ i32.const 0 i32.eq i32.eqz ->>>>>>> master if i32.const 0 i32.const 544 @@ -27781,8 +23081,7 @@ global.set $~lib/memory/__stack_pointer ) (func $~lib/map/Map#has (param $0 i32) (param $1 f64) (result i32) - (local $2 f64) - (local $3 i32) + (local $2 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -27792,61 +23091,30 @@ i32.const 0 i32.store local.get $0 - local.set $3 + local.set $2 global.get $~lib/memory/__stack_pointer - local.get $3 + local.get $2 i32.store - local.get $3 + local.get $2 local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.0 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne - local.set $3 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $3 - ) -<<<<<<< HEAD - (func $~lib/map/Map#set (param $0 i32) (param $1 f32) (param $2 f32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $1 - call $~lib/util/hash/HASH - local.set $3 -======= + local.set $2 + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.add + global.set $~lib/memory/__stack_pointer + local.get $2 + ) (func $~lib/map/Map#set (param $0 i32) (param $1 f64) (param $2 i32) (result i32) - (local $3 f64) + (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -27855,54 +23123,22 @@ global.get $~lib/memory/__stack_pointer i64.const 0 i64.store - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $3 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $4 ->>>>>>> master + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 - local.set $8 + local.set $7 global.get $~lib/memory/__stack_pointer - local.get $8 + local.get $7 i32.store - local.get $8 + local.get $7 local.get $1 -<<<<<<< HEAD local.get $3 - call $~lib/map/Map#find + call $~lib/map/Map#find local.set $4 local.get $4 if - i32.const 0 - drop local.get $4 -======= - local.get $4 - call $~lib/map/Map#find - local.set $5 - local.get $5 - if - local.get $5 ->>>>>>> master local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -27915,11 +23151,11 @@ i32.eq if local.get $0 - local.set $8 + local.set $7 global.get $~lib/memory/__stack_pointer - local.get $8 + local.get $7 i32.store - local.get $8 + local.get $7 local.get $0 i32.load offset=20 local.get $0 @@ -27945,44 +23181,27 @@ global.get $~lib/memory/__stack_pointer local.get $0 i32.load offset=8 -<<<<<<< HEAD - call $~lib/rt/pure/__retain - local.set $5 - local.get $5 -======= - local.tee $6 + local.tee $5 i32.store offset=4 - local.get $6 ->>>>>>> master + local.get $5 local.get $0 local.get $0 i32.load offset=16 local.tee $6 i32.const 1 i32.add -<<<<<<< HEAD - i32.store offset=16 - local.get $6 - i32.const 12 -======= call $~lib/map/Map#set:entriesOffset - local.get $7 + local.get $6 i32.const 16 ->>>>>>> master i32.mul i32.add local.set $4 local.get $4 local.get $1 -<<<<<<< HEAD - f32.store - local.get $4 -======= call $~lib/map/MapEntry#set:key i32.const 0 drop - local.get $5 ->>>>>>> master + local.get $4 local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -28006,39 +23225,22 @@ local.get $4 local.get $6 i32.load -<<<<<<< HEAD - i32.store offset=8 + call $~lib/map/MapEntry#set:taggedNext local.get $6 local.get $4 i32.store - local.get $5 - call $~lib/rt/pure/__release -======= - call $~lib/map/MapEntry#set:taggedNext - local.get $7 - local.get $5 - i32.store ->>>>>>> master end local.get $0 - local.set $8 + local.set $7 global.get $~lib/memory/__stack_pointer i32.const 8 i32.add global.set $~lib/memory/__stack_pointer - local.get $8 + local.get $7 ) -<<<<<<< HEAD - (func $~lib/map/Map#delete (param $0 i32) (param $1 f32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) -======= (func $~lib/map/Map#get (param $0 i32) (param $1 f64) (result i32) - (local $2 f64) + (local $2 i32) (local $3 i32) - (local $4 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -28047,47 +23249,18 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store ->>>>>>> master local.get $0 - local.set $4 + local.set $3 global.get $~lib/memory/__stack_pointer - local.get $4 + local.get $3 i32.store - local.get $4 + local.get $3 local.get $1 -<<<<<<< HEAD local.get $1 - call $~lib/util/hash/HASH - call $~lib/map/Map#find + call $~lib/util/hash/HASH + call $~lib/map/Map#find local.set $2 local.get $2 -======= - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.3 - end - call $~lib/map/Map#find - local.set $3 - local.get $3 ->>>>>>> master i32.eqz if i32.const 592 @@ -28097,55 +23270,19 @@ call $~lib/builtins/abort unreachable end -<<<<<<< HEAD - i32.const 0 - drop - i32.const 0 - drop - local.get $2 local.get $2 i32.load offset=8 - i32.const 1 - i32.or - i32.store offset=8 - local.get $0 - local.get $0 - i32.load offset=20 - i32.const 1 - i32.sub - i32.store offset=20 - local.get $0 - i32.load offset=4 - i32.const 1 - i32.shr_u local.set $3 - local.get $3 - i32.const 1 -======= - local.get $3 - i32.load offset=8 - local.set $4 global.get $~lib/memory/__stack_pointer i32.const 4 ->>>>>>> master i32.add global.set $~lib/memory/__stack_pointer - local.get $4 + local.get $3 ) (func $~lib/array/Array#__set (param $0 i32) (param $1 i32) (param $2 f64) (local $3 i32) global.get $~lib/memory/__stack_pointer i32.const 4 -<<<<<<< HEAD - local.tee $4 - local.get $0 - i32.load offset=20 - local.tee $5 - local.get $4 - local.get $5 - i32.gt_u - select -======= i32.sub global.set $~lib/memory/__stack_pointer call $~stack_check @@ -28155,7 +23292,6 @@ local.get $1 local.get $0 i32.load offset=12 ->>>>>>> master i32.ge_u if local.get $1 @@ -28176,15 +23312,10 @@ i32.const 3 call $~lib/array/ensureSize local.get $0 -<<<<<<< HEAD - local.get $3 - call $~lib/map/Map#rehash -======= local.get $1 i32.const 1 i32.add call $~lib/array/Array#set:length_ ->>>>>>> master end local.get $0 local.set $3 @@ -28385,12 +23516,11 @@ local.get $9 ) (func $~lib/map/Map#set (param $0 i32) (param $1 f64) (param $2 f64) (result i32) - (local $3 f64) + (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) (local $7 i32) - (local $8 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -28399,42 +23529,22 @@ global.get $~lib/memory/__stack_pointer i64.const 0 i64.store - block $~lib/util/hash/HASH|inlined.4 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $3 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.4 - end - local.set $4 + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 - local.set $8 + local.set $7 global.get $~lib/memory/__stack_pointer - local.get $8 + local.get $7 i32.store - local.get $8 + local.get $7 local.get $1 - local.get $4 + local.get $3 call $~lib/map/Map#find - local.set $5 - local.get $5 + local.set $4 + local.get $4 if - local.get $5 + local.get $4 local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -28447,11 +23557,11 @@ i32.eq if local.get $0 - local.set $8 + local.set $7 global.get $~lib/memory/__stack_pointer - local.get $8 + local.get $7 i32.store - local.get $8 + local.get $7 local.get $0 i32.load offset=20 local.get $0 @@ -28477,27 +23587,27 @@ global.get $~lib/memory/__stack_pointer local.get $0 i32.load offset=8 - local.tee $6 + local.tee $5 i32.store offset=4 - local.get $6 + local.get $5 local.get $0 local.get $0 i32.load offset=16 - local.tee $7 + local.tee $6 i32.const 1 i32.add call $~lib/map/Map#set:entriesOffset - local.get $7 + local.get $6 i32.const 24 i32.mul i32.add - local.set $5 - local.get $5 + local.set $4 + local.get $4 local.get $1 call $~lib/map/MapEntry#set:key i32.const 0 drop - local.get $5 + local.get $4 local.get $2 call $~lib/map/MapEntry#set:value i32.const 0 @@ -28510,90 +23620,69 @@ call $~lib/map/Map#set:entriesCount local.get $0 i32.load - local.get $4 + local.get $3 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $7 - local.get $5 - local.get $7 + local.set $6 + local.get $4 + local.get $6 i32.load call $~lib/map/MapEntry#set:taggedNext - local.get $7 - local.get $5 + local.get $6 + local.get $4 i32.store end local.get $0 - local.set $8 + local.set $7 global.get $~lib/memory/__stack_pointer i32.const 8 i32.add global.set $~lib/memory/__stack_pointer - local.get $8 + local.get $7 ) (func $~lib/map/Map#delete (param $0 i32) (param $1 f64) (result i32) - (local $2 f64) + (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - local.get $0 - local.set $7 - global.get $~lib/memory/__stack_pointer - local.get $7 - i32.store - local.get $7 - local.get $1 - block $~lib/util/hash/HASH|inlined.6 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.6 - end + call $~stack_check + global.get $~lib/memory/__stack_pointer + i32.const 0 + i32.store + local.get $0 + local.set $6 + global.get $~lib/memory/__stack_pointer + local.get $6 + i32.store + local.get $6 + local.get $1 + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 0 - local.set $7 + local.set $6 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $7 + local.get $6 return end - local.get $3 - local.get $3 + local.get $2 + local.get $2 i32.load offset=12 i32.const 1 i32.or @@ -28608,17 +23697,17 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.const 1 i32.add i32.const 4 - local.tee $5 + local.tee $4 local.get $0 i32.load offset=20 - local.tee $6 + local.tee $5 + local.get $4 local.get $5 - local.get $6 i32.gt_u select i32.ge_u @@ -28637,21 +23726,21 @@ end if local.get $0 - local.set $7 + local.set $6 global.get $~lib/memory/__stack_pointer - local.get $7 + local.get $6 i32.store - local.get $7 - local.get $4 + local.get $6 + local.get $3 call $~lib/map/Map#rehash end i32.const 1 - local.set $7 + local.set $6 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $7 + local.get $6 ) (func $std/map/testNumeric (local $0 i32) @@ -28732,310 +23821,61 @@ local.get $1 call $~lib/map/Map#has i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 8 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $9 - global.get $~lib/memory/__stack_pointer - local.get $9 - i32.store offset=4 - local.get $9 - local.get $1 - call $~lib/map/Map#get - i32.const 10 - local.get $1 - i32.trunc_f64_s - i32.add - i32.eq - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 9 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $1 - f64.const 1 - f64.add - local.set $1 - br $for-loop|0 - end - end - local.get $0 - local.set $9 - global.get $~lib/memory/__stack_pointer - local.get $9 - i32.store offset=4 - local.get $9 - call $~lib/map/Map#get:size - i32.const 100 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 11 - i32.const 3 - call $~lib/builtins/abort - unreachable - end -<<<<<<< HEAD - local.get $2 - call $~lib/rt/pure/__release - local.get $3 - call $~lib/rt/pure/__release - local.get $4 - call $~lib/rt/pure/__release - local.get $5 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - ) - (func $~lib/map/Map#constructor (param $0 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 24 - i32.const 29 - call $~lib/rt/pure/__new - call $~lib/rt/pure/__retain - local.set $0 - end - local.get $0 - i32.const 0 - i32.const 4 - i32.const 4 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - i32.store - local.get $0 - i32.const 4 - i32.const 1 - i32.sub - i32.store offset=4 - local.get $0 - i32.const 0 - i32.const 4 - i32.const 16 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - i32.store offset=8 - local.get $0 - i32.const 4 - i32.store offset=12 - local.get $0 - i32.const 0 - i32.store offset=16 - local.get $0 - i32.const 0 - i32.store offset=20 - local.get $0 - ) - (func $~lib/util/hash/HASH (param $0 f64) (result i32) - (local $1 i64) - (local $2 i32) - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $0 - i64.reinterpret_f64 - local.set $1 - i32.const 0 - i32.const 374761393 - i32.add - i32.const 8 - i32.add - local.set $2 - local.get $2 - local.get $1 - i32.wrap_i64 - i32.const -1028477379 - i32.mul - i32.add - local.set $2 - local.get $2 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $2 - local.get $2 - local.get $1 - i64.const 32 - i64.shr_u - i32.wrap_i64 - i32.const -1028477379 - i32.mul - i32.add - local.set $2 - local.get $2 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $2 - local.get $2 - local.get $2 - i32.const 15 - i32.shr_u - i32.xor - local.set $2 - local.get $2 - i32.const -2048144777 - i32.mul - local.set $2 - local.get $2 - local.get $2 - i32.const 13 - i32.shr_u - i32.xor - local.set $2 - local.get $2 - i32.const -1028477379 - i32.mul - local.set $2 - local.get $2 - local.get $2 - i32.const 16 - i32.shr_u - i32.xor - local.set $2 - local.get $2 - return - ) - (func $~lib/map/Map#find (param $0 i32) (param $1 f64) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.get $2 - local.get $0 - i32.load offset=4 - i32.and - i32.const 4 - i32.mul - i32.add - i32.load - local.set $3 - loop $while-continue|0 - local.get $3 - local.set $4 - local.get $4 - if - local.get $3 - i32.load offset=12 - local.set $5 - local.get $5 - i32.const 1 - i32.and - i32.eqz - if (result i32) - local.get $3 - f64.load - local.get $1 - f64.eq - else + if i32.const 0 + i32.const 544 + i32.const 8 + i32.const 5 + call $~lib/builtins/abort + unreachable end + local.get $0 + local.set $9 + global.get $~lib/memory/__stack_pointer + local.get $9 + i32.store offset=4 + local.get $9 + local.get $1 + call $~lib/map/Map#get + i32.const 10 + local.get $1 + i32.trunc_f64_s + i32.add + i32.eq + i32.eqz if - local.get $3 - return + i32.const 0 + i32.const 544 + i32.const 9 + i32.const 5 + call $~lib/builtins/abort + unreachable end - local.get $5 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 - br $while-continue|0 + local.get $1 + f64.const 1 + f64.add + local.set $1 + br $for-loop|0 end end - i32.const 0 - ) - (func $~lib/map/Map#has (param $0 i32) (param $1 f64) (result i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/map/Map#find - i32.const 0 - i32.ne - ) - (func $~lib/map/Map#rehash (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 f64) - (local $13 i32) - (local $14 i32) - local.get $1 - i32.const 1 - i32.add - local.set $2 - i32.const 0 - local.get $2 - i32.const 4 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $3 - local.get $2 - i32.const 8 - i32.mul - i32.const 3 - i32.div_s - local.set $4 - i32.const 0 - local.get $4 - i32.const 16 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 - local.get $0 - i32.load offset=8 - local.set $6 - local.get $6 local.get $0 - i32.load offset=16 - i32.const 16 - i32.mul - i32.add - local.set $7 - local.get $5 - local.set $8 - loop $while-continue|0 - local.get $6 - local.get $7 - i32.ne - local.set $9 - local.get $9 -======= + local.set $9 + global.get $~lib/memory/__stack_pointer + local.get $9 + i32.store offset=4 + local.get $9 + call $~lib/map/Map#get:size + i32.const 100 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 544 + i32.const 11 + i32.const 3 + call $~lib/builtins/abort + unreachable + end f64.const 0 local.set $1 loop $for-loop|1 @@ -29044,7 +23884,6 @@ f64.lt local.set $2 local.get $2 ->>>>>>> master if local.get $0 local.set $9 @@ -29056,39 +23895,6 @@ call $~lib/map/Map#has i32.eqz if -<<<<<<< HEAD - local.get $8 - local.set $11 - local.get $10 - f64.load - local.set $12 - local.get $11 - local.get $12 - f64.store - local.get $11 - local.get $10 - i32.load offset=8 - i32.store offset=8 - local.get $12 - call $~lib/util/hash/HASH - local.get $1 - i32.and - local.set $13 - local.get $3 - local.get $13 - i32.const 4 - i32.mul - i32.add - local.set $14 - local.get $11 - local.get $14 - i32.load - i32.store offset=12 - local.get $14 - local.get $8 - i32.store - local.get $8 -======= i32.const 0 i32.const 544 i32.const 15 @@ -29113,7 +23919,6 @@ if i32.const 0 i32.const 544 ->>>>>>> master i32.const 16 i32.const 5 call $~lib/builtins/abort @@ -29179,35 +23984,6 @@ end end local.get $0 -<<<<<<< HEAD - local.tee $11 - local.get $3 - local.tee $13 - local.get $11 - i32.load - local.tee $9 - i32.ne - if - local.get $13 - call $~lib/rt/pure/__retain - local.set $13 - local.get $9 - call $~lib/rt/pure/__release - end - local.get $13 - i32.store - local.get $0 - local.get $1 - i32.store offset=4 - local.get $0 - local.tee $14 - local.get $5 - local.tee $9 - local.get $14 - i32.load offset=8 - local.tee $11 - i32.ne -======= local.set $9 global.get $~lib/memory/__stack_pointer local.get $9 @@ -29217,7 +23993,6 @@ i32.const 100 i32.eq i32.eqz ->>>>>>> master if i32.const 0 i32.const 544 @@ -29251,31 +24026,6 @@ call $~lib/map/Map#constructor local.tee $4 i32.store offset=16 -<<<<<<< HEAD - local.get $3 - call $~lib/rt/pure/__release - local.get $5 - call $~lib/rt/pure/__release - ) - (func $~lib/map/Map#set (param $0 i32) (param $1 f64) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $1 - call $~lib/util/hash/HASH - local.set $3 - local.get $0 - local.get $1 - local.get $3 - call $~lib/map/Map#find - local.set $4 - local.get $4 - if - i32.const 0 - drop - local.get $4 -======= global.get $~lib/memory/__stack_pointer i32.const 0 call $~lib/map/Map#constructor @@ -29285,7 +24035,6 @@ local.set $6 loop $for-loop|2 local.get $6 ->>>>>>> master local.get $2 local.set $9 global.get $~lib/memory/__stack_pointer @@ -29375,76 +24124,13 @@ i32.const 20 i32.sub call $~lib/map/Map#set - drop - local.get $6 - i32.const 1 - i32.add - local.set $6 - br $for-loop|2 - end -<<<<<<< HEAD - local.get $0 - i32.load offset=8 - call $~lib/rt/pure/__retain - local.set $5 - local.get $5 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $6 - i32.const 1 - i32.add - i32.store offset=16 - local.get $6 - i32.const 16 - i32.mul - i32.add - local.set $4 - local.get $4 - local.get $1 - f64.store - local.get $4 - local.get $2 - i32.store offset=8 - local.get $0 - local.get $0 - i32.load offset=20 - i32.const 1 - i32.add - i32.store offset=20 - local.get $0 - i32.load - local.get $3 - local.get $0 - i32.load offset=4 - i32.and - i32.const 4 - i32.mul - i32.add - local.set $6 - local.get $4 - local.get $6 - i32.load - i32.store offset=12 - local.get $6 - local.get $4 - i32.store - local.get $5 - call $~lib/rt/pure/__release - end - local.get $0 - call $~lib/rt/pure/__retain - ) - (func $~lib/map/Map#get (param $0 i32) (param $1 f64) (result i32) - (local $2 i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/map/Map#find - local.set $2 - local.get $2 -======= + drop + local.get $6 + i32.const 1 + i32.add + local.set $6 + br $for-loop|2 + end end local.get $4 local.set $9 @@ -29455,7 +24141,6 @@ call $~lib/map/Map#get:size i32.const 100 i32.eq ->>>>>>> master i32.eqz if i32.const 0 @@ -29465,22 +24150,6 @@ call $~lib/builtins/abort unreachable end -<<<<<<< HEAD - local.get $2 - i32.load offset=8 - ) - (func $~lib/map/Map#get:size (param $0 i32) (result i32) - local.get $0 - i32.load offset=20 - ) - (func $~lib/array/Array#constructor (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $0 -======= local.get $5 local.set $9 global.get $~lib/memory/__stack_pointer @@ -29490,7 +24159,6 @@ call $~lib/map/Map#get:size i32.const 100 i32.eq ->>>>>>> master i32.eqz if i32.const 0 @@ -29920,31 +24588,7 @@ (local $2 i32) (local $3 i32) (local $4 i32) -<<<<<<< HEAD - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 f64) - (local $13 i32) - (local $14 i32) - local.get $1 - i32.const 1 - i32.add - local.set $2 - i32.const 0 - local.get $2 - i32.const 4 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $3 - local.get $2 -======= global.get $~lib/memory/__stack_pointer ->>>>>>> master i32.const 8 i32.sub global.set $~lib/memory/__stack_pointer @@ -29969,71 +24613,6 @@ i32.const 0 call $~lib/array/Array#set:dataStart local.get $0 -<<<<<<< HEAD - i32.load offset=16 - i32.const 24 - i32.mul - i32.add - local.set $7 - local.get $5 - local.set $8 - loop $while-continue|0 - local.get $6 - local.get $7 - i32.ne - local.set $9 - local.get $9 - if - local.get $6 - local.set $10 - local.get $10 - i32.load offset=16 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $11 - local.get $10 - f64.load - local.set $12 - local.get $11 - local.get $12 - f64.store - local.get $11 - local.get $10 - f64.load offset=8 - f64.store offset=8 - local.get $12 - call $~lib/util/hash/HASH - local.get $1 - i32.and - local.set $13 - local.get $3 - local.get $13 - i32.const 4 - i32.mul - i32.add - local.set $14 - local.get $11 - local.get $14 - i32.load - i32.store offset=16 - local.get $14 - local.get $8 - i32.store - local.get $8 - i32.const 24 - i32.add - local.set $8 - end - local.get $6 - i32.const 24 - i32.add - local.set $6 - br $while-continue|0 - end -======= i32.const 0 call $~lib/array/Array#set:byteLength local.get $0 @@ -30051,7 +24630,6 @@ i32.const 60 call $~lib/builtins/abort unreachable ->>>>>>> master end local.get $1 i32.const 2 @@ -30072,22 +24650,6 @@ call $~lib/array/Array#set:buffer local.get $0 local.get $3 -<<<<<<< HEAD - local.tee $13 - local.get $11 - i32.load - local.tee $9 - i32.ne - if - local.get $13 - call $~lib/rt/pure/__retain - local.set $13 - local.get $9 - call $~lib/rt/pure/__release - end - local.get $13 - i32.store -======= call $~lib/array/Array#set:dataStart local.get $0 local.get $2 @@ -30123,7 +24685,6 @@ local.tee $0 i32.store end ->>>>>>> master local.get $0 i32.const 0 i32.const 4 @@ -30171,17 +24732,7 @@ i32.const 0 i32.store local.get $0 -<<<<<<< HEAD - local.tee $14 - local.get $5 - local.tee $9 - local.get $14 - i32.load offset=8 - local.tee $11 - i32.ne -======= i32.eqz ->>>>>>> master if global.get $~lib/memory/__stack_pointer i32.const 24 @@ -30226,16 +24777,6 @@ global.set $~lib/memory/__stack_pointer local.get $1 ) -<<<<<<< HEAD - (func $~lib/map/Map#set (param $0 i32) (param $1 f64) (param $2 f64) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $1 - call $~lib/util/hash/HASH - local.set $3 -======= (func $~lib/map/Map#constructor (param $0 i32) (result i32) (local $1 i32) global.get $~lib/memory/__stack_pointer @@ -30256,7 +24797,6 @@ local.tee $0 i32.store end ->>>>>>> master local.get $0 i32.const 0 i32.const 4 @@ -30292,96 +24832,6 @@ i32.add global.set $~lib/memory/__stack_pointer local.get $1 -<<<<<<< HEAD - local.get $3 - call $~lib/map/Map#find - local.set $4 - local.get $4 - if - i32.const 0 - drop - local.get $4 - local.get $2 - f64.store offset=8 - else - local.get $0 - i32.load offset=16 - local.get $0 - i32.load offset=12 - i32.eq - if - local.get $0 - local.get $0 - i32.load offset=20 - local.get $0 - i32.load offset=12 - i32.const 3 - i32.mul - i32.const 4 - i32.div_s - i32.lt_s - if (result i32) - local.get $0 - i32.load offset=4 - else - local.get $0 - i32.load offset=4 - i32.const 1 - i32.shl - i32.const 1 - i32.or - end - call $~lib/map/Map#rehash - end - local.get $0 - i32.load offset=8 - call $~lib/rt/pure/__retain - local.set $5 - local.get $5 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $6 - i32.const 1 - i32.add - i32.store offset=16 - local.get $6 - i32.const 24 - i32.mul - i32.add - local.set $4 - local.get $4 - local.get $1 - f64.store - local.get $4 - local.get $2 - f64.store offset=8 - local.get $0 - local.get $0 - i32.load offset=20 - i32.const 1 - i32.add - i32.store offset=20 - local.get $0 - i32.load - local.get $3 - local.get $0 - i32.load offset=4 - i32.and - i32.const 4 - i32.mul - i32.add - local.set $6 - local.get $4 - local.get $6 - i32.load - i32.store offset=16 - local.get $6 - local.get $4 - i32.store - local.get $5 - call $~lib/rt/pure/__release -======= ) (func $~lib/array/Array#constructor (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -30404,44 +24854,24 @@ call $~lib/rt/itcms/__new local.tee $0 i32.store ->>>>>>> master end local.get $0 i32.const 0 call $~lib/array/Array#set:buffer local.get $0 -<<<<<<< HEAD - i32.load offset=20 - ) - (func $~lib/map/Map#delete (param $0 i32) (param $1 f64) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) -======= i32.const 0 call $~lib/array/Array#set:dataStart local.get $0 i32.const 0 call $~lib/array/Array#set:byteLength ->>>>>>> master local.get $0 i32.const 0 call $~lib/array/Array#set:length_ local.get $1 -<<<<<<< HEAD - local.get $1 - call $~lib/util/hash/HASH - call $~lib/map/Map#find - local.set $2 - local.get $2 - i32.eqz -======= i32.const 1073741820 i32.const 0 i32.shr_u i32.gt_u ->>>>>>> master if i32.const 432 i32.const 704 @@ -30457,15 +24887,6 @@ global.get $~lib/memory/__stack_pointer local.get $2 i32.const 0 -<<<<<<< HEAD - drop - local.get $2 - local.get $2 - i32.load offset=12 - i32.const 1 - i32.or - i32.store offset=12 -======= call $~lib/rt/itcms/__new local.tee $3 i32.store offset=4 @@ -30479,7 +24900,6 @@ local.get $0 local.get $3 call $~lib/array/Array#set:dataStart ->>>>>>> master local.get $0 local.get $2 call $~lib/array/Array#set:byteLength @@ -30487,18 +24907,9 @@ local.get $1 call $~lib/array/Array#set:length_ local.get $0 -<<<<<<< HEAD - i32.load offset=4 - i32.const 1 - i32.shr_u - local.set $3 - local.get $3 - i32.const 1 -======= local.set $4 global.get $~lib/memory/__stack_pointer i32.const 8 ->>>>>>> master i32.add global.set $~lib/memory/__stack_pointer local.get $4 @@ -30507,34 +24918,6 @@ (local $1 i32) global.get $~lib/memory/__stack_pointer i32.const 4 -<<<<<<< HEAD - local.tee $4 - local.get $0 - i32.load offset=20 - local.tee $5 - local.get $4 - local.get $5 - i32.gt_u - select - i32.ge_u - if (result i32) - local.get $0 - i32.load offset=20 - local.get $0 - i32.load offset=12 - i32.const 3 - i32.mul - i32.const 4 - i32.div_s - i32.lt_s - else - i32.const 0 - end - if - local.get $0 - local.get $3 - call $~lib/map/Map#rehash -======= i32.sub global.set $~lib/memory/__stack_pointer call $~stack_check @@ -30550,7 +24933,6 @@ call $~lib/rt/itcms/__new local.tee $0 i32.store ->>>>>>> master end local.get $0 i32.const 0 diff --git a/tests/compiler/std/set.optimized.wat b/tests/compiler/std/set.optimized.wat index f3986c3493..4e866282c8 100644 --- a/tests/compiler/std/set.optimized.wat +++ b/tests/compiler/std/set.optimized.wat @@ -1,12 +1,8 @@ (module (type $i32_i32_=>_none (func (param i32 i32))) -<<<<<<< HEAD (type $i32_=>_i32 (func (param i32) (result i32))) -======= ->>>>>>> master (type $i32_i32_=>_i32 (func (param i32 i32) (result i32))) (type $none_=>_none (func)) - (type $i32_=>_i32 (func (param i32) (result i32))) (type $none_=>_i32 (func (result i32))) (type $i32_i32_i32_=>_none (func (param i32 i32 i32))) (type $i32_=>_none (func (param i32))) @@ -20,17 +16,12 @@ (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_i32_i64_=>_none (func (param i32 i32 i64))) (type $i64_=>_i32 (func (param i64) (result i32))) + (type $f32_=>_i32 (func (param f32) (result i32))) + (type $f64_=>_i32 (func (param f64) (result i32))) (type $i32_f32_=>_i32 (func (param i32 f32) (result i32))) (type $i32_f32_i32_=>_i32 (func (param i32 f32 i32) (result i32))) (type $i32_f64_=>_i32 (func (param i32 f64) (result i32))) (type $i32_f64_i32_=>_i32 (func (param i32 f64 i32) (result i32))) -<<<<<<< HEAD - (type $i64_=>_i32 (func (param i64) (result i32))) - (type $f32_=>_i32 (func (param f32) (result i32))) - (type $f64_=>_i32 (func (param f64) (result i32))) - (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) -======= ->>>>>>> master (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) @@ -1907,18 +1898,6 @@ end i32.const 0 ) -<<<<<<< HEAD - (func $~lib/set/Set#has (param $0 i32) (param $1 i32) (result i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/set/Set#find - i32.const 0 - i32.ne - ) -======= ->>>>>>> master (func $~lib/set/Set#rehash (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) @@ -1943,24 +1922,15 @@ i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor -<<<<<<< HEAD - local.set $5 - local.get $3 -======= local.tee $6 i32.store global.get $~lib/memory/__stack_pointer local.get $2 ->>>>>>> master i32.const 3 i32.shl i32.const 3 i32.div_s -<<<<<<< HEAD - local.tee $7 -======= local.tee $5 ->>>>>>> master i32.const 3 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor @@ -1968,17 +1938,13 @@ i32.store offset=4 local.get $0 i32.load offset=8 - local.tee $4 + local.tee $8 local.get $0 i32.load offset=16 i32.const 3 i32.shl i32.add -<<<<<<< HEAD - local.set $8 -======= local.set $4 ->>>>>>> master local.get $3 local.set $2 loop $while-continue|0 @@ -1986,35 +1952,30 @@ local.get $8 i32.ne if - local.get $4 - local.tee $6 + local.get $8 i32.load offset=4 i32.const 1 i32.and i32.eqz if local.get $2 - local.get $6 + local.get $8 i32.load8_s - local.tee $4 + local.tee $7 i32.store8 local.get $2 -<<<<<<< HEAD - local.get $5 - local.get $4 - call $~lib/util/hash/HASH -======= local.get $6 ->>>>>>> master + local.get $7 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 i32.shl i32.add - local.tee $4 + local.tee $7 i32.load i32.store offset=4 - local.get $4 + local.get $7 local.get $2 i32.store local.get $2 @@ -2022,29 +1983,13 @@ i32.add local.set $2 end - local.get $6 + local.get $8 i32.const 8 i32.add - local.set $4 + local.set $8 br $while-continue|0 end end -<<<<<<< HEAD - local.get $5 - local.tee $2 - local.get $0 - i32.load - local.tee $4 - i32.ne - if - local.get $2 - call $~lib/rt/pure/__retain - local.set $2 - local.get $4 - call $~lib/rt/pure/__release - end -======= ->>>>>>> master local.get $0 local.get $6 call $~lib/set/Set#set:buckets @@ -2055,143 +2000,16 @@ local.get $3 call $~lib/set/Set#set:entries local.get $0 -<<<<<<< HEAD - local.get $7 -======= local.get $5 ->>>>>>> master i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 -<<<<<<< HEAD - local.get $5 - call $~lib/rt/pure/__release - local.get $3 - call $~lib/rt/pure/__release - ) - (func $~lib/set/Set#add (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - local.tee $3 - call $~lib/set/Set#find - i32.eqz - if - local.get $0 - i32.load offset=16 - local.get $0 - i32.load offset=12 - i32.eq - if - local.get $0 - local.get $0 - i32.load offset=20 - local.get $0 - i32.load offset=12 - i32.const 3 - i32.mul - i32.const 4 - i32.div_s - i32.lt_s - if (result i32) - local.get $0 - i32.load offset=4 - else - local.get $0 - i32.load offset=4 - i32.const 1 - i32.shl - i32.const 1 - i32.or - end - call $~lib/set/Set#rehash - end - local.get $0 - i32.load offset=8 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $4 - i32.const 1 - i32.add - i32.store offset=16 - local.get $4 - i32.const 3 - i32.shl - i32.add - local.tee $2 - local.get $1 - i32.store8 - local.get $0 - local.get $0 - i32.load offset=20 - i32.const 1 - i32.add - i32.store offset=20 - local.get $2 - local.get $0 - i32.load - local.get $3 - local.get $0 - i32.load offset=4 - i32.and - i32.const 2 - i32.shl - i32.add - local.tee $1 - i32.load - i32.store offset=4 - local.get $1 - local.get $2 - i32.store - end - local.get $0 - call $~lib/rt/pure/__retain - ) - (func $~lib/rt/tlsf/checkUsedBlock (param $0 i32) (result i32) - (local $1 i32) - local.get $0 - i32.const 4 - i32.sub - local.set $1 - local.get $0 - i32.const 15 - i32.and - i32.eqz - i32.const 0 - local.get $0 - select - if (result i32) - local.get $1 - i32.load - i32.const 1 - i32.and - i32.eqz - else - i32.const 0 - end - i32.eqz - if - i32.const 0 - i32.const 1184 - i32.const 563 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $1 -======= global.get $~lib/memory/__stack_pointer i32.const 8 i32.add global.set $~lib/memory/__stack_pointer ->>>>>>> master ) (func $~lib/memory/memory.copy (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) @@ -2513,6 +2331,38 @@ i32.const 0 i32.store offset=20 ) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) + local.get $0 + i32.const 255 + i32.and + i32.const -1028477379 + i32.mul + i32.const 374761394 + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.tee $0 + local.get $0 + i32.const 15 + i32.shr_u + i32.xor + i32.const -2048144777 + i32.mul + local.tee $0 + local.get $0 + i32.const 13 + i32.shr_u + i32.xor + i32.const -1028477379 + i32.mul + local.tee $0 + local.get $0 + i32.const 16 + i32.shr_u + i32.xor + ) (func $~lib/set/Set#rehash (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) @@ -2580,12 +2430,9 @@ i32.store8 local.get $2 local.get $6 - local.get $1 local.get $7 - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/HASH + local.get $1 i32.and i32.const 2 i32.shl @@ -2648,44 +2495,39 @@ i32.add i32.load8_u ) - (func $~lib/util/hash/hash16 (param $0 i32) (result i32) - local.get $0 -<<<<<<< HEAD - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/set/Set#find - local.tee $1 - i32.eqz - if - return - end - local.get $1 - local.get $1 - i32.load offset=4 - i32.const 1 - i32.or - i32.store offset=4 + (func $~lib/util/hash/HASH (param $0 i32) (result i32) local.get $0 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + i32.const -1028477379 + i32.mul + i32.const 374761395 + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.tee $0 local.get $0 - i32.load offset=20 - i32.const 1 - i32.sub - i32.store offset=20 -======= - i32.const 255 - i32.and - i32.const -2128831035 + i32.const 15 + i32.shr_u i32.xor - i32.const 16777619 + i32.const -2048144777 i32.mul ->>>>>>> master + local.tee $0 local.get $0 - i32.const 8 + i32.const 13 i32.shr_u i32.xor - i32.const 16777619 + i32.const -1028477379 i32.mul + local.tee $0 + local.get $0 + i32.const 16 + i32.shr_u + i32.xor ) (func $~lib/set/Set#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 @@ -2798,7 +2640,7 @@ local.get $2 local.get $6 local.get $7 - call $~lib/util/hash/hash16 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -2873,13 +2715,45 @@ i32.add i32.load16_s ) - (func $~lib/set/Set#rehash (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) + local.get $0 + i32.const 65535 + i32.and + i32.const -1028477379 + i32.mul + i32.const 374761395 + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.tee $0 + local.get $0 + i32.const 15 + i32.shr_u + i32.xor + i32.const -2048144777 + i32.mul + local.tee $0 + local.get $0 + i32.const 13 + i32.shr_u + i32.xor + i32.const -1028477379 + i32.mul + local.tee $0 + local.get $0 + i32.const 16 + i32.shr_u + i32.xor + ) + (func $~lib/set/Set#rehash (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + (local $6 i32) + (local $7 i32) (local $8 i32) global.get $~lib/memory/__stack_pointer i32.const 8 @@ -2941,7 +2815,7 @@ local.get $2 local.get $6 local.get $7 - call $~lib/util/hash/hash16 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -3007,24 +2881,11 @@ i32.add i32.load16_u ) - (func $~lib/util/hash/hash32 (param $0 i32) (result i32) - local.get $0 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $0 -<<<<<<< HEAD - ) - (func $~lib/util/hash/HASH (param $0 i32) (result i32) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) local.get $0 - i32.const 255 - i32.and i32.const -1028477379 i32.mul - i32.const 374761394 + i32.const 374761397 i32.add i32.const 17 i32.rotl @@ -3034,24 +2895,9 @@ local.get $0 i32.const 15 i32.shr_u -======= - i32.const 8 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.get $0 - i32.const 16 - i32.shr_u - i32.const 255 - i32.and ->>>>>>> master i32.xor i32.const -2048144777 i32.mul -<<<<<<< HEAD local.tee $0 local.get $0 i32.const 13 @@ -3065,20 +2911,6 @@ i32.shr_u i32.xor ) - (func $~lib/set/Set#has (param $0 i32) (param $1 i32) (result i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/set/Set#find -======= - local.get $0 - i32.const 24 - i32.shr_u - i32.xor - i32.const 16777619 - i32.mul - ) (func $~lib/set/Set#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 i32.load @@ -3118,7 +2950,6 @@ br $while-continue|0 end end ->>>>>>> master i32.const 0 ) (func $~lib/set/Set#rehash (param $0 i32) (param $1 i32) @@ -3145,24 +2976,15 @@ i32.const 2 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor -<<<<<<< HEAD - local.set $5 - local.get $3 -======= local.tee $6 i32.store global.get $~lib/memory/__stack_pointer local.get $2 ->>>>>>> master i32.const 3 i32.shl i32.const 3 i32.div_s -<<<<<<< HEAD - local.tee $7 -======= local.tee $5 ->>>>>>> master i32.const 3 i32.shl call $~lib/arraybuffer/ArrayBuffer#constructor @@ -3170,17 +2992,13 @@ i32.store offset=4 local.get $0 i32.load offset=8 - local.tee $4 + local.tee $8 local.get $0 i32.load offset=16 i32.const 3 i32.shl i32.add -<<<<<<< HEAD - local.set $8 -======= local.set $4 ->>>>>>> master local.get $3 local.set $2 loop $while-continue|0 @@ -3188,24 +3006,13 @@ local.get $8 i32.ne if - local.get $4 - local.tee $6 + local.get $8 i32.load offset=4 i32.const 1 i32.and i32.eqz if local.get $2 -<<<<<<< HEAD - local.get $6 - i32.load8_u - local.tee $4 - i32.store8 - local.get $2 - local.get $5 - local.get $4 - call $~lib/util/hash/HASH -======= local.get $8 i32.load local.tee $7 @@ -3213,17 +3020,16 @@ local.get $2 local.get $6 local.get $7 - call $~lib/util/hash/hash32 ->>>>>>> master + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 i32.shl i32.add - local.tee $4 + local.tee $7 i32.load i32.store offset=4 - local.get $4 + local.get $7 local.get $2 i32.store local.get $2 @@ -3231,29 +3037,13 @@ i32.add local.set $2 end - local.get $6 + local.get $8 i32.const 8 i32.add - local.set $4 + local.set $8 br $while-continue|0 end end -<<<<<<< HEAD - local.get $5 - local.tee $2 - local.get $0 - i32.load - local.tee $4 - i32.ne - if - local.get $2 - call $~lib/rt/pure/__retain - local.set $2 - local.get $4 - call $~lib/rt/pure/__release - end -======= ->>>>>>> master local.get $0 local.get $6 call $~lib/set/Set#set:buckets @@ -3264,34 +3054,12 @@ local.get $3 call $~lib/set/Set#set:entries local.get $0 -<<<<<<< HEAD - local.get $7 -======= local.get $5 ->>>>>>> master i32.store offset=12 local.get $0 local.get $0 i32.load offset=20 i32.store offset=16 -<<<<<<< HEAD - local.get $5 - call $~lib/rt/pure/__release - local.get $3 - call $~lib/rt/pure/__release - ) - (func $~lib/set/Set#add (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - local.tee $3 - call $~lib/set/Set#find - i32.eqz -======= global.get $~lib/memory/__stack_pointer i32.const 8 i32.add @@ -3311,7 +3079,6 @@ local.get $0 i32.load offset=12 i32.ge_u ->>>>>>> master if i32.const 1248 i32.const 1616 @@ -3437,7 +3204,7 @@ local.get $2 local.get $6 local.get $7 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -3503,76 +3270,48 @@ i32.add i32.load ) - (func $~lib/util/hash/hash64 (param $0 i64) (result i32) + (func $~lib/util/hash/HASH (param $0 i64) (result i32) (local $1 i32) local.get $0 i32.wrap_i64 - local.tee $1 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.get $1 - i32.const 8 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.get $1 -<<<<<<< HEAD - call $~lib/util/hash/HASH - call $~lib/set/Set#find -======= - i32.const 16 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 + i32.const -1028477379 i32.mul - local.get $1 - i32.const 24 - i32.shr_u - i32.xor - i32.const 16777619 + i32.const 374761401 + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 i32.mul local.get $0 i64.const 32 i64.shr_u i32.wrap_i64 ->>>>>>> master - local.tee $1 - i32.const 255 - i32.and - i32.xor - i32.const 16777619 + i32.const -1028477379 + i32.mul + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 i32.mul + local.tee $1 local.get $1 - i32.const 8 + i32.const 15 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 + i32.const -2048144777 i32.mul + local.tee $1 local.get $1 - i32.const 16 + i32.const 13 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 + i32.const -1028477379 i32.mul + local.tee $1 local.get $1 - i32.const 24 + i32.const 16 i32.shr_u i32.xor - i32.const 16777619 - i32.mul ) (func $~lib/set/Set#find (param $0 i32) (param $1 i64) (param $2 i32) (result i32) local.get $0 @@ -3684,7 +3423,7 @@ local.get $2 local.get $8 local.get $5 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -3891,7 +3630,7 @@ local.get $2 local.get $8 local.get $5 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -3936,62 +3675,58 @@ i32.add global.set $~lib/memory/__stack_pointer ) -<<<<<<< HEAD - (func $~lib/util/hash/HASH (param $0 i32) (result i32) + (func $~lib/array/Array#__get (param $0 i32) (param $1 i32) (result i64) + local.get $1 local.get $0 - i32.const 16 + i32.load offset=12 + i32.ge_u + if + i32.const 1248 + i32.const 1616 + i32.const 92 + i32.const 42 + call $~lib/builtins/abort + unreachable + end + local.get $0 + i32.load offset=4 + local.get $1 + i32.const 3 i32.shl - i32.const 16 - i32.shr_s + i32.add + i64.load + ) + (func $~lib/util/hash/HASH (param $0 f32) (result i32) + (local $1 i32) + local.get $0 + i32.reinterpret_f32 i32.const -1028477379 i32.mul - i32.const 374761395 + i32.const 374761397 i32.add i32.const 17 i32.rotl i32.const 668265263 i32.mul - local.tee $0 - local.get $0 + local.tee $1 + local.get $1 i32.const 15 i32.shr_u i32.xor i32.const -2048144777 i32.mul - local.tee $0 - local.get $0 + local.tee $1 + local.get $1 i32.const 13 i32.shr_u i32.xor i32.const -1028477379 i32.mul - local.tee $0 - local.get $0 + local.tee $1 + local.get $1 i32.const 16 i32.shr_u i32.xor -======= - (func $~lib/array/Array#__get (param $0 i32) (param $1 i32) (result i64) - local.get $1 - local.get $0 - i32.load offset=12 - i32.ge_u - if - i32.const 1248 - i32.const 1616 - i32.const 92 - i32.const 42 - call $~lib/builtins/abort - unreachable - end - local.get $0 - i32.load offset=4 - local.get $1 - i32.const 3 - i32.shl - i32.add - i64.load ->>>>>>> master ) (func $~lib/set/Set#find (param $0 i32) (param $1 f32) (param $2 i32) (result i32) local.get $0 @@ -4034,20 +3769,7 @@ end i32.const 0 ) -<<<<<<< HEAD - (func $~lib/set/Set#has (param $0 i32) (param $1 i32) (result i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/set/Set#find - i32.const 0 - i32.ne - ) - (func $~lib/set/Set#rehash (param $0 i32) (param $1 i32) -======= (func $~lib/set/Set#rehash (param $0 i32) (param $1 i32) ->>>>>>> master (local $2 i32) (local $3 i32) (local $4 i32) @@ -4116,13 +3838,7 @@ local.get $2 local.get $8 local.get $5 -<<<<<<< HEAD - local.get $4 - call $~lib/util/hash/HASH -======= - i32.reinterpret_f32 - call $~lib/util/hash/hash32 ->>>>>>> master + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -4183,20 +3899,57 @@ local.get $0 i32.load offset=4 local.get $1 -<<<<<<< HEAD - call $~lib/util/hash/HASH - local.tee $3 - call $~lib/set/Set#find - i32.eqz - if - local.get $0 - i32.load offset=16 -======= i32.const 2 i32.shl i32.add f32.load ) + (func $~lib/util/hash/HASH (param $0 f64) (result i32) + (local $1 i32) + (local $2 i64) + local.get $0 + i64.reinterpret_f64 + local.tee $2 + i32.wrap_i64 + i32.const -1028477379 + i32.mul + i32.const 374761401 + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.get $2 + i64.const 32 + i64.shr_u + i32.wrap_i64 + i32.const -1028477379 + i32.mul + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.tee $1 + local.get $1 + i32.const 15 + i32.shr_u + i32.xor + i32.const -2048144777 + i32.mul + local.tee $1 + local.get $1 + i32.const 13 + i32.shr_u + i32.xor + i32.const -1028477379 + i32.mul + local.tee $1 + local.get $1 + i32.const 16 + i32.shr_u + i32.xor + ) (func $~lib/set/Set#find (param $0 i32) (param $1 f64) (param $2 i32) (result i32) local.get $0 i32.load @@ -4210,7 +3963,6 @@ i32.load local.set $0 loop $while-continue|0 ->>>>>>> master local.get $0 if local.get $0 @@ -4308,8 +4060,7 @@ local.get $2 local.get $8 local.get $5 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -4375,18 +4126,6 @@ i32.add f64.load ) -<<<<<<< HEAD - (func $~lib/set/Set#delete (param $0 i32) (param $1 i32) - (local $2 i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/set/Set#find - local.tee $1 - i32.eqz - if -======= (func $~lib/rt/__visit_members (param $0 i32) block $folding-inner1 block $folding-inner0 @@ -4421,7 +4160,6 @@ local.get $0 i32.load offset=8 call $~lib/rt/itcms/__visit ->>>>>>> master return end local.get $0 @@ -4510,14 +4248,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/HASH call $~lib/set/Set#find i32.const 0 i32.ne @@ -4538,23 +4269,15 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store + local.get $1 + call $~lib/util/hash/HASH + local.set $3 global.get $~lib/memory/__stack_pointer local.get $0 i32.store - local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.tee $2 - local.set $3 local.get $0 local.get $1 - local.get $2 + local.get $3 call $~lib/set/Set#find i32.eqz if @@ -4835,14 +4558,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/HASH call $~lib/set/Set#find local.tee $1 i32.eqz @@ -5333,164 +5049,23 @@ i32.store global.get $~lib/memory/__stack_pointer local.get $0 -<<<<<<< HEAD - ) - (func $~lib/util/hash/HASH (param $0 i32) (result i32) - local.get $0 - i32.const 65535 - i32.and - i32.const -1028477379 - i32.mul - i32.const 374761395 - i32.add - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.tee $0 - local.get $0 - i32.const 15 - i32.shr_u - i32.xor - i32.const -2048144777 - i32.mul - local.tee $0 - local.get $0 - i32.const 13 - i32.shr_u - i32.xor - i32.const -1028477379 - i32.mul - local.tee $0 - local.get $0 - i32.const 16 - i32.shr_u - i32.xor - ) - (func $~lib/set/Set#has (param $0 i32) (param $1 i32) (result i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/set/Set#find -======= i32.store local.get $0 local.get $1 local.get $1 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/HASH call $~lib/set/Set#find ->>>>>>> master i32.const 0 - i32.ne - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - ) - (func $~lib/set/Set#add (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) -<<<<<<< HEAD - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - local.get $1 - i32.const 1 - i32.add - local.tee $3 - i32.const 2 - i32.shl - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 - local.get $3 - i32.const 3 - i32.shl - i32.const 3 - i32.div_s - local.tee $7 - i32.const 3 - i32.shl - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $3 - local.get $0 - i32.load offset=8 - local.tee $4 - local.get $0 - i32.load offset=16 - i32.const 3 - i32.shl - i32.add - local.set $8 - local.get $3 - local.set $2 - loop $while-continue|0 - local.get $4 - local.get $8 - i32.ne - if - local.get $4 - local.tee $6 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - if - local.get $2 - local.get $6 - i32.load16_u - local.tee $4 - i32.store16 - local.get $2 - local.get $5 - local.get $4 - call $~lib/util/hash/HASH - local.get $1 - i32.and - i32.const 2 - i32.shl - i32.add - local.tee $4 - i32.load - i32.store offset=4 - local.get $4 - local.get $2 - i32.store - local.get $2 - i32.const 8 - i32.add - local.set $2 - end - local.get $6 - i32.const 8 - i32.add - local.set $4 - br $while-continue|0 - end - end - local.get $5 - local.tee $2 - local.get $0 - i32.load - local.tee $4 - i32.ne - if - local.get $2 - call $~lib/rt/pure/__retain - local.set $2 - local.get $4 - call $~lib/rt/pure/__release - end - local.get $0 - local.get $2 -======= + i32.ne + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.add + global.set $~lib/memory/__stack_pointer + ) + (func $~lib/set/Set#add (param $0 i32) (param $1 i32) + (local $2 i32) + (local $3 i32) + (local $4 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -5498,31 +5073,17 @@ call $~stack_check global.get $~lib/memory/__stack_pointer i32.const 0 ->>>>>>> master i32.store + local.get $1 + call $~lib/util/hash/HASH + local.set $3 global.get $~lib/memory/__stack_pointer local.get $0 i32.store - local.get $1 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul - local.tee $2 - local.set $3 local.get $0 local.get $1 -<<<<<<< HEAD - local.get $1 - call $~lib/util/hash/HASH - local.tee $3 - call $~lib/set/Set#find -======= - local.get $2 + local.get $3 call $~lib/set/Set#find ->>>>>>> master i32.eqz if local.get $0 @@ -5751,18 +5312,8 @@ local.get $0 local.get $1 local.get $1 -<<<<<<< HEAD - call $~lib/util/hash/HASH - call $~lib/set/Set#find -======= - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 - i32.mul + call $~lib/util/hash/HASH call $~lib/set/Set#find ->>>>>>> master local.tee $1 i32.eqz if @@ -6241,40 +5792,6 @@ call $~stack_check global.get $~lib/memory/__stack_pointer i32.const 0 -<<<<<<< HEAD - i32.store offset=20 - local.get $0 - ) - (func $~lib/util/hash/HASH (param $0 i32) (result i32) - local.get $0 - i32.const -1028477379 - i32.mul - i32.const 374761397 - i32.add - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.tee $0 - local.get $0 - i32.const 15 - i32.shr_u - i32.xor - i32.const -2048144777 - i32.mul - local.tee $0 - local.get $0 - i32.const 13 - i32.shr_u - i32.xor - i32.const -1028477379 - i32.mul - local.tee $0 - local.get $0 - i32.const 16 - i32.shr_u - i32.xor -======= i32.store global.get $~lib/memory/__stack_pointer local.get $0 @@ -6282,11 +5799,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/util/hash/hash16 + call $~lib/util/hash/HASH call $~lib/set/Set#find i32.const 0 i32.ne @@ -6294,7 +5807,6 @@ i32.const 4 i32.add global.set $~lib/memory/__stack_pointer ->>>>>>> master ) (func $~lib/set/Set#add (param $0 i32) (param $1 i32) (local $2 i32) @@ -6309,198 +5821,15 @@ i32.const 0 i32.store local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/util/hash/hash16 + call $~lib/util/hash/HASH local.set $3 global.get $~lib/memory/__stack_pointer local.get $0 -<<<<<<< HEAD - i32.load - local.get $2 - local.get $0 - i32.load offset=4 - i32.and - i32.const 2 - i32.shl - i32.add - i32.load - local.set $0 - loop $while-continue|0 - local.get $0 - if - local.get $0 - i32.load offset=4 - local.tee $2 - i32.const 1 - i32.and - if (result i32) - i32.const 0 - else - local.get $1 - local.get $0 - i32.load - i32.eq - end - if - local.get $0 - return - end - local.get $2 - i32.const -2 - i32.and - local.set $0 - br $while-continue|0 - end - end - i32.const 0 - ) - (func $~lib/set/Set#has (param $0 i32) (param $1 i32) (result i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/set/Set#find - i32.const 0 - i32.ne - ) - (func $~lib/set/Set#rehash (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - local.get $1 - i32.const 1 - i32.add - local.tee $3 - i32.const 2 - i32.shl - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 - local.get $3 - i32.const 3 - i32.shl - i32.const 3 - i32.div_s - local.tee $7 - i32.const 3 - i32.shl - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $3 - local.get $0 - i32.load offset=8 - local.tee $4 - local.get $0 - i32.load offset=16 - i32.const 3 - i32.shl - i32.add - local.set $8 - local.get $3 - local.set $2 - loop $while-continue|0 - local.get $4 - local.get $8 - i32.ne - if - local.get $4 - local.tee $6 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - if - local.get $2 - local.get $6 - i32.load - local.tee $4 - i32.store - local.get $2 - local.get $5 - local.get $4 - call $~lib/util/hash/HASH - local.get $1 - i32.and - i32.const 2 - i32.shl - i32.add - local.tee $4 - i32.load - i32.store offset=4 - local.get $4 - local.get $2 - i32.store - local.get $2 - i32.const 8 - i32.add - local.set $2 - end - local.get $6 - i32.const 8 - i32.add - local.set $4 - br $while-continue|0 - end - end - local.get $5 - local.tee $2 - local.get $0 - i32.load - local.tee $4 - i32.ne - if - local.get $2 - call $~lib/rt/pure/__retain - local.set $2 - local.get $4 - call $~lib/rt/pure/__release - end - local.get $0 - local.get $2 - i32.store - local.get $0 - local.get $1 - i32.store offset=4 - local.get $3 - local.tee $1 - local.get $0 - i32.load offset=8 - local.tee $2 - i32.ne - if - local.get $1 - call $~lib/rt/pure/__retain - local.set $1 - local.get $2 - call $~lib/rt/pure/__release - end -======= i32.store ->>>>>>> master local.get $0 local.get $1 local.get $3 -<<<<<<< HEAD - call $~lib/rt/pure/__release - ) - (func $~lib/set/Set#add (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - local.tee $3 - call $~lib/set/Set#find -======= call $~lib/set/Set#find ->>>>>>> master i32.eqz if local.get $0 @@ -6788,17 +6117,8 @@ local.get $0 local.get $1 local.get $1 -<<<<<<< HEAD - call $~lib/util/hash/HASH - call $~lib/set/Set#find -======= - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/util/hash/hash16 + call $~lib/util/hash/HASH call $~lib/set/Set#find ->>>>>>> master local.tee $1 i32.eqz if @@ -7292,9 +6612,7 @@ local.get $0 local.get $1 local.get $1 - i32.const 65535 - i32.and - call $~lib/util/hash/hash16 + call $~lib/util/hash/HASH call $~lib/set/Set#find i32.const 0 i32.ne @@ -7316,9 +6634,7 @@ i32.const 0 i32.store local.get $1 - i32.const 65535 - i32.and - call $~lib/util/hash/hash16 + call $~lib/util/hash/HASH local.set $3 global.get $~lib/memory/__stack_pointer local.get $0 @@ -7560,10 +6876,8 @@ i32.store local.get $0 local.get $1 - local.get $1 - i32.const 65535 - i32.and - call $~lib/util/hash/hash16 + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find local.tee $1 i32.eqz @@ -8046,122 +7360,12 @@ i32.store global.get $~lib/memory/__stack_pointer local.get $0 -<<<<<<< HEAD - i32.const 3 - i32.store offset=4 - local.get $0 - i32.const 64 - call $~lib/arraybuffer/ArrayBuffer#constructor - i32.store offset=8 - local.get $0 - i32.const 4 - i32.store offset=12 - local.get $0 - i32.const 0 - i32.store offset=16 - local.get $0 - i32.const 0 - i32.store offset=20 - local.get $0 - ) - (func $~lib/util/hash/HASH (param $0 i64) (result i32) - (local $1 i32) - local.get $0 - i32.wrap_i64 - i32.const -1028477379 - i32.mul - i32.const 374761401 - i32.add - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.get $0 - i64.const 32 - i64.shr_u - i32.wrap_i64 - i32.const -1028477379 - i32.mul - i32.add - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.tee $1 - local.get $1 - i32.const 15 - i32.shr_u - i32.xor - i32.const -2048144777 - i32.mul - local.tee $1 - local.get $1 - i32.const 13 - i32.shr_u - i32.xor - i32.const -1028477379 - i32.mul - local.tee $1 - local.get $1 - i32.const 16 - i32.shr_u - i32.xor - ) - (func $~lib/set/Set#find (param $0 i32) (param $1 i64) (param $2 i32) (result i32) - local.get $0 - i32.load - local.get $2 - local.get $0 - i32.load offset=4 - i32.and - i32.const 2 - i32.shl - i32.add - i32.load - local.set $0 - loop $while-continue|0 - local.get $0 - if - local.get $0 - i32.load offset=8 - local.tee $2 - i32.const 1 - i32.and - if (result i32) - i32.const 0 - else - local.get $1 - local.get $0 - i64.load - i64.eq - end - if - local.get $0 - return - end - local.get $2 - i32.const -2 - i32.and - local.set $0 - br $while-continue|0 - end - end - i32.const 0 - ) - (func $~lib/set/Set#has (param $0 i32) (param $1 i64) (result i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/set/Set#find -======= i32.store local.get $0 local.get $1 local.get $1 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/set/Set#find ->>>>>>> master i32.const 0 i32.ne global.get $~lib/memory/__stack_pointer @@ -8175,81 +7379,14 @@ (local $4 i32) global.get $~lib/memory/__stack_pointer i32.const 4 -<<<<<<< HEAD - i32.shl - i32.add - local.set $8 - local.get $3 - local.set $2 - loop $while-continue|0 - local.get $4 - local.get $8 - i32.ne - if - local.get $4 - local.tee $6 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $2 - local.get $6 - i64.load - local.tee $9 - i64.store - local.get $2 - local.get $5 - local.get $9 - call $~lib/util/hash/HASH - local.get $1 - i32.and - i32.const 2 - i32.shl - i32.add - local.tee $4 - i32.load - i32.store offset=8 - local.get $4 - local.get $2 - i32.store - local.get $2 - i32.const 16 - i32.add - local.set $2 - end - local.get $6 - i32.const 16 - i32.add - local.set $4 - br $while-continue|0 - end - end - local.get $5 - local.tee $2 - local.get $0 - i32.load - local.tee $4 - i32.ne - if - local.get $2 - call $~lib/rt/pure/__retain - local.set $2 - local.get $4 - call $~lib/rt/pure/__release - end - local.get $0 - local.get $2 -======= i32.sub global.set $~lib/memory/__stack_pointer call $~stack_check global.get $~lib/memory/__stack_pointer i32.const 0 ->>>>>>> master i32.store local.get $1 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.set $3 global.get $~lib/memory/__stack_pointer local.get $0 @@ -8257,22 +7394,7 @@ local.get $0 local.get $1 local.get $3 -<<<<<<< HEAD - call $~lib/rt/pure/__release - ) - (func $~lib/set/Set#add (param $0 i32) (param $1 i64) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - local.tee $3 - call $~lib/set/Set#find -======= call $~lib/set/Set#find ->>>>>>> master i32.eqz if local.get $0 @@ -8560,15 +7682,9 @@ local.get $0 local.get $1 local.get $1 -<<<<<<< HEAD - call $~lib/util/hash/HASH - call $~lib/set/Set#find - local.tee $2 -======= - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/set/Set#find local.tee $1 ->>>>>>> master i32.eqz if global.get $~lib/memory/__stack_pointer @@ -9045,7 +8161,7 @@ local.get $0 local.get $1 local.get $1 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/set/Set#find i32.const 0 i32.ne @@ -9067,7 +8183,7 @@ i32.const 0 i32.store local.get $1 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.set $3 global.get $~lib/memory/__stack_pointer local.get $0 @@ -9310,7 +8426,7 @@ local.get $0 local.get $1 local.get $1 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/set/Set#find local.tee $1 i32.eqz @@ -9749,95 +8865,48 @@ i32.const 45 i32.const 3 call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=4 - local.get $0 - call $~lib/set/Set#clear - global.get $~lib/memory/__stack_pointer - local.get $0 - i32.store offset=4 - local.get $0 - i32.load offset=20 - if - i32.const 0 - i32.const 1568 - i32.const 49 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - i32.const 20 - i32.add - global.set $~lib/memory/__stack_pointer - ) - (func $~lib/set/Set#has (param $0 i32) (param $1 i64) (result i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 -<<<<<<< HEAD - i32.store offset=20 - local.get $0 - ) - (func $~lib/util/hash/HASH (param $0 f32) (result i32) - (local $1 i32) - local.get $0 - i32.reinterpret_f32 - i32.const -1028477379 - i32.mul - i32.const 374761397 - i32.add - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.tee $1 - local.get $1 - i32.const 15 - i32.shr_u - i32.xor - i32.const -2048144777 - i32.mul - local.tee $1 - local.get $1 - i32.const 13 - i32.shr_u - i32.xor - i32.const -1028477379 - i32.mul - local.tee $1 - local.get $1 - i32.const 16 - i32.shr_u - i32.xor - ) - (func $~lib/set/Set#find (param $0 i32) (param $1 f32) (param $2 i32) (result i32) + unreachable + end + global.get $~lib/memory/__stack_pointer local.get $0 - i32.load - local.get $2 -======= + i32.store offset=4 + local.get $0 + call $~lib/set/Set#clear + global.get $~lib/memory/__stack_pointer + local.get $0 + i32.store offset=4 + local.get $0 + i32.load offset=20 + if + i32.const 0 + i32.const 1568 + i32.const 49 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/memory/__stack_pointer + i32.const 20 + i32.add + global.set $~lib/memory/__stack_pointer + ) + (func $~lib/set/Set#has (param $0 i32) (param $1 i64) (result i32) + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i32.const 0 i32.store global.get $~lib/memory/__stack_pointer ->>>>>>> master local.get $0 i32.store local.get $0 local.get $1 local.get $1 -<<<<<<< HEAD - call $~lib/util/hash/HASH - call $~lib/set/Set#find -======= - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH call $~lib/set/Set#find ->>>>>>> master i32.const 0 i32.ne global.get $~lib/memory/__stack_pointer @@ -9858,102 +8927,15 @@ i32.const 0 i32.store local.get $1 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH local.set $3 global.get $~lib/memory/__stack_pointer local.get $0 -<<<<<<< HEAD - i32.load offset=8 - local.tee $4 - local.get $0 - i32.load offset=16 - i32.const 3 - i32.shl - i32.add - local.set $8 - local.get $3 - local.set $2 - loop $while-continue|0 - local.get $4 - local.get $8 - i32.ne - if - local.get $4 - local.tee $6 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - if - local.get $2 - local.get $6 - f32.load - local.tee $9 - f32.store - local.get $2 - local.get $5 - local.get $9 - call $~lib/util/hash/HASH - local.get $1 - i32.and - i32.const 2 - i32.shl - i32.add - local.tee $4 - i32.load - i32.store offset=4 - local.get $4 - local.get $2 - i32.store - local.get $2 - i32.const 8 - i32.add - local.set $2 - end - local.get $6 - i32.const 8 - i32.add - local.set $4 - br $while-continue|0 - end - end - local.get $5 - local.tee $2 - local.get $0 - i32.load - local.tee $4 - i32.ne - if - local.get $2 - call $~lib/rt/pure/__retain - local.set $2 - local.get $4 - call $~lib/rt/pure/__release - end - local.get $0 - local.get $2 -======= ->>>>>>> master i32.store local.get $0 local.get $1 local.get $3 -<<<<<<< HEAD - call $~lib/rt/pure/__release - ) - (func $~lib/set/Set#add (param $0 i32) (param $1 f32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - local.tee $3 - call $~lib/set/Set#find -======= call $~lib/set/Set#find ->>>>>>> master i32.eqz if local.get $0 @@ -10242,13 +9224,8 @@ local.get $0 local.get $1 local.get $1 -<<<<<<< HEAD - call $~lib/util/hash/HASH - call $~lib/set/Set#find -======= - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH call $~lib/set/Set#find ->>>>>>> master local.tee $2 i32.eqz if @@ -10720,76 +9697,15 @@ call $~stack_check global.get $~lib/memory/__stack_pointer i32.const 0 -<<<<<<< HEAD - i32.store offset=20 - local.get $0 - ) - (func $~lib/util/hash/HASH (param $0 f64) (result i32) - (local $1 i32) - (local $2 i64) - local.get $0 - i64.reinterpret_f64 - local.tee $2 - i32.wrap_i64 - i32.const -1028477379 - i32.mul - i32.const 374761401 - i32.add - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.get $2 - i64.const 32 - i64.shr_u - i32.wrap_i64 - i32.const -1028477379 - i32.mul - i32.add - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.tee $1 - local.get $1 - i32.const 15 - i32.shr_u - i32.xor - i32.const -2048144777 - i32.mul - local.tee $1 - local.get $1 - i32.const 13 - i32.shr_u - i32.xor - i32.const -1028477379 - i32.mul - local.tee $1 - local.get $1 - i32.const 16 - i32.shr_u - i32.xor - ) - (func $~lib/set/Set#find (param $0 i32) (param $1 f64) (param $2 i32) (result i32) - local.get $0 - i32.load - local.get $2 -======= i32.store global.get $~lib/memory/__stack_pointer ->>>>>>> master local.get $0 i32.store local.get $0 local.get $1 local.get $1 -<<<<<<< HEAD - call $~lib/util/hash/HASH - call $~lib/set/Set#find -======= - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH call $~lib/set/Set#find ->>>>>>> master i32.const 0 i32.ne global.get $~lib/memory/__stack_pointer @@ -10803,81 +9719,14 @@ (local $4 i32) global.get $~lib/memory/__stack_pointer i32.const 4 -<<<<<<< HEAD - i32.shl - i32.add - local.set $8 - local.get $3 - local.set $2 - loop $while-continue|0 - local.get $4 - local.get $8 - i32.ne - if - local.get $4 - local.tee $6 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $2 - local.get $6 - f64.load - local.tee $9 - f64.store - local.get $2 - local.get $5 - local.get $9 - call $~lib/util/hash/HASH - local.get $1 - i32.and - i32.const 2 - i32.shl - i32.add - local.tee $4 - i32.load - i32.store offset=8 - local.get $4 - local.get $2 - i32.store - local.get $2 - i32.const 16 - i32.add - local.set $2 - end - local.get $6 - i32.const 16 - i32.add - local.set $4 - br $while-continue|0 - end - end - local.get $5 - local.tee $2 - local.get $0 - i32.load - local.tee $4 - i32.ne - if - local.get $2 - call $~lib/rt/pure/__retain - local.set $2 - local.get $4 - call $~lib/rt/pure/__release - end - local.get $0 - local.get $2 -======= i32.sub global.set $~lib/memory/__stack_pointer call $~stack_check global.get $~lib/memory/__stack_pointer i32.const 0 ->>>>>>> master i32.store local.get $1 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH local.set $3 global.get $~lib/memory/__stack_pointer local.get $0 @@ -10885,22 +9734,7 @@ local.get $0 local.get $1 local.get $3 -<<<<<<< HEAD - call $~lib/rt/pure/__release - ) - (func $~lib/set/Set#add (param $0 i32) (param $1 f64) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - local.tee $3 - call $~lib/set/Set#find -======= call $~lib/set/Set#find ->>>>>>> master i32.eqz if local.get $0 @@ -11136,13 +9970,8 @@ local.get $0 local.get $1 local.get $1 -<<<<<<< HEAD - call $~lib/util/hash/HASH - call $~lib/set/Set#find -======= - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH call $~lib/set/Set#find ->>>>>>> master local.tee $2 i32.eqz if @@ -11621,8 +10450,7 @@ local.get $0 local.get $1 local.get $1 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/set/Set#find i32.const 0 i32.ne @@ -11644,8 +10472,7 @@ i32.const 0 i32.store local.get $1 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.set $3 global.get $~lib/memory/__stack_pointer local.get $0 @@ -11938,8 +10765,7 @@ local.get $0 local.get $1 local.get $1 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/set/Set#find local.tee $2 i32.eqz @@ -12419,8 +11245,7 @@ local.get $0 local.get $1 local.get $1 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH call $~lib/set/Set#find i32.const 0 i32.ne @@ -12442,8 +11267,7 @@ i32.const 0 i32.store local.get $1 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH local.set $3 global.get $~lib/memory/__stack_pointer local.get $0 @@ -12736,8 +11560,7 @@ local.get $0 local.get $1 local.get $1 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 + call $~lib/util/hash/HASH call $~lib/set/Set#find local.tee $2 i32.eqz diff --git a/tests/compiler/std/set.untouched.wat b/tests/compiler/std/set.untouched.wat index 01e1ddd5e0..c862ca4524 100644 --- a/tests/compiler/std/set.untouched.wat +++ b/tests/compiler/std/set.untouched.wat @@ -13,28 +13,19 @@ (type $i32_i32_f32_=>_none (func (param i32 i32 f32))) (type $i32_i32_f64_=>_none (func (param i32 i32 f64))) (type $i32_i64_=>_none (func (param i32 i64))) - (type $i32_i64_i32_=>_i32 (func (param i32 i64 i32) (result i32))) -<<<<<<< HEAD (type $i64_=>_i32 (func (param i64) (result i32))) - (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) - (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) -======= + (type $i32_i64_i32_=>_i32 (func (param i32 i64 i32) (result i32))) (type $i32_i32_=>_i64 (func (param i32 i32) (result i64))) ->>>>>>> master (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32))) (type $i32_f32_=>_none (func (param i32 f32))) (type $i32_f64_=>_none (func (param i32 f64))) (type $none_=>_i32 (func (result i32))) - (type $i64_=>_i32 (func (param i64) (result i32))) - (type $i32_f32_i32_=>_i32 (func (param i32 f32 i32) (result i32))) - (type $i32_f64_i32_=>_i32 (func (param i32 f64 i32) (result i32))) -<<<<<<< HEAD (type $f32_=>_i32 (func (param f32) (result i32))) (type $f64_=>_i32 (func (param f64) (result i32))) -======= + (type $i32_f32_i32_=>_i32 (func (param i32 f32 i32) (result i32))) + (type $i32_f64_i32_=>_i32 (func (param i32 f64 i32) (result i32))) (type $i32_i32_=>_f32 (func (param i32 i32) (result f32))) (type $i32_i32_=>_f64 (func (param i32 i32) (result f64))) ->>>>>>> master (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32))) (memory $0 1) (data (i32.const 12) "<\00\00\00\00\00\00\00\00\00\00\00\01\00\00\00(\00\00\00A\00l\00l\00o\00c\00a\00t\00i\00o\00n\00 \00t\00o\00o\00 \00l\00a\00r\00g\00e\00\00\00\00\00") @@ -1655,134 +1646,8 @@ call $~lib/builtins/abort unreachable end -<<<<<<< HEAD - local.get $1 - i32.const 0 - call $~lib/rt/pure/__new - local.set $2 - local.get $2 - i32.const 0 - local.get $1 - call $~lib/memory/memory.fill - local.get $2 - call $~lib/rt/pure/__retain - local.set $3 - local.get $0 - call $~lib/rt/pure/__release - local.get $3 - ) - (func $~lib/set/Set#constructor (param $0 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 24 - i32.const 3 - call $~lib/rt/pure/__new - call $~lib/rt/pure/__retain - local.set $0 - end - local.get $0 - i32.const 0 - i32.const 4 - i32.const 4 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - i32.store - local.get $0 - i32.const 4 - i32.const 1 - i32.sub - i32.store offset=4 - local.get $0 - i32.const 0 - i32.const 4 - i32.const 8 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - i32.store offset=8 - local.get $0 - i32.const 4 - i32.store offset=12 - local.get $0 - i32.const 0 - i32.store offset=16 - local.get $0 - i32.const 0 - i32.store offset=20 - local.get $0 - ) - (func $~lib/util/hash/HASH (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 4 - i32.le_u - drop - local.get $0 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - local.set $2 - i32.const 1 - local.set $1 - i32.const 0 - i32.const 374761393 - i32.add - local.get $1 - i32.add - local.set $3 - local.get $3 - local.get $2 - i32.const -1028477379 - i32.mul - i32.add - local.set $3 - local.get $3 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 15 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -2048144777 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 13 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -1028477379 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 16 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - return -======= local.get $0 call $~lib/rt/tlsf/computeSize ->>>>>>> master ) (func $~lib/rt/tlsf/searchBlock (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -1821,35 +1686,6 @@ else local.get $1 end -<<<<<<< HEAD - end - i32.const 0 - ) - (func $~lib/set/Set#has (param $0 i32) (param $1 i32) (result i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/set/Set#find - i32.const 0 - i32.ne - ) - (func $~lib/set/Set#rehash (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - local.get $1 -======= local.set $4 i32.const 31 local.get $4 @@ -1873,7 +1709,6 @@ i32.sub local.set $2 end ->>>>>>> master i32.const 1 drop local.get $2 @@ -1953,45 +1788,12 @@ local.get $6 i32.eqz if -<<<<<<< HEAD - local.get $8 - local.set $11 - local.get $10 - i32.load8_s - local.set $12 - local.get $11 - local.get $12 - i32.store8 - local.get $12 - call $~lib/util/hash/HASH - local.get $1 - i32.and - local.set $13 - local.get $3 - local.get $13 - i32.const 4 - i32.mul - i32.add - local.set $14 - local.get $11 - local.get $14 - i32.load - i32.store offset=4 - local.get $14 - local.get $8 - i32.store - local.get $8 - i32.const 8 - i32.add - local.set $8 -======= i32.const 0 i32.const 368 i32.const 347 i32.const 18 call $~lib/builtins/abort unreachable ->>>>>>> master end local.get $0 local.set $9 @@ -2038,18 +1840,6 @@ (local $2 i32) (local $3 i32) (local $4 i32) -<<<<<<< HEAD - local.get $1 - call $~lib/util/hash/HASH - local.set $2 - local.get $0 - local.get $1 - local.get $2 - call $~lib/set/Set#find - local.set $3 - local.get $3 - i32.eqz -======= (local $5 i32) (local $6 i32) (local $7 i32) @@ -2111,7 +1901,6 @@ memory.grow i32.const 0 i32.lt_s ->>>>>>> master if local.get $4 memory.grow @@ -2120,26 +1909,6 @@ if unreachable end -<<<<<<< HEAD - local.get $0 - i32.load offset=8 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $4 - i32.const 1 - i32.add - i32.store offset=16 - local.get $4 - i32.const 8 - i32.mul - i32.add - local.set $3 - local.get $3 - local.get $1 - i32.store8 - local.get $0 -======= end memory.size local.set $7 @@ -2211,7 +1980,6 @@ i32.const 1 i32.or call $~lib/rt/common/BLOCK#set:mmInfo ->>>>>>> master local.get $0 local.get $5 call $~lib/rt/tlsf/insertBlock @@ -2230,15 +1998,9 @@ i32.add local.get $5 i32.load -<<<<<<< HEAD - local.get $2 - local.get $0 - i32.load offset=4 -======= i32.const 3 i32.const -1 i32.xor ->>>>>>> master i32.and i32.add local.get $1 @@ -2246,16 +2008,6 @@ local.get $5 i32.const 4 i32.add -<<<<<<< HEAD - local.set $4 - local.get $3 - local.get $4 - i32.load - i32.store offset=4 - local.get $4 - local.get $3 - i32.store -======= local.get $5 i32.load i32.const 3 @@ -2269,7 +2021,6 @@ i32.xor i32.and call $~lib/rt/common/BLOCK#set:mmInfo ->>>>>>> master end ) (func $~lib/rt/tlsf/allocateBlock (param $0 i32) (param $1 i32) (result i32) @@ -2728,34 +2479,96 @@ local.get $1 i32.store offset=20 ) - (func $~lib/util/hash/hash8 (param $0 i32) (result i32) - i32.const -2128831035 - local.get $0 - i32.xor - i32.const 16777619 - i32.mul - ) - (func $~lib/set/Set#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.get $2 - local.get $0 - i32.load offset=4 - i32.and + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 1 i32.const 4 - i32.mul - i32.add - i32.load - local.set $3 - loop $while-continue|0 - local.get $3 - local.set $4 - local.get $4 - if - local.get $3 + i32.le_u + drop + local.get $0 + i32.const 24 + i32.shl + i32.const 24 + i32.shr_s + local.set $2 + i32.const 1 + local.set $1 + i32.const 0 + i32.const 374761393 + i32.add + local.get $1 + i32.add + local.set $3 + local.get $3 + local.get $2 + i32.const -1028477379 + i32.mul + i32.add + local.set $3 + local.get $3 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 15 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -2048144777 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 13 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -1028477379 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 16 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + return + ) + (func $~lib/set/Set#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + i32.load + local.get $2 + local.get $0 + i32.load offset=4 + i32.and + i32.const 4 + i32.mul + i32.add + i32.load + local.set $3 + loop $while-continue|0 + local.get $3 + local.set $4 + local.get $4 + if + local.get $3 i32.load offset=4 local.set $5 local.get $5 @@ -2882,23 +2695,8 @@ local.get $11 local.get $12 call $~lib/set/SetEntry#set:key - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 1 - i32.eq - drop - local.get $13 - call $~lib/util/hash/hash8 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -4459,6 +4257,73 @@ local.get $1 i32.store offset=20 ) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 1 + i32.const 4 + i32.le_u + drop + local.get $0 + i32.const 255 + i32.and + local.set $2 + i32.const 1 + local.set $1 + i32.const 0 + i32.const 374761393 + i32.add + local.get $1 + i32.add + local.set $3 + local.get $3 + local.get $2 + i32.const -1028477379 + i32.mul + i32.add + local.set $3 + local.get $3 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 15 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -2048144777 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 13 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -1028477379 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 16 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + return + ) (func $~lib/set/Set#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) @@ -4604,23 +4469,8 @@ local.get $11 local.get $12 call $~lib/set/SetEntry#set:key - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 1 - i32.eq - drop - local.get $13 - call $~lib/util/hash/hash8 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -4817,27 +4667,74 @@ local.get $1 i32.store offset=20 ) - (func $~lib/util/hash/hash16 (param $0 i32) (result i32) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) (local $1 i32) - i32.const -2128831035 + (local $2 i32) + (local $3 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 2 + i32.const 4 + i32.le_u + drop + local.get $0 + i32.const 16 + i32.shl + i32.const 16 + i32.shr_s + local.set $2 + i32.const 2 local.set $1 + i32.const 0 + i32.const 374761393 + i32.add local.get $1 - local.get $0 - i32.const 255 - i32.and + i32.add + local.set $3 + local.get $3 + local.get $2 + i32.const -1028477379 + i32.mul + i32.add + local.set $3 + local.get $3 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 15 + i32.shr_u i32.xor - i32.const 16777619 + local.set $3 + local.get $3 + i32.const -2048144777 i32.mul - local.set $1 - local.get $1 - local.get $0 - i32.const 8 + local.set $3 + local.get $3 + local.get $3 + i32.const 13 i32.shr_u i32.xor - i32.const 16777619 + local.set $3 + local.get $3 + i32.const -1028477379 i32.mul - local.set $1 - local.get $1 + local.set $3 + local.get $3 + local.get $3 + i32.const 16 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + return ) (func $~lib/set/Set#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -4986,27 +4883,8 @@ local.get $11 local.get $12 call $~lib/set/SetEntry#set:key - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq - drop - local.get $13 - call $~lib/util/hash/hash16 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -5203,16 +5081,83 @@ local.get $1 i32.store offset=20 ) - (func $~lib/set/Set#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.get $2 - local.get $0 - i32.load offset=4 - i32.and + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 2 + i32.const 4 + i32.le_u + drop + local.get $0 + i32.const 65535 + i32.and + local.set $2 + i32.const 2 + local.set $1 + i32.const 0 + i32.const 374761393 + i32.add + local.get $1 + i32.add + local.set $3 + local.get $3 + local.get $2 + i32.const -1028477379 + i32.mul + i32.add + local.set $3 + local.get $3 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 15 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -2048144777 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 13 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -1028477379 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 16 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + return + ) + (func $~lib/set/Set#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + i32.load + local.get $2 + local.get $0 + i32.load offset=4 + i32.and i32.const 4 i32.mul i32.add @@ -5348,27 +5293,8 @@ local.get $11 local.get $12 call $~lib/set/SetEntry#set:key - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq - drop - local.get $13 - call $~lib/util/hash/hash16 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -5565,47 +5491,70 @@ local.get $1 i32.store offset=20 ) - (func $~lib/util/hash/hash32 (param $0 i32) (result i32) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) (local $1 i32) - i32.const -2128831035 - local.set $1 - local.get $1 + (local $2 i32) + (local $3 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 4 + i32.const 4 + i32.le_u + drop local.get $0 - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul + local.set $2 + i32.const 4 local.set $1 + i32.const 0 + i32.const 374761393 + i32.add local.get $1 - local.get $0 - i32.const 8 + i32.add + local.set $3 + local.get $3 + local.get $2 + i32.const -1028477379 + i32.mul + i32.add + local.set $3 + local.get $3 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 15 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 + local.set $3 + local.get $3 + i32.const -2048144777 i32.mul - local.set $1 - local.get $1 - local.get $0 - i32.const 16 + local.set $3 + local.get $3 + local.get $3 + i32.const 13 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 + local.set $3 + local.get $3 + i32.const -1028477379 i32.mul - local.set $1 - local.get $1 - local.get $0 - i32.const 24 + local.set $3 + local.get $3 + local.get $3 + i32.const 16 i32.shr_u i32.xor - i32.const 16777619 - i32.mul - local.set $1 - local.get $1 + local.set $3 + local.get $3 + return ) (func $~lib/set/Set#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -5750,31 +5699,8 @@ local.get $11 local.get $12 call $~lib/set/SetEntry#set:key - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $13 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -5971,6 +5897,71 @@ local.get $1 i32.store offset=20 ) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) + (local $1 i32) + (local $2 i32) + (local $3 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 4 + i32.const 4 + i32.le_u + drop + local.get $0 + local.set $2 + i32.const 4 + local.set $1 + i32.const 0 + i32.const 374761393 + i32.add + local.get $1 + i32.add + local.set $3 + local.get $3 + local.get $2 + i32.const -1028477379 + i32.mul + i32.add + local.set $3 + local.get $3 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 15 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -2048144777 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 13 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -1028477379 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 16 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + return + ) (func $~lib/set/Set#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) @@ -6114,31 +6105,8 @@ local.get $11 local.get $12 call $~lib/set/SetEntry#set:key - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $13 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -6335,93 +6303,87 @@ local.get $1 i32.store offset=20 ) - (func $~lib/util/hash/hash64 (param $0 i64) (result i32) - (local $1 i32) + (func $~lib/util/hash/HASH (param $0 i64) (result i32) + (local $1 i64) (local $2 i32) - (local $3 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 8 + i32.const 4 + i32.le_u + drop + i32.const 8 + i32.const 8 + i32.eq + drop local.get $0 - i32.wrap_i64 local.set $1 - local.get $0 - i64.const 32 - i64.shr_u - i32.wrap_i64 + i32.const 0 + i32.const 374761393 + i32.add + i32.const 8 + i32.add local.set $2 - i32.const -2128831035 - local.set $3 - local.get $3 - local.get $1 - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul - local.set $3 - local.get $3 + local.get $2 local.get $1 - i32.const 8 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 + i32.wrap_i64 + i32.const -1028477379 i32.mul - local.set $3 - local.get $3 - local.get $1 - i32.const 16 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 + i32.add + local.set $2 + local.get $2 + i32.const 17 + i32.rotl + i32.const 668265263 i32.mul - local.set $3 - local.get $3 + local.set $2 + local.get $2 local.get $1 - i32.const 24 - i32.shr_u - i32.xor - i32.const 16777619 + i64.const 32 + i64.shr_u + i32.wrap_i64 + i32.const -1028477379 i32.mul - local.set $3 - local.get $3 + i32.add + local.set $2 local.get $2 - i32.const 255 - i32.and - i32.xor - i32.const 16777619 + i32.const 17 + i32.rotl + i32.const 668265263 i32.mul - local.set $3 - local.get $3 + local.set $2 local.get $2 - i32.const 8 + local.get $2 + i32.const 15 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 + local.set $2 + local.get $2 + i32.const -2048144777 i32.mul - local.set $3 - local.get $3 + local.set $2 local.get $2 - i32.const 16 + local.get $2 + i32.const 13 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 + local.set $2 + local.get $2 + i32.const -1028477379 i32.mul - local.set $3 - local.get $3 + local.set $2 local.get $2 - i32.const 24 + local.get $2 + i32.const 16 i32.shr_u i32.xor - i32.const 16777619 - i32.mul - local.set $3 - local.get $3 + local.set $2 + local.get $2 + return ) (func $~lib/set/Set#find (param $0 i32) (param $1 i64) (param $2 i32) (result i32) (local $3 i32) @@ -6495,9 +6457,8 @@ (local $10 i32) (local $11 i32) (local $12 i64) - (local $13 i64) + (local $13 i32) (local $14 i32) - (local $15 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -6567,49 +6528,22 @@ local.get $11 local.get $12 call $~lib/set/SetEntry#set:key - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $13 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and - local.set $14 + local.set $13 local.get $3 - local.get $14 + local.get $13 i32.const 4 i32.mul i32.add - local.set $15 + local.set $14 local.get $11 - local.get $15 + local.get $14 i32.load call $~lib/set/SetEntry#set:taggedNext - local.get $15 + local.get $14 local.get $8 i32.store local.get $8 @@ -6792,6 +6726,88 @@ local.get $1 i32.store offset=20 ) + (func $~lib/util/hash/HASH (param $0 i64) (result i32) + (local $1 i64) + (local $2 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 8 + i32.const 4 + i32.le_u + drop + i32.const 8 + i32.const 8 + i32.eq + drop + local.get $0 + local.set $1 + i32.const 0 + i32.const 374761393 + i32.add + i32.const 8 + i32.add + local.set $2 + local.get $2 + local.get $1 + i32.wrap_i64 + i32.const -1028477379 + i32.mul + i32.add + local.set $2 + local.get $2 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $2 + local.get $2 + local.get $1 + i64.const 32 + i64.shr_u + i32.wrap_i64 + i32.const -1028477379 + i32.mul + i32.add + local.set $2 + local.get $2 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 15 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + i32.const -2048144777 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 13 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + i32.const -1028477379 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 16 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + return + ) (func $~lib/set/Set#find (param $0 i32) (param $1 i64) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) @@ -6864,9 +6880,8 @@ (local $10 i32) (local $11 i32) (local $12 i64) - (local $13 i64) + (local $13 i32) (local $14 i32) - (local $15 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -6936,49 +6951,22 @@ local.get $11 local.get $12 call $~lib/set/SetEntry#set:key - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $13 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and - local.set $14 + local.set $13 local.get $3 - local.get $14 + local.get $13 i32.const 4 i32.mul i32.add - local.set $15 + local.set $14 local.get $11 - local.get $15 + local.get $14 i32.load call $~lib/set/SetEntry#set:taggedNext - local.get $15 + local.get $14 local.get $8 i32.store local.get $8 @@ -7161,13 +7149,79 @@ local.get $1 i32.store offset=20 ) - (func $~lib/set/Set#find (param $0 i32) (param $1 f32) (param $2 i32) (result i32) + (func $~lib/util/hash/HASH (param $0 f32) (result i32) + (local $1 i32) + (local $2 i32) (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.get $2 + i32.const 0 + drop + i32.const 0 + drop + i32.const 1 + drop + i32.const 4 + i32.const 4 + i32.eq + drop + local.get $0 + i32.reinterpret_f32 + local.set $1 + i32.const 4 + local.set $2 + i32.const 0 + i32.const 374761393 + i32.add + local.get $2 + i32.add + local.set $3 + local.get $3 + local.get $1 + i32.const -1028477379 + i32.mul + i32.add + local.set $3 + local.get $3 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 15 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -2048144777 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 13 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -1028477379 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 16 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + return + ) + (func $~lib/set/Set#find (param $0 i32) (param $1 f32) (param $2 i32) (result i32) + (local $3 i32) + (local $4 i32) + (local $5 i32) + local.get $0 + i32.load + local.get $2 local.get $0 i32.load offset=4 i32.and @@ -7233,9 +7287,8 @@ (local $10 i32) (local $11 i32) (local $12 f32) - (local $13 f32) + (local $13 i32) (local $14 i32) - (local $15 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -7305,38 +7358,22 @@ local.get $11 local.get $12 call $~lib/set/SetEntry#set:key - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $13 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and - local.set $14 + local.set $13 local.get $3 - local.get $14 + local.get $13 i32.const 4 i32.mul i32.add - local.set $15 + local.set $14 local.get $11 - local.get $15 + local.get $14 i32.load call $~lib/set/SetEntry#set:taggedNext - local.get $15 + local.get $14 local.get $8 i32.store local.get $8 @@ -7519,6 +7556,89 @@ local.get $1 i32.store offset=20 ) + (func $~lib/util/hash/HASH (param $0 f64) (result i32) + (local $1 i64) + (local $2 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 1 + drop + i32.const 8 + i32.const 4 + i32.eq + drop + i32.const 8 + i32.const 8 + i32.eq + drop + local.get $0 + i64.reinterpret_f64 + local.set $1 + i32.const 0 + i32.const 374761393 + i32.add + i32.const 8 + i32.add + local.set $2 + local.get $2 + local.get $1 + i32.wrap_i64 + i32.const -1028477379 + i32.mul + i32.add + local.set $2 + local.get $2 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $2 + local.get $2 + local.get $1 + i64.const 32 + i64.shr_u + i32.wrap_i64 + i32.const -1028477379 + i32.mul + i32.add + local.set $2 + local.get $2 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 15 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + i32.const -2048144777 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 13 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + i32.const -1028477379 + i32.mul + local.set $2 + local.get $2 + local.get $2 + i32.const 16 + i32.shr_u + i32.xor + local.set $2 + local.get $2 + return + ) (func $~lib/set/Set#find (param $0 i32) (param $1 f64) (param $2 i32) (result i32) (local $3 i32) (local $4 i32) @@ -7591,9 +7711,8 @@ (local $10 i32) (local $11 i32) (local $12 f64) - (local $13 f64) + (local $13 i32) (local $14 i32) - (local $15 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -7663,42 +7782,22 @@ local.get $11 local.get $12 call $~lib/set/SetEntry#set:key - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $13 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and - local.set $14 + local.set $13 local.get $3 - local.get $14 + local.get $13 i32.const 4 i32.mul i32.add - local.set $15 + local.set $14 local.get $11 - local.get $15 + local.get $14 i32.load call $~lib/set/SetEntry#set:taggedNext - local.get $15 + local.get $14 local.get $8 i32.store local.get $8 @@ -8433,7 +8532,6 @@ ) (func $~lib/set/Set#has (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -8443,42 +8541,23 @@ i32.const 0 i32.store local.get $0 - local.set $3 + local.set $2 global.get $~lib/memory/__stack_pointer - local.get $3 + local.get $2 i32.store - local.get $3 + local.get $2 local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 1 - i32.eq - drop - local.get $2 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/util/hash/hash8 - br $~lib/util/hash/HASH|inlined.0 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find i32.const 0 i32.ne - local.set $3 + local.set $2 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $3 + local.get $2 ) (func $~lib/set/Set#add (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -8493,28 +8572,9 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 1 - i32.eq - drop - local.get $2 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/util/hash/hash8 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $3 + local.get $1 + call $~lib/util/hash/HASH + local.set $2 local.get $0 local.set $5 global.get $~lib/memory/__stack_pointer @@ -8522,10 +8582,10 @@ i32.store local.get $5 local.get $1 - local.get $3 + local.get $2 call $~lib/set/Set#find - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.eqz if local.get $0 @@ -8567,16 +8627,16 @@ local.get $0 local.get $0 i32.load offset=16 - local.tee $2 + local.tee $4 i32.const 1 i32.add call $~lib/set/Set#set:entriesOffset - local.get $2 + local.get $4 i32.const 8 i32.mul i32.add - local.set $4 - local.get $4 + local.set $3 + local.get $3 local.get $1 call $~lib/set/SetEntry#set:key i32.const 0 @@ -8589,20 +8649,20 @@ call $~lib/set/Set#set:entriesCount local.get $0 i32.load - local.get $3 + local.get $2 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $2 + local.set $4 + local.get $3 local.get $4 - local.get $2 i32.load call $~lib/set/SetEntry#set:taggedNext - local.get $2 local.get $4 + local.get $3 i32.store end local.get $0 @@ -8778,30 +8838,11 @@ i32.store local.get $6 local.get $1 - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 1 - i32.eq - drop - local.get $2 - i32.const 24 - i32.shl - i32.const 24 - i32.shr_s - call $~lib/util/hash/hash8 - br $~lib/util/hash/HASH|inlined.3 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 0 @@ -8813,8 +8854,8 @@ local.get $6 return end - local.get $3 - local.get $3 + local.get $2 + local.get $2 i32.load offset=4 i32.const 1 i32.or @@ -8829,16 +8870,16 @@ i32.load offset=4 i32.const 1 i32.shr_u - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.const 1 i32.add i32.const 4 - local.tee $2 + local.tee $4 local.get $0 i32.load offset=20 local.tee $5 - local.get $2 + local.get $4 local.get $5 i32.gt_u select @@ -8863,7 +8904,7 @@ local.get $6 i32.store local.get $6 - local.get $4 + local.get $3 call $~lib/set/Set#rehash end i32.const 1 @@ -9391,7 +9432,6 @@ ) (func $~lib/set/Set#has (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -9401,40 +9441,23 @@ i32.const 0 i32.store local.get $0 - local.set $3 + local.set $2 global.get $~lib/memory/__stack_pointer - local.get $3 + local.get $2 i32.store - local.get $3 + local.get $2 local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 1 - i32.eq - drop - local.get $2 - i32.const 255 - i32.and - call $~lib/util/hash/hash8 - br $~lib/util/hash/HASH|inlined.0 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find i32.const 0 i32.ne - local.set $3 + local.set $2 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $3 + local.get $2 ) (func $~lib/set/Set#add (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -9449,26 +9472,9 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 1 - i32.eq - drop - local.get $2 - i32.const 255 - i32.and - call $~lib/util/hash/hash8 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $3 + local.get $1 + call $~lib/util/hash/HASH + local.set $2 local.get $0 local.set $5 global.get $~lib/memory/__stack_pointer @@ -9476,10 +9482,10 @@ i32.store local.get $5 local.get $1 - local.get $3 + local.get $2 call $~lib/set/Set#find - local.set $4 - local.get $4 + local.set $3 + local.get $3 i32.eqz if local.get $0 @@ -9521,16 +9527,16 @@ local.get $0 local.get $0 i32.load offset=16 - local.tee $2 + local.tee $4 i32.const 1 i32.add call $~lib/set/Set#set:entriesOffset - local.get $2 + local.get $4 i32.const 8 i32.mul i32.add - local.set $4 - local.get $4 + local.set $3 + local.get $3 local.get $1 call $~lib/set/SetEntry#set:key i32.const 0 @@ -9543,20 +9549,20 @@ call $~lib/set/Set#set:entriesCount local.get $0 i32.load - local.get $3 + local.get $2 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $2 + local.set $4 + local.get $3 local.get $4 - local.get $2 i32.load call $~lib/set/SetEntry#set:taggedNext - local.get $2 local.get $4 + local.get $3 i32.store end local.get $0 @@ -9732,36 +9738,11 @@ i32.store local.get $6 local.get $1 -<<<<<<< HEAD local.get $1 - call $~lib/util/hash/HASH - call $~lib/set/Set#find + call $~lib/util/hash/HASH + call $~lib/set/Set#find local.set $2 local.get $2 -======= - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 1 - i32.eq - drop - local.get $2 - i32.const 255 - i32.and - call $~lib/util/hash/hash8 - br $~lib/util/hash/HASH|inlined.3 - end - call $~lib/set/Set#find - local.set $3 - local.get $3 ->>>>>>> master i32.eqz if i32.const 0 @@ -9773,15 +9754,8 @@ local.get $6 return end -<<<<<<< HEAD - i32.const 0 - drop local.get $2 local.get $2 -======= - local.get $3 - local.get $3 ->>>>>>> master i32.load offset=4 i32.const 1 i32.or @@ -9825,18 +9799,13 @@ end if local.get $0 -<<<<<<< HEAD - local.get $3 - call $~lib/set/Set#rehash -======= local.set $6 global.get $~lib/memory/__stack_pointer local.get $6 i32.store local.get $6 - local.get $4 + local.get $3 call $~lib/set/Set#rehash ->>>>>>> master end i32.const 1 local.set $6 @@ -10180,14 +10149,13 @@ i32.store offset=4 local.get $9 local.get $5 -<<<<<<< HEAD - call $~lib/set/Set#has + call $~lib/set/Set#has i32.eqz i32.eqz if i32.const 0 - i32.const 336 - i32.const 43 + i32.const 544 + i32.const 33 i32.const 5 call $~lib/builtins/abort unreachable @@ -10196,259 +10164,27 @@ i32.const 1 i32.add local.set $5 - br $for-loop|8 + br $for-loop|6 end end local.get $0 - call $~lib/set/Set#get:size + local.set $9 + global.get $~lib/memory/__stack_pointer + local.get $9 + i32.store offset=4 + local.get $9 + call $~lib/set/Set#get:size i32.const 50 i32.eq i32.eqz if i32.const 0 - i32.const 336 - i32.const 45 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - call $~lib/set/Set#clear - local.get $0 - call $~lib/set/Set#get:size - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 336 - i32.const 49 + i32.const 544 + i32.const 35 i32.const 3 call $~lib/builtins/abort unreachable end - local.get $1 - call $~lib/rt/pure/__release - local.get $4 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - ) - (func $~lib/set/Set#constructor (param $0 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 24 - i32.const 5 - call $~lib/rt/pure/__new - call $~lib/rt/pure/__retain - local.set $0 - end - local.get $0 - i32.const 0 - i32.const 4 - i32.const 4 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - i32.store - local.get $0 - i32.const 4 - i32.const 1 - i32.sub - i32.store offset=4 - local.get $0 - i32.const 0 - i32.const 4 - i32.const 8 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - i32.store offset=8 - local.get $0 - i32.const 4 - i32.store offset=12 - local.get $0 - i32.const 0 - i32.store offset=16 - local.get $0 - i32.const 0 - i32.store offset=20 - local.get $0 - ) - (func $~lib/util/hash/HASH (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - i32.const 4 - i32.le_u - drop - local.get $0 - i32.const 255 - i32.and - local.set $2 - i32.const 1 - local.set $1 - i32.const 0 - i32.const 374761393 - i32.add - local.get $1 - i32.add - local.set $3 - local.get $3 - local.get $2 - i32.const -1028477379 - i32.mul - i32.add - local.set $3 - local.get $3 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 15 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -2048144777 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 13 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -1028477379 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 16 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - return - ) - (func $~lib/set/Set#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.get $2 - local.get $0 - i32.load offset=4 - i32.and - i32.const 4 - i32.mul - i32.add - i32.load - local.set $3 - loop $while-continue|0 - local.get $3 - local.set $4 - local.get $4 - if - local.get $3 - i32.load offset=4 - local.set $5 - local.get $5 - i32.const 1 - i32.and -======= - call $~lib/set/Set#has - i32.eqz ->>>>>>> master - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 33 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $5 - i32.const 1 - i32.add - local.set $5 - br $for-loop|6 - end - end -<<<<<<< HEAD - i32.const 0 - ) - (func $~lib/set/Set#has (param $0 i32) (param $1 i32) (result i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/set/Set#find - i32.const 0 - i32.ne - ) - (func $~lib/set/Set#rehash (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - local.get $1 - i32.const 1 - i32.add - local.set $2 - i32.const 0 - local.get $2 - i32.const 4 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $3 - local.get $2 - i32.const 8 - i32.mul - i32.const 3 - i32.div_s - local.set $4 -======= - local.get $0 - local.set $9 - global.get $~lib/memory/__stack_pointer - local.get $9 - i32.store offset=4 - local.get $9 - call $~lib/set/Set#get:size - i32.const 50 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 35 - i32.const 3 - call $~lib/builtins/abort - unreachable - end ->>>>>>> master i32.const 0 local.set $5 loop $for-loop|8 @@ -10471,45 +10207,12 @@ i32.eqz i32.eqz if -<<<<<<< HEAD - local.get $8 - local.set $11 - local.get $10 - i32.load8_u - local.set $12 - local.get $11 - local.get $12 - i32.store8 - local.get $12 - call $~lib/util/hash/HASH - local.get $1 - i32.and - local.set $13 - local.get $3 - local.get $13 - i32.const 4 - i32.mul - i32.add - local.set $14 - local.get $11 - local.get $14 - i32.load - i32.store offset=4 - local.get $14 - local.get $8 - i32.store - local.get $8 - i32.const 8 - i32.add - local.set $8 -======= i32.const 0 i32.const 544 i32.const 39 i32.const 5 call $~lib/builtins/abort unreachable ->>>>>>> master end local.get $0 local.set $9 @@ -10621,7 +10324,6 @@ ) (func $~lib/set/Set#has (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -10631,56 +10333,28 @@ i32.const 0 i32.store local.get $0 - local.set $3 + local.set $2 global.get $~lib/memory/__stack_pointer - local.get $3 + local.get $2 i32.store - local.get $3 + local.get $2 local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq - drop - local.get $2 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/util/hash/hash16 - br $~lib/util/hash/HASH|inlined.0 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find i32.const 0 i32.ne - local.set $3 + local.set $2 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $3 + local.get $2 ) (func $~lib/set/Set#add (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) -<<<<<<< HEAD - local.get $1 - call $~lib/util/hash/HASH - local.set $2 -======= (local $5 i32) global.get $~lib/memory/__stack_pointer i32.const 4 @@ -10690,33 +10364,9 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq - drop - local.get $2 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/util/hash/hash16 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $3 ->>>>>>> master + local.get $1 + call $~lib/util/hash/HASH + local.set $2 local.get $0 local.set $5 global.get $~lib/memory/__stack_pointer @@ -10724,17 +10374,10 @@ i32.store local.get $5 local.get $1 -<<<<<<< HEAD local.get $2 - call $~lib/set/Set#find + call $~lib/set/Set#find local.set $3 local.get $3 -======= - local.get $3 - call $~lib/set/Set#find - local.set $4 - local.get $4 ->>>>>>> master i32.eqz if local.get $0 @@ -10779,13 +10422,8 @@ local.tee $4 i32.const 1 i32.add -<<<<<<< HEAD - i32.store offset=16 - local.get $4 -======= call $~lib/set/Set#set:entriesOffset - local.get $2 ->>>>>>> master + local.get $4 i32.const 8 i32.mul i32.add @@ -10814,12 +10452,7 @@ local.get $3 local.get $4 i32.load -<<<<<<< HEAD - i32.store offset=4 -======= call $~lib/set/SetEntry#set:taggedNext - local.get $2 ->>>>>>> master local.get $4 local.get $3 i32.store @@ -10997,44 +10630,13 @@ i32.store local.get $6 local.get $1 -<<<<<<< HEAD local.get $1 - call $~lib/util/hash/HASH - call $~lib/set/Set#find + call $~lib/util/hash/HASH + call $~lib/set/Set#find local.set $2 local.get $2 -======= - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq - drop - local.get $2 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - call $~lib/util/hash/hash16 - br $~lib/util/hash/HASH|inlined.3 - end - call $~lib/set/Set#find - local.set $3 - local.get $3 ->>>>>>> master - i32.eqz - if + i32.eqz + if i32.const 0 local.set $6 global.get $~lib/memory/__stack_pointer @@ -11044,15 +10646,8 @@ local.get $6 return end -<<<<<<< HEAD - i32.const 0 - drop local.get $2 local.get $2 -======= - local.get $3 - local.get $3 ->>>>>>> master i32.load offset=4 i32.const 1 i32.or @@ -11096,18 +10691,13 @@ end if local.get $0 -<<<<<<< HEAD - local.get $3 - call $~lib/set/Set#rehash -======= local.set $6 global.get $~lib/memory/__stack_pointer local.get $6 i32.store local.get $6 - local.get $4 + local.get $3 call $~lib/set/Set#rehash ->>>>>>> master end i32.const 1 local.set $6 @@ -11634,7 +11224,6 @@ ) (func $~lib/set/Set#has (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -11642,176 +11231,25 @@ call $~stack_check global.get $~lib/memory/__stack_pointer i32.const 0 -<<<<<<< HEAD - i32.store offset=20 - local.get $0 - ) - (func $~lib/util/hash/HASH (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 4 - i32.le_u - drop + i32.store local.get $0 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s local.set $2 - i32.const 2 - local.set $1 - i32.const 0 - i32.const 374761393 - i32.add - local.get $1 - i32.add - local.set $3 - local.get $3 - local.get $2 - i32.const -1028477379 - i32.mul - i32.add - local.set $3 - local.get $3 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 15 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -2048144777 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 13 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -1028477379 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 16 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - return - ) - (func $~lib/set/Set#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load + global.get $~lib/memory/__stack_pointer local.get $2 -======= i32.store ->>>>>>> master - local.get $0 - local.set $3 -<<<<<<< HEAD - loop $while-continue|0 - local.get $3 - local.set $4 - local.get $4 - if - local.get $3 - i32.load offset=4 - local.set $5 - local.get $5 - i32.const 1 - i32.and - i32.eqz - if (result i32) - local.get $3 - i32.load16_s - local.get $1 - i32.const 16 - i32.shl - i32.const 16 - i32.shr_s - i32.eq - else - i32.const 0 - end - if - local.get $3 - return - end - local.get $5 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 - br $while-continue|0 - end - end - i32.const 0 - ) - (func $~lib/set/Set#has (param $0 i32) (param $1 i32) (result i32) - local.get $0 - local.get $1 + local.get $2 local.get $1 - call $~lib/util/hash/HASH - call $~lib/set/Set#find -======= - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store - local.get $3 local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq - drop - local.get $2 - i32.const 65535 - i32.and - call $~lib/util/hash/hash16 - br $~lib/util/hash/HASH|inlined.0 - end + call $~lib/util/hash/HASH call $~lib/set/Set#find ->>>>>>> master i32.const 0 i32.ne - local.set $3 + local.set $2 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $3 + local.get $2 ) (func $~lib/set/Set#add (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -11825,185 +11263,28 @@ call $~stack_check global.get $~lib/memory/__stack_pointer i32.const 0 -<<<<<<< HEAD - local.get $4 - i32.const 8 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 - local.get $0 - i32.load offset=8 - local.set $6 - local.get $6 + i32.store + local.get $1 + call $~lib/util/hash/HASH + local.set $2 local.get $0 - i32.load offset=16 - i32.const 8 - i32.mul - i32.add - local.set $7 + local.set $5 + global.get $~lib/memory/__stack_pointer local.get $5 - local.set $8 - loop $while-continue|0 - local.get $6 - local.get $7 - i32.ne - local.set $9 - local.get $9 - if - local.get $6 - local.set $10 - local.get $10 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $11 - local.get $10 - i32.load16_s - local.set $12 - local.get $11 - local.get $12 - i32.store16 - local.get $12 - call $~lib/util/hash/HASH - local.get $1 - i32.and - local.set $13 - local.get $3 - local.get $13 - i32.const 4 - i32.mul - i32.add - local.set $14 - local.get $11 - local.get $14 - i32.load - i32.store offset=4 - local.get $14 - local.get $8 - i32.store - local.get $8 - i32.const 8 - i32.add - local.set $8 - end - local.get $6 - i32.const 8 - i32.add - local.set $6 - br $while-continue|0 - end - end - local.get $0 - local.tee $11 - local.get $3 - local.tee $12 - local.get $11 - i32.load - local.tee $9 - i32.ne - if - local.get $12 - call $~lib/rt/pure/__retain - local.set $12 - local.get $9 - call $~lib/rt/pure/__release - end - local.get $12 - i32.store - local.get $0 - local.get $1 - i32.store offset=4 - local.get $0 - local.tee $13 - local.get $5 - local.tee $14 - local.get $13 - i32.load offset=8 - local.tee $11 - i32.ne - if - local.get $14 - call $~lib/rt/pure/__retain - local.set $14 - local.get $11 - call $~lib/rt/pure/__release - end - local.get $14 - i32.store offset=8 - local.get $0 - local.get $4 - i32.store offset=12 - local.get $0 - local.get $0 - i32.load offset=20 - i32.store offset=16 - local.get $3 - call $~lib/rt/pure/__release - local.get $5 - call $~lib/rt/pure/__release - ) - (func $~lib/set/Set#add (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $1 - call $~lib/util/hash/HASH - local.set $2 -======= - i32.store - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq - drop - local.get $2 - i32.const 65535 - i32.and - call $~lib/util/hash/hash16 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $3 ->>>>>>> master - local.get $0 - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.store - local.get $5 - local.get $1 -<<<<<<< HEAD - local.get $2 - call $~lib/set/Set#find - local.set $3 - local.get $3 -======= - local.get $3 - call $~lib/set/Set#find - local.set $4 - local.get $4 ->>>>>>> master - i32.eqz - if - local.get $0 - i32.load offset=16 - local.get $0 - i32.load offset=12 - i32.eq + i32.store + local.get $5 + local.get $1 + local.get $2 + call $~lib/set/Set#find + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + i32.load offset=16 + local.get $0 + i32.load offset=12 + i32.eq if local.get $0 local.set $5 @@ -12041,114 +11322,40 @@ local.tee $4 i32.const 1 i32.add -<<<<<<< HEAD - i32.store offset=16 - local.get $4 -======= call $~lib/set/Set#set:entriesOffset - local.get $2 ->>>>>>> master + local.get $4 i32.const 8 i32.mul i32.add local.set $3 local.get $3 local.get $1 -<<<<<<< HEAD - i32.store16 -======= call $~lib/set/SetEntry#set:key i32.const 0 drop ->>>>>>> master local.get $0 local.get $0 i32.load offset=20 i32.const 1 i32.add -<<<<<<< HEAD - i32.store offset=20 - local.get $0 - i32.load - local.get $2 -======= call $~lib/set/Set#set:entriesCount local.get $0 i32.load - local.get $3 ->>>>>>> master + local.get $2 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add -<<<<<<< HEAD local.set $4 local.get $3 local.get $4 i32.load - i32.store offset=4 - local.get $4 - local.get $3 - i32.store - end - local.get $0 - call $~lib/rt/pure/__retain - ) - (func $~lib/set/Set#get:size (param $0 i32) (result i32) - local.get $0 - i32.load offset=20 - ) - (func $~lib/array/Array#constructor (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $0 - i32.eqz - if - i32.const 16 - i32.const 8 - call $~lib/rt/pure/__new - call $~lib/rt/pure/__retain - local.set $0 - end - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 - local.get $0 - i32.const 0 - i32.store offset=12 - local.get $1 - i32.const 1073741820 - i32.const 1 - i32.shr_u - i32.gt_u - if - i32.const 224 - i32.const 384 - i32.const 57 - i32.const 60 - call $~lib/builtins/abort - unreachable -======= - local.set $2 - local.get $4 - local.get $2 - i32.load call $~lib/set/SetEntry#set:taggedNext - local.get $2 local.get $4 + local.get $3 i32.store ->>>>>>> master end local.get $0 local.set $5 @@ -12323,40 +11530,11 @@ i32.store local.get $6 local.get $1 -<<<<<<< HEAD local.get $1 - call $~lib/util/hash/HASH - call $~lib/set/Set#find + call $~lib/util/hash/HASH + call $~lib/set/Set#find local.set $2 local.get $2 -======= - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 1 - i32.eq - drop - i32.const 2 - i32.const 2 - i32.eq - drop - local.get $2 - i32.const 65535 - i32.and - call $~lib/util/hash/hash16 - br $~lib/util/hash/HASH|inlined.3 - end - call $~lib/set/Set#find - local.set $3 - local.get $3 ->>>>>>> master i32.eqz if i32.const 0 @@ -12368,15 +11546,8 @@ local.get $6 return end -<<<<<<< HEAD - i32.const 0 - drop local.get $2 local.get $2 -======= - local.get $3 - local.get $3 ->>>>>>> master i32.load offset=4 i32.const 1 i32.or @@ -12395,7 +11566,6 @@ local.get $3 i32.const 1 i32.add -<<<<<<< HEAD i32.const 4 local.tee $4 local.get $0 @@ -12419,73 +11589,6 @@ else i32.const 0 end - if - local.get $0 - local.get $3 - call $~lib/set/Set#rehash - end - i32.const 1 - ) - (func $~lib/set/Set#clear (param $0 i32) - (local $1 i32) - (local $2 i32) - local.get $0 - local.tee $1 - i32.const 0 - i32.const 4 - i32.const 4 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $2 - local.get $1 - i32.load - call $~lib/rt/pure/__release - local.get $2 - i32.store - local.get $0 - i32.const 4 - i32.const 1 - i32.sub - i32.store offset=4 - local.get $0 - local.tee $2 - i32.const 0 - i32.const 4 - i32.const 8 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $1 - local.get $2 - i32.load offset=8 - call $~lib/rt/pure/__release - local.get $1 - i32.store offset=8 - local.get $0 -======= ->>>>>>> master - i32.const 4 - local.tee $2 - local.get $0 - i32.load offset=20 - local.tee $5 - local.get $2 - local.get $5 - i32.gt_u - select - i32.ge_u - if (result i32) - local.get $0 - i32.load offset=20 - local.get $0 - i32.load offset=12 - i32.const 3 - i32.mul - i32.const 4 - i32.div_s - i32.lt_s - else - i32.const 0 - end if local.get $0 local.set $6 @@ -12493,7 +11596,7 @@ local.get $6 i32.store local.get $6 - local.get $4 + local.get $3 call $~lib/set/Set#rehash end i32.const 1 @@ -13013,7 +12116,6 @@ ) (func $~lib/set/Set#has (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -13021,308 +12123,290 @@ call $~stack_check global.get $~lib/memory/__stack_pointer i32.const 0 -<<<<<<< HEAD - i32.store offset=20 + i32.store local.get $0 - ) - (func $~lib/util/hash/HASH (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 2 - i32.const 4 - i32.le_u - drop - local.get $0 - i32.const 65535 - i32.and local.set $2 - i32.const 2 - local.set $1 - i32.const 0 - i32.const 374761393 - i32.add + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + local.get $1 local.get $1 + call $~lib/util/hash/HASH + call $~lib/set/Set#find + i32.const 0 + i32.ne + local.set $2 + global.get $~lib/memory/__stack_pointer + i32.const 4 i32.add - local.set $3 - local.get $3 + global.set $~lib/memory/__stack_pointer local.get $2 - i32.const -1028477379 - i32.mul - i32.add - local.set $3 - local.get $3 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 15 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -2048144777 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 13 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -1028477379 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 16 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - return ) - (func $~lib/set/Set#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/set/Set#add (param $0 i32) (param $1 i32) (result i32) + (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i32.const 0 + i32.store + local.get $1 + call $~lib/util/hash/HASH + local.set $2 local.get $0 - i32.load + local.set $5 + global.get $~lib/memory/__stack_pointer + local.get $5 + i32.store + local.get $5 + local.get $1 local.get $2 - local.get $0 - i32.load offset=4 - i32.and - i32.const 4 - i32.mul - i32.add - i32.load + call $~lib/set/Set#find local.set $3 - loop $while-continue|0 - local.get $3 - local.set $4 - local.get $4 + local.get $3 + i32.eqz + if + local.get $0 + i32.load offset=16 + local.get $0 + i32.load offset=12 + i32.eq if - local.get $3 - i32.load offset=4 + local.get $0 local.set $5 + global.get $~lib/memory/__stack_pointer local.get $5 - i32.const 1 - i32.and - i32.eqz + i32.store + local.get $5 + local.get $0 + i32.load offset=20 + local.get $0 + i32.load offset=12 + i32.const 3 + i32.mul + i32.const 4 + i32.div_s + i32.lt_s if (result i32) - local.get $3 - i32.load16_u - local.get $1 - i32.const 65535 - i32.and - i32.eq + local.get $0 + i32.load offset=4 else - i32.const 0 - end - if - local.get $3 - return + local.get $0 + i32.load offset=4 + i32.const 1 + i32.shl + i32.const 1 + i32.or end - local.get $5 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 - br $while-continue|0 + call $~lib/set/Set#rehash end + local.get $0 + i32.load offset=8 + local.get $0 + local.get $0 + i32.load offset=16 + local.tee $4 + i32.const 1 + i32.add + call $~lib/set/Set#set:entriesOffset + local.get $4 + i32.const 8 + i32.mul + i32.add + local.set $3 + local.get $3 + local.get $1 + call $~lib/set/SetEntry#set:key + i32.const 0 + drop + local.get $0 + local.get $0 + i32.load offset=20 + i32.const 1 + i32.add + call $~lib/set/Set#set:entriesCount + local.get $0 + i32.load + local.get $2 + local.get $0 + i32.load offset=4 + i32.and + i32.const 4 + i32.mul + i32.add + local.set $4 + local.get $3 + local.get $4 + i32.load + call $~lib/set/SetEntry#set:taggedNext + local.get $4 + local.get $3 + i32.store end - i32.const 0 - ) - (func $~lib/set/Set#has (param $0 i32) (param $1 i32) (result i32) local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/set/Set#find - i32.const 0 - i32.ne + local.set $5 + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.add + global.set $~lib/memory/__stack_pointer + local.get $5 ) - (func $~lib/set/Set#rehash (param $0 i32) (param $1 i32) - (local $2 i32) + (func $~lib/array/Array#__set (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i32) - (local $13 i32) - (local $14 i32) - local.get $1 - i32.const 1 - i32.add - local.set $2 - i32.const 0 - local.get $2 + global.get $~lib/memory/__stack_pointer i32.const 4 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $3 - local.get $2 - i32.const 8 - i32.mul - i32.const 3 - i32.div_s - local.set $4 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer i32.const 0 - local.get $4 - i32.const 8 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 + i32.store + local.get $1 + local.get $0 + i32.load offset=12 + i32.ge_u + if + local.get $1 + i32.const 0 + i32.lt_s + if + i32.const 224 + i32.const 592 + i32.const 108 + i32.const 22 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.const 2 + call $~lib/array/ensureSize + local.get $0 + local.get $1 + i32.const 1 + i32.add + call $~lib/array/Array#set:length_ + end + local.get $0 + local.set $3 + global.get $~lib/memory/__stack_pointer + local.get $3 + i32.store + local.get $3 + local.get $1 + local.get $2 + call $~lib/array/Array#__uset + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.add + global.set $~lib/memory/__stack_pointer + ) + (func $~lib/set/Set#values (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) + (local $8 i32) + (local $9 i32) + global.get $~lib/memory/__stack_pointer + i32.const 8 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store local.get $0 i32.load offset=8 - local.set $6 - local.get $6 + local.set $1 local.get $0 i32.load offset=16 - i32.const 8 - i32.mul - i32.add - local.set $7 - local.get $5 - local.set $8 - loop $while-continue|0 + local.set $2 + global.get $~lib/memory/__stack_pointer + i32.const 0 + local.get $2 + call $~lib/array/Array#constructor + local.tee $3 + i32.store + i32.const 0 + local.set $4 + i32.const 0 + local.set $5 + loop $for-loop|0 + local.get $5 + local.get $2 + i32.lt_s + local.set $6 local.get $6 - local.get $7 - i32.ne - local.set $9 - local.get $9 if - local.get $6 - local.set $10 - local.get $10 + local.get $1 + local.get $5 + i32.const 8 + i32.mul + i32.add + local.set $7 + local.get $7 i32.load offset=4 i32.const 1 i32.and i32.eqz if - local.get $8 - local.set $11 - local.get $10 - i32.load16_u - local.set $12 - local.get $11 - local.get $12 - i32.store16 - local.get $12 - call $~lib/util/hash/HASH - local.get $1 - i32.and - local.set $13 local.get $3 - local.get $13 - i32.const 4 - i32.mul - i32.add - local.set $14 - local.get $11 - local.get $14 - i32.load + local.set $9 + global.get $~lib/memory/__stack_pointer + local.get $9 i32.store offset=4 - local.get $14 - local.get $8 - i32.store - local.get $8 - i32.const 8 + local.get $9 + local.get $4 + local.tee $8 + i32.const 1 i32.add - local.set $8 + local.set $4 + local.get $8 + local.get $7 + i32.load + call $~lib/array/Array#__set end - local.get $6 - i32.const 8 + local.get $5 + i32.const 1 i32.add - local.set $6 - br $while-continue|0 + local.set $5 + br $for-loop|0 end end - local.get $0 - local.tee $11 local.get $3 - local.tee $12 - local.get $11 - i32.load - local.tee $9 - i32.ne - if - local.get $12 - call $~lib/rt/pure/__retain - local.set $12 - local.get $9 - call $~lib/rt/pure/__release -======= - i32.store - local.get $0 - local.set $3 + local.set $9 global.get $~lib/memory/__stack_pointer + local.get $9 + i32.store offset=4 + local.get $9 + local.get $4 + call $~lib/array/Array#set:length local.get $3 - i32.store - local.get $3 - local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.0 ->>>>>>> master - end - call $~lib/set/Set#find - i32.const 0 - i32.ne - local.set $3 + local.set $9 global.get $~lib/memory/__stack_pointer - i32.const 4 + i32.const 8 i32.add global.set $~lib/memory/__stack_pointer - local.get $3 + local.get $9 ) - (func $~lib/set/Set#add (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#delete (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) -<<<<<<< HEAD - local.get $1 - call $~lib/util/hash/HASH - local.set $2 -======= (local $5 i32) + (local $6 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -13331,496 +12415,153 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $3 ->>>>>>> master local.get $0 - local.set $5 + local.set $6 global.get $~lib/memory/__stack_pointer - local.get $5 + local.get $6 i32.store - local.get $5 + local.get $6 local.get $1 -<<<<<<< HEAD - local.get $2 - call $~lib/set/Set#find - local.set $3 - local.get $3 -======= - local.get $3 + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find - local.set $4 - local.get $4 ->>>>>>> master + local.set $2 + local.get $2 i32.eqz if - local.get $0 - i32.load offset=16 - local.get $0 - i32.load offset=12 - i32.eq - if - local.get $0 - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.store - local.get $5 - local.get $0 - i32.load offset=20 - local.get $0 - i32.load offset=12 - i32.const 3 - i32.mul - i32.const 4 - i32.div_s - i32.lt_s - if (result i32) - local.get $0 - i32.load offset=4 - else - local.get $0 - i32.load offset=4 - i32.const 1 - i32.shl - i32.const 1 - i32.or - end - call $~lib/set/Set#rehash - end - local.get $0 - i32.load offset=8 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $4 - i32.const 1 - i32.add -<<<<<<< HEAD - i32.store offset=16 - local.get $4 -======= - call $~lib/set/Set#set:entriesOffset - local.get $2 ->>>>>>> master - i32.const 8 - i32.mul - i32.add - local.set $3 - local.get $3 - local.get $1 - call $~lib/set/SetEntry#set:key i32.const 0 - drop - local.get $0 - local.get $0 - i32.load offset=20 - i32.const 1 - i32.add - call $~lib/set/Set#set:entriesCount - local.get $0 - i32.load - local.get $2 - local.get $0 - i32.load offset=4 - i32.and + local.set $6 + global.get $~lib/memory/__stack_pointer i32.const 4 - i32.mul i32.add - local.set $4 - local.get $3 - local.get $4 - i32.load -<<<<<<< HEAD - i32.store offset=4 -======= - call $~lib/set/SetEntry#set:taggedNext - local.get $2 ->>>>>>> master - local.get $4 - local.get $3 - i32.store + global.set $~lib/memory/__stack_pointer + local.get $6 + return end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.or + call $~lib/set/SetEntry#set:taggedNext local.get $0 - local.set $5 - global.get $~lib/memory/__stack_pointer - i32.const 4 + local.get $0 + i32.load offset=20 + i32.const 1 + i32.sub + call $~lib/set/Set#set:entriesCount + local.get $0 + i32.load offset=4 + i32.const 1 + i32.shr_u + local.set $3 + local.get $3 + i32.const 1 i32.add - global.set $~lib/memory/__stack_pointer - local.get $5 - ) - (func $~lib/array/Array#__set (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - global.get $~lib/memory/__stack_pointer i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - local.get $1 + local.tee $4 local.get $0 - i32.load offset=12 + i32.load offset=20 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_u + select i32.ge_u - if - local.get $1 - i32.const 0 - i32.lt_s - if - i32.const 224 - i32.const 592 - i32.const 108 - i32.const 22 - call $~lib/builtins/abort - unreachable - end + if (result i32) local.get $0 - local.get $1 - i32.const 1 - i32.add - i32.const 2 - call $~lib/array/ensureSize + i32.load offset=20 local.get $0 - local.get $1 - i32.const 1 - i32.add - call $~lib/array/Array#set:length_ + i32.load offset=12 + i32.const 3 + i32.mul + i32.const 4 + i32.div_s + i32.lt_s + else + i32.const 0 end - local.get $0 - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store - local.get $3 - local.get $1 - local.get $2 - call $~lib/array/Array#__uset + if + local.get $0 + local.set $6 + global.get $~lib/memory/__stack_pointer + local.get $6 + i32.store + local.get $6 + local.get $3 + call $~lib/set/Set#rehash + end + i32.const 1 + local.set $6 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer + local.get $6 ) - (func $~lib/set/Set#values (param $0 i32) (result i32) + (func $std/set/testNumeric + (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) global.get $~lib/memory/__stack_pointer - i32.const 8 + i32.const 20 i32.sub global.set $~lib/memory/__stack_pointer call $~stack_check global.get $~lib/memory/__stack_pointer i64.const 0 i64.store - local.get $0 - i32.load offset=8 - local.set $1 - local.get $0 - i32.load offset=16 - local.set $2 + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store offset=8 global.get $~lib/memory/__stack_pointer i32.const 0 - local.get $2 - call $~lib/array/Array#constructor - local.tee $3 - i32.store + i32.store offset=16 + global.get $~lib/memory/__stack_pointer i32.const 0 - local.set $4 + call $~lib/set/Set#constructor + local.tee $0 + i32.store i32.const 0 - local.set $5 + local.set $1 loop $for-loop|0 - local.get $5 - local.get $2 + local.get $1 + i32.const 100 i32.lt_s - local.set $6 - local.get $6 + local.set $2 + local.get $2 if - local.get $1 + local.get $0 + local.set $5 + global.get $~lib/memory/__stack_pointer local.get $5 - i32.const 8 - i32.mul - i32.add - local.set $7 - local.get $7 - i32.load offset=4 - i32.const 1 - i32.and + i32.store offset=4 + local.get $5 + local.get $1 + call $~lib/set/Set#has + i32.eqz i32.eqz if - local.get $3 - local.set $9 - global.get $~lib/memory/__stack_pointer - local.get $9 - i32.store offset=4 - local.get $9 - local.get $4 - local.tee $8 - i32.const 1 - i32.add - local.set $4 - local.get $8 - local.get $7 - i32.load - call $~lib/array/Array#__set + i32.const 0 + i32.const 544 + i32.const 6 + i32.const 5 + call $~lib/builtins/abort + unreachable end + local.get $0 + local.set $5 + global.get $~lib/memory/__stack_pointer local.get $5 - i32.const 1 - i32.add - local.set $5 - br $for-loop|0 - end - end - local.get $3 - local.set $9 - global.get $~lib/memory/__stack_pointer - local.get $9 - i32.store offset=4 - local.get $9 - local.get $4 - call $~lib/array/Array#set:length - local.get $3 - local.set $9 - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $9 - ) - (func $~lib/set/Set#delete (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - local.get $0 - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store - local.get $6 - local.get $1 -<<<<<<< HEAD - local.get $1 - call $~lib/util/hash/HASH - call $~lib/set/Set#find - local.set $2 - local.get $2 -======= - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.3 - end - call $~lib/set/Set#find - local.set $3 - local.get $3 ->>>>>>> master - i32.eqz - if - i32.const 0 - local.set $6 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $6 - return - end -<<<<<<< HEAD - i32.const 0 - drop - local.get $2 - local.get $2 -======= - local.get $3 - local.get $3 ->>>>>>> master - i32.load offset=4 - i32.const 1 - i32.or - call $~lib/set/SetEntry#set:taggedNext - local.get $0 - local.get $0 - i32.load offset=20 - i32.const 1 - i32.sub - call $~lib/set/Set#set:entriesCount - local.get $0 - i32.load offset=4 - i32.const 1 - i32.shr_u - local.set $3 - local.get $3 - i32.const 1 - i32.add - i32.const 4 - local.tee $4 - local.get $0 - i32.load offset=20 - local.tee $5 - local.get $4 - local.get $5 - i32.gt_u - select - i32.ge_u - if (result i32) - local.get $0 - i32.load offset=20 - local.get $0 - i32.load offset=12 - i32.const 3 - i32.mul - i32.const 4 - i32.div_s - i32.lt_s - else - i32.const 0 - end - if - local.get $0 -<<<<<<< HEAD - local.get $3 - call $~lib/set/Set#rehash -======= - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store - local.get $6 - local.get $4 - call $~lib/set/Set#rehash ->>>>>>> master - end - i32.const 1 - local.set $6 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $6 - ) - (func $std/set/testNumeric - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - global.get $~lib/memory/__stack_pointer - i32.const 20 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i64.const 0 - i64.store - global.get $~lib/memory/__stack_pointer - i64.const 0 - i64.store offset=8 - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store offset=16 - global.get $~lib/memory/__stack_pointer - i32.const 0 - call $~lib/set/Set#constructor - local.tee $0 - i32.store - i32.const 0 - local.set $1 - loop $for-loop|0 - local.get $1 - i32.const 100 - i32.lt_s - local.set $2 - local.get $2 - if - local.get $0 - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.store offset=4 - local.get $5 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 6 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.store offset=4 - local.get $5 - local.get $1 - call $~lib/set/Set#add - drop - local.get $0 + i32.store offset=4 + local.get $5 + local.get $1 + call $~lib/set/Set#add + drop + local.get $0 local.set $5 global.get $~lib/memory/__stack_pointer local.get $5 @@ -14238,158 +12979,55 @@ local.get $5 call $~lib/set/Set#get:size i32.const 0 -<<<<<<< HEAD - i32.const 4 - i32.const 8 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - i32.store offset=8 - local.get $0 - i32.const 4 - i32.store offset=12 - local.get $0 - i32.const 0 - i32.store offset=16 - local.get $0 - i32.const 0 - i32.store offset=20 - local.get $0 + i32.eq + i32.eqz + if + i32.const 0 + i32.const 544 + i32.const 49 + i32.const 3 + call $~lib/builtins/abort + unreachable + end + global.get $~lib/memory/__stack_pointer + i32.const 20 + i32.add + global.set $~lib/memory/__stack_pointer ) - (func $~lib/util/hash/HASH (param $0 i32) (result i32) - (local $1 i32) + (func $~lib/set/Set#has (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 + global.get $~lib/memory/__stack_pointer i32.const 4 - i32.le_u - drop + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i32.const 0 + i32.store local.get $0 local.set $2 - i32.const 4 - local.set $1 - i32.const 0 - i32.const 374761393 - i32.add - local.get $1 - i32.add - local.set $3 - local.get $3 + global.get $~lib/memory/__stack_pointer local.get $2 - i32.const -1028477379 - i32.mul - i32.add - local.set $3 - local.get $3 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 15 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -2048144777 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 13 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -1028477379 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 16 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - return - ) - (func $~lib/set/Set#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load + i32.store local.get $2 - local.get $0 - i32.load offset=4 - i32.and - i32.const 4 - i32.mul - i32.add - i32.load - local.set $3 - loop $while-continue|0 - local.get $3 - local.set $4 - local.get $4 - if - local.get $3 - i32.load offset=4 - local.set $5 - local.get $5 - i32.const 1 - i32.and - i32.eqz - if (result i32) - local.get $3 - i32.load - local.get $1 - i32.eq - else - i32.const 0 - end - if - local.get $3 - return - end - local.get $5 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 - br $while-continue|0 - end - end + local.get $1 + local.get $1 + call $~lib/util/hash/HASH + call $~lib/set/Set#find i32.const 0 - ) - (func $~lib/set/Set#has (param $0 i32) (param $1 i32) (result i32) -======= - i32.eq - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 49 - i32.const 3 - call $~lib/builtins/abort - unreachable - end + i32.ne + local.set $2 global.get $~lib/memory/__stack_pointer - i32.const 20 + i32.const 4 i32.add global.set $~lib/memory/__stack_pointer + local.get $2 ) - (func $~lib/set/Set#has (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#add (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) + (local $4 i32) + (local $5 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -14398,60 +13036,109 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store ->>>>>>> master + local.get $1 + call $~lib/util/hash/HASH + local.set $2 local.get $0 - local.set $3 + local.set $5 global.get $~lib/memory/__stack_pointer - local.get $3 + local.get $5 i32.store - local.get $3 - local.get $1 -<<<<<<< HEAD + local.get $5 local.get $1 - call $~lib/util/hash/HASH - call $~lib/set/Set#find -======= - block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $2 + call $~lib/set/Set#find + local.set $3 + local.get $3 + i32.eqz + if + local.get $0 + i32.load offset=16 + local.get $0 + i32.load offset=12 + i32.eq + if + local.get $0 + local.set $5 + global.get $~lib/memory/__stack_pointer + local.get $5 + i32.store + local.get $5 + local.get $0 + i32.load offset=20 + local.get $0 + i32.load offset=12 + i32.const 3 + i32.mul + i32.const 4 + i32.div_s + i32.lt_s + if (result i32) + local.get $0 + i32.load offset=4 + else + local.get $0 + i32.load offset=4 + i32.const 1 + i32.shl + i32.const 1 + i32.or + end + call $~lib/set/Set#rehash + end + local.get $0 + i32.load offset=8 + local.get $0 + local.get $0 + i32.load offset=16 + local.tee $4 + i32.const 1 + i32.add + call $~lib/set/Set#set:entriesOffset + local.get $4 + i32.const 8 + i32.mul + i32.add + local.set $3 + local.get $3 local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop + call $~lib/set/SetEntry#set:key i32.const 0 drop - i32.const 4 + local.get $0 + local.get $0 + i32.load offset=20 i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop + i32.add + call $~lib/set/Set#set:entriesCount + local.get $0 + i32.load local.get $2 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.0 + local.get $0 + i32.load offset=4 + i32.and + i32.const 4 + i32.mul + i32.add + local.set $4 + local.get $3 + local.get $4 + i32.load + call $~lib/set/SetEntry#set:taggedNext + local.get $4 + local.get $3 + i32.store end - call $~lib/set/Set#find ->>>>>>> master - i32.const 0 - i32.ne - local.set $3 + local.get $0 + local.set $5 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $3 + local.get $5 ) - (func $~lib/set/Set#add (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) + (func $~lib/array/Array#__set (param $0 i32) (param $1 i32) (param $2 i32) (local $3 i32) - (local $4 i32) - (local $5 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -14459,657 +13146,283 @@ call $~stack_check global.get $~lib/memory/__stack_pointer i32.const 0 -<<<<<<< HEAD - local.get $4 - i32.const 8 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 - local.get $0 - i32.load offset=8 - local.set $6 - local.get $6 + i32.store + local.get $1 local.get $0 - i32.load offset=16 - i32.const 8 - i32.mul - i32.add - local.set $7 - local.get $5 - local.set $8 - loop $while-continue|0 + i32.load offset=12 + i32.ge_u + if + local.get $1 + i32.const 0 + i32.lt_s + if + i32.const 224 + i32.const 592 + i32.const 108 + i32.const 22 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 + i32.const 1 + i32.add + i32.const 2 + call $~lib/array/ensureSize + local.get $0 + local.get $1 + i32.const 1 + i32.add + call $~lib/array/Array#set:length_ + end + local.get $0 + local.set $3 + global.get $~lib/memory/__stack_pointer + local.get $3 + i32.store + local.get $3 + local.get $1 + local.get $2 + call $~lib/array/Array#__uset + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.add + global.set $~lib/memory/__stack_pointer + ) + (func $~lib/set/Set#values (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) + (local $8 i32) + (local $9 i32) + global.get $~lib/memory/__stack_pointer + i32.const 8 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store + local.get $0 + i32.load offset=8 + local.set $1 + local.get $0 + i32.load offset=16 + local.set $2 + global.get $~lib/memory/__stack_pointer + i32.const 0 + local.get $2 + call $~lib/array/Array#constructor + local.tee $3 + i32.store + i32.const 0 + local.set $4 + i32.const 0 + local.set $5 + loop $for-loop|0 + local.get $5 + local.get $2 + i32.lt_s + local.set $6 local.get $6 - local.get $7 - i32.ne - local.set $9 - local.get $9 if - local.get $6 - local.set $10 - local.get $10 + local.get $1 + local.get $5 + i32.const 8 + i32.mul + i32.add + local.set $7 + local.get $7 i32.load offset=4 i32.const 1 i32.and i32.eqz if - local.get $8 - local.set $11 - local.get $10 - i32.load - local.set $12 - local.get $11 - local.get $12 - i32.store - local.get $12 - call $~lib/util/hash/HASH - local.get $1 - i32.and - local.set $13 local.get $3 - local.get $13 - i32.const 4 - i32.mul - i32.add - local.set $14 - local.get $11 - local.get $14 - i32.load + local.set $9 + global.get $~lib/memory/__stack_pointer + local.get $9 i32.store offset=4 - local.get $14 - local.get $8 - i32.store - local.get $8 - i32.const 8 + local.get $9 + local.get $4 + local.tee $8 + i32.const 1 i32.add - local.set $8 + local.set $4 + local.get $8 + local.get $7 + i32.load + call $~lib/array/Array#__set end - local.get $6 - i32.const 8 + local.get $5 + i32.const 1 i32.add - local.set $6 - br $while-continue|0 + local.set $5 + br $for-loop|0 end end - local.get $0 - local.tee $11 local.get $3 - local.tee $12 - local.get $11 - i32.load - local.tee $9 - i32.ne - if - local.get $12 - call $~lib/rt/pure/__retain - local.set $12 - local.get $9 - call $~lib/rt/pure/__release - end - local.get $12 - i32.store - local.get $0 - local.get $1 + local.set $9 + global.get $~lib/memory/__stack_pointer + local.get $9 i32.store offset=4 - local.get $0 - local.tee $13 - local.get $5 - local.tee $14 - local.get $13 - i32.load offset=8 - local.tee $11 - i32.ne - if - local.get $14 - call $~lib/rt/pure/__retain - local.set $14 - local.get $11 - call $~lib/rt/pure/__release - end - local.get $14 - i32.store offset=8 - local.get $0 + local.get $9 local.get $4 - i32.store offset=12 - local.get $0 - local.get $0 - i32.load offset=20 - i32.store offset=16 + call $~lib/array/Array#set:length local.get $3 - call $~lib/rt/pure/__release - local.get $5 - call $~lib/rt/pure/__release + local.set $9 + global.get $~lib/memory/__stack_pointer + i32.const 8 + i32.add + global.set $~lib/memory/__stack_pointer + local.get $9 ) - (func $~lib/set/Set#add (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#delete (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - local.get $1 - call $~lib/util/hash/HASH - local.set $2 -======= + (local $5 i32) + (local $6 i32) + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i32.const 0 i32.store - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $3 ->>>>>>> master local.get $0 - local.set $5 + local.set $6 global.get $~lib/memory/__stack_pointer - local.get $5 + local.get $6 i32.store - local.get $5 + local.get $6 local.get $1 -<<<<<<< HEAD - local.get $2 - call $~lib/set/Set#find - local.set $3 - local.get $3 -======= - local.get $3 + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find - local.set $4 - local.get $4 ->>>>>>> master + local.set $2 + local.get $2 i32.eqz if - local.get $0 - i32.load offset=16 - local.get $0 - i32.load offset=12 - i32.eq - if - local.get $0 - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.store - local.get $5 - local.get $0 - i32.load offset=20 - local.get $0 - i32.load offset=12 - i32.const 3 - i32.mul - i32.const 4 - i32.div_s - i32.lt_s - if (result i32) - local.get $0 - i32.load offset=4 - else - local.get $0 - i32.load offset=4 - i32.const 1 - i32.shl - i32.const 1 - i32.or - end - call $~lib/set/Set#rehash - end - local.get $0 - i32.load offset=8 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $4 - i32.const 1 - i32.add -<<<<<<< HEAD - i32.store offset=16 - local.get $4 -======= - call $~lib/set/Set#set:entriesOffset - local.get $2 ->>>>>>> master - i32.const 8 - i32.mul - i32.add - local.set $3 - local.get $3 - local.get $1 - call $~lib/set/SetEntry#set:key i32.const 0 - drop - local.get $0 - local.get $0 - i32.load offset=20 - i32.const 1 - i32.add - call $~lib/set/Set#set:entriesCount - local.get $0 - i32.load - local.get $2 - local.get $0 - i32.load offset=4 - i32.and + local.set $6 + global.get $~lib/memory/__stack_pointer i32.const 4 - i32.mul i32.add - local.set $4 - local.get $3 - local.get $4 -<<<<<<< HEAD - i32.load - i32.store offset=4 - local.get $4 - local.get $3 - i32.store + global.set $~lib/memory/__stack_pointer + local.get $6 + return end + local.get $2 + local.get $2 + i32.load offset=4 + i32.const 1 + i32.or + call $~lib/set/SetEntry#set:taggedNext local.get $0 - call $~lib/rt/pure/__retain - ) - (func $~lib/set/Set#get:size (param $0 i32) (result i32) local.get $0 i32.load offset=20 - ) - (func $~lib/array/Array#constructor (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $0 - i32.eqz - if - i32.const 16 - i32.const 12 - call $~lib/rt/pure/__new - call $~lib/rt/pure/__retain - local.set $0 - end - local.get $0 - i32.const 0 - i32.store - local.get $0 - i32.const 0 - i32.store offset=4 - local.get $0 - i32.const 0 - i32.store offset=8 + i32.const 1 + i32.sub + call $~lib/set/Set#set:entriesCount local.get $0 - i32.const 0 - i32.store offset=12 - local.get $1 - i32.const 1073741820 - i32.const 2 + i32.load offset=4 + i32.const 1 i32.shr_u - i32.gt_u - if - i32.const 224 - i32.const 384 - i32.const 57 - i32.const 60 - call $~lib/builtins/abort - unreachable -======= - local.get $2 - i32.load - call $~lib/set/SetEntry#set:taggedNext - local.get $2 - local.get $4 - i32.store ->>>>>>> master - end - local.get $0 - local.set $5 - global.get $~lib/memory/__stack_pointer - i32.const 4 + local.set $3 + local.get $3 + i32.const 1 i32.add - global.set $~lib/memory/__stack_pointer - local.get $5 - ) - (func $~lib/array/Array#__set (param $0 i32) (param $1 i32) (param $2 i32) - (local $3 i32) - global.get $~lib/memory/__stack_pointer i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - local.get $1 + local.tee $4 local.get $0 - i32.load offset=12 + i32.load offset=20 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_u + select i32.ge_u - if - local.get $1 - i32.const 0 - i32.lt_s - if - i32.const 224 - i32.const 592 - i32.const 108 - i32.const 22 - call $~lib/builtins/abort - unreachable - end + if (result i32) local.get $0 - local.get $1 - i32.const 1 - i32.add - i32.const 2 - call $~lib/array/ensureSize + i32.load offset=20 local.get $0 - local.get $1 - i32.const 1 - i32.add - call $~lib/array/Array#set:length_ + i32.load offset=12 + i32.const 3 + i32.mul + i32.const 4 + i32.div_s + i32.lt_s + else + i32.const 0 end - local.get $0 - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store - local.get $3 - local.get $1 - local.get $2 - call $~lib/array/Array#__uset + if + local.get $0 + local.set $6 + global.get $~lib/memory/__stack_pointer + local.get $6 + i32.store + local.get $6 + local.get $3 + call $~lib/set/Set#rehash + end + i32.const 1 + local.set $6 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer + local.get $6 ) - (func $~lib/set/Set#values (param $0 i32) (result i32) + (func $std/set/testNumeric + (local $0 i32) (local $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) global.get $~lib/memory/__stack_pointer - i32.const 8 + i32.const 20 i32.sub global.set $~lib/memory/__stack_pointer call $~stack_check global.get $~lib/memory/__stack_pointer i64.const 0 i64.store - local.get $0 - i32.load offset=8 - local.set $1 - local.get $0 - i32.load offset=16 - local.set $2 + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store offset=8 global.get $~lib/memory/__stack_pointer i32.const 0 - local.get $2 - call $~lib/array/Array#constructor - local.tee $3 - i32.store + i32.store offset=16 + global.get $~lib/memory/__stack_pointer i32.const 0 - local.set $4 + call $~lib/set/Set#constructor + local.tee $0 + i32.store i32.const 0 - local.set $5 + local.set $1 loop $for-loop|0 - local.get $5 + local.get $1 + i32.const 100 + i32.lt_u + local.set $2 local.get $2 - i32.lt_s - local.set $6 - local.get $6 if - local.get $1 + local.get $0 + local.set $5 + global.get $~lib/memory/__stack_pointer local.get $5 - i32.const 8 - i32.mul - i32.add - local.set $7 - local.get $7 - i32.load offset=4 - i32.const 1 - i32.and - i32.eqz - if - local.get $3 - local.set $9 - global.get $~lib/memory/__stack_pointer - local.get $9 - i32.store offset=4 - local.get $9 - local.get $4 - local.tee $8 - i32.const 1 - i32.add - local.set $4 - local.get $8 - local.get $7 - i32.load - call $~lib/array/Array#__set - end - local.get $5 - i32.const 1 - i32.add - local.set $5 - br $for-loop|0 - end - end - local.get $3 - local.set $9 - global.get $~lib/memory/__stack_pointer - local.get $9 - i32.store offset=4 - local.get $9 - local.get $4 - call $~lib/array/Array#set:length - local.get $3 - local.set $9 - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $9 - ) - (func $~lib/set/Set#delete (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - local.get $0 - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store - local.get $6 - local.get $1 -<<<<<<< HEAD - local.get $1 - call $~lib/util/hash/HASH - call $~lib/set/Set#find - local.set $2 - local.get $2 -======= - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.3 - end - call $~lib/set/Set#find - local.set $3 - local.get $3 ->>>>>>> master - i32.eqz - if - i32.const 0 - local.set $6 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $6 - return - end -<<<<<<< HEAD - i32.const 0 - drop - local.get $2 - local.get $2 -======= - local.get $3 - local.get $3 ->>>>>>> master - i32.load offset=4 - i32.const 1 - i32.or - call $~lib/set/SetEntry#set:taggedNext - local.get $0 - local.get $0 - i32.load offset=20 - i32.const 1 - i32.sub - call $~lib/set/Set#set:entriesCount - local.get $0 - i32.load offset=4 - i32.const 1 - i32.shr_u - local.set $3 - local.get $3 - i32.const 1 - i32.add - i32.const 4 - local.tee $4 - local.get $0 - i32.load offset=20 - local.tee $5 - local.get $4 - local.get $5 - i32.gt_u - select - i32.ge_u - if (result i32) - local.get $0 - i32.load offset=20 - local.get $0 - i32.load offset=12 - i32.const 3 - i32.mul - i32.const 4 - i32.div_s - i32.lt_s - else - i32.const 0 - end - if - local.get $0 -<<<<<<< HEAD - local.get $3 - call $~lib/set/Set#rehash -======= - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store - local.get $6 - local.get $4 - call $~lib/set/Set#rehash ->>>>>>> master - end - i32.const 1 - local.set $6 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $6 - ) - (func $std/set/testNumeric - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - global.get $~lib/memory/__stack_pointer - i32.const 20 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i64.const 0 - i64.store - global.get $~lib/memory/__stack_pointer - i64.const 0 - i64.store offset=8 - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store offset=16 - global.get $~lib/memory/__stack_pointer - i32.const 0 - call $~lib/set/Set#constructor - local.tee $0 - i32.store - i32.const 0 - local.set $1 - loop $for-loop|0 - local.get $1 - i32.const 100 - i32.lt_u - local.set $2 - local.get $2 - if - local.get $0 - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.store offset=4 - local.get $5 - local.get $1 - call $~lib/set/Set#has - i32.eqz + i32.store offset=4 + local.get $5 + local.get $1 + call $~lib/set/Set#has + i32.eqz i32.eqz if i32.const 0 @@ -15514,243 +13827,197 @@ end end local.get $0 -<<<<<<< HEAD - call $~lib/set/Set#get:size -======= local.set $5 global.get $~lib/memory/__stack_pointer local.get $5 i32.store offset=4 local.get $5 call $~lib/set/Set#get:size ->>>>>>> master i32.const 50 i32.eq i32.eqz if i32.const 0 -<<<<<<< HEAD - i32.const 336 -======= i32.const 544 ->>>>>>> master i32.const 45 i32.const 3 call $~lib/builtins/abort unreachable end local.get $0 -<<<<<<< HEAD - call $~lib/set/Set#clear + local.set $5 + global.get $~lib/memory/__stack_pointer + local.get $5 + i32.store offset=4 + local.get $5 + call $~lib/set/Set#clear local.get $0 - call $~lib/set/Set#get:size + local.set $5 + global.get $~lib/memory/__stack_pointer + local.get $5 + i32.store offset=4 + local.get $5 + call $~lib/set/Set#get:size i32.const 0 i32.eq i32.eqz if i32.const 0 - i32.const 336 + i32.const 544 i32.const 49 i32.const 3 call $~lib/builtins/abort unreachable end - local.get $1 - call $~lib/rt/pure/__release - local.get $2 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release + global.get $~lib/memory/__stack_pointer + i32.const 20 + i32.add + global.set $~lib/memory/__stack_pointer ) - (func $~lib/set/Set#constructor (param $0 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 24 - i32.const 13 - call $~lib/rt/pure/__new - call $~lib/rt/pure/__retain - local.set $0 - end - local.get $0 - i32.const 0 - i32.const 4 - i32.const 4 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - i32.store - local.get $0 + (func $~lib/set/Set#has (param $0 i32) (param $1 i64) (result i32) + (local $2 i32) + global.get $~lib/memory/__stack_pointer i32.const 4 - i32.const 1 i32.sub - i32.store offset=4 - local.get $0 + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer i32.const 0 - i32.const 4 - i32.const 8 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - i32.store offset=8 - local.get $0 - i32.const 4 - i32.store offset=12 - local.get $0 - i32.const 0 - i32.store offset=16 - local.get $0 - i32.const 0 - i32.store offset=20 + i32.store local.get $0 - ) - (func $~lib/util/hash/HASH (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - i32.const 0 - drop - i32.const 0 - drop + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + local.get $1 + local.get $1 + call $~lib/util/hash/HASH + call $~lib/set/Set#find i32.const 0 - drop - i32.const 4 - i32.const 4 - i32.le_u - drop - local.get $0 + i32.ne local.set $2 + global.get $~lib/memory/__stack_pointer i32.const 4 - local.set $1 - i32.const 0 - i32.const 374761393 - i32.add - local.get $1 i32.add - local.set $3 - local.get $3 + global.set $~lib/memory/__stack_pointer local.get $2 - i32.const -1028477379 - i32.mul - i32.add - local.set $3 - local.get $3 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 15 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -2048144777 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 13 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -1028477379 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 16 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - return ) - (func $~lib/set/Set#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) + (func $~lib/set/Set#add (param $0 i32) (param $1 i64) (result i32) + (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i32.const 0 + i32.store + local.get $1 + call $~lib/util/hash/HASH + local.set $2 local.get $0 - i32.load + local.set $5 + global.get $~lib/memory/__stack_pointer + local.get $5 + i32.store + local.get $5 + local.get $1 local.get $2 - local.get $0 - i32.load offset=4 - i32.and - i32.const 4 - i32.mul - i32.add - i32.load + call $~lib/set/Set#find local.set $3 - loop $while-continue|0 - local.get $3 - local.set $4 - local.get $4 + local.get $3 + i32.eqz + if + local.get $0 + i32.load offset=16 + local.get $0 + i32.load offset=12 + i32.eq if - local.get $3 - i32.load offset=4 + local.get $0 local.set $5 + global.get $~lib/memory/__stack_pointer local.get $5 - i32.const 1 - i32.and - i32.eqz + i32.store + local.get $5 + local.get $0 + i32.load offset=20 + local.get $0 + i32.load offset=12 + i32.const 3 + i32.mul + i32.const 4 + i32.div_s + i32.lt_s if (result i32) - local.get $3 - i32.load - local.get $1 - i32.eq + local.get $0 + i32.load offset=4 else - i32.const 0 - end - if - local.get $3 - return + local.get $0 + i32.load offset=4 + i32.const 1 + i32.shl + i32.const 1 + i32.or end - local.get $5 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 - br $while-continue|0 + call $~lib/set/Set#rehash end + local.get $0 + i32.load offset=8 + local.get $0 + local.get $0 + i32.load offset=16 + local.tee $4 + i32.const 1 + i32.add + call $~lib/set/Set#set:entriesOffset + local.get $4 + i32.const 16 + i32.mul + i32.add + local.set $3 + local.get $3 + local.get $1 + call $~lib/set/SetEntry#set:key + i32.const 0 + drop + local.get $0 + local.get $0 + i32.load offset=20 + i32.const 1 + i32.add + call $~lib/set/Set#set:entriesCount + local.get $0 + i32.load + local.get $2 + local.get $0 + i32.load offset=4 + i32.and + i32.const 4 + i32.mul + i32.add + local.set $4 + local.get $3 + local.get $4 + i32.load + call $~lib/set/SetEntry#set:taggedNext + local.get $4 + local.get $3 + i32.store end -======= - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.store offset=4 - local.get $5 - call $~lib/set/Set#clear local.get $0 local.set $5 global.get $~lib/memory/__stack_pointer - local.get $5 - i32.store offset=4 - local.get $5 - call $~lib/set/Set#get:size ->>>>>>> master - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 49 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - i32.const 20 + i32.const 4 i32.add global.set $~lib/memory/__stack_pointer + local.get $5 ) -<<<<<<< HEAD - (func $~lib/set/Set#has (param $0 i32) (param $1 i32) (result i32) -======= - (func $~lib/set/Set#has (param $0 i32) (param $1 i64) (result i32) - (local $2 i64) + (func $~lib/array/Array#__set (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) global.get $~lib/memory/__stack_pointer i32.const 4 @@ -15760,232 +14027,154 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store ->>>>>>> master - local.get $0 - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store - local.get $3 local.get $1 -<<<<<<< HEAD - local.get $1 - call $~lib/util/hash/HASH - call $~lib/set/Set#find -======= - block $~lib/util/hash/HASH|inlined.0 (result i32) + local.get $0 + i32.load offset=12 + i32.ge_u + if local.get $1 - local.set $2 - i32.const 0 - drop i32.const 0 - drop - i32.const 0 - drop - i32.const 8 + i32.lt_s + if + i32.const 224 + i32.const 592 + i32.const 108 + i32.const 22 + call $~lib/builtins/abort + unreachable + end + local.get $0 + local.get $1 i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.0 + i32.add + i32.const 3 + call $~lib/array/ensureSize + local.get $0 + local.get $1 + i32.const 1 + i32.add + call $~lib/array/Array#set:length_ end - call $~lib/set/Set#find ->>>>>>> master - i32.const 0 - i32.ne + local.get $0 local.set $3 global.get $~lib/memory/__stack_pointer + local.get $3 + i32.store + local.get $3 + local.get $1 + local.get $2 + call $~lib/array/Array#__uset + global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $3 ) - (func $~lib/set/Set#add (param $0 i32) (param $1 i64) (result i32) - (local $2 i64) + (func $~lib/set/Set#values (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) + (local $8 i32) + (local $9 i32) global.get $~lib/memory/__stack_pointer - i32.const 4 + i32.const 8 i32.sub global.set $~lib/memory/__stack_pointer call $~stack_check global.get $~lib/memory/__stack_pointer - i32.const 0 -<<<<<<< HEAD - local.get $4 - i32.const 8 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 + i64.const 0 + i64.store local.get $0 i32.load offset=8 - local.set $6 - local.get $6 + local.set $1 local.get $0 i32.load offset=16 - i32.const 8 - i32.mul - i32.add - local.set $7 - local.get $5 - local.set $8 - loop $while-continue|0 + local.set $2 + global.get $~lib/memory/__stack_pointer + i32.const 0 + local.get $2 + call $~lib/array/Array#constructor + local.tee $3 + i32.store + i32.const 0 + local.set $4 + i32.const 0 + local.set $5 + loop $for-loop|0 + local.get $5 + local.get $2 + i32.lt_s + local.set $6 local.get $6 - local.get $7 - i32.ne - local.set $9 - local.get $9 if - local.get $6 - local.set $10 - local.get $10 - i32.load offset=4 + local.get $1 + local.get $5 + i32.const 16 + i32.mul + i32.add + local.set $7 + local.get $7 + i32.load offset=8 i32.const 1 i32.and i32.eqz if - local.get $8 - local.set $11 - local.get $10 - i32.load - local.set $12 - local.get $11 - local.get $12 - i32.store - local.get $12 - call $~lib/util/hash/HASH - local.get $1 - i32.and - local.set $13 local.get $3 - local.get $13 - i32.const 4 - i32.mul - i32.add - local.set $14 - local.get $11 - local.get $14 - i32.load + local.set $9 + global.get $~lib/memory/__stack_pointer + local.get $9 i32.store offset=4 - local.get $14 - local.get $8 - i32.store - local.get $8 - i32.const 8 + local.get $9 + local.get $4 + local.tee $8 + i32.const 1 i32.add - local.set $8 + local.set $4 + local.get $8 + local.get $7 + i64.load + call $~lib/array/Array#__set end - local.get $6 - i32.const 8 + local.get $5 + i32.const 1 i32.add - local.set $6 - br $while-continue|0 + local.set $5 + br $for-loop|0 end end - local.get $0 - local.tee $11 local.get $3 - local.tee $12 - local.get $11 - i32.load - local.tee $9 - i32.ne - if - local.get $12 - call $~lib/rt/pure/__retain - local.set $12 - local.get $9 - call $~lib/rt/pure/__release - end - local.get $12 - i32.store - local.get $0 - local.get $1 + local.set $9 + global.get $~lib/memory/__stack_pointer + local.get $9 i32.store offset=4 - local.get $0 - local.tee $13 - local.get $5 - local.tee $14 - local.get $13 - i32.load offset=8 - local.tee $11 - i32.ne - if - local.get $14 - call $~lib/rt/pure/__retain - local.set $14 - local.get $11 - call $~lib/rt/pure/__release - end - local.get $14 - i32.store offset=8 - local.get $0 + local.get $9 local.get $4 - i32.store offset=12 - local.get $0 - local.get $0 - i32.load offset=20 - i32.store offset=16 + call $~lib/array/Array#set:length local.get $3 - call $~lib/rt/pure/__release - local.get $5 - call $~lib/rt/pure/__release + local.set $9 + global.get $~lib/memory/__stack_pointer + i32.const 8 + i32.add + global.set $~lib/memory/__stack_pointer + local.get $9 ) - (func $~lib/set/Set#add (param $0 i32) (param $1 i32) (result i32) + (func $~lib/set/Set#delete (param $0 i32) (param $1 i64) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) - local.get $1 - call $~lib/util/hash/HASH - local.set $2 -======= + (local $5 i32) + (local $6 i32) + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i32.const 0 i32.store - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $3 ->>>>>>> master local.get $0 local.set $6 global.get $~lib/memory/__stack_pointer @@ -15993,474 +14182,136 @@ i32.store local.get $6 local.get $1 -<<<<<<< HEAD - local.get $2 - call $~lib/set/Set#find - local.set $3 - local.get $3 -======= - local.get $3 + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find - local.set $4 - local.get $4 ->>>>>>> master + local.set $2 + local.get $2 i32.eqz if - local.get $0 - i32.load offset=16 - local.get $0 - i32.load offset=12 - i32.eq - if - local.get $0 - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store - local.get $6 - local.get $0 - i32.load offset=20 - local.get $0 - i32.load offset=12 - i32.const 3 - i32.mul - i32.const 4 - i32.div_s - i32.lt_s - if (result i32) - local.get $0 - i32.load offset=4 - else - local.get $0 - i32.load offset=4 - i32.const 1 - i32.shl - i32.const 1 - i32.or - end - call $~lib/set/Set#rehash - end - local.get $0 - i32.load offset=8 - local.get $0 - local.get $0 - i32.load offset=16 -<<<<<<< HEAD - local.tee $4 - i32.const 1 - i32.add - i32.store offset=16 - local.get $4 - i32.const 8 -======= - local.tee $5 - i32.const 1 - i32.add - call $~lib/set/Set#set:entriesOffset - local.get $5 - i32.const 16 ->>>>>>> master - i32.mul - i32.add - local.set $3 - local.get $3 - local.get $1 - call $~lib/set/SetEntry#set:key i32.const 0 - drop - local.get $0 - local.get $0 - i32.load offset=20 - i32.const 1 - i32.add - call $~lib/set/Set#set:entriesCount - local.get $0 - i32.load - local.get $2 - local.get $0 - i32.load offset=4 - i32.and + local.set $6 + global.get $~lib/memory/__stack_pointer i32.const 4 - i32.mul i32.add -<<<<<<< HEAD - local.set $4 - local.get $3 - local.get $4 - i32.load - i32.store offset=4 -======= - local.set $5 - local.get $4 - local.get $5 - i32.load - call $~lib/set/SetEntry#set:taggedNext - local.get $5 ->>>>>>> master - local.get $4 - local.get $3 - i32.store + global.set $~lib/memory/__stack_pointer + local.get $6 + return end + local.get $2 + local.get $2 + i32.load offset=8 + i32.const 1 + i32.or + call $~lib/set/SetEntry#set:taggedNext local.get $0 - local.set $6 - global.get $~lib/memory/__stack_pointer - i32.const 4 + local.get $0 + i32.load offset=20 + i32.const 1 + i32.sub + call $~lib/set/Set#set:entriesCount + local.get $0 + i32.load offset=4 + i32.const 1 + i32.shr_u + local.set $3 + local.get $3 + i32.const 1 i32.add - global.set $~lib/memory/__stack_pointer - local.get $6 - ) - (func $~lib/array/Array#__set (param $0 i32) (param $1 i32) (param $2 i64) - (local $3 i32) - global.get $~lib/memory/__stack_pointer i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - local.get $1 + local.tee $4 local.get $0 - i32.load offset=12 + i32.load offset=20 + local.tee $5 + local.get $4 + local.get $5 + i32.gt_u + select i32.ge_u - if - local.get $1 - i32.const 0 - i32.lt_s - if - i32.const 224 - i32.const 592 - i32.const 108 - i32.const 22 - call $~lib/builtins/abort - unreachable - end + if (result i32) local.get $0 - local.get $1 - i32.const 1 - i32.add + i32.load offset=20 + local.get $0 + i32.load offset=12 i32.const 3 - call $~lib/array/ensureSize + i32.mul + i32.const 4 + i32.div_s + i32.lt_s + else + i32.const 0 + end + if local.get $0 - local.get $1 - i32.const 1 - i32.add - call $~lib/array/Array#set:length_ + local.set $6 + global.get $~lib/memory/__stack_pointer + local.get $6 + i32.store + local.get $6 + local.get $3 + call $~lib/set/Set#rehash end - local.get $0 - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store - local.get $3 - local.get $1 - local.get $2 - call $~lib/array/Array#__uset + i32.const 1 + local.set $6 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer + local.get $6 ) - (func $~lib/set/Set#values (param $0 i32) (result i32) - (local $1 i32) + (func $std/set/testNumeric + (local $0 i32) + (local $1 i64) (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) global.get $~lib/memory/__stack_pointer - i32.const 8 + i32.const 20 i32.sub global.set $~lib/memory/__stack_pointer call $~stack_check global.get $~lib/memory/__stack_pointer i64.const 0 i64.store - local.get $0 - i32.load offset=8 - local.set $1 - local.get $0 - i32.load offset=16 - local.set $2 + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store offset=8 global.get $~lib/memory/__stack_pointer i32.const 0 - local.get $2 - call $~lib/array/Array#constructor - local.tee $3 - i32.store - i32.const 0 - local.set $4 + i32.store offset=16 + global.get $~lib/memory/__stack_pointer i32.const 0 - local.set $5 + call $~lib/set/Set#constructor + local.tee $0 + i32.store + i64.const 0 + local.set $1 loop $for-loop|0 - local.get $5 + local.get $1 + i64.const 100 + i64.lt_s + local.set $2 local.get $2 - i32.lt_s - local.set $6 - local.get $6 if + local.get $0 + local.set $6 + global.get $~lib/memory/__stack_pointer + local.get $6 + i32.store offset=4 + local.get $6 local.get $1 - local.get $5 - i32.const 16 - i32.mul - i32.add - local.set $7 - local.get $7 - i32.load offset=8 - i32.const 1 - i32.and + call $~lib/set/Set#has + i32.eqz i32.eqz if - local.get $3 - local.set $9 - global.get $~lib/memory/__stack_pointer - local.get $9 - i32.store offset=4 - local.get $9 - local.get $4 - local.tee $8 - i32.const 1 - i32.add - local.set $4 - local.get $8 - local.get $7 - i64.load - call $~lib/array/Array#__set - end - local.get $5 - i32.const 1 - i32.add - local.set $5 - br $for-loop|0 - end - end - local.get $3 - local.set $9 - global.get $~lib/memory/__stack_pointer - local.get $9 - i32.store offset=4 - local.get $9 - local.get $4 - call $~lib/array/Array#set:length - local.get $3 - local.set $9 - global.get $~lib/memory/__stack_pointer - i32.const 8 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $9 - ) - (func $~lib/set/Set#delete (param $0 i32) (param $1 i64) (result i32) - (local $2 i64) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - local.get $0 - local.set $7 - global.get $~lib/memory/__stack_pointer - local.get $7 - i32.store - local.get $7 - local.get $1 -<<<<<<< HEAD - local.get $1 - call $~lib/util/hash/HASH - call $~lib/set/Set#find - local.set $2 - local.get $2 -======= - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.3 - end - call $~lib/set/Set#find - local.set $3 - local.get $3 ->>>>>>> master - i32.eqz - if - i32.const 0 - local.set $7 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $7 - return - end -<<<<<<< HEAD - i32.const 0 - drop - local.get $2 - local.get $2 - i32.load offset=4 -======= - local.get $3 - local.get $3 - i32.load offset=8 ->>>>>>> master - i32.const 1 - i32.or - call $~lib/set/SetEntry#set:taggedNext - local.get $0 - local.get $0 - i32.load offset=20 - i32.const 1 - i32.sub - call $~lib/set/Set#set:entriesCount - local.get $0 - i32.load offset=4 - i32.const 1 - i32.shr_u - local.set $3 - local.get $3 - i32.const 1 - i32.add - i32.const 4 -<<<<<<< HEAD - local.tee $4 - local.get $0 - i32.load offset=20 - local.tee $5 - local.get $4 -======= - local.tee $5 - local.get $0 - i32.load offset=20 - local.tee $6 ->>>>>>> master - local.get $5 - local.get $6 - i32.gt_u - select - i32.ge_u - if (result i32) - local.get $0 - i32.load offset=20 - local.get $0 - i32.load offset=12 - i32.const 3 - i32.mul - i32.const 4 - i32.div_s - i32.lt_s - else - i32.const 0 - end - if - local.get $0 -<<<<<<< HEAD - local.get $3 - call $~lib/set/Set#rehash -======= - local.set $7 - global.get $~lib/memory/__stack_pointer - local.get $7 - i32.store - local.get $7 - local.get $4 - call $~lib/set/Set#rehash ->>>>>>> master - end - i32.const 1 - local.set $7 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $7 - ) - (func $std/set/testNumeric - (local $0 i32) - (local $1 i64) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - global.get $~lib/memory/__stack_pointer - i32.const 20 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i64.const 0 - i64.store - global.get $~lib/memory/__stack_pointer - i64.const 0 - i64.store offset=8 - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store offset=16 - global.get $~lib/memory/__stack_pointer - i32.const 0 - call $~lib/set/Set#constructor - local.tee $0 - i32.store - i64.const 0 - local.set $1 - loop $for-loop|0 - local.get $1 - i64.const 100 - i64.lt_s - local.set $2 - local.get $2 - if - local.get $0 - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=4 - local.get $6 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 6 - i32.const 5 - call $~lib/builtins/abort - unreachable + i32.const 0 + i32.const 544 + i32.const 6 + i32.const 5 + call $~lib/builtins/abort + unreachable end local.get $0 local.set $6 @@ -16691,161 +14542,12 @@ call $~lib/builtins/abort unreachable end -<<<<<<< HEAD - local.get $1 - call $~lib/rt/pure/__release - local.get $2 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - ) - (func $~lib/set/Set#constructor (param $0 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 24 - i32.const 15 - call $~lib/rt/pure/__new - call $~lib/rt/pure/__retain - local.set $0 - end - local.get $0 - i32.const 0 - i32.const 4 - i32.const 4 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - i32.store - local.get $0 - i32.const 4 - i32.const 1 - i32.sub - i32.store offset=4 - local.get $0 - i32.const 0 - i32.const 4 - i32.const 16 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - i32.store offset=8 - local.get $0 - i32.const 4 - i32.store offset=12 - local.get $0 - i32.const 0 - i32.store offset=16 - local.get $0 - i32.const 0 - i32.store offset=20 - local.get $0 - ) - (func $~lib/util/hash/HASH (param $0 i64) (result i32) - (local $1 i64) - (local $2 i32) - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 4 - i32.le_u - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $0 - local.set $1 - i32.const 0 - i32.const 374761393 - i32.add - i32.const 8 - i32.add - local.set $2 - local.get $2 - local.get $1 - i32.wrap_i64 - i32.const -1028477379 - i32.mul - i32.add - local.set $2 - local.get $2 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $2 - local.get $2 - local.get $1 - i64.const 32 - i64.shr_u - i32.wrap_i64 - i32.const -1028477379 - i32.mul - i32.add - local.set $2 - local.get $2 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $2 - local.get $2 - local.get $2 - i32.const 15 - i32.shr_u - i32.xor - local.set $2 - local.get $2 - i32.const -2048144777 - i32.mul - local.set $2 - local.get $2 - local.get $2 - i32.const 13 - i32.shr_u - i32.xor - local.set $2 - local.get $2 - i32.const -1028477379 - i32.mul - local.set $2 - local.get $2 - local.get $2 - i32.const 16 - i32.shr_u - i32.xor - local.set $2 - local.get $2 - return - ) - (func $~lib/set/Set#find (param $0 i32) (param $1 i64) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.get $2 - local.get $0 - i32.load offset=4 - i32.and - i32.const 4 - i32.mul - i32.add - i32.load - local.set $3 - loop $while-continue|0 - local.get $3 -======= i64.const 0 local.set $1 loop $for-loop|3 local.get $1 i64.const 50 i64.lt_s ->>>>>>> master local.set $4 local.get $4 if @@ -16900,56 +14602,6 @@ br $for-loop|3 end end -<<<<<<< HEAD - i32.const 0 - ) - (func $~lib/set/Set#has (param $0 i32) (param $1 i64) (result i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/set/Set#find - i32.const 0 - i32.ne - ) - (func $~lib/set/Set#rehash (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i64) - (local $13 i32) - (local $14 i32) - local.get $1 - i32.const 1 - i32.add - local.set $2 - i32.const 0 - local.get $2 - i32.const 4 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $3 - local.get $2 - i32.const 8 - i32.mul - i32.const 3 - i32.div_s - local.set $4 - i32.const 0 - local.get $4 - i32.const 16 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 -======= ->>>>>>> master local.get $0 local.set $6 global.get $~lib/memory/__stack_pointer @@ -16988,38 +14640,6 @@ i32.eqz i32.eqz if -<<<<<<< HEAD - local.get $8 - local.set $11 - local.get $10 - i64.load - local.set $12 - local.get $11 - local.get $12 - i64.store - local.get $12 - call $~lib/util/hash/HASH - local.get $1 - i32.and - local.set $13 - local.get $3 - local.get $13 - i32.const 4 - i32.mul - i32.add - local.set $14 - local.get $11 - local.get $14 - i32.load - i32.store offset=8 - local.get $14 - local.get $8 - i32.store - local.get $8 - i32.const 16 - i32.add - local.set $8 -======= i32.const 0 i32.const 544 i32.const 39 @@ -17052,7 +14672,6 @@ i32.const 5 call $~lib/builtins/abort unreachable ->>>>>>> master end local.get $0 local.set $6 @@ -17089,24 +14708,6 @@ end end local.get $0 -<<<<<<< HEAD - local.tee $11 - local.get $3 - local.tee $13 - local.get $11 - i32.load - local.tee $9 - i32.ne - if - local.get $13 - call $~lib/rt/pure/__retain - local.set $13 - local.get $9 - call $~lib/rt/pure/__release - end - local.get $13 - i32.store -======= local.set $6 global.get $~lib/memory/__stack_pointer local.get $6 @@ -17124,7 +14725,6 @@ call $~lib/builtins/abort unreachable end ->>>>>>> master local.get $0 local.set $6 global.get $~lib/memory/__stack_pointer @@ -17133,15 +14733,6 @@ local.get $6 call $~lib/set/Set#clear local.get $0 -<<<<<<< HEAD - local.tee $14 - local.get $5 - local.tee $9 - local.get $14 - i32.load offset=8 - local.tee $11 - i32.ne -======= local.set $6 global.get $~lib/memory/__stack_pointer local.get $6 @@ -17151,7 +14742,6 @@ i32.const 0 i32.eq i32.eqz ->>>>>>> master if i32.const 0 i32.const 544 @@ -17166,8 +14756,7 @@ global.set $~lib/memory/__stack_pointer ) (func $~lib/set/Set#has (param $0 i32) (param $1 i64) (result i32) - (local $2 i64) - (local $3 i32) + (local $2 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -17177,66 +14766,29 @@ i32.const 0 i32.store local.get $0 - local.set $3 + local.set $2 global.get $~lib/memory/__stack_pointer - local.get $3 + local.get $2 i32.store - local.get $3 + local.get $2 local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.0 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find i32.const 0 i32.ne - local.set $3 + local.set $2 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $3 + local.get $2 ) -<<<<<<< HEAD - (func $~lib/set/Set#add (param $0 i32) (param $1 i64) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $1 - call $~lib/util/hash/HASH - local.set $2 -======= (func $~lib/set/Set#add (param $0 i32) (param $1 i64) (result i32) - (local $2 i64) + (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -17245,55 +14797,20 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $3 ->>>>>>> master + local.get $1 + call $~lib/util/hash/HASH + local.set $2 local.get $0 - local.set $6 + local.set $5 global.get $~lib/memory/__stack_pointer - local.get $6 + local.get $5 i32.store - local.get $6 + local.get $5 local.get $1 -<<<<<<< HEAD local.get $2 - call $~lib/set/Set#find + call $~lib/set/Set#find local.set $3 local.get $3 -======= - local.get $3 - call $~lib/set/Set#find - local.set $4 - local.get $4 ->>>>>>> master i32.eqz if local.get $0 @@ -17303,11 +14820,11 @@ i32.eq if local.get $0 - local.set $6 + local.set $5 global.get $~lib/memory/__stack_pointer - local.get $6 + local.get $5 i32.store - local.get $6 + local.get $5 local.get $0 i32.load offset=20 local.get $0 @@ -17338,8 +14855,7 @@ local.tee $4 i32.const 1 i32.add -<<<<<<< HEAD - i32.store offset=16 + call $~lib/set/Set#set:entriesOffset local.get $4 i32.const 16 i32.mul @@ -17347,58 +14863,6 @@ local.set $3 local.get $3 local.get $1 - i64.store - local.get $0 - local.get $0 - i32.load offset=20 - i32.const 1 - i32.add - i32.store offset=20 - local.get $0 - i32.load - local.get $2 - local.get $0 - i32.load offset=4 - i32.and - i32.const 4 - i32.mul - i32.add - local.set $4 - local.get $3 - local.get $4 - i32.load - i32.store offset=8 - local.get $4 - local.get $3 - i32.store - end - local.get $0 - call $~lib/rt/pure/__retain - ) - (func $~lib/set/Set#get:size (param $0 i32) (result i32) - local.get $0 - i32.load offset=20 - ) - (func $~lib/array/Array#constructor (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $0 - i32.eqz - if - i32.const 16 -======= - call $~lib/set/Set#set:entriesOffset - local.get $5 ->>>>>>> master - i32.const 16 - i32.mul - i32.add - local.set $4 - local.get $4 - local.get $1 call $~lib/set/SetEntry#set:key i32.const 0 drop @@ -17410,29 +14874,29 @@ call $~lib/set/Set#set:entriesCount local.get $0 i32.load - local.get $3 + local.get $2 local.get $0 i32.load offset=4 i32.and i32.const 4 i32.mul i32.add - local.set $5 + local.set $4 + local.get $3 local.get $4 - local.get $5 i32.load call $~lib/set/SetEntry#set:taggedNext - local.get $5 local.get $4 + local.get $3 i32.store end local.get $0 - local.set $6 + local.set $5 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $6 + local.get $5 ) (func $~lib/array/Array#__set (param $0 i32) (param $1 i32) (param $2 i64) (local $3 i32) @@ -17578,20 +15042,12 @@ global.set $~lib/memory/__stack_pointer local.get $9 ) -<<<<<<< HEAD - (func $~lib/set/Set#delete (param $0 i32) (param $1 i64) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) -======= (func $~lib/set/Set#delete (param $0 i32) (param $1 i64) (result i32) - (local $2 i64) + (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -17600,74 +15056,31 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store ->>>>>>> master local.get $0 - local.set $7 + local.set $6 global.get $~lib/memory/__stack_pointer - local.get $7 + local.get $6 i32.store - local.get $7 + local.get $6 local.get $1 -<<<<<<< HEAD local.get $1 - call $~lib/util/hash/HASH - call $~lib/set/Set#find + call $~lib/util/hash/HASH + call $~lib/set/Set#find local.set $2 local.get $2 -======= - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 1 - i32.eq - drop - i32.const 8 - i32.const 2 - i32.eq - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.3 - end - call $~lib/set/Set#find - local.set $3 - local.get $3 ->>>>>>> master i32.eqz if i32.const 0 - local.set $7 + local.set $6 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $7 + local.get $6 return end -<<<<<<< HEAD - i32.const 0 - drop local.get $2 local.get $2 -======= - local.get $3 - local.get $3 ->>>>>>> master i32.load offset=8 i32.const 1 i32.or @@ -17711,26 +15124,21 @@ end if local.get $0 -<<<<<<< HEAD - local.get $3 - call $~lib/set/Set#rehash -======= - local.set $7 + local.set $6 global.get $~lib/memory/__stack_pointer - local.get $7 + local.get $6 i32.store - local.get $7 - local.get $4 + local.get $6 + local.get $3 call $~lib/set/Set#rehash ->>>>>>> master end i32.const 1 - local.set $7 + local.set $6 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $7 + local.get $6 ) (func $std/set/testNumeric (local $0 i32) @@ -18181,453 +15589,109 @@ end end local.get $0 - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=4 - local.get $6 - call $~lib/set/Set#get:size - i32.const 50 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 45 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=4 - local.get $6 - call $~lib/set/Set#clear - local.get $0 - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=4 - local.get $6 - call $~lib/set/Set#get:size - i32.const 0 -<<<<<<< HEAD - i32.const 4 - i32.const 16 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - i32.store offset=8 - local.get $0 - i32.const 4 - i32.store offset=12 - local.get $0 - i32.const 0 - i32.store offset=16 - local.get $0 - i32.const 0 - i32.store offset=20 - local.get $0 - ) - (func $~lib/util/hash/HASH (param $0 i64) (result i32) - (local $1 i64) - (local $2 i32) - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 8 - i32.const 4 - i32.le_u - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $0 - local.set $1 - i32.const 0 - i32.const 374761393 - i32.add - i32.const 8 - i32.add - local.set $2 - local.get $2 - local.get $1 - i32.wrap_i64 - i32.const -1028477379 - i32.mul - i32.add - local.set $2 - local.get $2 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $2 - local.get $2 - local.get $1 - i64.const 32 - i64.shr_u - i32.wrap_i64 - i32.const -1028477379 - i32.mul - i32.add - local.set $2 - local.get $2 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $2 - local.get $2 - local.get $2 - i32.const 15 - i32.shr_u - i32.xor - local.set $2 - local.get $2 - i32.const -2048144777 - i32.mul - local.set $2 - local.get $2 - local.get $2 - i32.const 13 - i32.shr_u - i32.xor - local.set $2 - local.get $2 - i32.const -1028477379 - i32.mul - local.set $2 - local.get $2 - local.get $2 - i32.const 16 - i32.shr_u - i32.xor - local.set $2 - local.get $2 - return - ) - (func $~lib/set/Set#find (param $0 i32) (param $1 i64) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.get $2 - local.get $0 - i32.load offset=4 - i32.and - i32.const 4 - i32.mul - i32.add - i32.load - local.set $3 - loop $while-continue|0 - local.get $3 - local.set $4 - local.get $4 - if - local.get $3 - i32.load offset=8 - local.set $5 - local.get $5 - i32.const 1 - i32.and - i32.eqz - if (result i32) - local.get $3 - i64.load - local.get $1 - i64.eq - else - i32.const 0 - end - if - local.get $3 - return - end - local.get $5 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 - br $while-continue|0 - end - end - i32.const 0 - ) - (func $~lib/set/Set#has (param $0 i32) (param $1 i64) (result i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/set/Set#find -======= - i32.eq - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 49 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - i32.const 20 - i32.add - global.set $~lib/memory/__stack_pointer - ) - (func $~lib/set/Set#has (param $0 i32) (param $1 f32) (result i32) - (local $2 f32) - (local $3 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - local.get $0 - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store - local.get $3 - local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.0 - end - call $~lib/set/Set#find ->>>>>>> master - i32.const 0 - i32.ne - local.set $3 - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.add - global.set $~lib/memory/__stack_pointer - local.get $3 - ) - (func $~lib/set/Set#add (param $0 i32) (param $1 f32) (result i32) - (local $2 f32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) -<<<<<<< HEAD - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 i64) - (local $13 i32) - (local $14 i32) - local.get $1 - i32.const 1 - i32.add - local.set $2 - i32.const 0 - local.get $2 -======= - global.get $~lib/memory/__stack_pointer ->>>>>>> master - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 -<<<<<<< HEAD - local.get $4 - i32.const 16 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 - local.get $0 - i32.load offset=8 - local.set $6 - local.get $6 - local.get $0 - i32.load offset=16 - i32.const 16 - i32.mul - i32.add - local.set $7 - local.get $5 - local.set $8 - loop $while-continue|0 - local.get $6 - local.get $7 - i32.ne - local.set $9 - local.get $9 - if - local.get $6 - local.set $10 - local.get $10 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $11 - local.get $10 - i64.load - local.set $12 - local.get $11 - local.get $12 - i64.store - local.get $12 - call $~lib/util/hash/HASH - local.get $1 - i32.and - local.set $13 - local.get $3 - local.get $13 - i32.const 4 - i32.mul - i32.add - local.set $14 - local.get $11 - local.get $14 - i32.load - i32.store offset=8 - local.get $14 - local.get $8 - i32.store - local.get $8 - i32.const 16 - i32.add - local.set $8 - end - local.get $6 - i32.const 16 - i32.add - local.set $6 - br $while-continue|0 - end - end - local.get $0 - local.tee $11 - local.get $3 - local.tee $13 - local.get $11 - i32.load - local.tee $9 - i32.ne + local.set $6 + global.get $~lib/memory/__stack_pointer + local.get $6 + i32.store offset=4 + local.get $6 + call $~lib/set/Set#get:size + i32.const 50 + i32.eq + i32.eqz if - local.get $13 - call $~lib/rt/pure/__retain - local.set $13 - local.get $9 - call $~lib/rt/pure/__release + i32.const 0 + i32.const 544 + i32.const 45 + i32.const 3 + call $~lib/builtins/abort + unreachable end - local.get $13 - i32.store local.get $0 - local.get $1 + local.set $6 + global.get $~lib/memory/__stack_pointer + local.get $6 i32.store offset=4 + local.get $6 + call $~lib/set/Set#clear local.get $0 - local.tee $14 - local.get $5 - local.tee $9 - local.get $14 - i32.load offset=8 - local.tee $11 - i32.ne + local.set $6 + global.get $~lib/memory/__stack_pointer + local.get $6 + i32.store offset=4 + local.get $6 + call $~lib/set/Set#get:size + i32.const 0 + i32.eq + i32.eqz if - local.get $9 - call $~lib/rt/pure/__retain - local.set $9 - local.get $11 - call $~lib/rt/pure/__release + i32.const 0 + i32.const 544 + i32.const 49 + i32.const 3 + call $~lib/builtins/abort + unreachable end - local.get $9 - i32.store offset=8 - local.get $0 - local.get $4 - i32.store offset=12 - local.get $0 + global.get $~lib/memory/__stack_pointer + i32.const 20 + i32.add + global.set $~lib/memory/__stack_pointer + ) + (func $~lib/set/Set#has (param $0 i32) (param $1 f32) (result i32) + (local $2 i32) + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i32.const 0 + i32.store local.get $0 - i32.load offset=20 - i32.store offset=16 - local.get $3 - call $~lib/rt/pure/__release - local.get $5 - call $~lib/rt/pure/__release + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 + local.get $1 + local.get $1 + call $~lib/util/hash/HASH + call $~lib/set/Set#find + i32.const 0 + i32.ne + local.set $2 + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.add + global.set $~lib/memory/__stack_pointer + local.get $2 ) - (func $~lib/set/Set#add (param $0 i32) (param $1 i64) (result i32) + (func $~lib/set/Set#add (param $0 i32) (param $1 f32) (result i32) (local $2 i32) (local $3 i32) (local $4 i32) + (local $5 i32) + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i32.const 0 + i32.store local.get $1 - call $~lib/util/hash/HASH + call $~lib/util/hash/HASH local.set $2 -======= - i32.store - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $3 ->>>>>>> master local.get $0 - local.set $6 + local.set $5 global.get $~lib/memory/__stack_pointer - local.get $6 + local.get $5 i32.store - local.get $6 + local.get $5 local.get $1 -<<<<<<< HEAD local.get $2 - call $~lib/set/Set#find + call $~lib/set/Set#find local.set $3 local.get $3 -======= - local.get $3 - call $~lib/set/Set#find - local.set $4 - local.get $4 ->>>>>>> master i32.eqz if local.get $0 @@ -18637,11 +15701,11 @@ i32.eq if local.get $0 - local.set $6 + local.set $5 global.get $~lib/memory/__stack_pointer - local.get $6 + local.get $5 i32.store - local.get $6 + local.get $5 local.get $0 i32.load offset=20 local.get $0 @@ -18672,15 +15736,9 @@ local.tee $4 i32.const 1 i32.add -<<<<<<< HEAD - i32.store offset=16 - local.get $4 - i32.const 16 -======= call $~lib/set/Set#set:entriesOffset - local.get $5 + local.get $4 i32.const 8 ->>>>>>> master i32.mul i32.add local.set $3 @@ -18708,23 +15766,18 @@ local.get $3 local.get $4 i32.load -<<<<<<< HEAD - i32.store offset=8 -======= call $~lib/set/SetEntry#set:taggedNext - local.get $5 ->>>>>>> master local.get $4 local.get $3 i32.store end local.get $0 - local.set $6 + local.set $5 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $6 + local.get $5 ) (func $~lib/array/Array#__set (param $0 i32) (param $1 i32) (param $2 f32) (local $3 i32) @@ -18870,20 +15923,12 @@ global.set $~lib/memory/__stack_pointer local.get $9 ) -<<<<<<< HEAD - (func $~lib/set/Set#delete (param $0 i32) (param $1 i64) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) -======= (func $~lib/set/Set#delete (param $0 i32) (param $1 f32) (result i32) - (local $2 f32) + (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -18892,65 +15937,32 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store ->>>>>>> master local.get $0 - local.set $7 + local.set $6 global.get $~lib/memory/__stack_pointer - local.get $7 + local.get $6 i32.store - local.get $7 + local.get $6 local.get $1 -<<<<<<< HEAD local.get $1 - call $~lib/util/hash/HASH - call $~lib/set/Set#find + call $~lib/util/hash/HASH + call $~lib/set/Set#find local.set $2 local.get $2 -======= - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - i32.reinterpret_f32 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.3 - end - call $~lib/set/Set#find - local.set $3 - local.get $3 ->>>>>>> master i32.eqz if i32.const 0 - local.set $7 + local.set $6 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $7 + local.get $6 return end -<<<<<<< HEAD - i32.const 0 - drop local.get $2 local.get $2 - i32.load offset=8 -======= - local.get $3 - local.get $3 i32.load offset=4 ->>>>>>> master i32.const 1 i32.or call $~lib/set/SetEntry#set:taggedNext @@ -18993,47 +16005,21 @@ end if local.get $0 -<<<<<<< HEAD - local.get $3 - call $~lib/set/Set#rehash - end - i32.const 1 - ) - (func $~lib/set/Set#clear (param $0 i32) - (local $1 i32) - (local $2 i32) - local.get $0 - local.tee $1 - i32.const 0 - i32.const 4 - i32.const 4 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $2 - local.get $1 - i32.load - call $~lib/rt/pure/__release - local.get $2 - i32.store - local.get $0 - i32.const 4 -======= - local.set $7 + local.set $6 global.get $~lib/memory/__stack_pointer - local.get $7 + local.get $6 i32.store - local.get $7 - local.get $4 + local.get $6 + local.get $3 call $~lib/set/Set#rehash end ->>>>>>> master i32.const 1 - local.set $7 + local.set $6 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $7 + local.get $6 ) (func $std/set/testNumeric (local $0 i32) @@ -19403,35 +16389,8 @@ f32.const 50 f32.lt local.set $4 - local.get $4 - if - local.get $0 - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=4 - local.get $6 - local.get $1 - call $~lib/set/Set#has - i32.eqz - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 39 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=4 - local.get $6 - local.get $1 - call $~lib/set/Set#add - drop + local.get $4 + if local.get $0 local.set $6 global.get $~lib/memory/__stack_pointer @@ -19441,10 +16400,11 @@ local.get $1 call $~lib/set/Set#has i32.eqz + i32.eqz if i32.const 0 i32.const 544 - i32.const 41 + i32.const 39 i32.const 5 call $~lib/builtins/abort unreachable @@ -19456,7 +16416,7 @@ i32.store offset=4 local.get $6 local.get $1 - call $~lib/set/Set#delete + call $~lib/set/Set#add drop local.get $0 local.set $6 @@ -19467,396 +16427,130 @@ local.get $1 call $~lib/set/Set#has i32.eqz - i32.eqz if i32.const 0 i32.const 544 - i32.const 43 + i32.const 41 i32.const 5 call $~lib/builtins/abort unreachable end - local.get $1 - f32.const 1 - f32.add - local.set $1 - br $for-loop|4 - end - end - local.get $0 - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=4 - local.get $6 - call $~lib/set/Set#get:size - i32.const 50 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 45 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=4 - local.get $6 - call $~lib/set/Set#clear - local.get $0 - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=4 - local.get $6 - call $~lib/set/Set#get:size - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 49 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - global.get $~lib/memory/__stack_pointer - i32.const 20 - i32.add - global.set $~lib/memory/__stack_pointer - ) - (func $~lib/set/Set#has (param $0 i32) (param $1 f64) (result i32) - (local $2 f64) - (local $3 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 -<<<<<<< HEAD - i32.store offset=20 - local.get $0 - ) - (func $~lib/util/hash/HASH (param $0 f32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $0 - i32.reinterpret_f32 - local.set $1 - i32.const 4 - local.set $2 - i32.const 0 - i32.const 374761393 - i32.add - local.get $2 - i32.add - local.set $3 - local.get $3 - local.get $1 - i32.const -1028477379 - i32.mul - i32.add - local.set $3 - local.get $3 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 15 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -2048144777 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 13 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -1028477379 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 16 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - return - ) - (func $~lib/set/Set#find (param $0 i32) (param $1 f32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.get $2 -======= - i32.store ->>>>>>> master - local.get $0 - local.set $3 -<<<<<<< HEAD - loop $while-continue|0 - local.get $3 - local.set $4 - local.get $4 - if - local.get $3 - i32.load offset=4 - local.set $5 - local.get $5 - i32.const 1 - i32.and - i32.eqz - if (result i32) - local.get $3 - f32.load - local.get $1 - f32.eq - else - i32.const 0 - end - if - local.get $3 - return - end - local.get $5 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 - br $while-continue|0 - end - end - i32.const 0 - ) - (func $~lib/set/Set#has (param $0 i32) (param $1 f32) (result i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/set/Set#find - i32.const 0 - i32.ne - ) - (func $~lib/set/Set#rehash (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 f32) - (local $13 i32) - (local $14 i32) - local.get $1 - i32.const 1 - i32.add - local.set $2 - i32.const 0 - local.get $2 - i32.const 4 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $3 - local.get $2 - i32.const 8 - i32.mul - i32.const 3 - i32.div_s - local.set $4 - i32.const 0 - local.get $4 - i32.const 8 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 - local.get $0 - i32.load offset=8 - local.set $6 - local.get $6 - local.get $0 - i32.load offset=16 - i32.const 8 - i32.mul - i32.add - local.set $7 - local.get $5 - local.set $8 - loop $while-continue|0 - local.get $6 - local.get $7 - i32.ne - local.set $9 - local.get $9 - if + local.get $0 + local.set $6 + global.get $~lib/memory/__stack_pointer local.get $6 - local.set $10 - local.get $10 - i32.load offset=4 - i32.const 1 - i32.and + i32.store offset=4 + local.get $6 + local.get $1 + call $~lib/set/Set#delete + drop + local.get $0 + local.set $6 + global.get $~lib/memory/__stack_pointer + local.get $6 + i32.store offset=4 + local.get $6 + local.get $1 + call $~lib/set/Set#has + i32.eqz i32.eqz if - local.get $8 - local.set $11 - local.get $10 - f32.load - local.set $12 - local.get $11 - local.get $12 - f32.store - local.get $12 - call $~lib/util/hash/HASH - local.get $1 - i32.and - local.set $13 - local.get $3 - local.get $13 - i32.const 4 - i32.mul - i32.add - local.set $14 - local.get $11 - local.get $14 - i32.load - i32.store offset=4 - local.get $14 - local.get $8 - i32.store - local.get $8 - i32.const 8 - i32.add - local.set $8 + i32.const 0 + i32.const 544 + i32.const 43 + i32.const 5 + call $~lib/builtins/abort + unreachable end - local.get $6 - i32.const 8 - i32.add - local.set $6 - br $while-continue|0 + local.get $1 + f32.const 1 + f32.add + local.set $1 + br $for-loop|4 end end local.get $0 - local.tee $11 - local.get $3 - local.tee $13 - local.get $11 - i32.load - local.tee $9 - i32.ne + local.set $6 + global.get $~lib/memory/__stack_pointer + local.get $6 + i32.store offset=4 + local.get $6 + call $~lib/set/Set#get:size + i32.const 50 + i32.eq + i32.eqz if - local.get $13 - call $~lib/rt/pure/__retain - local.set $13 - local.get $9 - call $~lib/rt/pure/__release + i32.const 0 + i32.const 544 + i32.const 45 + i32.const 3 + call $~lib/builtins/abort + unreachable end - local.get $13 - i32.store local.get $0 - local.get $1 + local.set $6 + global.get $~lib/memory/__stack_pointer + local.get $6 i32.store offset=4 + local.get $6 + call $~lib/set/Set#clear local.get $0 - local.tee $14 - local.get $5 - local.tee $9 - local.get $14 - i32.load offset=8 - local.tee $11 - i32.ne + local.set $6 + global.get $~lib/memory/__stack_pointer + local.get $6 + i32.store offset=4 + local.get $6 + call $~lib/set/Set#get:size + i32.const 0 + i32.eq + i32.eqz if - local.get $9 - call $~lib/rt/pure/__retain - local.set $9 - local.get $11 - call $~lib/rt/pure/__release -======= + i32.const 0 + i32.const 544 + i32.const 49 + i32.const 3 + call $~lib/builtins/abort + unreachable + end global.get $~lib/memory/__stack_pointer - local.get $3 + i32.const 20 + i32.add + global.set $~lib/memory/__stack_pointer + ) + (func $~lib/set/Set#has (param $0 i32) (param $1 f64) (result i32) + (local $2 i32) + global.get $~lib/memory/__stack_pointer + i32.const 4 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i32.const 0 i32.store - local.get $3 + local.get $0 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store + local.get $2 local.get $1 - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.0 ->>>>>>> master - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find i32.const 0 i32.ne - local.set $3 + local.set $2 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $3 + local.get $2 ) -<<<<<<< HEAD - (func $~lib/set/Set#add (param $0 i32) (param $1 f32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $1 - call $~lib/util/hash/HASH - local.set $2 -======= (func $~lib/set/Set#add (param $0 i32) (param $1 f64) (result i32) - (local $2 f64) + (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) - (local $6 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -19865,47 +16559,20 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.1 - end - local.set $3 ->>>>>>> master + local.get $1 + call $~lib/util/hash/HASH + local.set $2 local.get $0 - local.set $6 + local.set $5 global.get $~lib/memory/__stack_pointer - local.get $6 + local.get $5 i32.store - local.get $6 + local.get $5 local.get $1 local.get $2 - call $~lib/set/Set#find + call $~lib/set/Set#find local.set $3 local.get $3 -<<<<<<< HEAD -======= - call $~lib/set/Set#find - local.set $4 - local.get $4 ->>>>>>> master i32.eqz if local.get $0 @@ -19915,11 +16582,11 @@ i32.eq if local.get $0 - local.set $6 + local.set $5 global.get $~lib/memory/__stack_pointer - local.get $6 + local.get $5 i32.store - local.get $6 + local.get $5 local.get $0 i32.load offset=20 local.get $0 @@ -19950,15 +16617,9 @@ local.tee $4 i32.const 1 i32.add -<<<<<<< HEAD - i32.store offset=16 - local.get $4 - i32.const 8 -======= call $~lib/set/Set#set:entriesOffset - local.get $5 + local.get $4 i32.const 16 ->>>>>>> master i32.mul i32.add local.set $3 @@ -19986,23 +16647,18 @@ local.get $3 local.get $4 i32.load -<<<<<<< HEAD - i32.store offset=4 -======= call $~lib/set/SetEntry#set:taggedNext - local.get $5 ->>>>>>> master local.get $4 local.get $3 i32.store end local.get $0 - local.set $6 + local.set $5 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $6 + local.get $5 ) (func $~lib/array/Array#__set (param $0 i32) (param $1 i32) (param $2 f64) (local $3 i32) @@ -20148,20 +16804,12 @@ global.set $~lib/memory/__stack_pointer local.get $9 ) -<<<<<<< HEAD - (func $~lib/set/Set#delete (param $0 i32) (param $1 f32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) -======= (func $~lib/set/Set#delete (param $0 i32) (param $1 f64) (result i32) - (local $2 f64) + (local $2 i32) (local $3 i32) (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -20170,69 +16818,32 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store ->>>>>>> master local.get $0 - local.set $7 - global.get $~lib/memory/__stack_pointer - local.get $7 - i32.store - local.get $7 - local.get $1 -<<<<<<< HEAD - local.get $1 - call $~lib/util/hash/HASH - call $~lib/set/Set#find - local.set $2 - local.get $2 -======= - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $2 - i64.reinterpret_f64 - call $~lib/util/hash/hash64 - br $~lib/util/hash/HASH|inlined.3 - end + local.set $6 + global.get $~lib/memory/__stack_pointer + local.get $6 + i32.store + local.get $6 + local.get $1 + local.get $1 + call $~lib/util/hash/HASH call $~lib/set/Set#find - local.set $3 - local.get $3 ->>>>>>> master + local.set $2 + local.get $2 i32.eqz if i32.const 0 - local.set $7 + local.set $6 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $7 + local.get $6 return end -<<<<<<< HEAD - i32.const 0 - drop local.get $2 local.get $2 - i32.load offset=4 -======= - local.get $3 - local.get $3 i32.load offset=8 ->>>>>>> master i32.const 1 i32.or call $~lib/set/SetEntry#set:taggedNext @@ -20275,26 +16886,21 @@ end if local.get $0 -<<<<<<< HEAD - local.get $3 - call $~lib/set/Set#rehash -======= - local.set $7 + local.set $6 global.get $~lib/memory/__stack_pointer - local.get $7 + local.get $6 i32.store - local.get $7 - local.get $4 + local.get $6 + local.get $3 call $~lib/set/Set#rehash ->>>>>>> master end i32.const 1 - local.set $7 + local.set $6 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $7 + local.get $6 ) (func $std/set/testNumeric (local $0 i32) @@ -20424,301 +17030,42 @@ i32.const 544 i32.const 14 i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $0 - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=4 - local.get $6 - local.get $1 - call $~lib/set/Set#add - drop - local.get $0 - local.set $6 - global.get $~lib/memory/__stack_pointer - local.get $6 - i32.store offset=4 - local.get $6 - local.get $1 - call $~lib/set/Set#has - i32.eqz - if - i32.const 0 - i32.const 544 - i32.const 16 - i32.const 5 - call $~lib/builtins/abort - unreachable - end - local.get $1 - f64.const 1 - f64.add - local.set $1 -<<<<<<< HEAD - br $for-loop|4 - end - end - local.get $0 - call $~lib/set/Set#get:size - i32.const 50 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 336 - i32.const 45 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $0 - call $~lib/set/Set#clear - local.get $0 - call $~lib/set/Set#get:size - i32.const 0 - i32.eq - i32.eqz - if - i32.const 0 - i32.const 336 - i32.const 49 - i32.const 3 - call $~lib/builtins/abort - unreachable - end - local.get $2 - call $~lib/rt/pure/__release - local.get $3 - call $~lib/rt/pure/__release - local.get $0 - call $~lib/rt/pure/__release - ) - (func $~lib/set/Set#constructor (param $0 i32) (result i32) - local.get $0 - i32.eqz - if - i32.const 24 - i32.const 21 - call $~lib/rt/pure/__new - call $~lib/rt/pure/__retain - local.set $0 - end - local.get $0 - i32.const 0 - i32.const 4 - i32.const 4 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - i32.store - local.get $0 - i32.const 4 - i32.const 1 - i32.sub - i32.store offset=4 - local.get $0 - i32.const 0 - i32.const 4 - i32.const 16 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - i32.store offset=8 - local.get $0 - i32.const 4 - i32.store offset=12 - local.get $0 - i32.const 0 - i32.store offset=16 - local.get $0 - i32.const 0 - i32.store offset=20 - local.get $0 - ) - (func $~lib/util/hash/HASH (param $0 f64) (result i32) - (local $1 i64) - (local $2 i32) - i32.const 0 - drop - i32.const 0 - drop - i32.const 1 - drop - i32.const 8 - i32.const 4 - i32.eq - drop - i32.const 8 - i32.const 8 - i32.eq - drop - local.get $0 - i64.reinterpret_f64 - local.set $1 - i32.const 0 - i32.const 374761393 - i32.add - i32.const 8 - i32.add - local.set $2 - local.get $2 - local.get $1 - i32.wrap_i64 - i32.const -1028477379 - i32.mul - i32.add - local.set $2 - local.get $2 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $2 - local.get $2 - local.get $1 - i64.const 32 - i64.shr_u - i32.wrap_i64 - i32.const -1028477379 - i32.mul - i32.add - local.set $2 - local.get $2 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $2 - local.get $2 - local.get $2 - i32.const 15 - i32.shr_u - i32.xor - local.set $2 - local.get $2 - i32.const -2048144777 - i32.mul - local.set $2 - local.get $2 - local.get $2 - i32.const 13 - i32.shr_u - i32.xor - local.set $2 - local.get $2 - i32.const -1028477379 - i32.mul - local.set $2 - local.get $2 - local.get $2 - i32.const 16 - i32.shr_u - i32.xor - local.set $2 - local.get $2 - return - ) - (func $~lib/set/Set#find (param $0 i32) (param $1 f64) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.get $2 - local.get $0 - i32.load offset=4 - i32.and - i32.const 4 - i32.mul - i32.add - i32.load - local.set $3 - loop $while-continue|0 - local.get $3 - local.set $4 - local.get $4 - if - local.get $3 - i32.load offset=8 - local.set $5 - local.get $5 - i32.const 1 - i32.and - i32.eqz - if (result i32) - local.get $3 - f64.load - local.get $1 - f64.eq - else - i32.const 0 + call $~lib/builtins/abort + unreachable end + local.get $0 + local.set $6 + global.get $~lib/memory/__stack_pointer + local.get $6 + i32.store offset=4 + local.get $6 + local.get $1 + call $~lib/set/Set#add + drop + local.get $0 + local.set $6 + global.get $~lib/memory/__stack_pointer + local.get $6 + i32.store offset=4 + local.get $6 + local.get $1 + call $~lib/set/Set#has + i32.eqz if - local.get $3 - return + i32.const 0 + i32.const 544 + i32.const 16 + i32.const 5 + call $~lib/builtins/abort + unreachable end - local.get $5 - i32.const 1 - i32.const -1 - i32.xor - i32.and - local.set $3 - br $while-continue|0 - end - end - i32.const 0 - ) - (func $~lib/set/Set#has (param $0 i32) (param $1 f64) (result i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/set/Set#find - i32.const 0 - i32.ne - ) - (func $~lib/set/Set#rehash (param $0 i32) (param $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - (local $7 i32) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - (local $12 f64) - (local $13 i32) - (local $14 i32) - local.get $1 - i32.const 1 - i32.add - local.set $2 - i32.const 0 - local.get $2 - i32.const 4 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $3 - local.get $2 - i32.const 8 - i32.mul - i32.const 3 - i32.div_s - local.set $4 - i32.const 0 - local.get $4 - i32.const 16 - i32.mul - call $~lib/arraybuffer/ArrayBuffer#constructor - local.set $5 -======= + local.get $1 + f64.const 1 + f64.add + local.set $1 br $for-loop|1 end end ->>>>>>> master local.get $0 local.set $6 global.get $~lib/memory/__stack_pointer @@ -20784,45 +17131,12 @@ call $~lib/set/Set#has i32.eqz if -<<<<<<< HEAD - local.get $8 - local.set $11 - local.get $10 - f64.load - local.set $12 - local.get $11 - local.get $12 - f64.store - local.get $12 - call $~lib/util/hash/HASH - local.get $1 - i32.and - local.set $13 - local.get $3 - local.get $13 - i32.const 4 - i32.mul - i32.add - local.set $14 - local.get $11 - local.get $14 - i32.load - i32.store offset=8 - local.get $14 - local.get $8 - i32.store - local.get $8 - i32.const 16 - i32.add - local.set $8 -======= i32.const 0 i32.const 544 i32.const 24 i32.const 5 call $~lib/builtins/abort unreachable ->>>>>>> master end local.get $3 local.set $6 @@ -20848,22 +17162,6 @@ end end local.get $3 -<<<<<<< HEAD - local.tee $13 - local.get $11 - i32.load - local.tee $9 - i32.ne - if - local.get $13 - call $~lib/rt/pure/__retain - local.set $13 - local.get $9 - call $~lib/rt/pure/__release - end - local.get $13 - i32.store -======= local.set $6 global.get $~lib/memory/__stack_pointer local.get $6 @@ -20947,63 +17245,11 @@ br $for-loop|3 end end ->>>>>>> master local.get $0 local.set $6 global.get $~lib/memory/__stack_pointer local.get $6 i32.store offset=4 -<<<<<<< HEAD - local.get $0 - local.tee $14 - local.get $5 - local.tee $9 - local.get $14 - i32.load offset=8 - local.tee $11 - i32.ne - if - local.get $9 - call $~lib/rt/pure/__retain - local.set $9 - local.get $11 - call $~lib/rt/pure/__release - end - local.get $9 - i32.store offset=8 - local.get $0 - local.get $4 - i32.store offset=12 - local.get $0 - local.get $0 - i32.load offset=20 - i32.store offset=16 - local.get $3 - call $~lib/rt/pure/__release - local.get $5 - call $~lib/rt/pure/__release - ) - (func $~lib/set/Set#add (param $0 i32) (param $1 f64) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $1 - call $~lib/util/hash/HASH - local.set $2 - local.get $0 - local.get $1 - local.get $2 - call $~lib/set/Set#find - local.set $3 - local.get $3 - i32.eqz - if - local.get $0 - i32.load offset=16 - local.get $0 - i32.load offset=12 - i32.eq -======= local.get $6 call $~lib/set/Set#get:size i32.const 50 @@ -21025,7 +17271,6 @@ f64.lt local.set $4 local.get $4 ->>>>>>> master if local.get $0 local.set $6 @@ -21104,49 +17349,6 @@ local.set $1 br $for-loop|4 end -<<<<<<< HEAD - local.get $0 - i32.load offset=8 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $4 - i32.const 1 - i32.add - i32.store offset=16 - local.get $4 - i32.const 16 - i32.mul - i32.add - local.set $3 - local.get $3 - local.get $1 - f64.store - local.get $0 - local.get $0 - i32.load offset=20 - i32.const 1 - i32.add - i32.store offset=20 - local.get $0 - i32.load - local.get $2 - local.get $0 - i32.load offset=4 - i32.and - i32.const 4 - i32.mul - i32.add - local.set $4 - local.get $3 - local.get $4 - i32.load - i32.store offset=8 - local.get $4 - local.get $3 - i32.store -======= ->>>>>>> master end local.get $0 local.set $6 @@ -21292,21 +17494,6 @@ global.set $~lib/memory/__stack_pointer local.get $1 ) -<<<<<<< HEAD - (func $~lib/set/Set#delete (param $0 i32) (param $1 f64) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/set/Set#find - local.set $2 - local.get $2 - i32.eqz -======= (func $~lib/array/Array#constructor (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) @@ -21346,7 +17533,6 @@ i32.const 0 i32.shr_u i32.gt_u ->>>>>>> master if i32.const 432 i32.const 592 @@ -21357,15 +17543,6 @@ end local.get $1 i32.const 0 -<<<<<<< HEAD - drop - local.get $2 - local.get $2 - i32.load offset=8 - i32.const 1 - i32.or - i32.store offset=8 -======= i32.shl local.set $2 global.get $~lib/memory/__stack_pointer @@ -21381,7 +17558,6 @@ local.get $0 local.get $3 call $~lib/array/Array#set:buffer ->>>>>>> master local.get $0 local.get $3 call $~lib/array/Array#set:dataStart @@ -21392,18 +17568,9 @@ local.get $1 call $~lib/array/Array#set:length_ local.get $0 -<<<<<<< HEAD - i32.load offset=4 - i32.const 1 - i32.shr_u - local.set $3 - local.get $3 - i32.const 1 -======= local.set $4 global.get $~lib/memory/__stack_pointer i32.const 8 ->>>>>>> master i32.add global.set $~lib/memory/__stack_pointer local.get $4 @@ -21412,34 +17579,6 @@ (local $1 i32) global.get $~lib/memory/__stack_pointer i32.const 4 -<<<<<<< HEAD - local.tee $4 - local.get $0 - i32.load offset=20 - local.tee $5 - local.get $4 - local.get $5 - i32.gt_u - select - i32.ge_u - if (result i32) - local.get $0 - i32.load offset=20 - local.get $0 - i32.load offset=12 - i32.const 3 - i32.mul - i32.const 4 - i32.div_s - i32.lt_s - else - i32.const 0 - end - if - local.get $0 - local.get $3 - call $~lib/set/Set#rehash -======= i32.sub global.set $~lib/memory/__stack_pointer call $~stack_check @@ -21455,7 +17594,6 @@ call $~lib/rt/itcms/__new local.tee $0 i32.store ->>>>>>> master end local.get $0 i32.const 0 diff --git a/tests/compiler/std/symbol.optimized.wat b/tests/compiler/std/symbol.optimized.wat index 60940fbe88..1ba98c6d4c 100644 --- a/tests/compiler/std/symbol.optimized.wat +++ b/tests/compiler/std/symbol.optimized.wat @@ -553,213 +553,6 @@ unreachable end local.get $1 -<<<<<<< HEAD - ) - (func $~lib/util/hash/HASH<~lib/string/String> (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) - (local $8 i32) - local.get $0 - if (result i32) - local.get $0 - i32.const 20 - i32.sub - i32.load offset=16 - i32.const 1 - i32.shr_u - i32.const 1 - i32.shl - local.tee $3 - i32.const 16 - i32.ge_s - if - i32.const 606290984 - local.set $2 - i32.const -2048144777 - local.set $4 - i32.const 1640531535 - local.set $5 - local.get $3 - i32.const 16 - i32.sub - local.set $7 - loop $while-continue|0 - local.get $1 - local.get $7 - i32.le_s - if - local.get $2 - local.get $0 - local.get $1 - i32.add - local.tee $6 - i32.load - i32.const -2048144777 - i32.mul - i32.add - i32.const 13 - i32.rotl - i32.const -1640531535 - i32.mul - local.set $2 - local.get $4 - local.get $6 - i32.load offset=4 - i32.const -2048144777 - i32.mul - i32.add - i32.const 13 - i32.rotl - i32.const -1640531535 - i32.mul - local.set $4 - local.get $8 - local.get $6 - i32.load offset=8 - i32.const -2048144777 - i32.mul - i32.add - i32.const 13 - i32.rotl - i32.const -1640531535 - i32.mul - local.set $8 - local.get $5 - local.get $6 - i32.load offset=12 - i32.const -2048144777 - i32.mul - i32.add - i32.const 13 - i32.rotl - i32.const -1640531535 - i32.mul - local.set $5 - local.get $1 - i32.const 16 - i32.add - local.set $1 - br $while-continue|0 - end - end - local.get $3 - local.get $2 - i32.const 1 - i32.rotl - local.get $4 - i32.const 7 - i32.rotl - i32.add - local.get $8 - i32.const 12 - i32.rotl - i32.add - local.get $5 - i32.const 18 - i32.rotl - i32.add - i32.add - local.set $2 - local.get $7 - local.get $1 - i32.sub - local.set $3 - else - local.get $3 - i32.const 374761393 - i32.add - local.set $2 - end - i32.const 0 - local.set $1 - local.get $3 - i32.const 4 - i32.sub - local.set $3 - loop $while-continue|1 - local.get $1 - local.get $3 - i32.le_s - if - local.get $2 - local.get $0 - local.get $1 - i32.add - i32.load - i32.const -1028477379 - i32.mul - i32.add - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $2 - local.get $1 - i32.const 4 - i32.add - local.set $1 - br $while-continue|1 - end - end - loop $while-continue|2 - local.get $1 - local.get $3 - i32.lt_s - if - local.get $2 - local.get $0 - local.get $1 - i32.add - i32.load8_u - i32.const 374761393 - i32.mul - i32.add - i32.const 11 - i32.rotl - i32.const -1640531535 - i32.mul - local.set $2 - local.get $1 - i32.const 1 - i32.add - local.set $1 - br $while-continue|2 - end - end - local.get $2 - local.get $2 - i32.const 15 - i32.shr_u - i32.xor - i32.const -2048144777 - i32.mul - local.tee $0 - local.get $0 - i32.const 13 - i32.shr_u - i32.xor - i32.const -1028477379 - i32.mul - local.tee $0 - local.get $0 - i32.const 16 - i32.shr_u - i32.xor - else - i32.const 0 - end - ) - (func $~lib/string/String.__eq (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - local.get $0 -======= i32.load local.tee $4 i32.const 1 @@ -776,7 +569,6 @@ local.get $1 i32.const 4 i32.add ->>>>>>> master local.get $1 i32.load i32.const -4 @@ -890,55 +682,6 @@ i32.lt_u i32.const 0 local.get $3 -<<<<<<< HEAD - local.set $2 - loop $while-continue|0 - local.get $5 - local.get $8 - i32.ne - if - local.get $8 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $2 - local.get $8 - i32.load - local.tee $7 - i32.store - local.get $2 - local.get $8 - i32.load offset=4 - i32.store offset=4 - local.get $2 - local.get $4 - local.get $7 - call $~lib/util/hash/HASH<~lib/string/String> - local.get $1 - i32.and - i32.const 2 - i32.shl - i32.add - local.tee $7 - i32.load - i32.store offset=8 - local.get $7 - local.get $2 - i32.store - local.get $2 - i32.const 12 - i32.add - local.set $2 - end - local.get $8 - i32.const 12 - i32.add - local.set $8 - br $while-continue|0 - end -======= i32.const 12 i32.ge_u select @@ -950,7 +693,6 @@ i32.const 14 call $~lib/builtins/abort unreachable ->>>>>>> master end local.get $5 local.get $3 @@ -1041,45 +783,6 @@ local.get $0 local.get $3 local.get $6 -<<<<<<< HEAD - i32.store offset=12 - local.get $0 - local.get $0 - i32.load offset=20 - i32.store offset=16 - ) - (func $~lib/util/hash/HASH (param $0 i32) (result i32) - local.get $0 - i32.const -1028477379 - i32.mul - i32.const 374761397 - i32.add - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.tee $0 - local.get $0 - i32.const 15 - i32.shr_u - i32.xor - i32.const -2048144777 - i32.mul - local.tee $0 - local.get $0 - i32.const 13 - i32.shr_u - i32.xor - i32.const -1028477379 - i32.mul - local.tee $0 - local.get $0 - i32.const 16 - i32.shr_u - i32.xor - ) - (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) -======= i32.const 4 i32.shl i32.add @@ -1089,7 +792,6 @@ local.get $1 i32.store offset=96 local.get $0 ->>>>>>> master local.get $0 i32.load i32.const 1 @@ -1146,48 +848,6 @@ i32.add i32.lt_u if -<<<<<<< HEAD - local.get $8 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $2 - local.get $8 - i32.load - local.tee $7 - i32.store - local.get $2 - local.get $8 - i32.load offset=4 - i32.store offset=4 - local.get $2 - local.get $4 - local.get $7 - call $~lib/util/hash/HASH - local.get $1 - i32.and - i32.const 2 - i32.shl - i32.add - local.tee $7 - i32.load - i32.store offset=8 - local.get $7 - local.get $2 - i32.store - local.get $2 - i32.const 12 - i32.add - local.set $2 - end - local.get $8 - i32.const 12 - i32.add - local.set $8 - br $while-continue|0 -======= i32.const 0 i32.const 1472 i32.const 388 @@ -1222,7 +882,6 @@ i32.const 5 call $~lib/builtins/abort unreachable ->>>>>>> master end end local.get $1 @@ -1264,13 +923,6 @@ i32.store offset=1568 local.get $0 local.get $1 -<<<<<<< HEAD - local.get $1 - call $~lib/util/hash/HASH - local.tee $3 - call $~lib/map/Map#find - local.tee $2 -======= call $~lib/rt/tlsf/insertBlock ) (func $~lib/rt/tlsf/initialize @@ -1290,7 +942,6 @@ else i32.const 0 end ->>>>>>> master if unreachable end @@ -1357,21 +1008,6 @@ (local $0 i32) (local $1 i32) (local $2 i32) -<<<<<<< HEAD - (local $3 i32) - (local $4 i32) - global.get $~lib/symbol/stringToId - if - global.get $~lib/symbol/stringToId - i32.const 1056 - call $~lib/util/hash/HASH<~lib/string/String> - call $~lib/map/Map<~lib/string/String,usize>#find - if - global.get $~lib/symbol/stringToId - i32.const 1056 - call $~lib/util/hash/HASH<~lib/string/String> - call $~lib/map/Map<~lib/string/String,usize>#find -======= block $folding-inner0 block $break|0 block $case2|0 @@ -1509,7 +1145,6 @@ br $folding-inner0 end global.get $~lib/rt/itcms/iter ->>>>>>> master local.tee $0 global.get $~lib/rt/itcms/toSpace i32.ne @@ -1621,15 +1256,6 @@ i32.const 0 return end -<<<<<<< HEAD - global.get $~lib/symbol/stringToId - local.tee $1 - i32.const 1056 - call $~lib/util/hash/HASH<~lib/string/String> - local.tee $3 - call $~lib/map/Map<~lib/string/String,usize>#find - local.tee $2 -======= global.get $~lib/rt/itcms/visitCount ) (func $~lib/rt/tlsf/searchBlock (param $0 i32) (param $1 i32) (result i32) @@ -1637,7 +1263,6 @@ local.get $1 i32.const 256 i32.lt_u ->>>>>>> master if local.get $1 i32.const 4 @@ -1767,14 +1392,6 @@ (local $3 i32) (local $4 i32) local.get $1 -<<<<<<< HEAD - call $~lib/util/hash/HASH - call $~lib/map/Map#find - i32.const 0 - i32.ne - ) - (func $~lib/map/Map#get (param $0 i32) (param $1 i32) (result i32) -======= i32.const 1073741820 i32.ge_u if @@ -1785,7 +1402,6 @@ call $~lib/builtins/abort unreachable end ->>>>>>> master local.get $0 i32.const 12 local.get $1 @@ -1794,20 +1410,14 @@ i32.const -16 i32.and i32.const 4 - i32.sub - local.get $1 -<<<<<<< HEAD - call $~lib/util/hash/HASH - call $~lib/map/Map#find - local.tee $0 -======= + i32.sub + local.get $1 i32.const 12 i32.le_u select local.tee $2 call $~lib/rt/tlsf/searchBlock local.tee $1 ->>>>>>> master i32.eqz if i32.const 4 @@ -2314,36 +1924,35 @@ i32.const 0 call $~lib/rt/itcms/__link ) - (func $~lib/util/hash/hash32 (param $0 i32) (result i32) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) local.get $0 - i32.const 255 - i32.and - i32.const -2128831035 - i32.xor - i32.const 16777619 + i32.const -1028477379 + i32.mul + i32.const 374761397 + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 i32.mul + local.tee $0 local.get $0 - i32.const 8 + i32.const 15 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 + i32.const -2048144777 i32.mul + local.tee $0 local.get $0 - i32.const 16 + i32.const 13 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 + i32.const -1028477379 i32.mul + local.tee $0 local.get $0 - i32.const 24 + i32.const 16 i32.shr_u i32.xor - i32.const 16777619 - i32.mul ) (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) local.get $0 @@ -2458,7 +2067,7 @@ local.get $2 local.get $6 local.get $7 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.get $1 i32.and i32.const 2 @@ -2806,25 +2415,35 @@ unreachable end ) - (func $~lib/util/hash/hashStr (param $0 i32) (result i32) + (func $~lib/util/hash/HASH<~lib/string/String> (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) + (local $8 i32) global.get $~lib/memory/__stack_pointer - i32.const 4 + i32.const 8 i32.sub global.set $~lib/memory/__stack_pointer call $~stack_check global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - i32.const -2128831035 - local.set $1 - local.get $0 - if + i64.const 0 + i64.store + block $~lib/util/hash/hashStr|inlined.0 (result i32) global.get $~lib/memory/__stack_pointer local.get $0 i32.store + i32.const 0 + local.get $0 + i32.eqz + br_if $~lib/util/hash/hashStr|inlined.0 + drop + global.get $~lib/memory/__stack_pointer + local.get $0 + i32.store offset=4 local.get $0 i32.const 20 i32.sub @@ -2833,34 +2452,187 @@ i32.shr_u i32.const 1 i32.shl + local.tee $3 + i32.const 16 + i32.ge_s + if + i32.const 606290984 + local.set $1 + i32.const -2048144777 + local.set $4 + i32.const 1640531535 + local.set $5 + local.get $3 + i32.const 16 + i32.sub + local.set $7 + loop $while-continue|0 + local.get $2 + local.get $7 + i32.le_s + if + local.get $1 + local.get $0 + local.get $2 + i32.add + local.tee $6 + i32.load + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $1 + local.get $4 + local.get $6 + i32.load offset=4 + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $4 + local.get $8 + local.get $6 + i32.load offset=8 + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $8 + local.get $5 + local.get $6 + i32.load offset=12 + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $5 + local.get $2 + i32.const 16 + i32.add + local.set $2 + br $while-continue|0 + end + end + local.get $3 + local.get $1 + i32.const 1 + i32.rotl + local.get $4 + i32.const 7 + i32.rotl + i32.add + local.get $8 + i32.const 12 + i32.rotl + i32.add + local.get $5 + i32.const 18 + i32.rotl + i32.add + i32.add + local.set $1 + local.get $7 + local.get $2 + i32.sub + local.set $3 + else + local.get $3 + i32.const 374761393 + i32.add + local.set $1 + end + i32.const 0 + local.set $2 + local.get $3 + i32.const 4 + i32.sub local.set $3 - loop $for-loop|0 + loop $while-continue|1 local.get $2 local.get $3 - i32.lt_u + i32.le_s + if + local.get $1 + local.get $0 + local.get $2 + i32.add + i32.load + i32.const -1028477379 + i32.mul + i32.add + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $1 + local.get $2 + i32.const 4 + i32.add + local.set $2 + br $while-continue|1 + end + end + loop $while-continue|2 + local.get $2 + local.get $3 + i32.lt_s if local.get $1 local.get $0 local.get $2 i32.add i32.load8_u - i32.xor - i32.const 16777619 + i32.const 374761393 + i32.mul + i32.add + i32.const 11 + i32.rotl + i32.const -1640531535 i32.mul local.set $1 local.get $2 i32.const 1 i32.add local.set $2 - br $for-loop|0 + br $while-continue|2 end end + local.get $1 + local.get $1 + i32.const 15 + i32.shr_u + i32.xor + i32.const -2048144777 + i32.mul + local.tee $0 + local.get $0 + i32.const 13 + i32.shr_u + i32.xor + i32.const -1028477379 + i32.mul + local.tee $0 + local.get $0 + i32.const 16 + i32.shr_u + i32.xor end global.get $~lib/memory/__stack_pointer - i32.const 4 + i32.const 8 i32.add global.set $~lib/memory/__stack_pointer - local.get $1 ) (func $~lib/string/String.__eq (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -3082,7 +2854,7 @@ (local $7 i32) (local $8 i32) global.get $~lib/memory/__stack_pointer - i32.const 20 + i32.const 16 i32.sub global.set $~lib/memory/__stack_pointer call $~stack_check @@ -3093,9 +2865,6 @@ i64.const 0 i64.store offset=8 global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store offset=16 - global.get $~lib/memory/__stack_pointer local.get $1 i32.const 1 i32.add @@ -3154,13 +2923,10 @@ global.get $~lib/memory/__stack_pointer local.get $7 i32.store offset=12 - global.get $~lib/memory/__stack_pointer - local.get $7 - i32.store offset=16 local.get $2 local.get $6 local.get $7 - call $~lib/util/hash/hashStr + call $~lib/util/hash/HASH<~lib/string/String> local.get $1 i32.and i32.const 2 @@ -3201,7 +2967,7 @@ i32.load offset=20 i32.store offset=16 global.get $~lib/memory/__stack_pointer - i32.const 20 + i32.const 16 i32.add global.set $~lib/memory/__stack_pointer ) @@ -3223,18 +2989,15 @@ global.get $~lib/memory/__stack_pointer i32.const 1056 i32.store - global.get $~lib/memory/__stack_pointer - i32.const 1056 - i32.store offset=4 i32.const 1056 - call $~lib/util/hash/hashStr + call $~lib/util/hash/HASH<~lib/string/String> local.set $3 global.get $~lib/memory/__stack_pointer local.get $0 - i32.store offset=4 + i32.store global.get $~lib/memory/__stack_pointer i32.const 1056 - i32.store offset=8 + i32.store offset=4 local.get $0 local.get $3 call $~lib/map/Map<~lib/string/String,usize>#find @@ -3252,7 +3015,7 @@ if global.get $~lib/memory/__stack_pointer local.get $0 - i32.store offset=4 + i32.store local.get $0 local.get $0 i32.load offset=20 @@ -3280,7 +3043,7 @@ local.get $0 i32.load offset=8 local.tee $2 - i32.store + i32.store offset=8 local.get $0 local.get $0 i32.load offset=16 @@ -3344,7 +3107,7 @@ i64.const 0 i64.store local.get $1 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH local.set $3 global.get $~lib/memory/__stack_pointer local.get $0 @@ -3474,7 +3237,7 @@ i32.const 1056 i32.store offset=4 global.get $~lib/memory/__stack_pointer - i32.const 16 + i32.const 12 i32.sub global.set $~lib/memory/__stack_pointer call $~stack_check @@ -3482,8 +3245,8 @@ i64.const 0 i64.store global.get $~lib/memory/__stack_pointer - i64.const 0 - i64.store offset=8 + i32.const 0 + i32.store offset=8 global.get $~lib/memory/__stack_pointer local.get $0 i32.store @@ -3493,17 +3256,14 @@ global.get $~lib/memory/__stack_pointer i32.const 1056 i32.store offset=8 - global.get $~lib/memory/__stack_pointer - i32.const 1056 - i32.store offset=12 local.get $0 i32.const 1056 - call $~lib/util/hash/hashStr + call $~lib/util/hash/HASH<~lib/string/String> call $~lib/map/Map<~lib/string/String,usize>#find i32.const 0 i32.ne global.get $~lib/memory/__stack_pointer - i32.const 16 + i32.const 12 i32.add global.set $~lib/memory/__stack_pointer if @@ -3515,7 +3275,7 @@ i32.const 1056 i32.store offset=4 global.get $~lib/memory/__stack_pointer - i32.const 16 + i32.const 12 i32.sub global.set $~lib/memory/__stack_pointer call $~stack_check @@ -3523,8 +3283,8 @@ i64.const 0 i64.store global.get $~lib/memory/__stack_pointer - i64.const 0 - i64.store offset=8 + i32.const 0 + i32.store offset=8 global.get $~lib/memory/__stack_pointer local.get $0 i32.store @@ -3534,12 +3294,9 @@ global.get $~lib/memory/__stack_pointer i32.const 1056 i32.store offset=8 - global.get $~lib/memory/__stack_pointer - i32.const 1056 - i32.store offset=12 local.get $0 i32.const 1056 - call $~lib/util/hash/hashStr + call $~lib/util/hash/HASH<~lib/string/String> call $~lib/map/Map<~lib/string/String,usize>#find local.tee $0 i32.eqz @@ -3554,7 +3311,7 @@ local.get $0 i32.load offset=4 global.get $~lib/memory/__stack_pointer - i32.const 16 + i32.const 12 i32.add global.set $~lib/memory/__stack_pointer global.get $~lib/memory/__stack_pointer @@ -3696,7 +3453,7 @@ local.get $0 local.get $1 local.get $1 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne @@ -3720,7 +3477,7 @@ local.get $0 local.get $1 local.get $1 - call $~lib/util/hash/hash32 + call $~lib/util/hash/HASH call $~lib/map/Map#find local.tee $0 i32.eqz diff --git a/tests/compiler/std/symbol.untouched.wat b/tests/compiler/std/symbol.untouched.wat index c0355092b0..e753630eb4 100644 --- a/tests/compiler/std/symbol.untouched.wat +++ b/tests/compiler/std/symbol.untouched.wat @@ -434,293 +434,10 @@ local.get $1 i32.store offset=8 ) -<<<<<<< HEAD - (func $~lib/util/hash/HASH<~lib/string/String> (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) - (local $8 i32) - (local $9 i32) - (local $10 i32) - (local $11 i32) - local.get $0 - call $~lib/rt/stub/__retain - local.set $0 - i32.const 1 - drop - block $~lib/util/hash/hashStr|inlined.0 (result i32) - local.get $0 - call $~lib/rt/stub/__retain - local.set $1 - local.get $1 - i32.const 0 - i32.eq - if - i32.const 0 - local.set $2 - local.get $1 - call $~lib/rt/stub/__release - local.get $2 - br $~lib/util/hash/hashStr|inlined.0 - end - local.get $1 - call $~lib/string/String#get:length - i32.const 1 - i32.shl - local.set $2 - local.get $2 - local.set $3 - local.get $2 - i32.const 16 - i32.ge_s - if - i32.const 0 - i32.const -1640531535 - i32.add - i32.const -2048144777 - i32.add - local.set $4 - i32.const 0 - i32.const -2048144777 - i32.add - local.set $5 - i32.const 0 - local.set $6 - i32.const 0 - i32.const -1640531535 - i32.sub - local.set $7 - i32.const 0 - local.set $8 - local.get $2 - i32.const 16 - i32.sub - local.set $2 - loop $while-continue|0 - local.get $8 - local.get $2 - i32.le_s - local.set $9 - local.get $9 - if - local.get $4 - local.set $11 - local.get $1 - local.get $8 - i32.add - i32.load - local.set $10 - local.get $11 - local.get $10 - i32.const -2048144777 - i32.mul - i32.add - i32.const 13 - i32.rotl - i32.const -1640531535 - i32.mul - local.set $4 - local.get $5 - local.set $11 - local.get $1 - local.get $8 - i32.add - i32.load offset=4 - local.set $10 - local.get $11 - local.get $10 - i32.const -2048144777 - i32.mul - i32.add - i32.const 13 - i32.rotl - i32.const -1640531535 - i32.mul - local.set $5 - local.get $6 - local.set $11 - local.get $1 - local.get $8 - i32.add - i32.load offset=8 - local.set $10 - local.get $11 - local.get $10 - i32.const -2048144777 - i32.mul - i32.add - i32.const 13 - i32.rotl - i32.const -1640531535 - i32.mul - local.set $6 - local.get $7 - local.set $11 - local.get $1 - local.get $8 - i32.add - i32.load offset=12 - local.set $10 - local.get $11 - local.get $10 - i32.const -2048144777 - i32.mul - i32.add - i32.const 13 - i32.rotl - i32.const -1640531535 - i32.mul - local.set $7 - local.get $8 - i32.const 16 - i32.add - local.set $8 - br $while-continue|0 - end - end - local.get $3 - local.get $4 - i32.const 1 - i32.rotl - local.get $5 - i32.const 7 - i32.rotl - i32.add - local.get $6 - i32.const 12 - i32.rotl - i32.add - local.get $7 - i32.const 18 - i32.rotl - i32.add - i32.add - local.set $3 - local.get $2 - local.get $8 - i32.sub - local.set $2 - else - local.get $3 - i32.const 0 - i32.const 374761393 - i32.add - i32.add - local.set $3 - end - i32.const 0 - local.set $8 - local.get $2 - i32.const 4 - i32.sub - local.set $2 - loop $while-continue|1 - local.get $8 - local.get $2 - i32.le_s - local.set $7 - local.get $7 - if - local.get $3 - local.get $1 - local.get $8 - i32.add - i32.load - i32.const -1028477379 - i32.mul - i32.add - local.set $3 - local.get $3 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $3 - local.get $8 - i32.const 4 - i32.add - local.set $8 - br $while-continue|1 - end - end - loop $while-continue|2 - local.get $8 - local.get $2 - i32.lt_s - local.set $7 - local.get $7 - if - local.get $3 - local.get $1 - local.get $8 - i32.add - i32.load8_u - i32.const 374761393 - i32.mul - i32.add - local.set $3 - local.get $3 - i32.const 11 - i32.rotl - i32.const -1640531535 - i32.mul - local.set $3 - local.get $8 - i32.const 1 - i32.add - local.set $8 - br $while-continue|2 - end - end - local.get $3 - local.get $3 - i32.const 15 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -2048144777 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 13 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -1028477379 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 16 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - local.set $7 - local.get $1 - call $~lib/rt/stub/__release - local.get $7 - end - local.set $8 - local.get $0 - call $~lib/rt/stub/__release - local.get $8 - return - ) - (func $~lib/util/string/compareImpl (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) -======= (func $~lib/rt/tlsf/removeBlock (param $0 i32) (param $1 i32) (local $2 i32) (local $3 i32) (local $4 i32) ->>>>>>> master (local $5 i32) (local $6 i32) (local $7 i32) @@ -1042,34 +759,6 @@ local.set $5 end end -<<<<<<< HEAD - i32.const 0 - local.set $4 - local.get $1 - call $~lib/rt/stub/__release - local.get $4 - ) - (func $~lib/map/Map<~lib/string/String,usize>#has (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - local.get $1 - call $~lib/rt/stub/__retain - local.set $1 - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH<~lib/string/String> - call $~lib/map/Map<~lib/string/String,usize>#find - i32.const 0 - i32.ne - local.set $2 - local.get $1 - call $~lib/rt/stub/__release - local.get $2 - ) - (func $~lib/map/Map<~lib/string/String,usize>#get (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - (local $3 i32) -======= local.get $2 i32.const 2 i32.and @@ -1165,7 +854,6 @@ end i32.const 1 drop ->>>>>>> master local.get $1 i32.const 4 i32.add @@ -1186,13 +874,6 @@ i32.const 4 i32.sub local.get $1 -<<<<<<< HEAD - local.get $1 - call $~lib/util/hash/HASH<~lib/string/String> - call $~lib/map/Map<~lib/string/String,usize>#find - local.set $2 - local.get $2 -======= i32.store local.get $8 i32.const 256 @@ -1239,7 +920,6 @@ else i32.const 0 end ->>>>>>> master i32.eqz if i32.const 0 @@ -1249,14 +929,6 @@ call $~lib/builtins/abort unreachable end -<<<<<<< HEAD - local.get $2 - i32.load offset=4 - local.set $3 - local.get $1 - call $~lib/rt/stub/__release - local.get $3 -======= local.get $0 local.set $7 local.get $9 @@ -1339,7 +1011,6 @@ i32.add local.get $7 i32.store offset=4 ->>>>>>> master ) (func $~lib/rt/tlsf/addMemory (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -1448,83 +1119,9 @@ i32.const 4 i32.const 12 i32.add -<<<<<<< HEAD - local.set $7 - local.get $5 - local.set $8 - loop $while-continue|0 - local.get $6 - local.get $7 - i32.ne - local.set $9 - local.get $9 - if - local.get $6 - local.set $10 - local.get $10 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $11 - local.get $10 - i32.load - call $~lib/rt/stub/__retain - local.set $12 - local.get $11 - local.get $12 - i32.store - local.get $11 - local.get $10 - i32.load offset=4 - i32.store offset=4 - local.get $12 - call $~lib/util/hash/HASH<~lib/string/String> - local.get $1 - i32.and - local.set $13 - local.get $3 - local.get $13 - i32.const 4 - i32.mul - i32.add - local.set $14 - local.get $11 - local.get $14 - i32.load - i32.store offset=8 - local.get $14 - local.get $8 - i32.store - local.get $8 - i32.const 12 - i32.add - local.set $8 - local.get $12 - call $~lib/rt/stub/__release - end - local.get $6 - i32.const 12 - i32.add - local.set $6 - br $while-continue|0 - end - end - local.get $0 - local.tee $11 - local.get $3 - local.tee $12 - local.get $11 - i32.load - local.tee $9 - i32.ne -======= i32.const 4 i32.add i32.lt_u ->>>>>>> master if i32.const 0 return @@ -1601,12 +1198,6 @@ local.set $0 memory.size local.set $1 -<<<<<<< HEAD - local.get $1 - call $~lib/util/hash/HASH<~lib/string/String> - local.set $3 -======= ->>>>>>> master local.get $0 i32.const 1572 i32.add @@ -1616,201 +1207,20 @@ i32.const -1 i32.xor i32.and - i32.const 16 - i32.shr_u - local.set $2 - local.get $2 - local.get $1 -<<<<<<< HEAD - local.get $3 - call $~lib/map/Map<~lib/string/String,usize>#find - local.set $4 - local.get $4 - if - i32.const 0 - drop - local.get $4 -======= - i32.gt_s - if (result i32) ->>>>>>> master - local.get $2 - local.get $1 - i32.sub - memory.grow - i32.const 0 - i32.lt_s - else -<<<<<<< HEAD - local.get $0 - i32.load offset=16 - local.get $0 - i32.load offset=12 - i32.eq - if - local.get $0 - local.get $0 - i32.load offset=20 - local.get $0 - i32.load offset=12 - i32.const 3 - i32.mul - i32.const 4 - i32.div_s - i32.lt_s - if (result i32) - local.get $0 - i32.load offset=4 - else - local.get $0 - i32.load offset=4 - i32.const 1 - i32.shl - i32.const 1 - i32.or - end - call $~lib/map/Map<~lib/string/String,usize>#rehash - end - local.get $0 - i32.load offset=8 - call $~lib/rt/stub/__retain - local.set $5 - local.get $5 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $6 - i32.const 1 - i32.add - i32.store offset=16 - local.get $6 - i32.const 12 - i32.mul - i32.add - local.set $4 - local.get $4 - local.get $1 - call $~lib/rt/stub/__retain - i32.store - local.get $4 - local.get $2 - i32.store offset=4 - local.get $0 - local.get $0 - i32.load offset=20 - i32.const 1 - i32.add - i32.store offset=20 - local.get $0 - i32.load - local.get $3 - local.get $0 - i32.load offset=4 - i32.and - i32.const 4 - i32.mul - i32.add - local.set $6 - local.get $4 - local.get $6 - i32.load - i32.store offset=8 - local.get $6 - local.get $4 - i32.store - local.get $5 - call $~lib/rt/stub/__release - end - local.get $0 - call $~lib/rt/stub/__retain - local.set $6 - local.get $1 - call $~lib/rt/stub/__release - local.get $6 - ) - (func $~lib/util/hash/HASH (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 4 - i32.le_u - drop - local.get $0 - local.set $2 - i32.const 4 - local.set $1 - i32.const 0 - i32.const 374761393 - i32.add - local.get $1 - i32.add - local.set $3 - local.get $3 - local.get $2 - i32.const -1028477379 - i32.mul - i32.add - local.set $3 - local.get $3 - i32.const 17 - i32.rotl - i32.const 668265263 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 15 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -2048144777 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 13 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - i32.const -1028477379 - i32.mul - local.set $3 - local.get $3 - local.get $3 - i32.const 16 - i32.shr_u - i32.xor - local.set $3 - local.get $3 - return - ) - (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - local.get $0 - i32.load - local.get $2 - local.get $0 - i32.load offset=4 - i32.and - i32.const 4 - i32.mul - i32.add - i32.load - local.set $3 - loop $while-continue|0 - local.get $3 -======= + i32.const 16 + i32.shr_u + local.set $2 + local.get $2 + local.get $1 + i32.gt_s + if (result i32) + local.get $2 + local.get $1 + i32.sub + memory.grow + i32.const 0 + i32.lt_s + else i32.const 0 end if @@ -1834,7 +1244,6 @@ local.get $5 i32.const 23 i32.lt_u ->>>>>>> master local.set $4 local.get $4 if @@ -1916,81 +1325,7 @@ i32.sub local.set $1 local.get $0 -<<<<<<< HEAD - i32.load offset=16 - i32.const 12 - i32.mul - i32.add - local.set $7 - local.get $5 - local.set $8 - loop $while-continue|0 - local.get $6 - local.get $7 - i32.ne - local.set $9 - local.get $9 - if - local.get $6 - local.set $10 - local.get $10 - i32.load offset=8 - i32.const 1 - i32.and - i32.eqz - if - local.get $8 - local.set $11 - local.get $10 - i32.load - local.set $12 - local.get $11 - local.get $12 - i32.store - local.get $11 - local.get $10 - i32.load offset=4 - i32.store offset=4 - local.get $12 - call $~lib/util/hash/HASH - local.get $1 - i32.and - local.set $13 - local.get $3 - local.get $13 - i32.const 4 - i32.mul - i32.add - local.set $14 - local.get $11 - local.get $14 - i32.load - i32.store offset=8 - local.get $14 - local.get $8 - i32.store - local.get $8 - i32.const 12 - i32.add - local.set $8 - end - local.get $6 - i32.const 12 - i32.add - local.set $6 - br $while-continue|0 - end - end - local.get $0 - local.tee $11 - local.get $3 - local.tee $12 - local.get $11 - i32.load - local.tee $9 -======= i32.const 0 ->>>>>>> master i32.ne if (result i32) local.get $0 @@ -2050,65 +1385,6 @@ call $~lib/rt/tlsf/checkUsedBlock call $~lib/rt/tlsf/freeBlock ) -<<<<<<< HEAD - (func $~lib/map/Map#set (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (local $6 i32) - local.get $2 - call $~lib/rt/stub/__retain - local.set $2 - local.get $1 - call $~lib/util/hash/HASH - local.set $3 - local.get $0 - local.get $1 - local.get $3 - call $~lib/map/Map#find - local.set $4 - local.get $4 - if - i32.const 1 - drop - local.get $4 - i32.load offset=4 - local.set $5 - local.get $2 - local.get $5 - i32.ne - if - local.get $4 - local.get $2 - call $~lib/rt/stub/__retain - i32.store offset=4 - local.get $5 - call $~lib/rt/stub/__release - end - else - local.get $0 - i32.load offset=16 - local.get $0 - i32.load offset=12 - i32.eq - if - local.get $0 - local.get $0 - i32.load offset=20 - local.get $0 - i32.load offset=12 - i32.const 3 - i32.mul - i32.const 4 - i32.div_s - i32.lt_s - if (result i32) - local.get $0 - i32.load offset=4 - else - local.get $0 - i32.load offset=4 -======= (func $~lib/rt/itcms/free (param $0 i32) local.get $0 global.get $~lib/memory/__heap_base @@ -2158,7 +1434,6 @@ br_if $case2|0 br $break|0 end ->>>>>>> master i32.const 1 global.set $~lib/rt/itcms/state i32.const 0 @@ -2172,59 +1447,6 @@ i32.mul return end -<<<<<<< HEAD - call $~lib/map/Map#rehash - end - local.get $0 - i32.load offset=8 - call $~lib/rt/stub/__retain - local.set $5 - local.get $5 - local.get $0 - local.get $0 - i32.load offset=16 - local.tee $6 - i32.const 1 - i32.add - i32.store offset=16 - local.get $6 - i32.const 12 - i32.mul - i32.add - local.set $4 - local.get $4 - local.get $1 - i32.store - local.get $4 - local.get $2 - call $~lib/rt/stub/__retain - i32.store offset=4 - local.get $0 - local.get $0 - i32.load offset=20 - i32.const 1 - i32.add - i32.store offset=20 - local.get $0 - i32.load - local.get $3 - local.get $0 - i32.load offset=4 - i32.and - i32.const 4 - i32.mul - i32.add - local.set $6 - local.get $4 - local.get $6 - i32.load - i32.store offset=8 - local.get $6 - local.get $4 - i32.store - local.get $5 - call $~lib/rt/stub/__release -======= global.get $~lib/rt/itcms/white i32.eqz local.set $1 @@ -2367,7 +1589,6 @@ i32.const 0 global.set $~lib/rt/itcms/state br $break|0 ->>>>>>> master end i32.const 0 ) @@ -2466,26 +1687,6 @@ local.get $0 call $~lib/rt/tlsf/computeSize ) -<<<<<<< HEAD - (func $~lib/map/Map#has (param $0 i32) (param $1 i32) (result i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/map/Map#find - i32.const 0 - i32.ne - ) - (func $~lib/map/Map#get (param $0 i32) (param $1 i32) (result i32) - (local $2 i32) - local.get $0 - local.get $1 - local.get $1 - call $~lib/util/hash/HASH - call $~lib/map/Map#find - local.set $2 - local.get $2 -======= (func $~lib/rt/tlsf/searchBlock (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) @@ -2558,7 +1759,6 @@ else i32.const 0 end ->>>>>>> master i32.eqz if i32.const 0 @@ -2568,9 +1768,6 @@ call $~lib/builtins/abort unreachable end -<<<<<<< HEAD - local.get $2 -======= local.get $0 local.set $5 local.get $2 @@ -2580,7 +1777,6 @@ i32.const 2 i32.shl i32.add ->>>>>>> master i32.load offset=4 i32.const 0 i32.const -1 @@ -3489,47 +2685,70 @@ local.get $1 i32.store offset=8 ) - (func $~lib/util/hash/hash32 (param $0 i32) (result i32) + (func $~lib/util/hash/HASH (param $0 i32) (result i32) (local $1 i32) - i32.const -2128831035 - local.set $1 - local.get $1 + (local $2 i32) + (local $3 i32) + i32.const 0 + drop + i32.const 0 + drop + i32.const 0 + drop + i32.const 4 + i32.const 4 + i32.le_u + drop local.get $0 - i32.const 255 - i32.and - i32.xor - i32.const 16777619 - i32.mul + local.set $2 + i32.const 4 local.set $1 + i32.const 0 + i32.const 374761393 + i32.add local.get $1 - local.get $0 - i32.const 8 - i32.shr_u - i32.const 255 - i32.and - i32.xor - i32.const 16777619 + i32.add + local.set $3 + local.get $3 + local.get $2 + i32.const -1028477379 i32.mul - local.set $1 - local.get $1 - local.get $0 - i32.const 16 + i32.add + local.set $3 + local.get $3 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 15 i32.shr_u - i32.const 255 - i32.and i32.xor - i32.const 16777619 + local.set $3 + local.get $3 + i32.const -2048144777 i32.mul - local.set $1 - local.get $1 - local.get $0 - i32.const 24 + local.set $3 + local.get $3 + local.get $3 + i32.const 13 i32.shr_u i32.xor - i32.const 16777619 + local.set $3 + local.get $3 + i32.const -1028477379 i32.mul - local.set $1 - local.get $1 + local.set $3 + local.get $3 + local.get $3 + i32.const 16 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + return ) (func $~lib/map/Map#find (param $0 i32) (param $1 i32) (param $2 i32) (result i32) (local $3 i32) @@ -3683,31 +2902,8 @@ local.get $10 i32.load offset=4 call $~lib/map/MapEntry#set:value - block $~lib/util/hash/HASH|inlined.1 (result i32) - local.get $12 - local.set $13 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $13 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.1 - end + local.get $12 + call $~lib/util/hash/HASH local.get $1 i32.and local.set $13 @@ -5214,137 +4410,358 @@ i32.const 12 i32.add local.set $3 - br $while-continue|0 + br $while-continue|0 + end + end + local.get $2 + local.get $1 + call $~lib/rt/itcms/__visit + ) + (func $~lib/map/Map~visit (param $0 i32) (param $1 i32) + local.get $0 + local.get $1 + call $~lib/map/Map#__visit + ) + (func $~lib/rt/__visit_members (param $0 i32) (param $1 i32) + block $invalid + block $~lib/map/Map + block $~lib/map/Map<~lib/string/String,usize> + block $~lib/arraybuffer/ArrayBufferView + block $~lib/string/String + block $~lib/arraybuffer/ArrayBuffer + local.get $0 + i32.const 8 + i32.sub + i32.load + br_table $~lib/arraybuffer/ArrayBuffer $~lib/string/String $~lib/arraybuffer/ArrayBufferView $~lib/map/Map<~lib/string/String,usize> $~lib/map/Map $invalid + end + return + end + return + end + local.get $0 + local.get $1 + call $~lib/arraybuffer/ArrayBufferView~visit + return + end + local.get $0 + local.get $1 + call $~lib/map/Map<~lib/string/String,usize>~visit + return + end + local.get $0 + local.get $1 + call $~lib/map/Map~visit + return + end + unreachable + ) + (func $~start + global.get $~started + if + return + end + i32.const 1 + global.set $~started + call $start:std/symbol + ) + (func $~stack_check + global.get $~lib/memory/__stack_pointer + global.get $~lib/memory/__data_end + i32.lt_s + if + i32.const 18112 + i32.const 18160 + i32.const 1 + i32.const 1 + call $~lib/builtins/abort + unreachable + end + ) + (func $~lib/util/hash/HASH<~lib/string/String> (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) + (local $8 i32) + (local $9 i32) + (local $10 i32) + (local $11 i32) + (local $12 i32) + global.get $~lib/memory/__stack_pointer + i32.const 8 + i32.sub + global.set $~lib/memory/__stack_pointer + call $~stack_check + global.get $~lib/memory/__stack_pointer + i64.const 0 + i64.store + i32.const 1 + drop + block $~lib/util/hash/hashStr|inlined.0 (result i32) + global.get $~lib/memory/__stack_pointer + local.get $0 + local.tee $1 + i32.store + local.get $1 + i32.const 0 + i32.eq + if + i32.const 0 + br $~lib/util/hash/hashStr|inlined.0 + end + local.get $1 + local.set $12 + global.get $~lib/memory/__stack_pointer + local.get $12 + i32.store offset=4 + local.get $12 + call $~lib/string/String#get:length + i32.const 1 + i32.shl + local.set $2 + local.get $2 + local.set $3 + local.get $2 + i32.const 16 + i32.ge_s + if + i32.const 0 + i32.const -1640531535 + i32.add + i32.const -2048144777 + i32.add + local.set $4 + i32.const 0 + i32.const -2048144777 + i32.add + local.set $5 + i32.const 0 + local.set $6 + i32.const 0 + i32.const -1640531535 + i32.sub + local.set $7 + i32.const 0 + local.set $8 + local.get $2 + i32.const 16 + i32.sub + local.set $2 + loop $while-continue|0 + local.get $8 + local.get $2 + i32.le_s + local.set $9 + local.get $9 + if + local.get $4 + local.set $11 + local.get $1 + local.get $8 + i32.add + i32.load + local.set $10 + local.get $11 + local.get $10 + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $4 + local.get $5 + local.set $11 + local.get $1 + local.get $8 + i32.add + i32.load offset=4 + local.set $10 + local.get $11 + local.get $10 + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $5 + local.get $6 + local.set $11 + local.get $1 + local.get $8 + i32.add + i32.load offset=8 + local.set $10 + local.get $11 + local.get $10 + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $6 + local.get $7 + local.set $11 + local.get $1 + local.get $8 + i32.add + i32.load offset=12 + local.set $10 + local.get $11 + local.get $10 + i32.const -2048144777 + i32.mul + i32.add + i32.const 13 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $7 + local.get $8 + i32.const 16 + i32.add + local.set $8 + br $while-continue|0 + end + end + local.get $3 + local.get $4 + i32.const 1 + i32.rotl + local.get $5 + i32.const 7 + i32.rotl + i32.add + local.get $6 + i32.const 12 + i32.rotl + i32.add + local.get $7 + i32.const 18 + i32.rotl + i32.add + i32.add + local.set $3 + local.get $2 + local.get $8 + i32.sub + local.set $2 + else + local.get $3 + i32.const 0 + i32.const 374761393 + i32.add + i32.add + local.set $3 end - end - local.get $2 - local.get $1 - call $~lib/rt/itcms/__visit - ) - (func $~lib/map/Map~visit (param $0 i32) (param $1 i32) - local.get $0 - local.get $1 - call $~lib/map/Map#__visit - ) - (func $~lib/rt/__visit_members (param $0 i32) (param $1 i32) - block $invalid - block $~lib/map/Map - block $~lib/map/Map<~lib/string/String,usize> - block $~lib/arraybuffer/ArrayBufferView - block $~lib/string/String - block $~lib/arraybuffer/ArrayBuffer - local.get $0 - i32.const 8 - i32.sub - i32.load - br_table $~lib/arraybuffer/ArrayBuffer $~lib/string/String $~lib/arraybuffer/ArrayBufferView $~lib/map/Map<~lib/string/String,usize> $~lib/map/Map $invalid - end - return - end - return - end - local.get $0 + i32.const 0 + local.set $8 + local.get $2 + i32.const 4 + i32.sub + local.set $2 + loop $while-continue|1 + local.get $8 + local.get $2 + i32.le_s + local.set $7 + local.get $7 + if + local.get $3 local.get $1 - call $~lib/arraybuffer/ArrayBufferView~visit - return + local.get $8 + i32.add + i32.load + i32.const -1028477379 + i32.mul + i32.add + local.set $3 + local.get $3 + i32.const 17 + i32.rotl + i32.const 668265263 + i32.mul + local.set $3 + local.get $8 + i32.const 4 + i32.add + local.set $8 + br $while-continue|1 end - local.get $0 - local.get $1 - call $~lib/map/Map<~lib/string/String,usize>~visit - return end - local.get $0 - local.get $1 - call $~lib/map/Map~visit - return - end - unreachable - ) - (func $~start - global.get $~started - if - return - end - i32.const 1 - global.set $~started - call $start:std/symbol - ) - (func $~stack_check - global.get $~lib/memory/__stack_pointer - global.get $~lib/memory/__data_end - i32.lt_s - if - i32.const 18112 - i32.const 18160 - i32.const 1 - i32.const 1 - call $~lib/builtins/abort - unreachable - end - ) - (func $~lib/util/hash/hashStr (param $0 i32) (result i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - global.get $~lib/memory/__stack_pointer - i32.const 4 - i32.sub - global.set $~lib/memory/__stack_pointer - call $~stack_check - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store - i32.const -2128831035 - local.set $1 - local.get $0 - i32.const 0 - i32.ne - if - i32.const 0 - local.set $2 - local.get $0 - local.set $5 - global.get $~lib/memory/__stack_pointer - local.get $5 - i32.store - local.get $5 - call $~lib/string/String#get:length - i32.const 1 - i32.shl - local.set $3 - loop $for-loop|0 + loop $while-continue|2 + local.get $8 local.get $2 - local.get $3 - i32.lt_u - local.set $4 - local.get $4 + i32.lt_s + local.set $7 + local.get $7 if + local.get $3 local.get $1 - local.get $0 - local.get $2 + local.get $8 i32.add i32.load8_u - i32.xor - i32.const 16777619 + i32.const 374761393 i32.mul - local.set $1 - local.get $2 + i32.add + local.set $3 + local.get $3 + i32.const 11 + i32.rotl + i32.const -1640531535 + i32.mul + local.set $3 + local.get $8 i32.const 1 i32.add - local.set $2 - br $for-loop|0 + local.set $8 + br $while-continue|2 end end + local.get $3 + local.get $3 + i32.const 15 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -2048144777 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 13 + i32.shr_u + i32.xor + local.set $3 + local.get $3 + i32.const -1028477379 + i32.mul + local.set $3 + local.get $3 + local.get $3 + i32.const 16 + i32.shr_u + i32.xor + local.set $3 + local.get $3 end - local.get $1 - local.set $5 + local.set $12 global.get $~lib/memory/__stack_pointer - i32.const 4 + i32.const 8 i32.add global.set $~lib/memory/__stack_pointer - local.get $5 + local.get $12 + return ) (func $~lib/string/String.__eq (param $0 i32) (param $1 i32) (result i32) (local $2 i32) @@ -5524,9 +4941,8 @@ ) (func $~lib/map/Map<~lib/string/String,usize>#has (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) global.get $~lib/memory/__stack_pointer - i32.const 16 + i32.const 12 i32.sub global.set $~lib/memory/__stack_pointer call $~stack_check @@ -5534,52 +4950,42 @@ i64.const 0 i64.store global.get $~lib/memory/__stack_pointer - i64.const 0 - i64.store offset=8 + i32.const 0 + i32.store offset=8 local.get $0 - local.set $3 + local.set $2 global.get $~lib/memory/__stack_pointer - local.get $3 + local.get $2 i32.store - local.get $3 + local.get $2 local.get $1 - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store offset=4 - local.get $3 - block $~lib/util/hash/HASH<~lib/string/String>|inlined.0 (result i32) - global.get $~lib/memory/__stack_pointer - local.get $1 - local.tee $2 - i32.store offset=8 - i32.const 1 - drop - local.get $2 - local.set $3 - global.get $~lib/memory/__stack_pointer - local.get $3 - i32.store offset=12 - local.get $3 - call $~lib/util/hash/hashStr - br $~lib/util/hash/HASH<~lib/string/String>|inlined.0 - end + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=4 + local.get $2 + local.get $1 + local.set $2 + global.get $~lib/memory/__stack_pointer + local.get $2 + i32.store offset=8 + local.get $2 + call $~lib/util/hash/HASH<~lib/string/String> call $~lib/map/Map<~lib/string/String,usize>#find i32.const 0 i32.ne - local.set $3 + local.set $2 global.get $~lib/memory/__stack_pointer - i32.const 16 + i32.const 12 i32.add global.set $~lib/memory/__stack_pointer - local.get $3 + local.get $2 ) (func $~lib/map/Map<~lib/string/String,usize>#get (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - (local $4 i32) global.get $~lib/memory/__stack_pointer - i32.const 16 + i32.const 12 i32.sub global.set $~lib/memory/__stack_pointer call $~stack_check @@ -5587,39 +4993,30 @@ i64.const 0 i64.store global.get $~lib/memory/__stack_pointer - i64.const 0 - i64.store offset=8 + i32.const 0 + i32.store offset=8 local.get $0 - local.set $4 + local.set $3 global.get $~lib/memory/__stack_pointer - local.get $4 + local.get $3 i32.store - local.get $4 + local.get $3 local.get $1 - local.set $4 + local.set $3 global.get $~lib/memory/__stack_pointer - local.get $4 + local.get $3 i32.store offset=4 - local.get $4 - block $~lib/util/hash/HASH<~lib/string/String>|inlined.1 (result i32) - global.get $~lib/memory/__stack_pointer - local.get $1 - local.tee $2 - i32.store offset=8 - i32.const 1 - drop - local.get $2 - local.set $4 - global.get $~lib/memory/__stack_pointer - local.get $4 - i32.store offset=12 - local.get $4 - call $~lib/util/hash/hashStr - br $~lib/util/hash/HASH<~lib/string/String>|inlined.1 - end - call $~lib/map/Map<~lib/string/String,usize>#find + local.get $3 + local.get $1 local.set $3 + global.get $~lib/memory/__stack_pointer + local.get $3 + i32.store offset=8 local.get $3 + call $~lib/util/hash/HASH<~lib/string/String> + call $~lib/map/Map<~lib/string/String,usize>#find + local.set $2 + local.get $2 i32.eqz if i32.const 624 @@ -5629,14 +5026,14 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $2 i32.load offset=4 - local.set $4 + local.set $3 global.get $~lib/memory/__stack_pointer - i32.const 16 + i32.const 12 i32.add global.set $~lib/memory/__stack_pointer - local.get $4 + local.get $3 ) (func $~lib/map/Map<~lib/string/String,usize>#rehash (param $0 i32) (param $1 i32) (local $2 i32) @@ -5654,7 +5051,7 @@ (local $14 i32) (local $15 i32) global.get $~lib/memory/__stack_pointer - i32.const 20 + i32.const 16 i32.sub global.set $~lib/memory/__stack_pointer call $~stack_check @@ -5664,9 +5061,6 @@ global.get $~lib/memory/__stack_pointer i64.const 0 i64.store offset=8 - global.get $~lib/memory/__stack_pointer - i32.const 0 - i32.store offset=16 local.get $1 i32.const 1 i32.add @@ -5734,22 +5128,13 @@ local.get $10 i32.load offset=4 call $~lib/map/MapEntry<~lib/string/String,usize>#set:value - block $~lib/util/hash/HASH<~lib/string/String>|inlined.3 (result i32) - global.get $~lib/memory/__stack_pointer - local.get $12 - local.tee $13 - i32.store offset=12 - i32.const 1 - drop - local.get $13 - local.set $15 - global.get $~lib/memory/__stack_pointer - local.get $15 - i32.store offset=16 - local.get $15 - call $~lib/util/hash/hashStr - br $~lib/util/hash/HASH<~lib/string/String>|inlined.3 - end + local.get $12 + local.set $15 + global.get $~lib/memory/__stack_pointer + local.get $15 + i32.store offset=12 + local.get $15 + call $~lib/util/hash/HASH<~lib/string/String> local.get $1 i32.and local.set $13 @@ -5795,7 +5180,7 @@ i32.load offset=20 call $~lib/map/Map<~lib/string/String,usize>#set:entriesOffset global.get $~lib/memory/__stack_pointer - i32.const 20 + i32.const 16 i32.add global.set $~lib/memory/__stack_pointer ) @@ -5816,41 +5201,32 @@ global.get $~lib/memory/__stack_pointer i32.const 0 i32.store offset=8 - block $~lib/util/hash/HASH<~lib/string/String>|inlined.2 (result i32) - global.get $~lib/memory/__stack_pointer - local.get $1 - local.tee $3 - i32.store - i32.const 1 - drop - local.get $3 - local.set $7 - global.get $~lib/memory/__stack_pointer - local.get $7 - i32.store offset=4 - local.get $7 - call $~lib/util/hash/hashStr - br $~lib/util/hash/HASH<~lib/string/String>|inlined.2 - end - local.set $4 + local.get $1 + local.set $7 + global.get $~lib/memory/__stack_pointer + local.get $7 + i32.store + local.get $7 + call $~lib/util/hash/HASH<~lib/string/String> + local.set $3 local.get $0 local.set $7 global.get $~lib/memory/__stack_pointer local.get $7 - i32.store offset=4 + i32.store local.get $7 local.get $1 local.set $7 global.get $~lib/memory/__stack_pointer local.get $7 - i32.store offset=8 + i32.store offset=4 local.get $7 - local.get $4 + local.get $3 call $~lib/map/Map<~lib/string/String,usize>#find - local.set $5 - local.get $5 + local.set $4 + local.get $4 if - local.get $5 + local.get $4 local.get $2 call $~lib/map/MapEntry<~lib/string/String,usize>#set:value i32.const 0 @@ -5866,7 +5242,7 @@ local.set $7 global.get $~lib/memory/__stack_pointer local.get $7 - i32.store offset=4 + i32.store local.get $7 local.get $0 i32.load offset=20 @@ -5893,9 +5269,9 @@ global.get $~lib/memory/__stack_pointer local.get $0 i32.load offset=8 - local.tee $3 - i32.store - local.get $3 + local.tee $5 + i32.store offset=8 + local.get $5 local.get $0 local.get $0 i32.load offset=16 @@ -5907,8 +5283,8 @@ i32.const 12 i32.mul i32.add - local.set $5 - local.get $5 + local.set $4 + local.get $4 local.get $1 call $~lib/map/MapEntry<~lib/string/String,usize>#set:key i32.const 1 @@ -5917,7 +5293,7 @@ local.get $1 i32.const 1 call $~lib/rt/itcms/__link - local.get $5 + local.get $4 local.get $2 call $~lib/map/MapEntry<~lib/string/String,usize>#set:value i32.const 0 @@ -5930,7 +5306,7 @@ call $~lib/map/Map<~lib/string/String,usize>#set:entriesCount local.get $0 i32.load - local.get $4 + local.get $3 local.get $0 i32.load offset=4 i32.and @@ -5938,12 +5314,12 @@ i32.mul i32.add local.set $6 - local.get $5 + local.get $4 local.get $6 i32.load call $~lib/map/MapEntry<~lib/string/String,usize>#set:taggedNext local.get $6 - local.get $5 + local.get $4 i32.store end local.get $0 @@ -5968,32 +5344,9 @@ global.get $~lib/memory/__stack_pointer i64.const 0 i64.store - block $~lib/util/hash/HASH|inlined.0 (result i32) - local.get $1 - local.set $3 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $3 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.0 - end - local.set $4 + local.get $1 + call $~lib/util/hash/HASH + local.set $3 local.get $0 local.set $7 global.get $~lib/memory/__stack_pointer @@ -6001,12 +5354,12 @@ i32.store local.get $7 local.get $1 - local.get $4 + local.get $3 call $~lib/map/Map#find - local.set $5 - local.get $5 + local.set $4 + local.get $4 if - local.get $5 + local.get $4 local.get $2 call $~lib/map/MapEntry#set:value i32.const 1 @@ -6053,9 +5406,9 @@ global.get $~lib/memory/__stack_pointer local.get $0 i32.load offset=8 - local.tee $3 + local.tee $5 i32.store offset=4 - local.get $3 + local.get $5 local.get $0 local.get $0 i32.load offset=16 @@ -6067,13 +5420,13 @@ i32.const 12 i32.mul i32.add - local.set $5 - local.get $5 + local.set $4 + local.get $4 local.get $1 call $~lib/map/MapEntry#set:key i32.const 0 drop - local.get $5 + local.get $4 local.get $2 call $~lib/map/MapEntry#set:value i32.const 1 @@ -6090,7 +5443,7 @@ call $~lib/map/Map#set:entriesCount local.get $0 i32.load - local.get $4 + local.get $3 local.get $0 i32.load offset=4 i32.and @@ -6098,12 +5451,12 @@ i32.mul i32.add local.set $6 - local.get $5 + local.get $4 local.get $6 i32.load call $~lib/map/MapEntry#set:taggedNext local.get $6 - local.get $5 + local.get $4 i32.store end local.get $0 @@ -6227,7 +5580,6 @@ ) (func $~lib/map/Map#has (param $0 i32) (param $1 i32) (result i32) (local $2 i32) - (local $3 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -6237,51 +5589,27 @@ i32.const 0 i32.store local.get $0 - local.set $3 + local.set $2 global.get $~lib/memory/__stack_pointer - local.get $3 + local.get $2 i32.store - local.get $3 + local.get $2 local.get $1 - block $~lib/util/hash/HASH|inlined.2 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.2 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find i32.const 0 i32.ne - local.set $3 + local.set $2 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $3 + local.get $2 ) (func $~lib/map/Map#get (param $0 i32) (param $1 i32) (result i32) (local $2 i32) (local $3 i32) - (local $4 i32) global.get $~lib/memory/__stack_pointer i32.const 4 i32.sub @@ -6291,40 +5619,17 @@ i32.const 0 i32.store local.get $0 - local.set $4 + local.set $3 global.get $~lib/memory/__stack_pointer - local.get $4 + local.get $3 i32.store - local.get $4 + local.get $3 local.get $1 - block $~lib/util/hash/HASH|inlined.3 (result i32) - local.get $1 - local.set $2 - i32.const 0 - drop - i32.const 0 - drop - i32.const 0 - drop - i32.const 4 - i32.const 1 - i32.eq - drop - i32.const 4 - i32.const 2 - i32.eq - drop - i32.const 4 - i32.const 4 - i32.eq - drop - local.get $2 - call $~lib/util/hash/hash32 - br $~lib/util/hash/HASH|inlined.3 - end + local.get $1 + call $~lib/util/hash/HASH call $~lib/map/Map#find - local.set $3 - local.get $3 + local.set $2 + local.get $2 i32.eqz if i32.const 624 @@ -6334,14 +5639,14 @@ call $~lib/builtins/abort unreachable end - local.get $3 + local.get $2 i32.load offset=4 - local.set $4 + local.set $3 global.get $~lib/memory/__stack_pointer i32.const 4 i32.add global.set $~lib/memory/__stack_pointer - local.get $4 + local.get $3 ) (func $~lib/symbol/_Symbol.keyFor (param $0 i32) (result i32) (local $1 i32) From 12ce5b2e3da3cb2a293a66b48b5fe8fd5a0680d3 Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Sat, 6 Feb 2021 22:35:33 +0200 Subject: [PATCH 07/14] fix --- std/assembly/util/hash.ts | 8 +- tests/compiler/std/hash.optimized.wat | 16 +-- tests/compiler/std/hash.untouched.wat | 126 ++++++++++++------------ tests/compiler/std/symbol.optimized.wat | 16 +-- tests/compiler/std/symbol.untouched.wat | 63 ++++++------ 5 files changed, 116 insertions(+), 113 deletions(-) diff --git a/std/assembly/util/hash.ts b/std/assembly/util/hash.ts index 58e390a347..2b0226a273 100644 --- a/std/assembly/util/hash.ts +++ b/std/assembly/util/hash.ts @@ -83,9 +83,9 @@ function hashStr(key: string): u32 { let s4 = XXH32_SEED - XXH32_P1; let i = 0; - len -= 16; + let n = len - 16; - while (i <= len) { + while (i <= n) { s1 = mix(s1, load(changetype(key) + i)); s2 = mix(s2, load(changetype(key) + i, 4)); s3 = mix(s3, load(changetype(key) + i, 8)); @@ -99,9 +99,9 @@ function hashStr(key: string): u32 { } var i = 0; - len -= 4; + var n = len - 4; - while (i <= len) { + while (i <= n) { h += load(changetype(key) + i) * XXH32_P3; h = rotl(h, 17) * XXH32_P4; i += 4; diff --git a/tests/compiler/std/hash.optimized.wat b/tests/compiler/std/hash.optimized.wat index 0d439f79d0..eb46703c61 100644 --- a/tests/compiler/std/hash.optimized.wat +++ b/tests/compiler/std/hash.optimized.wat @@ -89,10 +89,10 @@ local.get $3 i32.const 16 i32.sub - local.set $7 + local.set $8 loop $while-continue|0 local.get $1 - local.get $7 + local.get $8 i32.le_s if local.get $2 @@ -120,7 +120,7 @@ i32.const -1640531535 i32.mul local.set $4 - local.get $8 + local.get $7 local.get $6 i32.load offset=8 i32.const -2048144777 @@ -130,7 +130,7 @@ i32.rotl i32.const -1640531535 i32.mul - local.set $8 + local.set $7 local.get $5 local.get $6 i32.load offset=12 @@ -157,7 +157,7 @@ i32.const 7 i32.rotl i32.add - local.get $8 + local.get $7 i32.const 12 i32.rotl i32.add @@ -167,7 +167,7 @@ i32.add i32.add local.set $2 - local.get $7 + local.get $3 local.get $1 i32.sub local.set $3 @@ -182,10 +182,10 @@ local.get $3 i32.const 4 i32.sub - local.set $3 + local.set $4 loop $while-continue|1 local.get $1 - local.get $3 + local.get $4 i32.le_s if local.get $2 diff --git a/tests/compiler/std/hash.untouched.wat b/tests/compiler/std/hash.untouched.wat index 295b409a17..bcb1b24de8 100644 --- a/tests/compiler/std/hash.untouched.wat +++ b/tests/compiler/std/hash.untouched.wat @@ -211,6 +211,7 @@ (local $10 i32) (local $11 i32) (local $12 i32) + (local $13 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -234,11 +235,11 @@ br $~lib/util/hash/hashStr|inlined.0 end local.get $1 - local.set $12 + local.set $13 global.get $~lib/memory/__stack_pointer - local.get $12 + local.get $13 i32.store offset=4 - local.get $12 + local.get $13 call $~lib/string/String#get:length i32.const 1 i32.shl @@ -270,23 +271,23 @@ local.get $2 i32.const 16 i32.sub - local.set $2 + local.set $9 loop $while-continue|0 local.get $8 - local.get $2 - i32.le_s - local.set $9 local.get $9 + i32.le_s + local.set $10 + local.get $10 if local.get $4 - local.set $11 + local.set $12 local.get $1 local.get $8 i32.add i32.load - local.set $10 + local.set $11 + local.get $12 local.get $11 - local.get $10 i32.const -2048144777 i32.mul i32.add @@ -296,14 +297,14 @@ i32.mul local.set $4 local.get $5 - local.set $11 + local.set $12 local.get $1 local.get $8 i32.add i32.load offset=4 - local.set $10 + local.set $11 + local.get $12 local.get $11 - local.get $10 i32.const -2048144777 i32.mul i32.add @@ -313,14 +314,14 @@ i32.mul local.set $5 local.get $6 - local.set $11 + local.set $12 local.get $1 local.get $8 i32.add i32.load offset=8 - local.set $10 + local.set $11 + local.get $12 local.get $11 - local.get $10 i32.const -2048144777 i32.mul i32.add @@ -330,14 +331,14 @@ i32.mul local.set $6 local.get $7 - local.set $11 + local.set $12 local.get $1 local.get $8 i32.add i32.load offset=12 - local.set $10 + local.set $11 + local.get $12 local.get $11 - local.get $10 i32.const -2048144777 i32.mul i32.add @@ -384,21 +385,21 @@ local.set $3 end i32.const 0 - local.set $8 + local.set $9 local.get $2 i32.const 4 i32.sub - local.set $2 + local.set $8 loop $while-continue|1 + local.get $9 local.get $8 - local.get $2 i32.le_s local.set $7 local.get $7 if local.get $3 local.get $1 - local.get $8 + local.get $9 i32.add i32.load i32.const -1028477379 @@ -411,15 +412,15 @@ i32.const 668265263 i32.mul local.set $3 - local.get $8 + local.get $9 i32.const 4 i32.add - local.set $8 + local.set $9 br $while-continue|1 end end loop $while-continue|2 - local.get $8 + local.get $9 local.get $2 i32.lt_s local.set $7 @@ -427,7 +428,7 @@ if local.get $3 local.get $1 - local.get $8 + local.get $9 i32.add i32.load8_u i32.const 374761393 @@ -440,10 +441,10 @@ i32.const -1640531535 i32.mul local.set $3 - local.get $8 + local.get $9 i32.const 1 i32.add - local.set $8 + local.set $9 br $while-continue|2 end end @@ -475,12 +476,12 @@ local.set $3 local.get $3 end - local.set $12 + local.set $13 global.get $~lib/memory/__stack_pointer i32.const 8 i32.add global.set $~lib/memory/__stack_pointer - local.get $12 + local.get $13 return ) (func $~lib/util/hash/HASH<~lib/string/String> (param $0 i32) (result i32) @@ -496,6 +497,7 @@ (local $10 i32) (local $11 i32) (local $12 i32) + (local $13 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -519,11 +521,11 @@ br $~lib/util/hash/hashStr|inlined.1 end local.get $1 - local.set $12 + local.set $13 global.get $~lib/memory/__stack_pointer - local.get $12 + local.get $13 i32.store offset=4 - local.get $12 + local.get $13 call $~lib/string/String#get:length i32.const 1 i32.shl @@ -555,23 +557,23 @@ local.get $2 i32.const 16 i32.sub - local.set $2 + local.set $9 loop $while-continue|0 local.get $8 - local.get $2 - i32.le_s - local.set $9 local.get $9 + i32.le_s + local.set $10 + local.get $10 if local.get $4 - local.set $11 + local.set $12 local.get $1 local.get $8 i32.add i32.load - local.set $10 + local.set $11 + local.get $12 local.get $11 - local.get $10 i32.const -2048144777 i32.mul i32.add @@ -581,14 +583,14 @@ i32.mul local.set $4 local.get $5 - local.set $11 + local.set $12 local.get $1 local.get $8 i32.add i32.load offset=4 - local.set $10 + local.set $11 + local.get $12 local.get $11 - local.get $10 i32.const -2048144777 i32.mul i32.add @@ -598,14 +600,14 @@ i32.mul local.set $5 local.get $6 - local.set $11 + local.set $12 local.get $1 local.get $8 i32.add i32.load offset=8 - local.set $10 + local.set $11 + local.get $12 local.get $11 - local.get $10 i32.const -2048144777 i32.mul i32.add @@ -615,14 +617,14 @@ i32.mul local.set $6 local.get $7 - local.set $11 + local.set $12 local.get $1 local.get $8 i32.add i32.load offset=12 - local.set $10 + local.set $11 + local.get $12 local.get $11 - local.get $10 i32.const -2048144777 i32.mul i32.add @@ -669,21 +671,21 @@ local.set $3 end i32.const 0 - local.set $8 + local.set $9 local.get $2 i32.const 4 i32.sub - local.set $2 + local.set $8 loop $while-continue|1 + local.get $9 local.get $8 - local.get $2 i32.le_s local.set $7 local.get $7 if local.get $3 local.get $1 - local.get $8 + local.get $9 i32.add i32.load i32.const -1028477379 @@ -696,15 +698,15 @@ i32.const 668265263 i32.mul local.set $3 - local.get $8 + local.get $9 i32.const 4 i32.add - local.set $8 + local.set $9 br $while-continue|1 end end loop $while-continue|2 - local.get $8 + local.get $9 local.get $2 i32.lt_s local.set $7 @@ -712,7 +714,7 @@ if local.get $3 local.get $1 - local.get $8 + local.get $9 i32.add i32.load8_u i32.const 374761393 @@ -725,10 +727,10 @@ i32.const -1640531535 i32.mul local.set $3 - local.get $8 + local.get $9 i32.const 1 i32.add - local.set $8 + local.set $9 br $while-continue|2 end end @@ -760,12 +762,12 @@ local.set $3 local.get $3 end - local.set $12 + local.set $13 global.get $~lib/memory/__stack_pointer i32.const 8 i32.add global.set $~lib/memory/__stack_pointer - local.get $12 + local.get $13 return ) (func $start:std/hash diff --git a/tests/compiler/std/symbol.optimized.wat b/tests/compiler/std/symbol.optimized.wat index 1ba98c6d4c..f38af5cfd7 100644 --- a/tests/compiler/std/symbol.optimized.wat +++ b/tests/compiler/std/symbol.optimized.wat @@ -2465,10 +2465,10 @@ local.get $3 i32.const 16 i32.sub - local.set $7 + local.set $8 loop $while-continue|0 local.get $2 - local.get $7 + local.get $8 i32.le_s if local.get $1 @@ -2496,7 +2496,7 @@ i32.const -1640531535 i32.mul local.set $4 - local.get $8 + local.get $7 local.get $6 i32.load offset=8 i32.const -2048144777 @@ -2506,7 +2506,7 @@ i32.rotl i32.const -1640531535 i32.mul - local.set $8 + local.set $7 local.get $5 local.get $6 i32.load offset=12 @@ -2533,7 +2533,7 @@ i32.const 7 i32.rotl i32.add - local.get $8 + local.get $7 i32.const 12 i32.rotl i32.add @@ -2543,7 +2543,7 @@ i32.add i32.add local.set $1 - local.get $7 + local.get $3 local.get $2 i32.sub local.set $3 @@ -2558,10 +2558,10 @@ local.get $3 i32.const 4 i32.sub - local.set $3 + local.set $4 loop $while-continue|1 local.get $2 - local.get $3 + local.get $4 i32.le_s if local.get $1 diff --git a/tests/compiler/std/symbol.untouched.wat b/tests/compiler/std/symbol.untouched.wat index e753630eb4..1c15333818 100644 --- a/tests/compiler/std/symbol.untouched.wat +++ b/tests/compiler/std/symbol.untouched.wat @@ -4491,6 +4491,7 @@ (local $10 i32) (local $11 i32) (local $12 i32) + (local $13 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -4514,11 +4515,11 @@ br $~lib/util/hash/hashStr|inlined.0 end local.get $1 - local.set $12 + local.set $13 global.get $~lib/memory/__stack_pointer - local.get $12 + local.get $13 i32.store offset=4 - local.get $12 + local.get $13 call $~lib/string/String#get:length i32.const 1 i32.shl @@ -4550,23 +4551,23 @@ local.get $2 i32.const 16 i32.sub - local.set $2 + local.set $9 loop $while-continue|0 local.get $8 - local.get $2 - i32.le_s - local.set $9 local.get $9 + i32.le_s + local.set $10 + local.get $10 if local.get $4 - local.set $11 + local.set $12 local.get $1 local.get $8 i32.add i32.load - local.set $10 + local.set $11 + local.get $12 local.get $11 - local.get $10 i32.const -2048144777 i32.mul i32.add @@ -4576,14 +4577,14 @@ i32.mul local.set $4 local.get $5 - local.set $11 + local.set $12 local.get $1 local.get $8 i32.add i32.load offset=4 - local.set $10 + local.set $11 + local.get $12 local.get $11 - local.get $10 i32.const -2048144777 i32.mul i32.add @@ -4593,14 +4594,14 @@ i32.mul local.set $5 local.get $6 - local.set $11 + local.set $12 local.get $1 local.get $8 i32.add i32.load offset=8 - local.set $10 + local.set $11 + local.get $12 local.get $11 - local.get $10 i32.const -2048144777 i32.mul i32.add @@ -4610,14 +4611,14 @@ i32.mul local.set $6 local.get $7 - local.set $11 + local.set $12 local.get $1 local.get $8 i32.add i32.load offset=12 - local.set $10 + local.set $11 + local.get $12 local.get $11 - local.get $10 i32.const -2048144777 i32.mul i32.add @@ -4664,21 +4665,21 @@ local.set $3 end i32.const 0 - local.set $8 + local.set $9 local.get $2 i32.const 4 i32.sub - local.set $2 + local.set $8 loop $while-continue|1 + local.get $9 local.get $8 - local.get $2 i32.le_s local.set $7 local.get $7 if local.get $3 local.get $1 - local.get $8 + local.get $9 i32.add i32.load i32.const -1028477379 @@ -4691,15 +4692,15 @@ i32.const 668265263 i32.mul local.set $3 - local.get $8 + local.get $9 i32.const 4 i32.add - local.set $8 + local.set $9 br $while-continue|1 end end loop $while-continue|2 - local.get $8 + local.get $9 local.get $2 i32.lt_s local.set $7 @@ -4707,7 +4708,7 @@ if local.get $3 local.get $1 - local.get $8 + local.get $9 i32.add i32.load8_u i32.const 374761393 @@ -4720,10 +4721,10 @@ i32.const -1640531535 i32.mul local.set $3 - local.get $8 + local.get $9 i32.const 1 i32.add - local.set $8 + local.set $9 br $while-continue|2 end end @@ -4755,12 +4756,12 @@ local.set $3 local.get $3 end - local.set $12 + local.set $13 global.get $~lib/memory/__stack_pointer i32.const 8 i32.add global.set $~lib/memory/__stack_pointer - local.get $12 + local.get $13 return ) (func $~lib/string/String.__eq (param $0 i32) (param $1 i32) (result i32) From ceb6d091c2aac82818aad05875b3c91fe9956fd6 Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Sun, 7 Feb 2021 00:20:25 +0200 Subject: [PATCH 08/14] final fix --- std/assembly/util/hash.ts | 6 +- tests/compiler/std/hash.optimized.wat | 11 +- tests/compiler/std/hash.untouched.wat | 160 +++++++++++------------- tests/compiler/std/symbol.optimized.wat | 11 +- tests/compiler/std/symbol.untouched.wat | 80 ++++++------ 5 files changed, 116 insertions(+), 152 deletions(-) diff --git a/std/assembly/util/hash.ts b/std/assembly/util/hash.ts index 2b0226a273..59b2bccd54 100644 --- a/std/assembly/util/hash.ts +++ b/std/assembly/util/hash.ts @@ -75,6 +75,7 @@ function hashStr(key: string): u32 { var len = key.length << 1; var h: u32 = len; + let i = 0; if (len >= 16) { let s1 = XXH32_SEED + XXH32_P1 + XXH32_P2; @@ -82,9 +83,7 @@ function hashStr(key: string): u32 { let s3 = XXH32_SEED; let s4 = XXH32_SEED - XXH32_P1; - let i = 0; let n = len - 16; - while (i <= n) { s1 = mix(s1, load(changetype(key) + i)); s2 = mix(s2, load(changetype(key) + i, 4)); @@ -93,14 +92,11 @@ function hashStr(key: string): u32 { i += 16; } h += rotl(s1, 1) + rotl(s2, 7) + rotl(s3, 12) + rotl(s4, 18); - len -= i; } else { h += XXH32_SEED + XXH32_P5; } - var i = 0; var n = len - 4; - while (i <= n) { h += load(changetype(key) + i) * XXH32_P3; h = rotl(h, 17) * XXH32_P4; diff --git a/tests/compiler/std/hash.optimized.wat b/tests/compiler/std/hash.optimized.wat index eb46703c61..8bf6fc7a27 100644 --- a/tests/compiler/std/hash.optimized.wat +++ b/tests/compiler/std/hash.optimized.wat @@ -79,7 +79,7 @@ local.tee $3 i32.const 16 i32.ge_s - if + if (result i32) i32.const 606290984 local.set $2 i32.const -2048144777 @@ -166,19 +166,12 @@ i32.rotl i32.add i32.add - local.set $2 - local.get $3 - local.get $1 - i32.sub - local.set $3 else local.get $3 i32.const 374761393 i32.add - local.set $2 end - i32.const 0 - local.set $1 + local.set $2 local.get $3 i32.const 4 i32.sub diff --git a/tests/compiler/std/hash.untouched.wat b/tests/compiler/std/hash.untouched.wat index bcb1b24de8..97e69a4e77 100644 --- a/tests/compiler/std/hash.untouched.wat +++ b/tests/compiler/std/hash.untouched.wat @@ -246,6 +246,8 @@ local.set $2 local.get $2 local.set $3 + i32.const 0 + local.set $4 local.get $2 i32.const 16 i32.ge_s @@ -255,34 +257,32 @@ i32.add i32.const -2048144777 i32.add - local.set $4 + local.set $5 i32.const 0 i32.const -2048144777 i32.add - local.set $5 - i32.const 0 local.set $6 i32.const 0 - i32.const -1640531535 - i32.sub local.set $7 i32.const 0 + i32.const -1640531535 + i32.sub local.set $8 local.get $2 i32.const 16 i32.sub local.set $9 loop $while-continue|0 - local.get $8 + local.get $4 local.get $9 i32.le_s local.set $10 local.get $10 if - local.get $4 + local.get $5 local.set $12 local.get $1 - local.get $8 + local.get $4 i32.add i32.load local.set $11 @@ -295,11 +295,11 @@ i32.rotl i32.const -1640531535 i32.mul - local.set $4 - local.get $5 + local.set $5 + local.get $6 local.set $12 local.get $1 - local.get $8 + local.get $4 i32.add i32.load offset=4 local.set $11 @@ -312,11 +312,11 @@ i32.rotl i32.const -1640531535 i32.mul - local.set $5 - local.get $6 + local.set $6 + local.get $7 local.set $12 local.get $1 - local.get $8 + local.get $4 i32.add i32.load offset=8 local.set $11 @@ -329,11 +329,11 @@ i32.rotl i32.const -1640531535 i32.mul - local.set $6 - local.get $7 + local.set $7 + local.get $8 local.set $12 local.get $1 - local.get $8 + local.get $4 i32.add i32.load offset=12 local.set $11 @@ -346,36 +346,32 @@ i32.rotl i32.const -1640531535 i32.mul - local.set $7 - local.get $8 + local.set $8 + local.get $4 i32.const 16 i32.add - local.set $8 + local.set $4 br $while-continue|0 end end local.get $3 - local.get $4 + local.get $5 i32.const 1 i32.rotl - local.get $5 + local.get $6 i32.const 7 i32.rotl i32.add - local.get $6 + local.get $7 i32.const 12 i32.rotl i32.add - local.get $7 + local.get $8 i32.const 18 i32.rotl i32.add i32.add local.set $3 - local.get $2 - local.get $8 - i32.sub - local.set $2 else local.get $3 i32.const 0 @@ -384,22 +380,20 @@ i32.add local.set $3 end - i32.const 0 - local.set $9 local.get $2 i32.const 4 i32.sub - local.set $8 + local.set $9 loop $while-continue|1 + local.get $4 local.get $9 - local.get $8 i32.le_s - local.set $7 - local.get $7 + local.set $8 + local.get $8 if local.get $3 local.get $1 - local.get $9 + local.get $4 i32.add i32.load i32.const -1028477379 @@ -412,23 +406,23 @@ i32.const 668265263 i32.mul local.set $3 - local.get $9 + local.get $4 i32.const 4 i32.add - local.set $9 + local.set $4 br $while-continue|1 end end loop $while-continue|2 - local.get $9 + local.get $4 local.get $2 i32.lt_s - local.set $7 - local.get $7 + local.set $8 + local.get $8 if local.get $3 local.get $1 - local.get $9 + local.get $4 i32.add i32.load8_u i32.const 374761393 @@ -441,10 +435,10 @@ i32.const -1640531535 i32.mul local.set $3 - local.get $9 + local.get $4 i32.const 1 i32.add - local.set $9 + local.set $4 br $while-continue|2 end end @@ -532,6 +526,8 @@ local.set $2 local.get $2 local.set $3 + i32.const 0 + local.set $4 local.get $2 i32.const 16 i32.ge_s @@ -541,34 +537,32 @@ i32.add i32.const -2048144777 i32.add - local.set $4 + local.set $5 i32.const 0 i32.const -2048144777 i32.add - local.set $5 - i32.const 0 local.set $6 i32.const 0 - i32.const -1640531535 - i32.sub local.set $7 i32.const 0 + i32.const -1640531535 + i32.sub local.set $8 local.get $2 i32.const 16 i32.sub local.set $9 loop $while-continue|0 - local.get $8 + local.get $4 local.get $9 i32.le_s local.set $10 local.get $10 if - local.get $4 + local.get $5 local.set $12 local.get $1 - local.get $8 + local.get $4 i32.add i32.load local.set $11 @@ -581,11 +575,11 @@ i32.rotl i32.const -1640531535 i32.mul - local.set $4 - local.get $5 + local.set $5 + local.get $6 local.set $12 local.get $1 - local.get $8 + local.get $4 i32.add i32.load offset=4 local.set $11 @@ -598,11 +592,11 @@ i32.rotl i32.const -1640531535 i32.mul - local.set $5 - local.get $6 + local.set $6 + local.get $7 local.set $12 local.get $1 - local.get $8 + local.get $4 i32.add i32.load offset=8 local.set $11 @@ -615,11 +609,11 @@ i32.rotl i32.const -1640531535 i32.mul - local.set $6 - local.get $7 + local.set $7 + local.get $8 local.set $12 local.get $1 - local.get $8 + local.get $4 i32.add i32.load offset=12 local.set $11 @@ -632,36 +626,32 @@ i32.rotl i32.const -1640531535 i32.mul - local.set $7 - local.get $8 + local.set $8 + local.get $4 i32.const 16 i32.add - local.set $8 + local.set $4 br $while-continue|0 end end local.get $3 - local.get $4 + local.get $5 i32.const 1 i32.rotl - local.get $5 + local.get $6 i32.const 7 i32.rotl i32.add - local.get $6 + local.get $7 i32.const 12 i32.rotl i32.add - local.get $7 + local.get $8 i32.const 18 i32.rotl i32.add i32.add local.set $3 - local.get $2 - local.get $8 - i32.sub - local.set $2 else local.get $3 i32.const 0 @@ -670,22 +660,20 @@ i32.add local.set $3 end - i32.const 0 - local.set $9 local.get $2 i32.const 4 i32.sub - local.set $8 + local.set $9 loop $while-continue|1 + local.get $4 local.get $9 - local.get $8 i32.le_s - local.set $7 - local.get $7 + local.set $8 + local.get $8 if local.get $3 local.get $1 - local.get $9 + local.get $4 i32.add i32.load i32.const -1028477379 @@ -698,23 +686,23 @@ i32.const 668265263 i32.mul local.set $3 - local.get $9 + local.get $4 i32.const 4 i32.add - local.set $9 + local.set $4 br $while-continue|1 end end loop $while-continue|2 - local.get $9 + local.get $4 local.get $2 i32.lt_s - local.set $7 - local.get $7 + local.set $8 + local.get $8 if local.get $3 local.get $1 - local.get $9 + local.get $4 i32.add i32.load8_u i32.const 374761393 @@ -727,10 +715,10 @@ i32.const -1640531535 i32.mul local.set $3 - local.get $9 + local.get $4 i32.const 1 i32.add - local.set $9 + local.set $4 br $while-continue|2 end end diff --git a/tests/compiler/std/symbol.optimized.wat b/tests/compiler/std/symbol.optimized.wat index f38af5cfd7..e01291e5b2 100644 --- a/tests/compiler/std/symbol.optimized.wat +++ b/tests/compiler/std/symbol.optimized.wat @@ -2455,7 +2455,7 @@ local.tee $3 i32.const 16 i32.ge_s - if + if (result i32) i32.const 606290984 local.set $1 i32.const -2048144777 @@ -2542,19 +2542,12 @@ i32.rotl i32.add i32.add - local.set $1 - local.get $3 - local.get $2 - i32.sub - local.set $3 else local.get $3 i32.const 374761393 i32.add - local.set $1 end - i32.const 0 - local.set $2 + local.set $1 local.get $3 i32.const 4 i32.sub diff --git a/tests/compiler/std/symbol.untouched.wat b/tests/compiler/std/symbol.untouched.wat index 1c15333818..41a1801d68 100644 --- a/tests/compiler/std/symbol.untouched.wat +++ b/tests/compiler/std/symbol.untouched.wat @@ -4526,6 +4526,8 @@ local.set $2 local.get $2 local.set $3 + i32.const 0 + local.set $4 local.get $2 i32.const 16 i32.ge_s @@ -4535,34 +4537,32 @@ i32.add i32.const -2048144777 i32.add - local.set $4 + local.set $5 i32.const 0 i32.const -2048144777 i32.add - local.set $5 - i32.const 0 local.set $6 i32.const 0 - i32.const -1640531535 - i32.sub local.set $7 i32.const 0 + i32.const -1640531535 + i32.sub local.set $8 local.get $2 i32.const 16 i32.sub local.set $9 loop $while-continue|0 - local.get $8 + local.get $4 local.get $9 i32.le_s local.set $10 local.get $10 if - local.get $4 + local.get $5 local.set $12 local.get $1 - local.get $8 + local.get $4 i32.add i32.load local.set $11 @@ -4575,11 +4575,11 @@ i32.rotl i32.const -1640531535 i32.mul - local.set $4 - local.get $5 + local.set $5 + local.get $6 local.set $12 local.get $1 - local.get $8 + local.get $4 i32.add i32.load offset=4 local.set $11 @@ -4592,11 +4592,11 @@ i32.rotl i32.const -1640531535 i32.mul - local.set $5 - local.get $6 + local.set $6 + local.get $7 local.set $12 local.get $1 - local.get $8 + local.get $4 i32.add i32.load offset=8 local.set $11 @@ -4609,11 +4609,11 @@ i32.rotl i32.const -1640531535 i32.mul - local.set $6 - local.get $7 + local.set $7 + local.get $8 local.set $12 local.get $1 - local.get $8 + local.get $4 i32.add i32.load offset=12 local.set $11 @@ -4626,36 +4626,32 @@ i32.rotl i32.const -1640531535 i32.mul - local.set $7 - local.get $8 + local.set $8 + local.get $4 i32.const 16 i32.add - local.set $8 + local.set $4 br $while-continue|0 end end local.get $3 - local.get $4 + local.get $5 i32.const 1 i32.rotl - local.get $5 + local.get $6 i32.const 7 i32.rotl i32.add - local.get $6 + local.get $7 i32.const 12 i32.rotl i32.add - local.get $7 + local.get $8 i32.const 18 i32.rotl i32.add i32.add local.set $3 - local.get $2 - local.get $8 - i32.sub - local.set $2 else local.get $3 i32.const 0 @@ -4664,22 +4660,20 @@ i32.add local.set $3 end - i32.const 0 - local.set $9 local.get $2 i32.const 4 i32.sub - local.set $8 + local.set $9 loop $while-continue|1 + local.get $4 local.get $9 - local.get $8 i32.le_s - local.set $7 - local.get $7 + local.set $8 + local.get $8 if local.get $3 local.get $1 - local.get $9 + local.get $4 i32.add i32.load i32.const -1028477379 @@ -4692,23 +4686,23 @@ i32.const 668265263 i32.mul local.set $3 - local.get $9 + local.get $4 i32.const 4 i32.add - local.set $9 + local.set $4 br $while-continue|1 end end loop $while-continue|2 - local.get $9 + local.get $4 local.get $2 i32.lt_s - local.set $7 - local.get $7 + local.set $8 + local.get $8 if local.get $3 local.get $1 - local.get $9 + local.get $4 i32.add i32.load8_u i32.const 374761393 @@ -4721,10 +4715,10 @@ i32.const -1640531535 i32.mul local.set $3 - local.get $9 + local.get $4 i32.const 1 i32.add - local.set $9 + local.set $4 br $while-continue|2 end end From cdafa534215882409a425593b914f26c5bda62d3 Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Sun, 7 Feb 2021 01:34:10 +0200 Subject: [PATCH 09/14] refactor --- std/assembly/util/hash.ts | 13 ++- tests/compiler/std/hash.untouched.wat | 102 +++++++++++------------- tests/compiler/std/symbol.untouched.wat | 51 ++++++------ 3 files changed, 78 insertions(+), 88 deletions(-) diff --git a/std/assembly/util/hash.ts b/std/assembly/util/hash.ts index 59b2bccd54..1758e32136 100644 --- a/std/assembly/util/hash.ts +++ b/std/assembly/util/hash.ts @@ -69,9 +69,7 @@ function mix(h: u32, key: u32): u32 { // @ts-ignore: decorator @inline function hashStr(key: string): u32 { - if (key === null) { - return XXH32_SEED; - } + if (key === null) return XXH32_SEED; var len = key.length << 1; var h: u32 = len; @@ -85,10 +83,11 @@ function hashStr(key: string): u32 { let n = len - 16; while (i <= n) { - s1 = mix(s1, load(changetype(key) + i)); - s2 = mix(s2, load(changetype(key) + i, 4)); - s3 = mix(s3, load(changetype(key) + i, 8)); - s4 = mix(s4, load(changetype(key) + i, 12)); + let ptr = changetype(key) + i; + s1 = mix(s1, load(ptr )); + s2 = mix(s2, load(ptr, 4)); + s3 = mix(s3, load(ptr, 8)); + s4 = mix(s4, load(ptr, 12)); i += 16; } h += rotl(s1, 1) + rotl(s2, 7) + rotl(s3, 12) + rotl(s4, 18); diff --git a/tests/compiler/std/hash.untouched.wat b/tests/compiler/std/hash.untouched.wat index 97e69a4e77..e3cae15d39 100644 --- a/tests/compiler/std/hash.untouched.wat +++ b/tests/compiler/std/hash.untouched.wat @@ -212,6 +212,7 @@ (local $11 i32) (local $12 i32) (local $13 i32) + (local $14 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -235,11 +236,11 @@ br $~lib/util/hash/hashStr|inlined.0 end local.get $1 - local.set $13 + local.set $14 global.get $~lib/memory/__stack_pointer - local.get $13 + local.get $14 i32.store offset=4 - local.get $13 + local.get $14 call $~lib/string/String#get:length i32.const 1 i32.shl @@ -279,15 +280,17 @@ local.set $10 local.get $10 if - local.get $5 - local.set $12 local.get $1 local.get $4 i32.add - i32.load local.set $11 - local.get $12 + local.get $5 + local.set $13 local.get $11 + i32.load + local.set $12 + local.get $13 + local.get $12 i32.const -2048144777 i32.mul i32.add @@ -297,14 +300,12 @@ i32.mul local.set $5 local.get $6 - local.set $12 - local.get $1 - local.get $4 - i32.add + local.set $13 + local.get $11 i32.load offset=4 - local.set $11 + local.set $12 + local.get $13 local.get $12 - local.get $11 i32.const -2048144777 i32.mul i32.add @@ -314,14 +315,12 @@ i32.mul local.set $6 local.get $7 - local.set $12 - local.get $1 - local.get $4 - i32.add + local.set $13 + local.get $11 i32.load offset=8 - local.set $11 + local.set $12 + local.get $13 local.get $12 - local.get $11 i32.const -2048144777 i32.mul i32.add @@ -331,14 +330,12 @@ i32.mul local.set $7 local.get $8 - local.set $12 - local.get $1 - local.get $4 - i32.add + local.set $13 + local.get $11 i32.load offset=12 - local.set $11 + local.set $12 + local.get $13 local.get $12 - local.get $11 i32.const -2048144777 i32.mul i32.add @@ -470,12 +467,12 @@ local.set $3 local.get $3 end - local.set $13 + local.set $14 global.get $~lib/memory/__stack_pointer i32.const 8 i32.add global.set $~lib/memory/__stack_pointer - local.get $13 + local.get $14 return ) (func $~lib/util/hash/HASH<~lib/string/String> (param $0 i32) (result i32) @@ -492,6 +489,7 @@ (local $11 i32) (local $12 i32) (local $13 i32) + (local $14 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -515,11 +513,11 @@ br $~lib/util/hash/hashStr|inlined.1 end local.get $1 - local.set $13 + local.set $14 global.get $~lib/memory/__stack_pointer - local.get $13 + local.get $14 i32.store offset=4 - local.get $13 + local.get $14 call $~lib/string/String#get:length i32.const 1 i32.shl @@ -559,15 +557,17 @@ local.set $10 local.get $10 if - local.get $5 - local.set $12 local.get $1 local.get $4 i32.add - i32.load local.set $11 - local.get $12 + local.get $5 + local.set $13 local.get $11 + i32.load + local.set $12 + local.get $13 + local.get $12 i32.const -2048144777 i32.mul i32.add @@ -577,14 +577,12 @@ i32.mul local.set $5 local.get $6 - local.set $12 - local.get $1 - local.get $4 - i32.add + local.set $13 + local.get $11 i32.load offset=4 - local.set $11 + local.set $12 + local.get $13 local.get $12 - local.get $11 i32.const -2048144777 i32.mul i32.add @@ -594,14 +592,12 @@ i32.mul local.set $6 local.get $7 - local.set $12 - local.get $1 - local.get $4 - i32.add + local.set $13 + local.get $11 i32.load offset=8 - local.set $11 + local.set $12 + local.get $13 local.get $12 - local.get $11 i32.const -2048144777 i32.mul i32.add @@ -611,14 +607,12 @@ i32.mul local.set $7 local.get $8 - local.set $12 - local.get $1 - local.get $4 - i32.add + local.set $13 + local.get $11 i32.load offset=12 - local.set $11 + local.set $12 + local.get $13 local.get $12 - local.get $11 i32.const -2048144777 i32.mul i32.add @@ -750,12 +744,12 @@ local.set $3 local.get $3 end - local.set $13 + local.set $14 global.get $~lib/memory/__stack_pointer i32.const 8 i32.add global.set $~lib/memory/__stack_pointer - local.get $13 + local.get $14 return ) (func $start:std/hash diff --git a/tests/compiler/std/symbol.untouched.wat b/tests/compiler/std/symbol.untouched.wat index 41a1801d68..afb9d51684 100644 --- a/tests/compiler/std/symbol.untouched.wat +++ b/tests/compiler/std/symbol.untouched.wat @@ -4492,6 +4492,7 @@ (local $11 i32) (local $12 i32) (local $13 i32) + (local $14 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -4515,11 +4516,11 @@ br $~lib/util/hash/hashStr|inlined.0 end local.get $1 - local.set $13 + local.set $14 global.get $~lib/memory/__stack_pointer - local.get $13 + local.get $14 i32.store offset=4 - local.get $13 + local.get $14 call $~lib/string/String#get:length i32.const 1 i32.shl @@ -4559,15 +4560,17 @@ local.set $10 local.get $10 if - local.get $5 - local.set $12 local.get $1 local.get $4 i32.add - i32.load local.set $11 - local.get $12 + local.get $5 + local.set $13 local.get $11 + i32.load + local.set $12 + local.get $13 + local.get $12 i32.const -2048144777 i32.mul i32.add @@ -4577,14 +4580,12 @@ i32.mul local.set $5 local.get $6 - local.set $12 - local.get $1 - local.get $4 - i32.add + local.set $13 + local.get $11 i32.load offset=4 - local.set $11 + local.set $12 + local.get $13 local.get $12 - local.get $11 i32.const -2048144777 i32.mul i32.add @@ -4594,14 +4595,12 @@ i32.mul local.set $6 local.get $7 - local.set $12 - local.get $1 - local.get $4 - i32.add + local.set $13 + local.get $11 i32.load offset=8 - local.set $11 + local.set $12 + local.get $13 local.get $12 - local.get $11 i32.const -2048144777 i32.mul i32.add @@ -4611,14 +4610,12 @@ i32.mul local.set $7 local.get $8 - local.set $12 - local.get $1 - local.get $4 - i32.add + local.set $13 + local.get $11 i32.load offset=12 - local.set $11 + local.set $12 + local.get $13 local.get $12 - local.get $11 i32.const -2048144777 i32.mul i32.add @@ -4750,12 +4747,12 @@ local.set $3 local.get $3 end - local.set $13 + local.set $14 global.get $~lib/memory/__stack_pointer i32.const 8 i32.add global.set $~lib/memory/__stack_pointer - local.get $13 + local.get $14 return ) (func $~lib/string/String.__eq (param $0 i32) (param $1 i32) (result i32) From f3a4db4082769b42274be37b83223b7da32fbe84 Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Sun, 7 Feb 2021 01:58:14 +0200 Subject: [PATCH 10/14] refactor again --- std/assembly/util/hash.ts | 36 +-- tests/compiler/std/hash.optimized.wat | 87 ++++--- tests/compiler/std/hash.untouched.wat | 286 ++++++++++++------------ tests/compiler/std/symbol.optimized.wat | 71 +++--- tests/compiler/std/symbol.untouched.wat | 143 ++++++------ 5 files changed, 309 insertions(+), 314 deletions(-) diff --git a/std/assembly/util/hash.ts b/std/assembly/util/hash.ts index 1758e32136..637fa5826e 100644 --- a/std/assembly/util/hash.ts +++ b/std/assembly/util/hash.ts @@ -71,9 +71,9 @@ function mix(h: u32, key: u32): u32 { function hashStr(key: string): u32 { if (key === null) return XXH32_SEED; - var len = key.length << 1; - var h: u32 = len; - let i = 0; + var len: usize = key.length << 1; + var pos = changetype(key); + var h = len; if (len >= 16) { let s1 = XXH32_SEED + XXH32_P1 + XXH32_P2; @@ -81,31 +81,31 @@ function hashStr(key: string): u32 { let s3 = XXH32_SEED; let s4 = XXH32_SEED - XXH32_P1; - let n = len - 16; - while (i <= n) { - let ptr = changetype(key) + i; - s1 = mix(s1, load(ptr )); - s2 = mix(s2, load(ptr, 4)); - s3 = mix(s3, load(ptr, 8)); - s4 = mix(s4, load(ptr, 12)); - i += 16; + let end = len + pos - 16; + while (pos <= end) { + s1 = mix(s1, load(pos )); + s2 = mix(s2, load(pos, 4)); + s3 = mix(s3, load(pos, 8)); + s4 = mix(s4, load(pos, 12)); + pos += 16; } h += rotl(s1, 1) + rotl(s2, 7) + rotl(s3, 12) + rotl(s4, 18); } else { h += XXH32_SEED + XXH32_P5; } - var n = len - 4; - while (i <= n) { - h += load(changetype(key) + i) * XXH32_P3; + var end = len + pos - 4; + while (pos <= end) { + h += load(pos) * XXH32_P3; h = rotl(h, 17) * XXH32_P4; - i += 4; + pos += 4; } - while (i < len) { - h += load(changetype(key) + i) * XXH32_P5; + end = len + pos; + while (pos < end) { + h += load(pos) * XXH32_P5; h = rotl(h, 11) * XXH32_P1; - i++; + pos++; } h ^= h >> 15; diff --git a/tests/compiler/std/hash.optimized.wat b/tests/compiler/std/hash.optimized.wat index 8bf6fc7a27..964d664a71 100644 --- a/tests/compiler/std/hash.optimized.wat +++ b/tests/compiler/std/hash.optimized.wat @@ -50,8 +50,6 @@ (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - (local $8 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -76,30 +74,29 @@ i32.shr_u i32.const 1 i32.shl - local.tee $3 + local.tee $2 i32.const 16 - i32.ge_s + i32.ge_u if (result i32) i32.const 606290984 - local.set $2 + local.set $1 i32.const -2048144777 local.set $4 i32.const 1640531535 local.set $5 - local.get $3 + local.get $0 + local.get $2 + i32.add i32.const 16 i32.sub - local.set $8 + local.set $3 loop $while-continue|0 - local.get $1 - local.get $8 - i32.le_s + local.get $0 + local.get $3 + i32.le_u if - local.get $2 - local.get $0 local.get $1 - i32.add - local.tee $6 + local.get $0 i32.load i32.const -2048144777 i32.mul @@ -108,9 +105,9 @@ i32.rotl i32.const -1640531535 i32.mul - local.set $2 + local.set $1 local.get $4 - local.get $6 + local.get $0 i32.load offset=4 i32.const -2048144777 i32.mul @@ -120,8 +117,8 @@ i32.const -1640531535 i32.mul local.set $4 - local.get $7 local.get $6 + local.get $0 i32.load offset=8 i32.const -2048144777 i32.mul @@ -130,9 +127,9 @@ i32.rotl i32.const -1640531535 i32.mul - local.set $7 + local.set $6 local.get $5 - local.get $6 + local.get $0 i32.load offset=12 i32.const -2048144777 i32.mul @@ -142,22 +139,22 @@ i32.const -1640531535 i32.mul local.set $5 - local.get $1 + local.get $0 i32.const 16 i32.add - local.set $1 + local.set $0 br $while-continue|0 end end - local.get $3 local.get $2 + local.get $1 i32.const 1 i32.rotl local.get $4 i32.const 7 i32.rotl i32.add - local.get $7 + local.get $6 i32.const 12 i32.rotl i32.add @@ -167,24 +164,24 @@ i32.add i32.add else - local.get $3 + local.get $2 i32.const 374761393 i32.add end - local.set $2 - local.get $3 + local.set $1 + local.get $0 + local.get $2 + i32.add i32.const 4 i32.sub - local.set $4 + local.set $3 loop $while-continue|1 - local.get $1 - local.get $4 - i32.le_s + local.get $0 + local.get $3 + i32.le_u if - local.get $2 - local.get $0 local.get $1 - i32.add + local.get $0 i32.load i32.const -1028477379 i32.mul @@ -193,23 +190,25 @@ i32.rotl i32.const 668265263 i32.mul - local.set $2 - local.get $1 + local.set $1 + local.get $0 i32.const 4 i32.add - local.set $1 + local.set $0 br $while-continue|1 end end + local.get $0 + local.get $2 + i32.add + local.set $3 loop $while-continue|2 - local.get $1 + local.get $0 local.get $3 - i32.lt_s + i32.lt_u if - local.get $2 - local.get $0 local.get $1 - i32.add + local.get $0 i32.load8_u i32.const 374761393 i32.mul @@ -218,11 +217,11 @@ i32.rotl i32.const -1640531535 i32.mul - local.set $2 - local.get $1 + local.set $1 + local.get $0 i32.const 1 i32.add - local.set $1 + local.set $0 br $while-continue|2 end end diff --git a/tests/compiler/std/hash.untouched.wat b/tests/compiler/std/hash.untouched.wat index e3cae15d39..4f3a8fdf1f 100644 --- a/tests/compiler/std/hash.untouched.wat +++ b/tests/compiler/std/hash.untouched.wat @@ -212,7 +212,6 @@ (local $11 i32) (local $12 i32) (local $13 i32) - (local $14 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -236,22 +235,22 @@ br $~lib/util/hash/hashStr|inlined.0 end local.get $1 - local.set $14 + local.set $13 global.get $~lib/memory/__stack_pointer - local.get $14 + local.get $13 i32.store offset=4 - local.get $14 + local.get $13 call $~lib/string/String#get:length i32.const 1 i32.shl local.set $2 - local.get $2 + local.get $1 local.set $3 - i32.const 0 + local.get $2 local.set $4 local.get $2 i32.const 16 - i32.ge_s + i32.ge_u if i32.const 0 i32.const -1640531535 @@ -270,27 +269,25 @@ i32.sub local.set $8 local.get $2 + local.get $3 + i32.add i32.const 16 i32.sub local.set $9 loop $while-continue|0 - local.get $4 + local.get $3 local.get $9 - i32.le_s + i32.le_u local.set $10 local.get $10 if - local.get $1 - local.get $4 - i32.add - local.set $11 local.get $5 - local.set $13 - local.get $11 - i32.load local.set $12 - local.get $13 + local.get $3 + i32.load + local.set $11 local.get $12 + local.get $11 i32.const -2048144777 i32.mul i32.add @@ -300,12 +297,12 @@ i32.mul local.set $5 local.get $6 - local.set $13 - local.get $11 - i32.load offset=4 local.set $12 - local.get $13 + local.get $3 + i32.load offset=4 + local.set $11 local.get $12 + local.get $11 i32.const -2048144777 i32.mul i32.add @@ -315,12 +312,12 @@ i32.mul local.set $6 local.get $7 - local.set $13 - local.get $11 - i32.load offset=8 local.set $12 - local.get $13 + local.get $3 + i32.load offset=8 + local.set $11 local.get $12 + local.get $11 i32.const -2048144777 i32.mul i32.add @@ -330,12 +327,12 @@ i32.mul local.set $7 local.get $8 - local.set $13 - local.get $11 - i32.load offset=12 local.set $12 - local.get $13 + local.get $3 + i32.load offset=12 + local.set $11 local.get $12 + local.get $11 i32.const -2048144777 i32.mul i32.add @@ -344,14 +341,14 @@ i32.const -1640531535 i32.mul local.set $8 - local.get $4 + local.get $3 i32.const 16 i32.add - local.set $4 + local.set $3 br $while-continue|0 end end - local.get $3 + local.get $4 local.get $5 i32.const 1 i32.rotl @@ -368,111 +365,113 @@ i32.rotl i32.add i32.add - local.set $3 + local.set $4 else - local.get $3 + local.get $4 i32.const 0 i32.const 374761393 i32.add i32.add - local.set $3 + local.set $4 end local.get $2 + local.get $3 + i32.add i32.const 4 i32.sub local.set $9 loop $while-continue|1 - local.get $4 + local.get $3 local.get $9 - i32.le_s + i32.le_u local.set $8 local.get $8 if - local.get $3 - local.get $1 local.get $4 - i32.add + local.get $3 i32.load i32.const -1028477379 i32.mul i32.add - local.set $3 - local.get $3 + local.set $4 + local.get $4 i32.const 17 i32.rotl i32.const 668265263 i32.mul - local.set $3 - local.get $4 + local.set $4 + local.get $3 i32.const 4 i32.add - local.set $4 + local.set $3 br $while-continue|1 end end + local.get $2 + local.get $3 + i32.add + local.set $9 loop $while-continue|2 - local.get $4 - local.get $2 - i32.lt_s + local.get $3 + local.get $9 + i32.lt_u local.set $8 local.get $8 if - local.get $3 - local.get $1 local.get $4 - i32.add + local.get $3 i32.load8_u i32.const 374761393 i32.mul i32.add - local.set $3 - local.get $3 + local.set $4 + local.get $4 i32.const 11 i32.rotl i32.const -1640531535 i32.mul - local.set $3 - local.get $4 + local.set $4 + local.get $3 i32.const 1 i32.add - local.set $4 + local.set $3 br $while-continue|2 end end - local.get $3 - local.get $3 + local.get $4 + local.get $4 i32.const 15 i32.shr_u i32.xor - local.set $3 - local.get $3 + local.set $4 + local.get $4 i32.const -2048144777 i32.mul - local.set $3 - local.get $3 - local.get $3 + local.set $4 + local.get $4 + local.get $4 i32.const 13 i32.shr_u i32.xor - local.set $3 - local.get $3 + local.set $4 + local.get $4 i32.const -1028477379 i32.mul - local.set $3 - local.get $3 - local.get $3 + local.set $4 + local.get $4 + local.get $4 i32.const 16 i32.shr_u i32.xor - local.set $3 - local.get $3 + local.set $4 + local.get $4 end - local.set $14 + local.set $13 global.get $~lib/memory/__stack_pointer i32.const 8 i32.add global.set $~lib/memory/__stack_pointer - local.get $14 + local.get $13 return ) (func $~lib/util/hash/HASH<~lib/string/String> (param $0 i32) (result i32) @@ -489,7 +488,6 @@ (local $11 i32) (local $12 i32) (local $13 i32) - (local $14 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -513,22 +511,22 @@ br $~lib/util/hash/hashStr|inlined.1 end local.get $1 - local.set $14 + local.set $13 global.get $~lib/memory/__stack_pointer - local.get $14 + local.get $13 i32.store offset=4 - local.get $14 + local.get $13 call $~lib/string/String#get:length i32.const 1 i32.shl local.set $2 - local.get $2 + local.get $1 local.set $3 - i32.const 0 + local.get $2 local.set $4 local.get $2 i32.const 16 - i32.ge_s + i32.ge_u if i32.const 0 i32.const -1640531535 @@ -547,27 +545,25 @@ i32.sub local.set $8 local.get $2 + local.get $3 + i32.add i32.const 16 i32.sub local.set $9 loop $while-continue|0 - local.get $4 + local.get $3 local.get $9 - i32.le_s + i32.le_u local.set $10 local.get $10 if - local.get $1 - local.get $4 - i32.add - local.set $11 local.get $5 - local.set $13 - local.get $11 - i32.load local.set $12 - local.get $13 + local.get $3 + i32.load + local.set $11 local.get $12 + local.get $11 i32.const -2048144777 i32.mul i32.add @@ -577,12 +573,12 @@ i32.mul local.set $5 local.get $6 - local.set $13 - local.get $11 - i32.load offset=4 local.set $12 - local.get $13 + local.get $3 + i32.load offset=4 + local.set $11 local.get $12 + local.get $11 i32.const -2048144777 i32.mul i32.add @@ -592,12 +588,12 @@ i32.mul local.set $6 local.get $7 - local.set $13 - local.get $11 - i32.load offset=8 local.set $12 - local.get $13 + local.get $3 + i32.load offset=8 + local.set $11 local.get $12 + local.get $11 i32.const -2048144777 i32.mul i32.add @@ -607,12 +603,12 @@ i32.mul local.set $7 local.get $8 - local.set $13 - local.get $11 - i32.load offset=12 local.set $12 - local.get $13 + local.get $3 + i32.load offset=12 + local.set $11 local.get $12 + local.get $11 i32.const -2048144777 i32.mul i32.add @@ -621,14 +617,14 @@ i32.const -1640531535 i32.mul local.set $8 - local.get $4 + local.get $3 i32.const 16 i32.add - local.set $4 + local.set $3 br $while-continue|0 end end - local.get $3 + local.get $4 local.get $5 i32.const 1 i32.rotl @@ -645,111 +641,113 @@ i32.rotl i32.add i32.add - local.set $3 + local.set $4 else - local.get $3 + local.get $4 i32.const 0 i32.const 374761393 i32.add i32.add - local.set $3 + local.set $4 end local.get $2 + local.get $3 + i32.add i32.const 4 i32.sub local.set $9 loop $while-continue|1 - local.get $4 + local.get $3 local.get $9 - i32.le_s + i32.le_u local.set $8 local.get $8 if - local.get $3 - local.get $1 local.get $4 - i32.add + local.get $3 i32.load i32.const -1028477379 i32.mul i32.add - local.set $3 - local.get $3 + local.set $4 + local.get $4 i32.const 17 i32.rotl i32.const 668265263 i32.mul - local.set $3 - local.get $4 + local.set $4 + local.get $3 i32.const 4 i32.add - local.set $4 + local.set $3 br $while-continue|1 end end + local.get $2 + local.get $3 + i32.add + local.set $9 loop $while-continue|2 - local.get $4 - local.get $2 - i32.lt_s + local.get $3 + local.get $9 + i32.lt_u local.set $8 local.get $8 if - local.get $3 - local.get $1 local.get $4 - i32.add + local.get $3 i32.load8_u i32.const 374761393 i32.mul i32.add - local.set $3 - local.get $3 + local.set $4 + local.get $4 i32.const 11 i32.rotl i32.const -1640531535 i32.mul - local.set $3 - local.get $4 + local.set $4 + local.get $3 i32.const 1 i32.add - local.set $4 + local.set $3 br $while-continue|2 end end - local.get $3 - local.get $3 + local.get $4 + local.get $4 i32.const 15 i32.shr_u i32.xor - local.set $3 - local.get $3 + local.set $4 + local.get $4 i32.const -2048144777 i32.mul - local.set $3 - local.get $3 - local.get $3 + local.set $4 + local.get $4 + local.get $4 i32.const 13 i32.shr_u i32.xor - local.set $3 - local.get $3 + local.set $4 + local.get $4 i32.const -1028477379 i32.mul - local.set $3 - local.get $3 - local.get $3 + local.set $4 + local.get $4 + local.get $4 i32.const 16 i32.shr_u i32.xor - local.set $3 - local.get $3 + local.set $4 + local.get $4 end - local.set $14 + local.set $13 global.get $~lib/memory/__stack_pointer i32.const 8 i32.add global.set $~lib/memory/__stack_pointer - local.get $14 + local.get $13 return ) (func $start:std/hash diff --git a/tests/compiler/std/symbol.optimized.wat b/tests/compiler/std/symbol.optimized.wat index e01291e5b2..22c120a42b 100644 --- a/tests/compiler/std/symbol.optimized.wat +++ b/tests/compiler/std/symbol.optimized.wat @@ -2422,8 +2422,6 @@ (local $4 i32) (local $5 i32) (local $6 i32) - (local $7 i32) - (local $8 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -2452,9 +2450,9 @@ i32.shr_u i32.const 1 i32.shl - local.tee $3 + local.tee $2 i32.const 16 - i32.ge_s + i32.ge_u if (result i32) i32.const 606290984 local.set $1 @@ -2462,20 +2460,19 @@ local.set $4 i32.const 1640531535 local.set $5 - local.get $3 + local.get $0 + local.get $2 + i32.add i32.const 16 i32.sub - local.set $8 + local.set $3 loop $while-continue|0 - local.get $2 - local.get $8 - i32.le_s + local.get $0 + local.get $3 + i32.le_u if local.get $1 local.get $0 - local.get $2 - i32.add - local.tee $6 i32.load i32.const -2048144777 i32.mul @@ -2486,7 +2483,7 @@ i32.mul local.set $1 local.get $4 - local.get $6 + local.get $0 i32.load offset=4 i32.const -2048144777 i32.mul @@ -2496,8 +2493,8 @@ i32.const -1640531535 i32.mul local.set $4 - local.get $7 local.get $6 + local.get $0 i32.load offset=8 i32.const -2048144777 i32.mul @@ -2506,9 +2503,9 @@ i32.rotl i32.const -1640531535 i32.mul - local.set $7 + local.set $6 local.get $5 - local.get $6 + local.get $0 i32.load offset=12 i32.const -2048144777 i32.mul @@ -2518,14 +2515,14 @@ i32.const -1640531535 i32.mul local.set $5 - local.get $2 + local.get $0 i32.const 16 i32.add - local.set $2 + local.set $0 br $while-continue|0 end end - local.get $3 + local.get $2 local.get $1 i32.const 1 i32.rotl @@ -2533,7 +2530,7 @@ i32.const 7 i32.rotl i32.add - local.get $7 + local.get $6 i32.const 12 i32.rotl i32.add @@ -2543,24 +2540,24 @@ i32.add i32.add else - local.get $3 + local.get $2 i32.const 374761393 i32.add end local.set $1 - local.get $3 + local.get $0 + local.get $2 + i32.add i32.const 4 i32.sub - local.set $4 + local.set $3 loop $while-continue|1 - local.get $2 - local.get $4 - i32.le_s + local.get $0 + local.get $3 + i32.le_u if local.get $1 local.get $0 - local.get $2 - i32.add i32.load i32.const -1028477379 i32.mul @@ -2570,22 +2567,24 @@ i32.const 668265263 i32.mul local.set $1 - local.get $2 + local.get $0 i32.const 4 i32.add - local.set $2 + local.set $0 br $while-continue|1 end end + local.get $0 + local.get $2 + i32.add + local.set $3 loop $while-continue|2 - local.get $2 + local.get $0 local.get $3 - i32.lt_s + i32.lt_u if local.get $1 local.get $0 - local.get $2 - i32.add i32.load8_u i32.const 374761393 i32.mul @@ -2595,10 +2594,10 @@ i32.const -1640531535 i32.mul local.set $1 - local.get $2 + local.get $0 i32.const 1 i32.add - local.set $2 + local.set $0 br $while-continue|2 end end diff --git a/tests/compiler/std/symbol.untouched.wat b/tests/compiler/std/symbol.untouched.wat index afb9d51684..65cd7066ac 100644 --- a/tests/compiler/std/symbol.untouched.wat +++ b/tests/compiler/std/symbol.untouched.wat @@ -4492,7 +4492,6 @@ (local $11 i32) (local $12 i32) (local $13 i32) - (local $14 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -4516,22 +4515,22 @@ br $~lib/util/hash/hashStr|inlined.0 end local.get $1 - local.set $14 + local.set $13 global.get $~lib/memory/__stack_pointer - local.get $14 + local.get $13 i32.store offset=4 - local.get $14 + local.get $13 call $~lib/string/String#get:length i32.const 1 i32.shl local.set $2 - local.get $2 + local.get $1 local.set $3 - i32.const 0 + local.get $2 local.set $4 local.get $2 i32.const 16 - i32.ge_s + i32.ge_u if i32.const 0 i32.const -1640531535 @@ -4550,27 +4549,25 @@ i32.sub local.set $8 local.get $2 + local.get $3 + i32.add i32.const 16 i32.sub local.set $9 loop $while-continue|0 - local.get $4 + local.get $3 local.get $9 - i32.le_s + i32.le_u local.set $10 local.get $10 if - local.get $1 - local.get $4 - i32.add - local.set $11 local.get $5 - local.set $13 - local.get $11 - i32.load local.set $12 - local.get $13 + local.get $3 + i32.load + local.set $11 local.get $12 + local.get $11 i32.const -2048144777 i32.mul i32.add @@ -4580,12 +4577,12 @@ i32.mul local.set $5 local.get $6 - local.set $13 - local.get $11 - i32.load offset=4 local.set $12 - local.get $13 + local.get $3 + i32.load offset=4 + local.set $11 local.get $12 + local.get $11 i32.const -2048144777 i32.mul i32.add @@ -4595,12 +4592,12 @@ i32.mul local.set $6 local.get $7 - local.set $13 - local.get $11 - i32.load offset=8 local.set $12 - local.get $13 + local.get $3 + i32.load offset=8 + local.set $11 local.get $12 + local.get $11 i32.const -2048144777 i32.mul i32.add @@ -4610,12 +4607,12 @@ i32.mul local.set $7 local.get $8 - local.set $13 - local.get $11 - i32.load offset=12 local.set $12 - local.get $13 + local.get $3 + i32.load offset=12 + local.set $11 local.get $12 + local.get $11 i32.const -2048144777 i32.mul i32.add @@ -4624,14 +4621,14 @@ i32.const -1640531535 i32.mul local.set $8 - local.get $4 + local.get $3 i32.const 16 i32.add - local.set $4 + local.set $3 br $while-continue|0 end end - local.get $3 + local.get $4 local.get $5 i32.const 1 i32.rotl @@ -4648,111 +4645,113 @@ i32.rotl i32.add i32.add - local.set $3 + local.set $4 else - local.get $3 + local.get $4 i32.const 0 i32.const 374761393 i32.add i32.add - local.set $3 + local.set $4 end local.get $2 + local.get $3 + i32.add i32.const 4 i32.sub local.set $9 loop $while-continue|1 - local.get $4 + local.get $3 local.get $9 - i32.le_s + i32.le_u local.set $8 local.get $8 if - local.get $3 - local.get $1 local.get $4 - i32.add + local.get $3 i32.load i32.const -1028477379 i32.mul i32.add - local.set $3 - local.get $3 + local.set $4 + local.get $4 i32.const 17 i32.rotl i32.const 668265263 i32.mul - local.set $3 - local.get $4 + local.set $4 + local.get $3 i32.const 4 i32.add - local.set $4 + local.set $3 br $while-continue|1 end end + local.get $2 + local.get $3 + i32.add + local.set $9 loop $while-continue|2 - local.get $4 - local.get $2 - i32.lt_s + local.get $3 + local.get $9 + i32.lt_u local.set $8 local.get $8 if - local.get $3 - local.get $1 local.get $4 - i32.add + local.get $3 i32.load8_u i32.const 374761393 i32.mul i32.add - local.set $3 - local.get $3 + local.set $4 + local.get $4 i32.const 11 i32.rotl i32.const -1640531535 i32.mul - local.set $3 - local.get $4 + local.set $4 + local.get $3 i32.const 1 i32.add - local.set $4 + local.set $3 br $while-continue|2 end end - local.get $3 - local.get $3 + local.get $4 + local.get $4 i32.const 15 i32.shr_u i32.xor - local.set $3 - local.get $3 + local.set $4 + local.get $4 i32.const -2048144777 i32.mul - local.set $3 - local.get $3 - local.get $3 + local.set $4 + local.get $4 + local.get $4 i32.const 13 i32.shr_u i32.xor - local.set $3 - local.get $3 + local.set $4 + local.get $4 i32.const -1028477379 i32.mul - local.set $3 - local.get $3 - local.get $3 + local.set $4 + local.get $4 + local.get $4 i32.const 16 i32.shr_u i32.xor - local.set $3 - local.get $3 + local.set $4 + local.get $4 end - local.set $14 + local.set $13 global.get $~lib/memory/__stack_pointer i32.const 8 i32.add global.set $~lib/memory/__stack_pointer - local.get $14 + local.get $13 return ) (func $~lib/string/String.__eq (param $0 i32) (param $1 i32) (result i32) From 31c7138c8d29f5863d9fef561320e948a8cfbb29 Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Sun, 7 Feb 2021 01:58:52 +0200 Subject: [PATCH 11/14] remove space --- std/assembly/util/hash.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/std/assembly/util/hash.ts b/std/assembly/util/hash.ts index 637fa5826e..b2341a0636 100644 --- a/std/assembly/util/hash.ts +++ b/std/assembly/util/hash.ts @@ -97,7 +97,7 @@ function hashStr(key: string): u32 { var end = len + pos - 4; while (pos <= end) { h += load(pos) * XXH32_P3; - h = rotl(h, 17) * XXH32_P4; + h = rotl(h, 17) * XXH32_P4; pos += 4; } From 6af03ca39f13bb5e6b49df672788ca752f74a390 Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Sun, 7 Feb 2021 02:06:06 +0200 Subject: [PATCH 12/14] fix --- std/assembly/util/hash.ts | 4 +- tests/compiler/std/hash.optimized.wat | 68 +++++++++++------------ tests/compiler/std/hash.untouched.wat | 8 +-- tests/compiler/std/symbol.optimized.wat | 72 +++++++++++++------------ tests/compiler/std/symbol.untouched.wat | 4 +- 5 files changed, 80 insertions(+), 76 deletions(-) diff --git a/std/assembly/util/hash.ts b/std/assembly/util/hash.ts index b2341a0636..f17fa6c9fb 100644 --- a/std/assembly/util/hash.ts +++ b/std/assembly/util/hash.ts @@ -94,14 +94,14 @@ function hashStr(key: string): u32 { h += XXH32_SEED + XXH32_P5; } - var end = len + pos - 4; + var end = changetype(key) + len - 4; while (pos <= end) { h += load(pos) * XXH32_P3; h = rotl(h, 17) * XXH32_P4; pos += 4; } - end = len + pos; + end = changetype(key) + len; while (pos < end) { h += load(pos) * XXH32_P5; h = rotl(h, 11) * XXH32_P1; diff --git a/tests/compiler/std/hash.optimized.wat b/tests/compiler/std/hash.optimized.wat index 964d664a71..6da82ba0c8 100644 --- a/tests/compiler/std/hash.optimized.wat +++ b/tests/compiler/std/hash.optimized.wat @@ -50,6 +50,7 @@ (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -67,6 +68,7 @@ local.get $0 i32.store offset=4 local.get $0 + local.tee $1 i32.const 20 i32.sub i32.load offset=16 @@ -74,29 +76,29 @@ i32.shr_u i32.const 1 i32.shl - local.tee $2 + local.tee $3 i32.const 16 i32.ge_u if (result i32) i32.const 606290984 - local.set $1 + local.set $2 i32.const -2048144777 local.set $4 i32.const 1640531535 local.set $5 - local.get $0 - local.get $2 + local.get $1 + local.get $3 i32.add i32.const 16 i32.sub - local.set $3 + local.set $7 loop $while-continue|0 - local.get $0 - local.get $3 + local.get $1 + local.get $7 i32.le_u if + local.get $2 local.get $1 - local.get $0 i32.load i32.const -2048144777 i32.mul @@ -105,9 +107,9 @@ i32.rotl i32.const -1640531535 i32.mul - local.set $1 + local.set $2 local.get $4 - local.get $0 + local.get $1 i32.load offset=4 i32.const -2048144777 i32.mul @@ -118,7 +120,7 @@ i32.mul local.set $4 local.get $6 - local.get $0 + local.get $1 i32.load offset=8 i32.const -2048144777 i32.mul @@ -129,7 +131,7 @@ i32.mul local.set $6 local.get $5 - local.get $0 + local.get $1 i32.load offset=12 i32.const -2048144777 i32.mul @@ -139,15 +141,15 @@ i32.const -1640531535 i32.mul local.set $5 - local.get $0 + local.get $1 i32.const 16 i32.add - local.set $0 + local.set $1 br $while-continue|0 end end + local.get $3 local.get $2 - local.get $1 i32.const 1 i32.rotl local.get $4 @@ -164,24 +166,24 @@ i32.add i32.add else - local.get $2 + local.get $3 i32.const 374761393 i32.add end - local.set $1 + local.set $2 local.get $0 - local.get $2 + local.get $3 i32.add i32.const 4 i32.sub - local.set $3 + local.set $4 loop $while-continue|1 - local.get $0 - local.get $3 + local.get $1 + local.get $4 i32.le_u if + local.get $2 local.get $1 - local.get $0 i32.load i32.const -1028477379 i32.mul @@ -190,25 +192,25 @@ i32.rotl i32.const 668265263 i32.mul - local.set $1 - local.get $0 + local.set $2 + local.get $1 i32.const 4 i32.add - local.set $0 + local.set $1 br $while-continue|1 end end local.get $0 - local.get $2 + local.get $3 i32.add - local.set $3 + local.set $0 loop $while-continue|2 local.get $0 - local.get $3 - i32.lt_u + local.get $1 + i32.gt_u if + local.get $2 local.get $1 - local.get $0 i32.load8_u i32.const 374761393 i32.mul @@ -217,11 +219,11 @@ i32.rotl i32.const -1640531535 i32.mul - local.set $1 - local.get $0 + local.set $2 + local.get $1 i32.const 1 i32.add - local.set $0 + local.set $1 br $while-continue|2 end end diff --git a/tests/compiler/std/hash.untouched.wat b/tests/compiler/std/hash.untouched.wat index 4f3a8fdf1f..508ff318b4 100644 --- a/tests/compiler/std/hash.untouched.wat +++ b/tests/compiler/std/hash.untouched.wat @@ -374,8 +374,8 @@ i32.add local.set $4 end + local.get $1 local.get $2 - local.get $3 i32.add i32.const 4 i32.sub @@ -407,8 +407,8 @@ br $while-continue|1 end end + local.get $1 local.get $2 - local.get $3 i32.add local.set $9 loop $while-continue|2 @@ -650,8 +650,8 @@ i32.add local.set $4 end + local.get $1 local.get $2 - local.get $3 i32.add i32.const 4 i32.sub @@ -683,8 +683,8 @@ br $while-continue|1 end end + local.get $1 local.get $2 - local.get $3 i32.add local.set $9 loop $while-continue|2 diff --git a/tests/compiler/std/symbol.optimized.wat b/tests/compiler/std/symbol.optimized.wat index 22c120a42b..b278b0fb59 100644 --- a/tests/compiler/std/symbol.optimized.wat +++ b/tests/compiler/std/symbol.optimized.wat @@ -2422,6 +2422,7 @@ (local $4 i32) (local $5 i32) (local $6 i32) + (local $7 i32) global.get $~lib/memory/__stack_pointer i32.const 8 i32.sub @@ -2443,6 +2444,7 @@ local.get $0 i32.store offset=4 local.get $0 + local.tee $1 i32.const 20 i32.sub i32.load offset=16 @@ -2450,29 +2452,29 @@ i32.shr_u i32.const 1 i32.shl - local.tee $2 + local.tee $3 i32.const 16 i32.ge_u if (result i32) i32.const 606290984 - local.set $1 + local.set $2 i32.const -2048144777 local.set $4 i32.const 1640531535 local.set $5 - local.get $0 - local.get $2 + local.get $1 + local.get $3 i32.add i32.const 16 i32.sub - local.set $3 + local.set $7 loop $while-continue|0 - local.get $0 - local.get $3 + local.get $1 + local.get $7 i32.le_u if + local.get $2 local.get $1 - local.get $0 i32.load i32.const -2048144777 i32.mul @@ -2481,9 +2483,9 @@ i32.rotl i32.const -1640531535 i32.mul - local.set $1 + local.set $2 local.get $4 - local.get $0 + local.get $1 i32.load offset=4 i32.const -2048144777 i32.mul @@ -2494,7 +2496,7 @@ i32.mul local.set $4 local.get $6 - local.get $0 + local.get $1 i32.load offset=8 i32.const -2048144777 i32.mul @@ -2505,7 +2507,7 @@ i32.mul local.set $6 local.get $5 - local.get $0 + local.get $1 i32.load offset=12 i32.const -2048144777 i32.mul @@ -2515,15 +2517,15 @@ i32.const -1640531535 i32.mul local.set $5 - local.get $0 + local.get $1 i32.const 16 i32.add - local.set $0 + local.set $1 br $while-continue|0 end end + local.get $3 local.get $2 - local.get $1 i32.const 1 i32.rotl local.get $4 @@ -2540,24 +2542,24 @@ i32.add i32.add else - local.get $2 + local.get $3 i32.const 374761393 i32.add end - local.set $1 + local.set $2 local.get $0 - local.get $2 + local.get $3 i32.add i32.const 4 i32.sub - local.set $3 + local.set $4 loop $while-continue|1 - local.get $0 - local.get $3 + local.get $1 + local.get $4 i32.le_u if + local.get $2 local.get $1 - local.get $0 i32.load i32.const -1028477379 i32.mul @@ -2566,25 +2568,25 @@ i32.rotl i32.const 668265263 i32.mul - local.set $1 - local.get $0 + local.set $2 + local.get $1 i32.const 4 i32.add - local.set $0 + local.set $1 br $while-continue|1 end end local.get $0 - local.get $2 + local.get $3 i32.add - local.set $3 + local.set $0 loop $while-continue|2 local.get $0 - local.get $3 - i32.lt_u + local.get $1 + i32.gt_u if + local.get $2 local.get $1 - local.get $0 i32.load8_u i32.const 374761393 i32.mul @@ -2593,16 +2595,16 @@ i32.rotl i32.const -1640531535 i32.mul - local.set $1 - local.get $0 + local.set $2 + local.get $1 i32.const 1 i32.add - local.set $0 + local.set $1 br $while-continue|2 end end - local.get $1 - local.get $1 + local.get $2 + local.get $2 i32.const 15 i32.shr_u i32.xor diff --git a/tests/compiler/std/symbol.untouched.wat b/tests/compiler/std/symbol.untouched.wat index 65cd7066ac..2f79f301ac 100644 --- a/tests/compiler/std/symbol.untouched.wat +++ b/tests/compiler/std/symbol.untouched.wat @@ -4654,8 +4654,8 @@ i32.add local.set $4 end + local.get $1 local.get $2 - local.get $3 i32.add i32.const 4 i32.sub @@ -4687,8 +4687,8 @@ br $while-continue|1 end end + local.get $1 local.get $2 - local.get $3 i32.add local.set $9 loop $while-continue|2 From 834278c15e0e9068e94df09e40253a10ddf1ea63 Mon Sep 17 00:00:00 2001 From: Max Graey Date: Sun, 7 Feb 2021 02:54:10 +0200 Subject: [PATCH 13/14] Update std/assembly/util/hash.ts Co-authored-by: Daniel Wirtz --- std/assembly/util/hash.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/std/assembly/util/hash.ts b/std/assembly/util/hash.ts index f17fa6c9fb..c902598c7b 100644 --- a/std/assembly/util/hash.ts +++ b/std/assembly/util/hash.ts @@ -71,9 +71,9 @@ function mix(h: u32, key: u32): u32 { function hashStr(key: string): u32 { if (key === null) return XXH32_SEED; - var len: usize = key.length << 1; + var h: u32 = key.length << 1; + var len: usize = h; var pos = changetype(key); - var h = len; if (len >= 16) { let s1 = XXH32_SEED + XXH32_P1 + XXH32_P2; From 462343ccd1f63b193e7dbfae447d18b26ba99b93 Mon Sep 17 00:00:00 2001 From: MaxGraey Date: Sun, 7 Feb 2021 02:58:39 +0200 Subject: [PATCH 14/14] update --- tests/compiler/std/hash.untouched.wat | 180 ++++++++++++------------ tests/compiler/std/symbol.untouched.wat | 90 ++++++------ 2 files changed, 135 insertions(+), 135 deletions(-) diff --git a/tests/compiler/std/hash.untouched.wat b/tests/compiler/std/hash.untouched.wat index 508ff318b4..018f615805 100644 --- a/tests/compiler/std/hash.untouched.wat +++ b/tests/compiler/std/hash.untouched.wat @@ -244,11 +244,11 @@ i32.const 1 i32.shl local.set $2 - local.get $1 - local.set $3 local.get $2 + local.set $3 + local.get $1 local.set $4 - local.get $2 + local.get $3 i32.const 16 i32.ge_u if @@ -268,14 +268,14 @@ i32.const -1640531535 i32.sub local.set $8 - local.get $2 local.get $3 + local.get $4 i32.add i32.const 16 i32.sub local.set $9 loop $while-continue|0 - local.get $3 + local.get $4 local.get $9 i32.le_u local.set $10 @@ -283,7 +283,7 @@ if local.get $5 local.set $12 - local.get $3 + local.get $4 i32.load local.set $11 local.get $12 @@ -298,7 +298,7 @@ local.set $5 local.get $6 local.set $12 - local.get $3 + local.get $4 i32.load offset=4 local.set $11 local.get $12 @@ -313,7 +313,7 @@ local.set $6 local.get $7 local.set $12 - local.get $3 + local.get $4 i32.load offset=8 local.set $11 local.get $12 @@ -328,7 +328,7 @@ local.set $7 local.get $8 local.set $12 - local.get $3 + local.get $4 i32.load offset=12 local.set $11 local.get $12 @@ -341,14 +341,14 @@ i32.const -1640531535 i32.mul local.set $8 - local.get $3 + local.get $4 i32.const 16 i32.add - local.set $3 + local.set $4 br $while-continue|0 end end - local.get $4 + local.get $2 local.get $5 i32.const 1 i32.rotl @@ -365,106 +365,106 @@ i32.rotl i32.add i32.add - local.set $4 + local.set $2 else - local.get $4 + local.get $2 i32.const 0 i32.const 374761393 i32.add i32.add - local.set $4 + local.set $2 end local.get $1 - local.get $2 + local.get $3 i32.add i32.const 4 i32.sub local.set $9 loop $while-continue|1 - local.get $3 + local.get $4 local.get $9 i32.le_u local.set $8 local.get $8 if + local.get $2 local.get $4 - local.get $3 i32.load i32.const -1028477379 i32.mul i32.add - local.set $4 - local.get $4 + local.set $2 + local.get $2 i32.const 17 i32.rotl i32.const 668265263 i32.mul - local.set $4 - local.get $3 + local.set $2 + local.get $4 i32.const 4 i32.add - local.set $3 + local.set $4 br $while-continue|1 end end local.get $1 - local.get $2 + local.get $3 i32.add local.set $9 loop $while-continue|2 - local.get $3 + local.get $4 local.get $9 i32.lt_u local.set $8 local.get $8 if + local.get $2 local.get $4 - local.get $3 i32.load8_u i32.const 374761393 i32.mul i32.add - local.set $4 - local.get $4 + local.set $2 + local.get $2 i32.const 11 i32.rotl i32.const -1640531535 i32.mul - local.set $4 - local.get $3 + local.set $2 + local.get $4 i32.const 1 i32.add - local.set $3 + local.set $4 br $while-continue|2 end end - local.get $4 - local.get $4 + local.get $2 + local.get $2 i32.const 15 i32.shr_u i32.xor - local.set $4 - local.get $4 + local.set $2 + local.get $2 i32.const -2048144777 i32.mul - local.set $4 - local.get $4 - local.get $4 + local.set $2 + local.get $2 + local.get $2 i32.const 13 i32.shr_u i32.xor - local.set $4 - local.get $4 + local.set $2 + local.get $2 i32.const -1028477379 i32.mul - local.set $4 - local.get $4 - local.get $4 + local.set $2 + local.get $2 + local.get $2 i32.const 16 i32.shr_u i32.xor - local.set $4 - local.get $4 + local.set $2 + local.get $2 end local.set $13 global.get $~lib/memory/__stack_pointer @@ -520,11 +520,11 @@ i32.const 1 i32.shl local.set $2 - local.get $1 - local.set $3 local.get $2 + local.set $3 + local.get $1 local.set $4 - local.get $2 + local.get $3 i32.const 16 i32.ge_u if @@ -544,14 +544,14 @@ i32.const -1640531535 i32.sub local.set $8 - local.get $2 local.get $3 + local.get $4 i32.add i32.const 16 i32.sub local.set $9 loop $while-continue|0 - local.get $3 + local.get $4 local.get $9 i32.le_u local.set $10 @@ -559,7 +559,7 @@ if local.get $5 local.set $12 - local.get $3 + local.get $4 i32.load local.set $11 local.get $12 @@ -574,7 +574,7 @@ local.set $5 local.get $6 local.set $12 - local.get $3 + local.get $4 i32.load offset=4 local.set $11 local.get $12 @@ -589,7 +589,7 @@ local.set $6 local.get $7 local.set $12 - local.get $3 + local.get $4 i32.load offset=8 local.set $11 local.get $12 @@ -604,7 +604,7 @@ local.set $7 local.get $8 local.set $12 - local.get $3 + local.get $4 i32.load offset=12 local.set $11 local.get $12 @@ -617,14 +617,14 @@ i32.const -1640531535 i32.mul local.set $8 - local.get $3 + local.get $4 i32.const 16 i32.add - local.set $3 + local.set $4 br $while-continue|0 end end - local.get $4 + local.get $2 local.get $5 i32.const 1 i32.rotl @@ -641,106 +641,106 @@ i32.rotl i32.add i32.add - local.set $4 + local.set $2 else - local.get $4 + local.get $2 i32.const 0 i32.const 374761393 i32.add i32.add - local.set $4 + local.set $2 end local.get $1 - local.get $2 + local.get $3 i32.add i32.const 4 i32.sub local.set $9 loop $while-continue|1 - local.get $3 + local.get $4 local.get $9 i32.le_u local.set $8 local.get $8 if + local.get $2 local.get $4 - local.get $3 i32.load i32.const -1028477379 i32.mul i32.add - local.set $4 - local.get $4 + local.set $2 + local.get $2 i32.const 17 i32.rotl i32.const 668265263 i32.mul - local.set $4 - local.get $3 + local.set $2 + local.get $4 i32.const 4 i32.add - local.set $3 + local.set $4 br $while-continue|1 end end local.get $1 - local.get $2 + local.get $3 i32.add local.set $9 loop $while-continue|2 - local.get $3 + local.get $4 local.get $9 i32.lt_u local.set $8 local.get $8 if + local.get $2 local.get $4 - local.get $3 i32.load8_u i32.const 374761393 i32.mul i32.add - local.set $4 - local.get $4 + local.set $2 + local.get $2 i32.const 11 i32.rotl i32.const -1640531535 i32.mul - local.set $4 - local.get $3 + local.set $2 + local.get $4 i32.const 1 i32.add - local.set $3 + local.set $4 br $while-continue|2 end end - local.get $4 - local.get $4 + local.get $2 + local.get $2 i32.const 15 i32.shr_u i32.xor - local.set $4 - local.get $4 + local.set $2 + local.get $2 i32.const -2048144777 i32.mul - local.set $4 - local.get $4 - local.get $4 + local.set $2 + local.get $2 + local.get $2 i32.const 13 i32.shr_u i32.xor - local.set $4 - local.get $4 + local.set $2 + local.get $2 i32.const -1028477379 i32.mul - local.set $4 - local.get $4 - local.get $4 + local.set $2 + local.get $2 + local.get $2 i32.const 16 i32.shr_u i32.xor - local.set $4 - local.get $4 + local.set $2 + local.get $2 end local.set $13 global.get $~lib/memory/__stack_pointer diff --git a/tests/compiler/std/symbol.untouched.wat b/tests/compiler/std/symbol.untouched.wat index 2f79f301ac..61572c58d1 100644 --- a/tests/compiler/std/symbol.untouched.wat +++ b/tests/compiler/std/symbol.untouched.wat @@ -4524,11 +4524,11 @@ i32.const 1 i32.shl local.set $2 - local.get $1 - local.set $3 local.get $2 + local.set $3 + local.get $1 local.set $4 - local.get $2 + local.get $3 i32.const 16 i32.ge_u if @@ -4548,14 +4548,14 @@ i32.const -1640531535 i32.sub local.set $8 - local.get $2 local.get $3 + local.get $4 i32.add i32.const 16 i32.sub local.set $9 loop $while-continue|0 - local.get $3 + local.get $4 local.get $9 i32.le_u local.set $10 @@ -4563,7 +4563,7 @@ if local.get $5 local.set $12 - local.get $3 + local.get $4 i32.load local.set $11 local.get $12 @@ -4578,7 +4578,7 @@ local.set $5 local.get $6 local.set $12 - local.get $3 + local.get $4 i32.load offset=4 local.set $11 local.get $12 @@ -4593,7 +4593,7 @@ local.set $6 local.get $7 local.set $12 - local.get $3 + local.get $4 i32.load offset=8 local.set $11 local.get $12 @@ -4608,7 +4608,7 @@ local.set $7 local.get $8 local.set $12 - local.get $3 + local.get $4 i32.load offset=12 local.set $11 local.get $12 @@ -4621,14 +4621,14 @@ i32.const -1640531535 i32.mul local.set $8 - local.get $3 + local.get $4 i32.const 16 i32.add - local.set $3 + local.set $4 br $while-continue|0 end end - local.get $4 + local.get $2 local.get $5 i32.const 1 i32.rotl @@ -4645,106 +4645,106 @@ i32.rotl i32.add i32.add - local.set $4 + local.set $2 else - local.get $4 + local.get $2 i32.const 0 i32.const 374761393 i32.add i32.add - local.set $4 + local.set $2 end local.get $1 - local.get $2 + local.get $3 i32.add i32.const 4 i32.sub local.set $9 loop $while-continue|1 - local.get $3 + local.get $4 local.get $9 i32.le_u local.set $8 local.get $8 if + local.get $2 local.get $4 - local.get $3 i32.load i32.const -1028477379 i32.mul i32.add - local.set $4 - local.get $4 + local.set $2 + local.get $2 i32.const 17 i32.rotl i32.const 668265263 i32.mul - local.set $4 - local.get $3 + local.set $2 + local.get $4 i32.const 4 i32.add - local.set $3 + local.set $4 br $while-continue|1 end end local.get $1 - local.get $2 + local.get $3 i32.add local.set $9 loop $while-continue|2 - local.get $3 + local.get $4 local.get $9 i32.lt_u local.set $8 local.get $8 if + local.get $2 local.get $4 - local.get $3 i32.load8_u i32.const 374761393 i32.mul i32.add - local.set $4 - local.get $4 + local.set $2 + local.get $2 i32.const 11 i32.rotl i32.const -1640531535 i32.mul - local.set $4 - local.get $3 + local.set $2 + local.get $4 i32.const 1 i32.add - local.set $3 + local.set $4 br $while-continue|2 end end - local.get $4 - local.get $4 + local.get $2 + local.get $2 i32.const 15 i32.shr_u i32.xor - local.set $4 - local.get $4 + local.set $2 + local.get $2 i32.const -2048144777 i32.mul - local.set $4 - local.get $4 - local.get $4 + local.set $2 + local.get $2 + local.get $2 i32.const 13 i32.shr_u i32.xor - local.set $4 - local.get $4 + local.set $2 + local.get $2 i32.const -1028477379 i32.mul - local.set $4 - local.get $4 - local.get $4 + local.set $2 + local.get $2 + local.get $2 i32.const 16 i32.shr_u i32.xor - local.set $4 - local.get $4 + local.set $2 + local.get $2 end local.set $13 global.get $~lib/memory/__stack_pointer