Rework loop compilation / flows (#644)

This commit is contained in:
Daniel Wirtz
2019-06-11 12:52:16 +02:00
committed by GitHub
parent 420812f5b2
commit 40dac8269d
125 changed files with 52818 additions and 61256 deletions

View File

@ -27,7 +27,7 @@
global.set $assembly/index/s
i32.const 0
local.set $0
loop $repeat|0
loop $loop|0
block $break|0
local.get $0
global.get $assembly/index/h
@ -35,7 +35,7 @@
br_if $break|0
i32.const 0
local.set $1
loop $repeat|1
loop $loop|1
block $break|1
local.get $1
global.get $assembly/index/w
@ -69,14 +69,14 @@
i32.const 1
i32.add
local.set $1
br $repeat|1
br $loop|1
end
end
local.get $0
i32.const 1
i32.add
local.set $0
br $repeat|0
br $loop|0
end
end
)
@ -97,7 +97,7 @@
i32.const 1
i32.sub
local.set $7
loop $repeat|0
loop $loop|0
block $break|0
local.get $0
global.get $assembly/index/h
@ -121,7 +121,7 @@
local.set $5
i32.const 0
local.set $1
loop $repeat|1
loop $loop|1
block $break|1
local.get $1
global.get $assembly/index/w
@ -341,20 +341,20 @@
i32.const 1
i32.add
local.set $1
br $repeat|1
br $loop|1
end
end
local.get $0
i32.const 1
i32.add
local.set $0
br $repeat|0
br $loop|0
end
end
)
(func $assembly/index/fill (; 3 ;) (type $FUNCSIG$viid) (param $0 i32) (param $1 i32) (param $2 f64)
(local $3 i32)
loop $repeat|0
loop $loop|0
block $break|0
local.get $3
global.get $assembly/index/w
@ -382,12 +382,12 @@
i32.const 1
i32.add
local.set $3
br $repeat|0
br $loop|0
end
end
i32.const 0
local.set $3
loop $repeat|1
loop $loop|1
block $break|1
local.get $3
global.get $assembly/index/h
@ -415,7 +415,7 @@
i32.const 1
i32.add
local.set $3
br $repeat|1
br $loop|1
end
end
)

View File

@ -34,7 +34,7 @@
block $break|0
i32.const 0
local.set $2
loop $repeat|0
loop $loop|0
local.get $2
global.get $assembly/index/h
i32.lt_s
@ -43,48 +43,45 @@
block $break|1
i32.const 0
local.set $3
loop $repeat|1
loop $loop|1
local.get $3
global.get $assembly/index/w
i32.lt_s
i32.eqz
br_if $break|1
block $assembly/index/set|inlined.0
local.get $3
local.set $6
local.get $2
local.set $5
call $~lib/bindings/Math/random
f64.const 0.1
f64.gt
if (result i32)
global.get $assembly/config/BGR_DEAD
i32.const 16777215
i32.and
else
global.get $assembly/config/BGR_ALIVE
i32.const -16777216
i32.or
end
local.set $4
global.get $assembly/index/s
local.get $5
global.get $assembly/index/w
i32.mul
i32.add
local.get $6
i32.add
i32.const 2
i32.shl
local.get $4
i32.store
local.get $3
local.set $6
local.get $2
local.set $5
call $~lib/bindings/Math/random
f64.const 0.1
f64.gt
if (result i32)
global.get $assembly/config/BGR_DEAD
i32.const 16777215
i32.and
else
global.get $assembly/config/BGR_ALIVE
i32.const -16777216
i32.or
end
local.set $4
global.get $assembly/index/s
local.get $5
global.get $assembly/index/w
i32.mul
i32.add
local.get $6
i32.add
i32.const 2
i32.shl
local.get $4
i32.store
local.get $3
i32.const 1
i32.add
local.set $3
br $repeat|1
unreachable
br $loop|1
end
unreachable
end
@ -92,8 +89,7 @@
i32.const 1
i32.add
local.set $2
br $repeat|0
unreachable
br $loop|0
end
unreachable
end
@ -127,7 +123,7 @@
block $break|0
i32.const 0
local.set $2
loop $repeat|0
loop $loop|0
local.get $2
global.get $assembly/index/h
i32.lt_s
@ -158,7 +154,7 @@
block $break|1
i32.const 0
local.set $5
loop $repeat|1
loop $loop|1
local.get $5
global.get $assembly/index/w
i32.lt_s
@ -186,156 +182,138 @@
i32.add
end
local.set $7
block $assembly/index/get|inlined.0 (result i32)
local.get $6
local.set $9
local.get $3
local.set $8
local.get $8
global.get $assembly/index/w
i32.mul
local.get $9
i32.add
i32.const 2
i32.shl
i32.load
end
local.get $6
local.set $9
local.get $3
local.set $8
local.get $8
global.get $assembly/index/w
i32.mul
local.get $9
i32.add
i32.const 2
i32.shl
i32.load
i32.const 1
i32.and
block $assembly/index/get|inlined.1 (result i32)
local.get $5
local.set $9
local.get $3
local.set $8
local.get $8
global.get $assembly/index/w
i32.mul
local.get $9
i32.add
i32.const 2
i32.shl
i32.load
end
local.get $5
local.set $9
local.get $3
local.set $8
local.get $8
global.get $assembly/index/w
i32.mul
local.get $9
i32.add
i32.const 2
i32.shl
i32.load
i32.const 1
i32.and
i32.add
block $assembly/index/get|inlined.2 (result i32)
local.get $7
local.set $9
local.get $3
local.set $8
local.get $8
global.get $assembly/index/w
i32.mul
local.get $9
i32.add
i32.const 2
i32.shl
i32.load
end
local.get $7
local.set $9
local.get $3
local.set $8
local.get $8
global.get $assembly/index/w
i32.mul
local.get $9
i32.add
i32.const 2
i32.shl
i32.load
i32.const 1
i32.and
i32.add
block $assembly/index/get|inlined.3 (result i32)
local.get $6
local.set $9
local.get $2
local.set $8
local.get $8
global.get $assembly/index/w
i32.mul
local.get $9
i32.add
i32.const 2
i32.shl
i32.load
end
local.get $6
local.set $9
local.get $2
local.set $8
local.get $8
global.get $assembly/index/w
i32.mul
local.get $9
i32.add
i32.const 2
i32.shl
i32.load
i32.const 1
i32.and
i32.add
block $assembly/index/get|inlined.4 (result i32)
local.get $7
local.set $9
local.get $2
local.set $8
local.get $8
global.get $assembly/index/w
i32.mul
local.get $9
i32.add
i32.const 2
i32.shl
i32.load
end
local.get $7
local.set $9
local.get $2
local.set $8
local.get $8
global.get $assembly/index/w
i32.mul
local.get $9
i32.add
i32.const 2
i32.shl
i32.load
i32.const 1
i32.and
i32.add
block $assembly/index/get|inlined.5 (result i32)
local.get $6
local.set $9
local.get $4
local.set $8
local.get $8
global.get $assembly/index/w
i32.mul
local.get $9
i32.add
i32.const 2
i32.shl
i32.load
end
local.get $6
local.set $9
local.get $4
local.set $8
local.get $8
global.get $assembly/index/w
i32.mul
local.get $9
i32.add
i32.const 2
i32.shl
i32.load
i32.const 1
i32.and
i32.add
block $assembly/index/get|inlined.6 (result i32)
local.get $5
local.set $9
local.get $4
local.set $8
local.get $8
global.get $assembly/index/w
i32.mul
local.get $9
i32.add
i32.const 2
i32.shl
i32.load
end
local.get $5
local.set $9
local.get $4
local.set $8
local.get $8
global.get $assembly/index/w
i32.mul
local.get $9
i32.add
i32.const 2
i32.shl
i32.load
i32.const 1
i32.and
i32.add
block $assembly/index/get|inlined.7 (result i32)
local.get $7
local.set $9
local.get $4
local.set $8
local.get $8
global.get $assembly/index/w
i32.mul
local.get $9
i32.add
i32.const 2
i32.shl
i32.load
end
local.get $7
local.set $9
local.get $4
local.set $8
local.get $8
global.get $assembly/index/w
i32.mul
local.get $9
i32.add
i32.const 2
i32.shl
i32.load
i32.const 1
i32.and
i32.add
local.set $9
block $assembly/index/get|inlined.8 (result i32)
local.get $5
local.set $10
local.get $2
local.set $8
local.get $8
global.get $assembly/index/w
i32.mul
local.get $10
i32.add
i32.const 2
i32.shl
i32.load
end
local.get $5
local.set $10
local.get $2
local.set $8
local.get $8
global.get $assembly/index/w
i32.mul
local.get $10
i32.add
i32.const 2
i32.shl
i32.load
local.set $10
local.get $10
i32.const 1
@ -366,31 +344,29 @@
i32.gt_s
select
local.set $13
block $assembly/index/set|inlined.1
local.get $12
local.set $16
local.get $11
local.set $15
local.get $13
i32.const 24
i32.shl
local.get $8
i32.const 16777215
i32.and
i32.or
local.set $14
global.get $assembly/index/s
local.get $15
global.get $assembly/index/w
i32.mul
i32.add
local.get $16
i32.add
i32.const 2
i32.shl
local.get $14
i32.store
end
local.get $12
local.set $16
local.get $11
local.set $15
local.get $13
i32.const 24
i32.shl
local.get $8
i32.const 16777215
i32.and
i32.or
local.set $14
global.get $assembly/index/s
local.get $15
global.get $assembly/index/w
i32.mul
i32.add
local.get $16
i32.add
i32.const 2
i32.shl
local.get $14
i32.store
else
local.get $5
local.set $16
@ -456,39 +432,36 @@
i32.gt_s
select
local.set $12
block $assembly/index/set|inlined.4
local.get $15
local.set $11
local.get $14
local.set $8
local.get $12
i32.const 24
i32.shl
local.get $13
i32.const 16777215
i32.and
i32.or
local.set $16
global.get $assembly/index/s
local.get $8
global.get $assembly/index/w
i32.mul
i32.add
local.get $11
i32.add
i32.const 2
i32.shl
local.get $16
i32.store
end
local.get $15
local.set $11
local.get $14
local.set $8
local.get $12
i32.const 24
i32.shl
local.get $13
i32.const 16777215
i32.and
i32.or
local.set $16
global.get $assembly/index/s
local.get $8
global.get $assembly/index/w
i32.mul
i32.add
local.get $11
i32.add
i32.const 2
i32.shl
local.get $16
i32.store
end
end
local.get $5
i32.const 1
i32.add
local.set $5
br $repeat|1
unreachable
br $loop|1
end
unreachable
end
@ -496,8 +469,7 @@
i32.const 1
i32.add
local.set $2
br $repeat|0
unreachable
br $loop|0
end
unreachable
end
@ -510,7 +482,7 @@
block $break|0
i32.const 0
local.set $3
loop $repeat|0
loop $loop|0
local.get $3
global.get $assembly/index/w
i32.lt_s
@ -544,15 +516,14 @@
i32.const 1
i32.add
local.set $3
br $repeat|0
unreachable
br $loop|0
end
unreachable
end
block $break|1
i32.const 0
local.set $3
loop $repeat|1
loop $loop|1
local.get $3
global.get $assembly/index/h
i32.lt_s
@ -586,8 +557,7 @@
i32.const 1
i32.add
local.set $3
br $repeat|1
unreachable
br $loop|1
end
unreachable
end

View File

@ -8,6 +8,6 @@ declare module ASModule {
type f32 = number;
type f64 = number;
type bool = any;
function computeLine(y: u32, width: u32, height: u32, limit: u32): void;
export function computeLine(y: u32, width: u32, height: u32, limit: u32): void;
}
export default ASModule;

View File

@ -25,7 +25,6 @@
local.tee $9
f64.const 0.625
f64.mul
local.set $4
local.get $0
f64.convert_i32_u
local.get $2
@ -46,7 +45,6 @@
local.tee $10
f64.mul
local.set $11
local.get $4
local.get $10
f64.mul
local.set $13
@ -66,7 +64,7 @@
local.get $6
f64.min
local.set $15
loop $repeat|0
loop $loop|0
block $break|0
local.get $8
local.get $1
@ -86,43 +84,43 @@
i32.const 0
local.set $7
loop $continue|1
local.get $4
local.get $4
f64.mul
local.tee $9
local.get $5
local.get $5
f64.mul
local.tee $6
f64.add
f64.const 4
f64.le
if
block $break|1
f64.const 2
local.get $4
f64.mul
local.get $5
f64.mul
local.get $11
f64.add
local.set $5
local.get $9
local.get $6
f64.sub
local.get $12
f64.add
local.set $4
local.get $7
local.get $3
i32.ge_u
br_if $break|1
local.get $7
i32.const 1
i32.add
local.set $7
br $continue|1
end
block $break|1
local.get $4
local.get $4
f64.mul
local.tee $9
local.get $5
local.get $5
f64.mul
local.tee $6
f64.add
f64.const 4
f64.le
i32.eqz
br_if $break|1
f64.const 2
local.get $4
f64.mul
local.get $5
f64.mul
local.get $11
f64.add
local.set $5
local.get $9
local.get $6
f64.sub
local.get $12
f64.add
local.set $4
local.get $7
local.get $3
i32.ge_u
br_if $break|1
local.get $7
i32.const 1
i32.add
local.set $7
br $continue|1
end
end
loop $continue|2
@ -140,7 +138,6 @@
f64.sub
local.get $12
f64.add
local.set $6
f64.const 2
local.get $4
f64.mul
@ -149,7 +146,6 @@
local.get $11
f64.add
local.set $5
local.get $6
local.set $4
local.get $7
i32.const 1
@ -203,7 +199,7 @@
i32.const 1
i32.add
local.set $8
br $repeat|0
br $loop|0
end
end
)

View File

@ -88,7 +88,7 @@
block $break|0
i32.const 0
local.set $12
loop $repeat|0
loop $loop|0
local.get $12
local.get $1
i32.lt_u
@ -120,34 +120,35 @@
f64.add
f64.const 4
f64.le
i32.eqz
br_if $break|1
f64.const 2
local.get $14
f64.mul
local.get $15
f64.mul
local.get $7
f64.add
local.set $15
local.get $16
local.get $17
f64.sub
local.get $13
f64.add
local.set $14
local.get $18
local.get $3
i32.ge_u
if
f64.const 2
local.get $14
f64.mul
local.get $15
f64.mul
local.get $7
f64.add
local.set $15
local.get $16
local.get $17
f64.sub
local.get $13
f64.add
local.set $14
local.get $18
local.get $3
i32.ge_u
if
br $break|1
end
local.get $18
i32.const 1
i32.add
local.set $18
br $continue|1
br $break|1
end
local.get $18
i32.const 1
i32.add
local.set $18
br $continue|1
end
unreachable
end
block $break|2
loop $continue|2
@ -155,34 +156,35 @@
f64.convert_i32_u
local.get $11
f64.lt
if
local.get $14
local.get $14
f64.mul
local.get $15
local.get $15
f64.mul
f64.sub
local.get $13
f64.add
local.set $19
f64.const 2
local.get $14
f64.mul
local.get $15
f64.mul
local.get $7
f64.add
local.set $15
local.get $19
local.set $14
local.get $18
i32.const 1
i32.add
local.set $18
br $continue|2
end
i32.eqz
br_if $break|2
local.get $14
local.get $14
f64.mul
local.get $15
local.get $15
f64.mul
f64.sub
local.get $13
f64.add
local.set $19
f64.const 2
local.get $14
f64.mul
local.get $15
f64.mul
local.get $7
f64.add
local.set $15
local.get $19
local.set $14
local.get $18
i32.const 1
i32.add
local.set $18
br $continue|2
end
unreachable
end
global.get $assembly/index/NUM_COLORS
i32.const 1
@ -210,26 +212,24 @@
i32.const 1
i32.sub
f64.convert_i32_s
block $assembly/index/clamp<f64>|inlined.0 (result f64)
local.get $18
i32.const 1
i32.add
f64.convert_i32_u
local.get $21
f64.sub
local.get $10
f64.mul
local.set $24
f64.const 0
local.set $23
f64.const 1
local.set $22
local.get $24
local.get $23
f64.max
local.get $22
f64.min
end
local.get $18
i32.const 1
i32.add
f64.convert_i32_u
local.get $21
f64.sub
local.get $10
f64.mul
local.set $24
f64.const 0
local.set $23
f64.const 1
local.set $22
local.get $24
local.get $23
f64.max
local.get $22
f64.min
f64.mul
i32.trunc_f64_u
local.set $20
@ -245,8 +245,7 @@
i32.const 1
i32.add
local.set $12
br $repeat|0
unreachable
br $loop|0
end
unreachable
end

View File

@ -50,7 +50,7 @@ function asmFunc(global, env, buffer) {
function assembly_index_NBodySystem_constructor($0) {
var $1 = 0, $2 = 0, $3 = 0.0, $4 = 0.0, $5 = 0.0, $6 = 0.0, $7 = 0;
$7 = HEAP32[($0 + 12 | 0) >> 2];
repeat_0 : while (1) {
loop_0 : while (1) {
if (($1 | 0) < ($7 | 0)) {
$2 = HEAP32[(HEAP32[($0 + 4 | 0) >> 2] + ($1 << 2 | 0) | 0) >> 2];
$3 = HEAPF64[($2 + 48 | 0) >> 3];
@ -58,9 +58,9 @@ function asmFunc(global, env, buffer) {
$5 = $5 + HEAPF64[($2 + 32 | 0) >> 3] * $3;
$6 = $6 + HEAPF64[($2 + 40 | 0) >> 3] * $3;
$1 = $1 + 1 | 0;
continue repeat_0;
continue loop_0;
}
break repeat_0;
break loop_0;
};
$1 = HEAP32[HEAP32[($0 + 4 | 0) >> 2] >> 2];
HEAPF64[($1 + 24 | 0) >> 3] = -$4 / 39.47841760435743;
@ -111,7 +111,7 @@ function asmFunc(global, env, buffer) {
var $1 = 0, $2 = 0.0, $3 = 0.0, $4 = 0, $5 = 0.0, $6 = 0.0, $7 = 0.0, $8 = 0, $9 = 0.0, $10 = 0.0, $11 = 0.0, $12 = 0, $13 = 0, $14 = 0.0, $15 = 0.0, $16 = 0.0, $17 = 0.0;
$12 = HEAP32[$0 >> 2];
$13 = HEAP32[($12 + 12 | 0) >> 2];
repeat_0 : while (1) {
loop_0 : while (1) {
if ($4 >>> 0 < $13 >>> 0) {
$0 = HEAP32[(HEAP32[($12 + 4 | 0) >> 2] + ($4 << 2 | 0) | 0) >> 2];
$14 = HEAPF64[$0 >> 3];
@ -122,7 +122,7 @@ function asmFunc(global, env, buffer) {
$7 = HEAPF64[($0 + 40 | 0) >> 3];
$17 = HEAPF64[($0 + 48 | 0) >> 3];
$8 = $4 + 1 | 0;
repeat_1 : while (1) {
loop_1 : while (1) {
if ($8 >>> 0 < $13 >>> 0) {
$1 = HEAP32[(HEAP32[($12 + 4 | 0) >> 2] + ($8 << 2 | 0) | 0) >> 2];
$2 = $14 - HEAPF64[$1 >> 3];
@ -141,9 +141,9 @@ function asmFunc(global, env, buffer) {
HEAPF64[($1 + 32 | 0) >> 3] = HEAPF64[($1 + 32 | 0) >> 3] + $9 * $2;
HEAPF64[($1 + 40 | 0) >> 3] = HEAPF64[($1 + 40 | 0) >> 3] + $10 * $2;
$8 = $8 + 1 | 0;
continue repeat_1;
continue loop_1;
}
break repeat_1;
break loop_1;
};
HEAPF64[($0 + 24 | 0) >> 3] = $5;
HEAPF64[($0 + 32 | 0) >> 3] = $6;
@ -152,9 +152,9 @@ function asmFunc(global, env, buffer) {
HEAPF64[($0 + 8 | 0) >> 3] = HEAPF64[($0 + 8 | 0) >> 3] + .01 * $6;
HEAPF64[($0 + 16 | 0) >> 3] = HEAPF64[($0 + 16 | 0) >> 3] + .01 * $7;
$4 = $4 + 1 | 0;
continue repeat_0;
continue loop_0;
}
break repeat_0;
break loop_0;
};
}
@ -162,7 +162,7 @@ function asmFunc(global, env, buffer) {
var $1 = 0.0, $2 = 0.0, $3 = 0, $4 = 0, $5 = 0, $6 = 0.0, $7 = 0, $8 = 0.0, $9 = 0.0, $10 = 0.0, $11 = 0.0;
$5 = HEAP32[$0 >> 2];
$7 = HEAP32[($5 + 12 | 0) >> 2];
repeat_0 : while (1) {
loop_0 : while (1) {
if ($3 >>> 0 < $7 >>> 0) {
$0 = HEAP32[(HEAP32[($5 + 4 | 0) >> 2] + ($3 << 2 | 0) | 0) >> 2];
$9 = HEAPF64[$0 >> 3];
@ -177,7 +177,7 @@ function asmFunc(global, env, buffer) {
$1 = HEAPF64[($0 + 40 | 0) >> 3];
$1 = $6 + .5 * $8 * ($2 + $1 * $1);
$0 = $3 + 1 | 0;
repeat_1 : while (1) {
loop_1 : while (1) {
if ($0 >>> 0 < $7 >>> 0) {
$4 = HEAP32[(HEAP32[($5 + 4 | 0) >> 2] + ($0 << 2 | 0) | 0) >> 2];
$6 = $1;
@ -188,14 +188,14 @@ function asmFunc(global, env, buffer) {
$1 = $11 - HEAPF64[($4 + 16 | 0) >> 3];
$1 = $6 - $8 * HEAPF64[($4 + 48 | 0) >> 3] / Math_sqrt($2 + $1 * $1);
$0 = $0 + 1 | 0;
continue repeat_1;
continue loop_1;
}
break repeat_1;
break loop_1;
};
$3 = $3 + 1 | 0;
continue repeat_0;
continue loop_0;
}
break repeat_0;
break loop_0;
};
return $1;
}
@ -208,13 +208,13 @@ function asmFunc(global, env, buffer) {
function assembly_index_bench($0) {
$0 = $0 | 0;
var $1 = 0;
repeat_0 : while (1) {
loop_0 : while (1) {
if (!($1 >>> 0 >= $0 >>> 0)) {
assembly_index_NBodySystem_advance(assembly_index_system);
$1 = $1 + 1 | 0;
continue repeat_0;
continue loop_0;
}
break repeat_0;
break loop_0;
};
}

View File

@ -102,7 +102,7 @@
local.get $0
i32.load offset=12
local.set $7
loop $repeat|0
loop $loop|0
local.get $1
local.get $7
i32.lt_s
@ -142,7 +142,7 @@
i32.const 1
i32.add
local.set $1
br $repeat|0
br $loop|0
end
end
local.get $0
@ -308,7 +308,7 @@
local.tee $12
i32.load offset=12
local.set $13
loop $repeat|0
loop $loop|0
local.get $3
local.get $13
i32.lt_u
@ -345,7 +345,7 @@
i32.const 1
i32.add
local.set $7
loop $repeat|1
loop $loop|1
local.get $7
local.get $13
i32.lt_u
@ -441,7 +441,7 @@
i32.const 1
i32.add
local.set $7
br $repeat|1
br $loop|1
end
end
local.get $0
@ -481,7 +481,7 @@
i32.const 1
i32.add
local.set $3
br $repeat|0
br $loop|0
end
end
)
@ -501,7 +501,7 @@
local.tee $4
i32.load offset=12
local.set $5
loop $repeat|0
loop $loop|0
local.get $2
local.get $5
i32.lt_u
@ -552,7 +552,7 @@
i32.const 1
i32.add
local.set $0
loop $repeat|1
loop $loop|1
local.get $0
local.get $5
i32.lt_u
@ -601,14 +601,14 @@
i32.const 1
i32.add
local.set $0
br $repeat|1
br $loop|1
end
end
local.get $2
i32.const 1
i32.add
local.set $2
br $repeat|0
br $loop|0
end
end
local.get $1
@ -622,7 +622,7 @@
(func $assembly/index/bench (; 8 ;) (type $FUNCSIG$vi) (param $0 i32)
(local $1 i32)
block $break|0
loop $repeat|0
loop $loop|0
local.get $1
local.get $0
i32.ge_u
@ -633,8 +633,7 @@
i32.const 1
i32.add
local.set $1
br $repeat|0
unreachable
br $loop|0
end
unreachable
end

File diff suppressed because it is too large Load Diff

View File

@ -8,36 +8,36 @@ declare module ASModule {
type f32 = number;
type f64 = number;
type bool = any;
function getLo(): u32;
function getHi(): u32;
function clz(loLeft: u32, hiLeft: u32): void;
function ctz(loLeft: u32, hiLeft: u32): void;
function popcnt(loLeft: u32, hiLeft: u32): void;
function eqz(loLeft: u32, hiLeft: u32): void;
function add(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
function sub(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
function mul(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
function div_s(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
function div_u(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
function rem_s(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
function rem_u(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
function and(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
function or(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
function xor(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
function shl(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
function shr_s(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
function shr_u(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
function rotl(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
function rotr(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
function eq(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
function ne(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
function lt_s(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
function lt_u(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
function le_s(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
function le_u(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
function gt_s(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
function gt_u(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
function ge_s(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
function ge_u(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
export function getLo(): u32;
export function getHi(): u32;
export function clz(loLeft: u32, hiLeft: u32): void;
export function ctz(loLeft: u32, hiLeft: u32): void;
export function popcnt(loLeft: u32, hiLeft: u32): void;
export function eqz(loLeft: u32, hiLeft: u32): void;
export function add(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
export function sub(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
export function mul(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
export function div_s(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
export function div_u(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
export function rem_s(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
export function rem_u(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
export function and(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
export function or(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
export function xor(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
export function shl(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
export function shr_s(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
export function shr_u(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
export function rotl(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
export function rotr(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
export function eq(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
export function ne(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
export function lt_s(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
export function lt_u(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
export function le_s(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
export function le_u(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
export function gt_s(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
export function gt_u(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
export function ge_s(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
export function ge_u(loLeft: u32, hiLeft: u32, loRight: u32, hiRight: u32): void;
}
export default ASModule;

View File

@ -2174,10 +2174,8 @@
i64.lt_u
if
local.get $4
local.set $11
local.get $2
local.set $4
local.get $11
local.set $2
end
local.get $4

View File

@ -2382,10 +2382,8 @@
i32.lt_u
if
local.get $3
local.set $6
local.get $2
local.set $3
local.get $6
local.set $2
end
local.get $3

View File

@ -236,12 +236,10 @@
global.get $assembly/index/off
local.tee $1
i32.load8_u
local.set $0
local.get $1
i32.const 1
i32.add
global.set $assembly/index/off
local.get $0
i32.const 11
i32.ne
if
@ -267,12 +265,10 @@
global.get $assembly/index/off
local.tee $0
i32.load
local.set $2
local.get $0
i32.const 4
i32.add
global.set $assembly/index/off
local.get $2
i32.const 1836278016
i32.ne
if
@ -281,12 +277,10 @@
global.get $assembly/index/off
local.tee $0
i32.load
local.set $2
local.get $0
i32.const 4
i32.add
global.set $assembly/index/off
local.get $2
i32.const 1
i32.ne
if
@ -368,7 +362,7 @@
local.set $4
i32.const 0
local.set $2
loop $repeat|2
loop $loop|2
local.get $2
local.get $4
i32.lt_u
@ -383,7 +377,7 @@
local.set $5
i32.const 0
local.set $3
loop $repeat|3
loop $loop|3
local.get $3
local.get $5
i32.lt_u
@ -399,14 +393,14 @@
i32.const 1
i32.add
local.set $3
br $repeat|3
br $loop|3
end
end
call $assembly/index/readVaruint
local.set $5
i32.const 0
local.set $3
loop $repeat|4
loop $loop|4
local.get $3
local.get $5
i32.lt_u
@ -422,14 +416,14 @@
i32.const 1
i32.add
local.set $3
br $repeat|4
br $loop|4
end
end
local.get $2
i32.const 1
i32.add
local.set $2
br $repeat|2
br $loop|2
end
end
br $break|1
@ -438,7 +432,7 @@
local.set $7
i32.const 0
local.set $4
loop $repeat|5
loop $loop|5
local.get $4
local.get $7
i32.lt_u
@ -560,7 +554,7 @@
i32.const 1
i32.add
local.set $4
br $repeat|5
br $loop|5
end
end
br $break|1
@ -569,7 +563,7 @@
local.set $4
i32.const 0
local.set $3
loop $repeat|7
loop $loop|7
local.get $3
local.get $4
i32.lt_u
@ -586,7 +580,7 @@
i32.const 1
i32.add
local.set $3
br $repeat|7
br $loop|7
end
end
br $break|1
@ -595,7 +589,7 @@
local.set $7
i32.const 0
local.set $4
loop $repeat|8
loop $loop|8
local.get $4
local.get $7
i32.lt_u
@ -628,7 +622,7 @@
i32.const 1
i32.add
local.set $4
br $repeat|8
br $loop|8
end
end
br $break|1
@ -637,7 +631,7 @@
local.set $6
i32.const 0
local.set $3
loop $repeat|9
loop $loop|9
local.get $3
local.get $6
i32.lt_u
@ -665,7 +659,7 @@
i32.const 1
i32.add
local.set $3
br $repeat|9
br $loop|9
end
end
br $break|1
@ -674,7 +668,7 @@
local.set $4
i32.const 0
local.set $3
loop $repeat|10
loop $loop|10
local.get $3
local.get $4
i32.lt_u
@ -700,7 +694,7 @@
i32.const 1
i32.add
local.set $3
br $repeat|10
br $loop|10
end
end
br $break|1
@ -709,7 +703,7 @@
local.set $3
i32.const 0
local.set $2
loop $repeat|11
loop $loop|11
local.get $2
local.get $3
i32.lt_u
@ -738,7 +732,7 @@
i32.const 1
i32.add
local.set $2
br $repeat|11
br $loop|11
end
end
br $break|1
@ -762,9 +756,7 @@
call $assembly/index/readVaruint
local.set $2
call $assembly/index/readVaruint
local.set $4
global.get $assembly/index/off
local.set $5
block $break|12
block $case3|12
block $case2|12
@ -792,20 +784,18 @@
local.set $2
i32.const 0
local.set $3
loop $repeat|13
loop $loop|13
local.get $3
local.get $2
i32.lt_u
if
call $assembly/index/readVaruint
local.set $6
call $assembly/index/readVaruint
local.tee $7
global.get $assembly/index/off
local.tee $8
i32.add
global.set $assembly/index/off
local.get $6
local.get $8
local.get $7
call $assembly/options/onFunctionName
@ -813,7 +803,7 @@
i32.const 1
i32.add
local.set $3
br $repeat|13
br $loop|13
end
end
br $break|12
@ -822,7 +812,7 @@
local.set $6
i32.const 0
local.set $2
loop $repeat|14
loop $loop|14
local.get $2
local.get $6
i32.lt_u
@ -833,7 +823,7 @@
local.set $8
i32.const 0
local.set $3
loop $repeat|15
loop $loop|15
local.get $3
local.get $8
i32.lt_u
@ -855,22 +845,20 @@
i32.const 1
i32.add
local.set $3
br $repeat|15
br $loop|15
end
end
local.get $2
i32.const 1
i32.add
local.set $2
br $repeat|14
br $loop|14
end
end
br $break|12
end
unreachable
end
local.get $4
local.get $5
i32.add
global.set $assembly/index/off
br $break|1

View File

@ -38,11 +38,11 @@ import {
getBlockChildCount,
getBlockChild,
getBlockName,
needsExplicitUnreachable,
getLocalGetIndex,
FeatureFlags,
isLocalTee,
getLocalSetIndex
getLocalSetIndex,
FeatureFlags,
needsExplicitUnreachable
} from "./module";
import {
@ -1144,7 +1144,7 @@ export class Compiler extends DiagnosticEmitter {
);
if (!stmts) stmts = [ expr ];
else stmts.push(expr);
if (!flow.isAny(FlowFlags.ANY_TERMINATING)) { // TODO: detect if returning an autorelease local?
if (!flow.is(FlowFlags.TERMINATES)) { // TODO: detect if returning an autorelease local?
let indexBefore = stmts.length;
this.performAutoreleases(flow, stmts);
this.finishAutoreleases(flow, stmts);
@ -1159,7 +1159,7 @@ export class Compiler extends DiagnosticEmitter {
}
if (!canOverflow) flow.set(FlowFlags.RETURNS_WRAPPED);
if (nonNull) flow.set(FlowFlags.RETURNS_NONNULL);
flow.set(FlowFlags.RETURNS); // now is terminating
flow.set(FlowFlags.RETURNS | FlowFlags.TERMINATES);
}
}
@ -1169,7 +1169,7 @@ export class Compiler extends DiagnosticEmitter {
assert(instance.is(CommonFlags.INSTANCE));
let classInstance = assert(instance.parent); assert(classInstance.kind == ElementKind.CLASS);
if (!flow.isAny(FlowFlags.ANY_TERMINATING)) {
if (!flow.is(FlowFlags.TERMINATES)) {
let thisLocal = assert(flow.lookupLocal(CommonSymbols.this_));
// if `this` wasn't accessed before, allocate if necessary and initialize `this`
@ -1196,7 +1196,7 @@ export class Compiler extends DiagnosticEmitter {
this.performAutoreleases(flow, stmts); // `this` is excluded anyway
this.finishAutoreleases(flow, stmts);
stmts.push(module.local_get(thisLocal.index, this.options.nativeSizeType));
flow.set(FlowFlags.RETURNS | FlowFlags.RETURNS_NONNULL);
flow.set(FlowFlags.RETURNS | FlowFlags.RETURNS_NONNULL | FlowFlags.TERMINATES);
}
// check that super has been called if this is a derived class
@ -1207,8 +1207,8 @@ export class Compiler extends DiagnosticEmitter {
);
}
// if this is a normal function, make sure that all branches return
} else if (returnType != Type.void && !flow.is(FlowFlags.RETURNS)) {
// if this is a normal function, make sure that all branches terminate
} else if (returnType != Type.void && !flow.is(FlowFlags.TERMINATES)) {
this.error(
DiagnosticCode.A_function_whose_declared_type_is_not_void_must_return_a_value,
instance.prototype.signatureNode.returnType.range
@ -1283,7 +1283,7 @@ export class Compiler extends DiagnosticEmitter {
}
this.compileFunctionBody(instance, stmts);
if (!flow.isAny(FlowFlags.ANY_TERMINATING)) {
if (!flow.is(FlowFlags.TERMINATES)) {
this.performAutoreleases(flow, stmts);
this.finishAutoreleases(flow, stmts);
}
@ -1780,6 +1780,7 @@ export class Compiler extends DiagnosticEmitter {
stmts = new Array<ExpressionRef>(numStatements);
stmts.length = 0;
}
var module = this.module;
var flow = this.currentFlow;
for (let i = 0; i < numStatements; ++i) {
let stmt = this.compileStatement(statements[i],
@ -1798,8 +1799,8 @@ export class Compiler extends DiagnosticEmitter {
default: stmts.push(stmt);
case ExpressionId.Nop:
}
if (flow.isAny(FlowFlags.ANY_TERMINATING)) {
if (needsExplicitUnreachable(stmt)) stmts.push(this.module.unreachable());
if (flow.isAny(FlowFlags.TERMINATES | FlowFlags.BREAKS)) {
if (needsExplicitUnreachable(stmt)) stmts.push(module.unreachable());
break;
}
}
@ -1816,7 +1817,7 @@ export class Compiler extends DiagnosticEmitter {
this.currentFlow = innerFlow;
var stmts = this.compileStatements(statements);
if (!innerFlow.isAny(FlowFlags.ANY_TERMINATING)) this.performAutoreleases(innerFlow, stmts);
if (!innerFlow.isAny(FlowFlags.TERMINATES | FlowFlags.BREAKS)) this.performAutoreleases(innerFlow, stmts);
innerFlow.freeScopedLocals();
outerFlow.inherit(innerFlow); // TODO: only if not terminated?
this.currentFlow = outerFlow;
@ -1846,10 +1847,10 @@ export class Compiler extends DiagnosticEmitter {
}
var stmts = new Array<ExpressionRef>();
this.performAutoreleases(flow, stmts);
var current: Flow | null = flow.parent;
while (current && current.breakLabel === breakLabel) {
this.performAutoreleases(current, stmts, /* clearFlags */ false);
current = current.parent;
var parent = flow.parent;
while (parent !== null && parent.breakLabel == breakLabel) {
this.performAutoreleases(parent, stmts, /* clearFlags */ false);
parent = parent.parent;
}
flow.freeScopedLocals();
stmts.push(module.br(breakLabel));
@ -1880,7 +1881,7 @@ export class Compiler extends DiagnosticEmitter {
);
return module.unreachable();
}
flow.set(FlowFlags.CONTINUES);
flow.set(FlowFlags.CONTINUES | FlowFlags.TERMINATES);
var stmts = new Array<ExpressionRef>();
this.performAutoreleases(flow, stmts);
var current: Flow | null = flow.parent;
@ -1916,18 +1917,44 @@ export class Compiler extends DiagnosticEmitter {
this.compileStatement(statement.statement)
);
}
var condExpr = this.makeIsTrueish(
this.compileExpression(statement.condition, Type.i32),
this.currentType
var condExpr = module.precomputeExpression(
this.makeIsTrueish(
this.compileExpression(statement.condition, Type.i32),
this.currentType
)
);
// TODO: check if condition is always false and if so, omit it (just a block)
var alwaysFalse = false;
if (getExpressionId(condExpr) == ExpressionId.Const) {
assert(getExpressionType(condExpr) == NativeType.I32);
if (!getConstValueI32(condExpr)) alwaysFalse = true;
}
var terminates = innerFlow.is(FlowFlags.TERMINATES);
var continues = innerFlow.isAny(FlowFlags.CONTINUES | FlowFlags.CONDITIONALLY_CONTINUES);
var breaks = innerFlow.isAny(FlowFlags.BREAKS | FlowFlags.CONDITIONALLY_BREAKS);
// (block $break ;; (1) skip if no breaks
// (loop $continue ;; (2) skip if skipping (4) + no continues
// (...) ;; (3)
// (br_if cond $continue) ;; (4) skip if (3) does not fall through or always false
// )
// )
var fallsThrough = !terminates && !innerFlow.is(FlowFlags.BREAKS);
if (fallsThrough && !alwaysFalse) { // (4)
stmts.push(module.br(continueLabel, condExpr));
}
var expr = flatten(module, stmts, NativeType.None);
if (fallsThrough && !alwaysFalse || continues) { // (2)
expr = module.loop(continueLabel, expr);
}
if (breaks) { // (1)
expr = module.block(breakLabel, [ expr ]);
}
// Switch back to the parent flow
var terminated = innerFlow.isAny(FlowFlags.ANY_TERMINATING);
if (!terminated) this.performAutoreleases(innerFlow, stmts);
if (!terminates) this.performAutoreleases(innerFlow, stmts);
innerFlow.freeScopedLocals();
outerFlow.popBreakLabel();
this.currentFlow = outerFlow;
innerFlow.unset(
FlowFlags.BREAKS |
FlowFlags.CONDITIONALLY_BREAKS |
@ -1935,19 +1962,8 @@ export class Compiler extends DiagnosticEmitter {
FlowFlags.CONDITIONALLY_CONTINUES
);
outerFlow.inherit(innerFlow);
var block: ExpressionRef[] = [
module.loop(continueLabel,
terminated
? flatten(module, stmts, NativeType.None) // skip trailing continue if unnecessary
: module.block(null, [
flatten(module, stmts, NativeType.None),
module.br(continueLabel, condExpr)
], NativeType.None)
)
];
if (terminated) block.push(module.unreachable());
return module.block(breakLabel, block);
this.currentFlow = outerFlow;
return expr;
}
compileEmptyStatement(
@ -1970,23 +1986,20 @@ export class Compiler extends DiagnosticEmitter {
statement: ForStatement,
contextualFlags: ContextualFlags
): ExpressionRef {
// A for statement initiates a new branch with its own scoped variables
// possibly declared in its initializer, and break context.
var module = this.module;
// Set up and use the inner flow
var outerFlow = this.currentFlow;
var label = outerFlow.pushBreakLabel();
var innerFlow = outerFlow.fork();
this.currentFlow = innerFlow;
var breakLabel = innerFlow.breakLabel = "break|" + label;
innerFlow.breakLabel = breakLabel;
var continueLabel = "continue|" + label;
innerFlow.continueLabel = continueLabel;
var repeatLabel = "repeat|" + label;
// Compile in correct order
var module = this.module;
var initExpr = statement.initializer
? this.compileStatement(<Statement>statement.initializer)
: 0;
// Compile the initializer
var initializer = statement.initializer;
var initExpr: ExpressionRef = 0;
if (initializer) initExpr = this.compileStatement(initializer);
// Compile the condition
var condExpr: ExpressionRef = 0;
var alwaysTrue = false;
if (statement.condition) {
@ -1996,40 +2009,97 @@ export class Compiler extends DiagnosticEmitter {
this.currentType
)
);
// check if the condition is always true
// Simplify if the condition is constant
if (getExpressionId(condExpr) == ExpressionId.Const) {
assert(getExpressionType(condExpr) == NativeType.I32);
if (getConstValueI32(condExpr) != 0) alwaysTrue = true;
// TODO: could skip compilation if the condition is always false here, but beware that the
// initializer could still declare new 'var's that are used later on.
if (getConstValueI32(condExpr) == /* false */ 0) {
let stmts = new Array<ExpressionRef>();
if (initExpr) stmts.push(initExpr);
this.performAutoreleases(innerFlow, stmts);
innerFlow.freeScopedLocals();
outerFlow.popBreakLabel();
this.currentFlow = outerFlow;
return flatten(module, stmts, NativeType.None);
}
alwaysTrue = true;
}
} else {
// omitted condition is always true
} else { // Omitted condition is always true
condExpr = module.i32(1);
alwaysTrue = true;
}
innerFlow.inheritNonnullIfTrue(condExpr);
var incrExpr = statement.incrementor
? this.compileExpression(<Expression>statement.incrementor, Type.void,
ContextualFlags.IMPLICIT | ContextualFlags.WILL_DROP
)
: 0;
// Compile incrementor
var incrementor = statement.incrementor;
var incrExpr: ExpressionRef = 0;
if (incrementor) incrExpr = this.compileExpression(incrementor, Type.void, ContextualFlags.IMPLICIT | ContextualFlags.WILL_DROP);
// Compile body (break: drop out, continue: fall through to incrementor, + loop)
var breakLabel = innerFlow.breakLabel = "break|" + label; innerFlow.breakLabel = breakLabel;
innerFlow.breakLabel = breakLabel;
var continueLabel = "continue|" + label;
innerFlow.continueLabel = continueLabel;
var loopLabel = "loop|" + label;
var bodyStatement = statement.statement;
var stmts = new Array<ExpressionRef>();
if (bodyStatement.kind == NodeKind.BLOCK) {
this.compileStatements((<BlockStatement>bodyStatement).statements, false, stmts);
} else {
stmts.push(
this.compileStatement(bodyStatement)
);
stmts.push(this.compileStatement(bodyStatement));
}
var terminates = innerFlow.is(FlowFlags.TERMINATES);
var continues = innerFlow.isAny(FlowFlags.CONTINUES | FlowFlags.CONDITIONALLY_CONTINUES);
var breaks = innerFlow.isAny(FlowFlags.BREAKS | FlowFlags.CONDITIONALLY_BREAKS);
// (block $break ;; (1) skip label (needed anyway) if skipping (4) + no breaks
// (initializer) ;; (2) [may be empty]
// (loop $loop ;; (3) skip if (6) does not fall through + no continues
// (br_if !cond $break) ;; (4) skip if always true
// (block $continue ;; (5) skip if no continues or nothing else than continue
// (...) ;; (6)
// )
// (incrementor) ;; (7) skip if skipping (3) [may be empty]
// (br $loop) ;; (8) skip if skipping (3)
// )
// )
var fallsThrough = !terminates && !innerFlow.is(FlowFlags.BREAKS);
var needsLabel = !alwaysTrue || breaks;
var loop = new Array<ExpressionRef>();
if (!alwaysTrue) { // (4)
loop.push(module.br(breakLabel, module.unary(UnaryOp.EqzI32, condExpr)));
}
if (continues) { // (5)
if (stmts.length > 1 || getExpressionId(stmts[0]) != ExpressionId.Break) { // otherwise lonely continue
loop.push(module.block(continueLabel, stmts));
}
} else {
for (let i = 0, k = stmts.length; i < k; ++i) loop.push(stmts[i]);
}
var expr: ExpressionRef;
if (fallsThrough || continues) { // (3)
if (incrExpr) loop.push(incrExpr); // (7)
this.performAutoreleases(innerFlow, loop);
loop.push(module.br(loopLabel)); // (8)
if (initExpr) { // (2)
expr = module.block(needsLabel ? breakLabel : null, [
initExpr,
module.loop(loopLabel, module.block(null, loop))
]);
} else {
expr = module.block(needsLabel ? breakLabel : null, [
module.loop(loopLabel, flatten(module, loop, NativeType.None))
]);
}
} else {
if (initExpr) loop.unshift(initExpr); // (2)
this.performAutoreleases(innerFlow, loop);
expr = module.block(needsLabel ? breakLabel : null, loop);
}
if (!innerFlow.isAny(FlowFlags.ANY_TERMINATING)) this.performAutoreleases(innerFlow, stmts);
// Switch back to the parent flow
innerFlow.freeScopedLocals();
outerFlow.popBreakLabel();
this.currentFlow = outerFlow;
var usesContinue = innerFlow.isAny(FlowFlags.CONTINUES | FlowFlags.CONDITIONALLY_CONTINUES);
innerFlow.unset(
FlowFlags.BREAKS |
FlowFlags.CONDITIONALLY_BREAKS |
@ -2038,36 +2108,8 @@ export class Compiler extends DiagnosticEmitter {
);
if (alwaysTrue) outerFlow.inherit(innerFlow);
else outerFlow.inheritConditional(innerFlow);
var breakBlock = new Array<ExpressionRef>(); // outer 'break' block
if (initExpr) breakBlock.push(initExpr);
var repeatBlock = new Array<ExpressionRef>(); // block repeating the loop
if (usesContinue) {
stmts.unshift(
module.br(breakLabel, module.unary(UnaryOp.EqzI32, condExpr))
);
repeatBlock.push(
module.block(continueLabel, stmts, NativeType.None)
);
} else { // can omit the 'continue' block
repeatBlock.push(
module.br(breakLabel, module.unary(UnaryOp.EqzI32, condExpr))
);
for (let i = 0, k = stmts.length; i < k; ++i) {
repeatBlock.push(stmts[i]);
}
}
if (incrExpr) repeatBlock.push(incrExpr);
repeatBlock.push(
module.br(repeatLabel)
);
breakBlock.push(
module.loop(repeatLabel, module.block(null, repeatBlock, NativeType.None))
);
return module.block(breakLabel, breakBlock);
this.currentFlow = outerFlow;
return expr;
}
compileIfStatement(
@ -2109,7 +2151,7 @@ export class Compiler extends DiagnosticEmitter {
} else {
ifTrueStmts.push(this.compileStatement(ifTrue));
}
if (!ifTrueFlow.isAny(FlowFlags.ANY_TERMINATING)) this.performAutoreleases(ifTrueFlow, ifTrueStmts);
if (!ifTrueFlow.isAny(FlowFlags.TERMINATES | FlowFlags.BREAKS)) this.performAutoreleases(ifTrueFlow, ifTrueStmts);
ifTrueFlow.freeScopedLocals();
this.currentFlow = outerFlow;
@ -2123,7 +2165,7 @@ export class Compiler extends DiagnosticEmitter {
} else {
ifFalseStmts.push(this.compileStatement(ifFalse));
}
if (!ifFalseFlow.isAny(FlowFlags.ANY_TERMINATING)) this.performAutoreleases(ifFalseFlow, ifFalseStmts);
if (!ifFalseFlow.isAny(FlowFlags.TERMINATES | FlowFlags.BREAKS)) this.performAutoreleases(ifFalseFlow, ifFalseStmts);
ifFalseFlow.freeScopedLocals();
this.currentFlow = outerFlow;
outerFlow.inheritMutual(ifTrueFlow, ifFalseFlow);
@ -2133,9 +2175,7 @@ export class Compiler extends DiagnosticEmitter {
);
} else {
outerFlow.inheritConditional(ifTrueFlow);
if (ifTrueFlow.isAny(FlowFlags.ANY_TERMINATING)) {
outerFlow.inheritNonnullIfFalse(condExpr);
}
if (ifTrueFlow.is(FlowFlags.TERMINATES)) outerFlow.inheritNonnullIfFalse(condExpr);
return module.if(condExpr,
flatten(module, ifTrueStmts, NativeType.None)
);
@ -2157,7 +2197,7 @@ export class Compiler extends DiagnosticEmitter {
var returnType = flow.returnType;
// Remember that this flow returns
flow.set(FlowFlags.RETURNS);
flow.set(FlowFlags.RETURNS | FlowFlags.TERMINATES);
var valueExpression = statement.value;
if (valueExpression) {
@ -2294,10 +2334,8 @@ export class Compiler extends DiagnosticEmitter {
// nest blocks in order
var currentBlock = module.block("case0|" + context, breaks, NativeType.None);
var alwaysReturns = true;
var alwaysReturnsWrapped = true;
var alwaysThrows = true;
var alwaysAllocates = true;
var commonCategorical = FlowFlags.ANY_CATEGORICAL;
var commonConditional = 0;
for (let i = 0; i < numCases; ++i) {
let case_ = cases[i];
let statements = case_.statements;
@ -2314,27 +2352,25 @@ export class Compiler extends DiagnosticEmitter {
let stmts = new Array<ExpressionRef>(1 + numStatements);
stmts[0] = currentBlock;
let count = 1;
let terminated = false;
let terminates = false;
for (let j = 0; j < numStatements; ++j) {
let stmt = this.compileStatement(statements[j]);
if (getExpressionId(stmt) != ExpressionId.Nop) {
stmts[count++] = stmt;
if (innerFlow.isAny(FlowFlags.ANY_TERMINATING)) {
terminated = true;
break;
}
}
if (innerFlow.isAny(FlowFlags.TERMINATES | FlowFlags.BREAKS)) {
if (innerFlow.is(FlowFlags.TERMINATES)) terminates = true;
break;
}
}
stmts.length = count;
if (terminated || isLast) {
if (!innerFlow.is(FlowFlags.RETURNS)) alwaysReturns = false;
if (!innerFlow.is(FlowFlags.RETURNS_WRAPPED)) alwaysReturnsWrapped = false;
if (!innerFlow.is(FlowFlags.THROWS)) alwaysThrows = false;
if (!innerFlow.is(FlowFlags.ALLOCATES)) alwaysAllocates = false;
if (terminates || isLast || innerFlow.isAny(FlowFlags.BREAKS | FlowFlags.CONDITIONALLY_BREAKS)) {
commonCategorical &= innerFlow.flags;
}
commonConditional |= innerFlow.flags & FlowFlags.ANY_CONDITIONAL;
// Switch back to the parent flow
if (!innerFlow.isAny(FlowFlags.ANY_TERMINATING)) this.performAutoreleases(innerFlow, stmts);
if (!terminates) this.performAutoreleases(innerFlow, stmts);
innerFlow.unset(
FlowFlags.BREAKS |
FlowFlags.CONDITIONALLY_BREAKS
@ -2346,12 +2382,9 @@ export class Compiler extends DiagnosticEmitter {
outerFlow.popBreakLabel();
// If the switch has a default (guaranteed to handle any value), propagate common flags
if (defaultIndex >= 0) {
if (alwaysReturns) outerFlow.set(FlowFlags.RETURNS);
if (alwaysReturnsWrapped) outerFlow.set(FlowFlags.RETURNS_WRAPPED);
if (alwaysThrows) outerFlow.set(FlowFlags.THROWS);
if (alwaysAllocates) outerFlow.set(FlowFlags.ALLOCATES);
}
if (defaultIndex >= 0) outerFlow.flags |= commonCategorical & ~FlowFlags.BREAKS;
outerFlow.flags |= commonConditional & ~FlowFlags.CONDITIONALLY_BREAKS;
// TODO: what about local states?
return currentBlock;
}
@ -2362,10 +2395,7 @@ export class Compiler extends DiagnosticEmitter {
var flow = this.currentFlow;
// Remember that this branch throws
flow.set(FlowFlags.THROWS);
// FIXME: without try-catch it is safe to assume RETURNS as well for now
flow.set(FlowFlags.RETURNS);
flow.set(FlowFlags.THROWS | FlowFlags.TERMINATES);
var stmts = new Array<ExpressionRef>();
this.finishAutoreleases(flow, stmts);
@ -2597,7 +2627,7 @@ export class Compiler extends DiagnosticEmitter {
var module = this.module;
var outerFlow = this.currentFlow;
// The condition does not yet initialize a branch
// Compile condition
var condExpr = module.precomputeExpression(
this.makeIsTrueish(
this.compileExpressionRetainType(statement.condition, Type.bool),
@ -2605,15 +2635,15 @@ export class Compiler extends DiagnosticEmitter {
)
);
// Try to eliminate unnecesssary loops if the condition is constant
if (
getExpressionId(condExpr) == ExpressionId.Const &&
getExpressionType(condExpr) == NativeType.I32
) {
if (!getConstValueI32(condExpr)) return module.nop();
// Simplify if the condition is constant
var alwaysTrue = false;
if (getExpressionId(condExpr) == ExpressionId.Const) {
assert(getExpressionType(condExpr) == NativeType.I32);
if (!getConstValueI32(condExpr)) return module.nop(); // simplify
alwaysTrue = true;
}
// Statements initiate a new branch with its own break context
// Compile body
var label = outerFlow.pushBreakLabel();
var innerFlow = outerFlow.fork();
this.currentFlow = innerFlow;
@ -2621,7 +2651,6 @@ export class Compiler extends DiagnosticEmitter {
innerFlow.breakLabel = breakLabel;
var continueLabel = "continue|" + label;
innerFlow.continueLabel = continueLabel;
innerFlow.inheritNonnullIfTrue(condExpr);
var stmts = new Array<ExpressionRef>();
if (statement.statement.kind == NodeKind.BLOCK) {
@ -2629,17 +2658,35 @@ export class Compiler extends DiagnosticEmitter {
} else {
stmts.push(this.compileStatement(statement.statement));
}
var alwaysTrue = false; // TODO
var terminated = innerFlow.isAny(FlowFlags.ANY_TERMINATING);
if (!terminated) {
var terminates = innerFlow.is(FlowFlags.TERMINATES);
// (block $break ;; (1) skip if skipping (3) + no breaks
// (loop $continue ;; (2) skip if skipping (5) + no continues
// (br_if !cond $break) ;; (3) skip if always true
// (...) ;; (4)
// (br $continue) ;; (5) skip if (4) does not fall through
// )
// )
var fallsThrough = !terminates && !innerFlow.is(FlowFlags.BREAKS);
if (fallsThrough) { // (5)
this.performAutoreleases(innerFlow, stmts);
stmts.push(module.br(continueLabel));
}
innerFlow.freeScopedLocals();
if (!alwaysTrue) { // (3)
stmts.unshift(module.br(breakLabel, module.unary(UnaryOp.EqzI32, condExpr)));
}
var expr = flatten(module, stmts, NativeType.None);
if (fallsThrough || innerFlow.isAny(FlowFlags.CONTINUES | FlowFlags.CONDITIONALLY_CONTINUES)) { // (2)
expr = module.loop(continueLabel, expr);
}
if (!alwaysTrue || innerFlow.isAny(FlowFlags.BREAKS | FlowFlags.CONDITIONALLY_BREAKS)) { // (1)
expr = module.block(breakLabel, [ expr ]);
}
// Switch back to the parent flow
innerFlow.freeScopedLocals();
outerFlow.popBreakLabel();
this.currentFlow = outerFlow;
innerFlow.unset(
FlowFlags.BREAKS |
FlowFlags.CONDITIONALLY_BREAKS |
@ -2648,14 +2695,8 @@ export class Compiler extends DiagnosticEmitter {
);
if (alwaysTrue) outerFlow.inherit(innerFlow);
else outerFlow.inheritConditional(innerFlow);
return module.block(breakLabel, [
module.loop(continueLabel,
module.if(condExpr,
flatten(module, stmts, NativeType.None)
)
)
]);
this.currentFlow = outerFlow;
return expr;
}
// === Expressions ==============================================================================
@ -6282,7 +6323,7 @@ export class Compiler extends DiagnosticEmitter {
this.compileFunctionBody(instance, body);
// Free any new scoped locals and reset to the original flow
if (!flow.isAny(FlowFlags.ANY_TERMINATING)) {
if (!flow.is(FlowFlags.TERMINATES)) {
this.performAutoreleases(flow, body);
this.finishAutoreleases(flow, body);
}
@ -9028,7 +9069,16 @@ var mangleImportName_elementName: string;
export function flatten(module: Module, stmts: ExpressionRef[], type: NativeType): ExpressionRef {
var length = stmts.length;
if (length == 0) return module.nop(); // usually filtered out again
if (length == 1) return stmts[0];
if (length == 1) {
let single = stmts[0];
if (getExpressionType(single) == type) return single;
if (getExpressionId(single) == ExpressionId.Block) {
let count = getBlockChildCount(single);
let children = new Array<ExpressionRef>(count);
for (let i = 0; i < count; ++i) children[i] = getBlockChild(single, i);
return module.block(getBlockName(single), children, type);
}
}
return module.block(null, stmts,
type == NativeType.Auto
? getExpressionType(stmts[length - 1])

View File

@ -91,35 +91,33 @@ export const enum FlowFlags {
ALLOCATES = 1 << 6,
/** This flow calls super. Constructors only. */
CALLS_SUPER = 1 << 7,
/** This flow terminates (returns, throws or continues). */
TERMINATES = 1 << 8,
// conditional
/** This flow conditionally returns in a child flow. */
CONDITIONALLY_RETURNS = 1 << 8,
CONDITIONALLY_RETURNS = 1 << 9,
/** This flow conditionally throws in a child flow. */
CONDITIONALLY_THROWS = 1 << 9,
CONDITIONALLY_THROWS = 1 << 10,
/** This flow conditionally terminates in a child flow. */
CONDITIONALLY_TERMINATES = 1 << 11,
/** This flow conditionally breaks in a child flow. */
CONDITIONALLY_BREAKS = 1 << 10,
CONDITIONALLY_BREAKS = 1 << 12,
/** This flow conditionally continues in a child flow. */
CONDITIONALLY_CONTINUES = 1 << 11,
CONDITIONALLY_CONTINUES = 1 << 13,
/** This flow conditionally allocates in a child flow. Constructors only. */
CONDITIONALLY_ALLOCATES = 1 << 12,
CONDITIONALLY_ALLOCATES = 1 << 14,
// special
/** This is an inlining flow. */
INLINE_CONTEXT = 1 << 13,
INLINE_CONTEXT = 1 << 15,
/** This is a flow with explicitly disabled bounds checking. */
UNCHECKED_CONTEXT = 1 << 14,
UNCHECKED_CONTEXT = 1 << 16,
// masks
/** Any terminating flag. */
ANY_TERMINATING = FlowFlags.RETURNS
| FlowFlags.THROWS
| FlowFlags.BREAKS
| FlowFlags.CONTINUES,
/** Any categorical flag. */
ANY_CATEGORICAL = FlowFlags.RETURNS
| FlowFlags.RETURNS_WRAPPED
@ -128,7 +126,8 @@ export const enum FlowFlags {
| FlowFlags.BREAKS
| FlowFlags.CONTINUES
| FlowFlags.ALLOCATES
| FlowFlags.CALLS_SUPER,
| FlowFlags.CALLS_SUPER
| FlowFlags.TERMINATES,
/** Any conditional flag. */
ANY_CONDITIONAL = FlowFlags.CONDITIONALLY_RETURNS
@ -551,10 +550,14 @@ export class Flow {
// categorical flags set in both arms
this.set(left.flags & right.flags & FlowFlags.ANY_CATEGORICAL);
// conditional flags set in at least one arm
// conditional flags set in any arm
this.set(left.flags & FlowFlags.ANY_CONDITIONAL);
this.set(right.flags & FlowFlags.ANY_CONDITIONAL);
// categorical flags in either arm as conditional
this.inheritConditional(left);
this.inheritConditional(right);
// categorical local flags set in both arms / conditional local flags set in at least one arm
var leftLocalFlags = left.localFlags;
var numLeftLocalFlags = leftLocalFlags.length;

View File

@ -14,7 +14,11 @@ import "./i64";
import { Module } from "../../module";
Module.prototype.toText = function(this: Module) {
return binaryen.wrapModule(this.ref).emitStackIR();
// NOTE: Conversion to StackIR can yield conversion artifacts like sequences
// of unreachable statements not actually emitted by the compiler. Optimizing
// StackIR removes these again, but may also suppress useless code emitted by
// the compiler that's then no longer visible in tests. Both not ideal.
return binaryen.wrapModule(this.ref).emitStackIR(/* optimize-stack-ir */ true);
};
Module.prototype.toAsmjs = function(this: Module) {

View File

@ -1566,7 +1566,7 @@ export class Program extends DiagnosticEmitter {
this.error(
DiagnosticCode.Duplicate_identifier_0,
declaration.name.range, "default"
)
);
return;
}
exports.set("default", element);

View File

@ -0,0 +1,25 @@
var binaryen = require("binaryen");
var mod = new binaryen.Module();
var funcType = mod.addFunctionType("ii", binaryen.i32, [ binaryen.i32 ]);
mod.addFunction("0", funcType, [],
mod.block(null, [
mod.loop("continue",
mod.block(null, [
mod.if(
mod.local.get(0, binaryen.i32),
mod.return(mod.i32.const(1)),
mod.return(mod.i32.const(2))
),
mod.unreachable()
])
),
mod.unreachable()
], binaryen.i32)
);
mod.addExport("0", "0");
if (!mod.validate())
console.log("-> does not validate");
console.log(mod.emitText());
console.log(mod.emitStackIR(/*true*/)); // optimize-stack-ir fixes this

View File

@ -25,171 +25,161 @@
i32.const 0
i32.eqz
global.set $abi/condition
block
i32.const 256
local.set $0
local.get $0
i32.const 24
i32.shl
i32.const 24
i32.shr_s
i32.eqz
i32.eqz
if
i32.const 0
i32.const 24
i32.const 32
i32.const 2
call $~lib/builtins/abort
unreachable
end
end
block
i32.const 256
local.set $0
global.get $abi/condition
if
local.get $0
i32.const 24
i32.shl
i32.const 24
i32.shr_s
i32.const 2
i32.div_s
local.set $0
else
local.get $0
i32.const 24
i32.shl
i32.const 24
i32.shr_s
i32.const 2
i32.div_s
local.set $0
end
local.get $0
i32.const 24
i32.shl
i32.const 24
i32.shr_s
i32.eqz
i32.eqz
if
i32.const 0
i32.const 24
i32.const 45
i32.const 2
call $~lib/builtins/abort
unreachable
end
end
block
i32.const 256
local.set $0
global.get $abi/condition
if
local.get $0
i32.const 24
i32.shl
i32.const 24
i32.shr_s
i32.const 24
i32.shr_s
local.set $0
else
local.get $0
i32.const 127
i32.and
local.set $0
end
local.get $0
i32.eqz
i32.eqz
if
i32.const 0
i32.const 24
i32.const 58
i32.const 2
call $~lib/builtins/abort
unreachable
end
end
block
i32.const 256
i32.const 24
i32.shl
i32.const 24
i32.shr_s
global.set $abi/y
global.get $abi/y
i32.eqz
i32.eqz
if
i32.const 0
i32.const 24
i32.const 65
i32.const 2
call $~lib/builtins/abort
unreachable
end
end
block
i32.const 2
i32.ctz
local.set $0
local.get $0
i32.const 256
local.set $0
local.get $0
i32.const 24
i32.shl
i32.const 24
i32.shr_s
i32.eqz
i32.eqz
if
i32.const 0
i32.ne
i32.eqz
if
i32.const 0
i32.const 24
i32.const 72
i32.const 2
call $~lib/builtins/abort
unreachable
end
i32.const 1
i32.clz
local.set $0
local.get $0
i32.const 0
i32.ne
i32.eqz
if
i32.const 0
i32.const 24
i32.const 74
i32.const 2
call $~lib/builtins/abort
unreachable
end
i32.const 24
i32.const 32
i32.const 2
i32.ctz
local.set $1
local.get $1
i32.eqz
if
i32.const 0
i32.const 24
i32.const 77
i32.const 2
call $~lib/builtins/abort
unreachable
end
i32.const 1
i32.clz
local.set $1
local.get $1
i32.eqz
if
i32.const 0
i32.const 24
i32.const 79
i32.const 2
call $~lib/builtins/abort
unreachable
end
call $~lib/builtins/abort
unreachable
end
i32.const 256
local.set $0
global.get $abi/condition
if
local.get $0
i32.const 24
i32.shl
i32.const 24
i32.shr_s
i32.const 2
i32.div_s
local.set $0
else
local.get $0
i32.const 24
i32.shl
i32.const 24
i32.shr_s
i32.const 2
i32.div_s
local.set $0
end
local.get $0
i32.const 24
i32.shl
i32.const 24
i32.shr_s
i32.eqz
i32.eqz
if
i32.const 0
i32.const 24
i32.const 45
i32.const 2
call $~lib/builtins/abort
unreachable
end
i32.const 256
local.set $0
global.get $abi/condition
if
local.get $0
i32.const 24
i32.shl
i32.const 24
i32.shr_s
i32.const 24
i32.shr_s
local.set $0
else
local.get $0
i32.const 127
i32.and
local.set $0
end
local.get $0
i32.eqz
i32.eqz
if
i32.const 0
i32.const 24
i32.const 58
i32.const 2
call $~lib/builtins/abort
unreachable
end
i32.const 256
i32.const 24
i32.shl
i32.const 24
i32.shr_s
global.set $abi/y
global.get $abi/y
i32.eqz
i32.eqz
if
i32.const 0
i32.const 24
i32.const 65
i32.const 2
call $~lib/builtins/abort
unreachable
end
i32.const 2
i32.ctz
local.set $0
local.get $0
i32.const 0
i32.ne
i32.eqz
if
i32.const 0
i32.const 24
i32.const 72
i32.const 2
call $~lib/builtins/abort
unreachable
end
i32.const 1
i32.clz
local.set $0
local.get $0
i32.const 0
i32.ne
i32.eqz
if
i32.const 0
i32.const 24
i32.const 74
i32.const 2
call $~lib/builtins/abort
unreachable
end
i32.const 2
i32.ctz
local.set $1
local.get $1
i32.eqz
if
i32.const 0
i32.const 24
i32.const 77
i32.const 2
call $~lib/builtins/abort
unreachable
end
i32.const 1
i32.clz
local.set $1
local.get $1
i32.eqz
if
i32.const 0
i32.const 24
i32.const 79
i32.const 2
call $~lib/builtins/abort
unreachable
end
)
(func $abi/exported (; 3 ;) (type $FUNCSIG$i) (result i32)

View File

@ -157,13 +157,11 @@
local.get $0
call_indirect (type $FUNCSIG$i)
local.tee $0
local.set $1
local.get $0
i32.eqz
if
unreachable
end
local.get $1
)
(func $assert-nonnull/testObjFn (; 13 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
i32.const 0
@ -180,13 +178,11 @@
i32.load offset=4
call_indirect (type $FUNCSIG$i)
local.tee $0
local.set $1
local.get $0
i32.eqz
if
unreachable
end
local.get $1
)
(func $null (; 15 ;) (type $FUNCSIG$v)
nop

View File

@ -260,13 +260,11 @@
(func $assert-nonnull/testFn (; 14 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
block (result i32)
i32.const 0
global.set $~lib/argc
local.get $0
call_indirect (type $FUNCSIG$i)
local.tee $1
end
i32.const 0
global.set $~lib/argc
local.get $0
call_indirect (type $FUNCSIG$i)
local.tee $1
call $~lib/rt/stub/__retain
local.set $2
local.get $1
@ -285,13 +283,11 @@
unreachable
end
local.set $2
block (result i32)
i32.const 0
global.set $~lib/argc
local.get $2
call_indirect (type $FUNCSIG$i)
local.tee $1
end
i32.const 0
global.set $~lib/argc
local.get $2
call_indirect (type $FUNCSIG$i)
local.tee $1
call $~lib/rt/stub/__retain
local.set $3
local.get $1
@ -301,13 +297,11 @@
(func $assert-nonnull/testRet (; 16 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
block (result i32)
i32.const 0
global.set $~lib/argc
local.get $0
call_indirect (type $FUNCSIG$i)
local.tee $1
end
i32.const 0
global.set $~lib/argc
local.get $0
call_indirect (type $FUNCSIG$i)
local.tee $1
local.tee $2
if (result i32)
local.get $2
@ -326,14 +320,12 @@
local.get $0
call $~lib/rt/stub/__retain
drop
block (result i32)
i32.const 0
global.set $~lib/argc
local.get $0
i32.load offset=4
call_indirect (type $FUNCSIG$i)
local.tee $1
end
i32.const 0
global.set $~lib/argc
local.get $0
i32.load offset=4
call_indirect (type $FUNCSIG$i)
local.tee $1
call $~lib/rt/stub/__retain
local.set $2
local.get $1
@ -348,14 +340,12 @@
local.get $0
call $~lib/rt/stub/__retain
drop
block (result i32)
i32.const 0
global.set $~lib/argc
local.get $0
i32.load offset=4
call_indirect (type $FUNCSIG$i)
local.tee $1
end
i32.const 0
global.set $~lib/argc
local.get $0
i32.load offset=4
call_indirect (type $FUNCSIG$i)
local.tee $1
local.tee $2
if (result i32)
local.get $2

View File

@ -337,7 +337,6 @@
unreachable
end
unreachable
unreachable
end
local.get $8
i32.const 1072693248
@ -1344,36 +1343,37 @@
local.get $4
local.get $5
i32.gt_s
i32.eqz
br_if $break|0
local.get $2
local.get $3
i32.ge_u
if
local.get $2
local.get $3
i32.ge_u
i32.eq
if
local.get $2
local.get $3
i32.eq
if
f32.const 0
local.get $0
f32.mul
return
end
local.get $2
local.get $3
i32.sub
local.set $2
f32.const 0
local.get $0
f32.mul
return
end
local.get $2
i32.const 1
i32.shl
local.set $2
local.get $4
i32.const 1
local.get $3
i32.sub
local.set $4
br $continue|0
local.set $2
end
local.get $2
i32.const 1
i32.shl
local.set $2
local.get $4
i32.const 1
i32.sub
local.set $4
br $continue|0
end
unreachable
end
local.get $2
local.get $3
@ -1688,7 +1688,6 @@
unreachable
end
unreachable
unreachable
end
local.get $5
i32.const 1065353216
@ -2620,36 +2619,37 @@
local.get $4
local.get $5
i64.gt_s
i32.eqz
br_if $break|0
local.get $2
local.get $3
i64.ge_u
if
local.get $2
local.get $3
i64.ge_u
i64.eq
if
local.get $2
local.get $3
i64.eq
if
f64.const 0
local.get $0
f64.mul
return
end
local.get $2
local.get $3
i64.sub
local.set $2
f64.const 0
local.get $0
f64.mul
return
end
local.get $2
i64.const 1
i64.shl
local.set $2
local.get $4
i64.const 1
local.get $3
i64.sub
local.set $4
br $continue|0
local.set $2
end
local.get $2
i64.const 1
i64.shl
local.set $2
local.get $4
i64.const 1
i64.sub
local.set $4
br $continue|0
end
unreachable
end
local.get $2
local.get $3

View File

@ -42,14 +42,12 @@
call $call-optional/opt
)
(func $start:call-optional (; 3 ;) (type $FUNCSIG$v)
block (result i32)
i32.const 1
global.set $~lib/argc
i32.const 3
i32.const 0
i32.const 0
call $call-optional/opt|trampoline
end
i32.const 1
global.set $~lib/argc
i32.const 3
i32.const 0
i32.const 0
call $call-optional/opt|trampoline
i32.const 0
i32.eq
i32.eqz
@ -61,14 +59,12 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
i32.const 2
global.set $~lib/argc
i32.const 3
i32.const 4
i32.const 0
call $call-optional/opt|trampoline
end
i32.const 2
global.set $~lib/argc
i32.const 3
i32.const 4
i32.const 0
call $call-optional/opt|trampoline
i32.const 5
i32.eq
i32.eqz
@ -95,15 +91,13 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
i32.const 1
global.set $~lib/argc
i32.const 3
i32.const 0
i32.const 0
global.get $call-optional/optIndirect
call_indirect (type $FUNCSIG$iiii)
end
i32.const 1
global.set $~lib/argc
i32.const 3
i32.const 0
i32.const 0
global.get $call-optional/optIndirect
call_indirect (type $FUNCSIG$iiii)
i32.const 0
i32.eq
i32.eqz
@ -115,15 +109,13 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
i32.const 2
global.set $~lib/argc
i32.const 3
i32.const 4
i32.const 0
global.get $call-optional/optIndirect
call_indirect (type $FUNCSIG$iiii)
end
i32.const 2
global.set $~lib/argc
i32.const 3
i32.const 4
i32.const 0
global.get $call-optional/optIndirect
call_indirect (type $FUNCSIG$iiii)
i32.const 5
i32.eq
i32.eqz
@ -135,15 +127,13 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
i32.const 3
global.set $~lib/argc
i32.const 3
i32.const 4
i32.const 5
global.get $call-optional/optIndirect
call_indirect (type $FUNCSIG$iiii)
end
i32.const 3
global.set $~lib/argc
i32.const 3
i32.const 4
i32.const 5
global.get $call-optional/optIndirect
call_indirect (type $FUNCSIG$iiii)
i32.const 12
i32.eq
i32.eqz

View File

@ -330,9 +330,7 @@
)
(func $call-super/test4 (; 10 ;) (type $FUNCSIG$v)
(local $0 i32)
block (result i32)
call $call-super/H#constructor
end
call $call-super/H#constructor
local.tee $0
i32.load
i32.const 1
@ -381,9 +379,7 @@
)
(func $call-super/test5 (; 12 ;) (type $FUNCSIG$v)
(local $0 i32)
block (result i32)
call $call-super/J#constructor
end
call $call-super/J#constructor
local.tee $0
i32.load
i32.const 1

View File

@ -110,21 +110,19 @@
local.get $0
)
(func $call-super/A#constructor (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
block (result i32)
local.get $0
i32.eqz
if
i32.const 4
i32.const 3
call $~lib/rt/stub/__alloc
call $~lib/rt/stub/__retain
local.set $0
end
local.get $0
i32.const 1
i32.store
local.get $0
local.get $0
i32.eqz
if
i32.const 4
i32.const 3
call $~lib/rt/stub/__alloc
call $~lib/rt/stub/__retain
local.set $0
end
local.get $0
i32.const 1
i32.store
local.get $0
i32.load
i32.const 1
i32.eq
@ -312,21 +310,19 @@
call $~lib/rt/stub/__release
)
(func $call-super/E#constructor (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
block (result i32)
local.get $0
i32.eqz
if
i32.const 4
i32.const 7
call $~lib/rt/stub/__alloc
call $~lib/rt/stub/__retain
local.set $0
end
local.get $0
i32.const 1
i32.store
local.get $0
local.get $0
i32.eqz
if
i32.const 4
i32.const 7
call $~lib/rt/stub/__alloc
call $~lib/rt/stub/__retain
local.set $0
end
local.get $0
i32.const 1
i32.store
local.get $0
i32.load
i32.const 1
i32.eq

View File

@ -129,7 +129,7 @@
end
i32.const 0
local.set $0
loop $repeat|0
loop $loop|0
block $break|0
local.get $0
global.get $comma/a
@ -143,7 +143,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|0
br $loop|0
end
end
local.get $0

View File

@ -13,19 +13,15 @@
(func $start:comma (; 1 ;) (type $FUNCSIG$v)
(local $0 i32)
(local $1 i32)
block
block (result i32)
global.get $comma/a
local.tee $0
i32.const 1
i32.add
global.set $comma/a
local.get $0
end
global.set $comma/b
global.get $comma/a
drop
end
global.get $comma/a
local.tee $0
i32.const 1
i32.add
global.set $comma/a
local.get $0
global.set $comma/b
global.get $comma/a
drop
global.get $comma/a
i32.const 1
i32.eq
@ -50,14 +46,12 @@
call $~lib/builtins/abort
unreachable
end
block
global.get $comma/a
i32.const 1
i32.add
global.set $comma/a
global.get $comma/a
global.set $comma/b
end
global.get $comma/a
i32.const 1
i32.add
global.set $comma/a
global.get $comma/a
global.set $comma/b
global.get $comma/a
i32.const 2
i32.eq
@ -82,19 +76,15 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
i32.const 0
global.set $comma/b
global.get $comma/b
end
i32.const 0
global.set $comma/b
global.get $comma/b
global.set $comma/a
block (result i32)
global.get $comma/a
i32.const 1
i32.add
global.set $comma/a
global.get $comma/a
end
global.get $comma/a
i32.const 1
i32.add
global.set $comma/a
global.get $comma/a
global.set $comma/b
global.get $comma/a
i32.const 1
@ -120,17 +110,13 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $comma/a
i32.const 1
i32.add
global.set $comma/a
block (result i32)
global.get $comma/a
global.set $comma/b
global.get $comma/b
end
end
global.get $comma/a
i32.const 1
i32.add
global.set $comma/a
global.get $comma/a
global.set $comma/b
global.get $comma/b
global.set $comma/a
global.get $comma/a
i32.const 2
@ -159,25 +145,22 @@
block $break|0
i32.const 0
local.set $1
loop $repeat|0
loop $loop|0
local.get $1
global.get $comma/a
i32.lt_s
i32.eqz
br_if $break|0
nop
block
global.get $comma/a
i32.const 1
i32.sub
global.set $comma/a
local.get $1
i32.const 1
i32.add
local.set $1
end
br $repeat|0
unreachable
global.get $comma/a
i32.const 1
i32.sub
global.set $comma/a
local.get $1
i32.const 1
i32.add
local.set $1
br $loop|0
end
unreachable
end
@ -193,14 +176,12 @@
call $~lib/builtins/abort
unreachable
end
block
i32.const 1
drop
i32.const 2
drop
i32.const 3
drop
end
i32.const 1
drop
i32.const 2
drop
i32.const 3
drop
)
(func $start (; 2 ;) (type $FUNCSIG$v)
call $start:comma

View File

@ -154,17 +154,15 @@
global.set $constructor/ctorAllocates
i32.const 0
local.set $0
block (result i32)
global.get $constructor/b
if
i32.const 0
i32.const 12
call $~lib/rt/stub/__alloc
local.set $0
end
local.get $0
i32.eqz
global.get $constructor/b
if
i32.const 0
i32.const 12
call $~lib/rt/stub/__alloc
local.set $0
end
local.get $0
i32.eqz
if
i32.const 0
i32.const 12

View File

@ -223,36 +223,32 @@
local.get $0
)
(func $constructor/CtorAllocates#constructor (; 10 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
block (result i32)
local.get $0
i32.eqz
if
i32.const 0
i32.const 11
call $~lib/rt/stub/__alloc
call $~lib/rt/stub/__retain
local.set $0
end
local.get $0
local.get $0
i32.eqz
if
i32.const 0
i32.const 11
call $~lib/rt/stub/__alloc
call $~lib/rt/stub/__retain
local.set $0
end
local.get $0
drop
local.get $0
)
(func $constructor/CtorConditionallyAllocates#constructor (; 11 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
global.get $constructor/b
if
block (result i32)
local.get $0
i32.eqz
if
i32.const 0
i32.const 12
call $~lib/rt/stub/__alloc
call $~lib/rt/stub/__retain
local.set $0
end
local.get $0
local.get $0
i32.eqz
if
i32.const 0
i32.const 12
call $~lib/rt/stub/__alloc
call $~lib/rt/stub/__retain
local.set $0
end
local.get $0
drop
end
local.get $0

View File

@ -13,21 +13,17 @@
(start $start)
(func $start:do (; 1 ;) (type $FUNCSIG$v)
(local $0 i32)
block $break|0
loop $continue|0
block
global.get $do/n
i32.const 1
i32.sub
global.set $do/n
global.get $do/m
i32.const 1
i32.add
global.set $do/m
end
global.get $do/n
br_if $continue|0
end
loop $continue|0
global.get $do/n
i32.const 1
i32.sub
global.set $do/n
global.get $do/m
i32.const 1
i32.add
global.set $do/m
global.get $do/n
br_if $continue|0
end
global.get $do/n
i32.const 0
@ -55,19 +51,15 @@
end
i32.const 10
global.set $do/n
block $break|1
loop $continue|1
nop
block (result i32)
global.get $do/n
local.tee $0
i32.const 1
i32.sub
global.set $do/n
local.get $0
end
br_if $continue|1
end
loop $continue|1
nop
global.get $do/n
local.tee $0
i32.const 1
i32.sub
global.set $do/n
local.get $0
br_if $continue|1
end
global.get $do/n
i32.const -1
@ -85,61 +77,53 @@
global.set $do/n
i32.const 0
global.set $do/m
block $break|2
loop $continue|2
block
global.get $do/n
i32.const 1
i32.sub
global.set $do/n
global.get $do/m
i32.const 1
i32.add
global.set $do/m
block $break|3
loop $continue|3
block
global.get $do/n
i32.const 1
i32.sub
global.set $do/n
global.get $do/o
i32.const 1
i32.add
global.set $do/o
end
global.get $do/n
br_if $continue|3
end
end
global.get $do/n
i32.const 0
i32.eq
i32.eqz
if
i32.const 0
i32.const 24
i32.const 24
i32.const 2
call $~lib/builtins/abort
unreachable
end
global.get $do/o
i32.const 9
i32.eq
i32.eqz
if
i32.const 0
i32.const 24
i32.const 25
i32.const 2
call $~lib/builtins/abort
unreachable
end
end
loop $continue|2
global.get $do/n
i32.const 1
i32.sub
global.set $do/n
global.get $do/m
i32.const 1
i32.add
global.set $do/m
loop $continue|3
global.get $do/n
br_if $continue|2
i32.const 1
i32.sub
global.set $do/n
global.get $do/o
i32.const 1
i32.add
global.set $do/o
global.get $do/n
br_if $continue|3
end
global.get $do/n
i32.const 0
i32.eq
i32.eqz
if
i32.const 0
i32.const 24
i32.const 24
i32.const 2
call $~lib/builtins/abort
unreachable
end
global.get $do/o
i32.const 9
i32.eq
i32.eqz
if
i32.const 0
i32.const 24
i32.const 25
i32.const 2
call $~lib/builtins/abort
unreachable
end
global.get $do/n
br_if $continue|2
end
global.get $do/n
i32.const 0

View File

@ -1,6 +1,6 @@
{
"asc_flags": [
"--runtime half",
"--runtime none",
"--use ASC_RTRACE=1"
]
}

View File

@ -164,21 +164,19 @@
local.get $0
)
(func $exports/Car#constructor (; 6 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
block (result i32)
local.get $0
i32.eqz
if
i32.const 4
i32.const 3
call $~lib/rt/stub/__alloc
call $~lib/rt/stub/__retain
local.set $0
end
local.get $0
local.get $1
i32.store
local.get $0
local.get $0
i32.eqz
if
i32.const 4
i32.const 3
call $~lib/rt/stub/__alloc
call $~lib/rt/stub/__retain
local.set $0
end
local.get $0
local.get $1
i32.store
local.get $0
local.get $1
i32.store
local.get $0
@ -199,21 +197,19 @@
global.get $exports/vehicles.Car.TIRES
)
(func $exports/vehicles.Car#constructor (; 11 ;) (type $FUNCSIG$iii) (param $0 i32) (param $1 i32) (result i32)
block (result i32)
local.get $0
i32.eqz
if
i32.const 4
i32.const 4
call $~lib/rt/stub/__alloc
call $~lib/rt/stub/__retain
local.set $0
end
local.get $0
local.get $1
i32.store
local.get $0
local.get $0
i32.eqz
if
i32.const 4
i32.const 4
call $~lib/rt/stub/__alloc
call $~lib/rt/stub/__retain
local.set $0
end
local.get $0
local.get $1
i32.store
local.get $0
local.get $1
i32.store
local.get $0

View File

@ -12,7 +12,7 @@
(local $1 i32)
i32.const 0
global.set $for/i
loop $repeat|0
loop $loop|0
block $break|0
global.get $for/i
i32.const 10
@ -22,7 +22,7 @@
i32.const 1
i32.add
global.set $for/i
br $repeat|0
br $loop|0
end
end
global.get $for/i
@ -36,7 +36,7 @@
call $~lib/builtins/abort
unreachable
end
loop $repeat|1
loop $loop|1
block $break|1
local.get $0
i32.const 10
@ -46,10 +46,10 @@
i32.const 1
i32.add
local.set $0
br $repeat|1
br $loop|1
end
end
loop $repeat|2
loop $loop|2
global.get $for/i
i32.const 0
i32.le_s
@ -59,7 +59,7 @@
i32.const 1
i32.sub
global.set $for/i
br $repeat|2
br $loop|2
end
end
global.get $for/i
@ -71,7 +71,7 @@
call $~lib/builtins/abort
unreachable
end
loop $repeat|3
loop $loop|3
global.get $for/i
i32.const 10
i32.eq
@ -81,20 +81,20 @@
i32.const 1
i32.add
global.set $for/i
br $repeat|3
br $loop|3
end
end
loop $repeat|4
loop $loop|4
global.get $for/i
i32.const 1
i32.sub
global.set $for/i
global.get $for/i
br_if $repeat|4
br_if $loop|4
end
i32.const 0
local.set $0
loop $repeat|5
loop $loop|5
block $break|5
local.get $0
i32.const 10
@ -104,7 +104,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|5
br $loop|5
end
end
local.get $0
@ -120,7 +120,7 @@
end
i32.const 0
local.set $0
loop $repeat|6
loop $loop|6
block $break|6
local.get $0
i32.const 10
@ -128,7 +128,7 @@
br_if $break|6
i32.const 0
local.set $1
loop $repeat|7
loop $loop|7
block $break|7
local.get $1
i32.const 10
@ -144,14 +144,14 @@
i32.const 1
i32.add
local.set $1
br $repeat|7
br $loop|7
end
end
local.get $0
i32.const 1
i32.add
local.set $0
br $repeat|6
br $loop|6
end
end
)

View File

@ -17,7 +17,7 @@
block $break|0
i32.const 0
global.set $for/i
loop $repeat|0
loop $loop|0
global.get $for/i
i32.const 10
i32.lt_s
@ -27,8 +27,7 @@
i32.const 1
i32.add
global.set $for/i
br $repeat|0
unreachable
br $loop|0
end
unreachable
end
@ -47,7 +46,7 @@
block $break|1
i32.const 0
local.set $0
loop $repeat|1
loop $loop|1
local.get $0
i32.const 10
i32.lt_s
@ -57,13 +56,12 @@
i32.const 1
i32.add
local.set $0
br $repeat|1
unreachable
br $loop|1
end
unreachable
end
block $break|2
loop $repeat|2
loop $loop|2
global.get $for/i
i32.const 0
i32.gt_s
@ -74,8 +72,7 @@
i32.const 1
i32.sub
global.set $for/i
br $repeat|2
unreachable
br $loop|2
end
unreachable
end
@ -92,10 +89,7 @@
unreachable
end
block $break|3
loop $repeat|3
i32.const 1
i32.eqz
br_if $break|3
loop $loop|3
global.get $for/i
i32.const 10
i32.eq
@ -106,51 +100,43 @@
i32.const 1
i32.add
global.set $for/i
br $repeat|3
unreachable
br $loop|3
end
unreachable
end
block $break|4
loop $repeat|4
loop $loop|4
global.get $for/i
i32.const 1
i32.eqz
br_if $break|4
block (result i32)
global.get $for/i
i32.const 1
i32.sub
global.set $for/i
global.get $for/i
end
i32.sub
global.set $for/i
global.get $for/i
i32.const 0
i32.eq
if
br $break|4
end
br $repeat|4
unreachable
br $loop|4
end
unreachable
end
block $break|5
i32.const 0
local.set $1
loop $repeat|5
loop $loop|5
local.get $1
i32.const 10
i32.lt_s
i32.eqz
br_if $break|5
block $continue|5
local.get $1
i32.const 10
i32.lt_s
i32.eqz
br_if $break|5
br $continue|5
end
local.get $1
i32.const 1
i32.add
local.set $1
br $repeat|5
unreachable
br $loop|5
end
unreachable
end
@ -169,7 +155,7 @@
block $break|6
i32.const 0
local.set $2
loop $repeat|6
loop $loop|6
local.get $2
i32.const 10
i32.lt_s
@ -178,13 +164,13 @@
block $break|7
i32.const 0
local.set $3
loop $repeat|7
loop $loop|7
local.get $3
i32.const 10
i32.lt_s
i32.eqz
br_if $break|7
block $continue|7
local.get $3
i32.const 10
i32.lt_s
i32.eqz
br_if $break|7
local.get $2
local.get $3
i32.eq
@ -196,8 +182,7 @@
i32.const 1
i32.add
local.set $3
br $repeat|7
unreachable
br $loop|7
end
unreachable
end
@ -205,8 +190,7 @@
i32.const 1
i32.add
local.set $2
br $repeat|6
unreachable
br $loop|6
end
unreachable
end

View File

@ -68,13 +68,11 @@
i32.const 10
)
(func $start:function-expression (; 15 ;) (type $FUNCSIG$v)
block (result i32)
i32.const 1
global.set $~lib/argc
i32.const 1
global.get $function-expression/f1
call_indirect (type $FUNCSIG$ii)
end
i32.const 1
global.set $~lib/argc
i32.const 1
global.get $function-expression/f1
call_indirect (type $FUNCSIG$ii)
i32.const 1
i32.eq
i32.eqz
@ -86,13 +84,11 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
i32.const 1
global.set $~lib/argc
i32.const 2
global.get $function-expression/f2
call_indirect (type $FUNCSIG$ii)
end
i32.const 1
global.set $~lib/argc
i32.const 2
global.get $function-expression/f2
call_indirect (type $FUNCSIG$ii)
i32.const 2
i32.eq
i32.eqz
@ -104,18 +100,14 @@
call $~lib/builtins/abort
unreachable
end
block
i32.const 0
global.set $~lib/argc
global.get $function-expression/f3
call_indirect (type $FUNCSIG$v)
end
block (result i32)
i32.const 0
global.set $~lib/argc
global.get $function-expression/f4
call_indirect (type $FUNCSIG$i)
end
i32.const 0
global.set $~lib/argc
global.get $function-expression/f3
call_indirect (type $FUNCSIG$v)
i32.const 0
global.set $~lib/argc
global.get $function-expression/f4
call_indirect (type $FUNCSIG$i)
i32.const 1
i32.eq
i32.eqz
@ -166,14 +158,12 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
i32.const 2
global.set $~lib/argc
i32.const 1
i32.const 2
call $function-expression/testOmittedReturn1
call_indirect (type $FUNCSIG$iii)
end
i32.const 2
global.set $~lib/argc
i32.const 1
i32.const 2
call $function-expression/testOmittedReturn1
call_indirect (type $FUNCSIG$iii)
i32.const 3
i32.eq
i32.eqz
@ -185,14 +175,12 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
i32.const 2
global.set $~lib/argc
i32.const 1
i32.const 2
call $function-expression/testOmittedReturn2
call_indirect (type $FUNCSIG$iii)
end
i32.const 2
global.set $~lib/argc
i32.const 1
i32.const 2
call $function-expression/testOmittedReturn2
call_indirect (type $FUNCSIG$iii)
i32.const 1
i32.eq
i32.eqz
@ -204,14 +192,12 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
i32.const 2
global.set $~lib/argc
i32.const 1
i32.const 2
call $function-expression/testOmittedReturn3
call_indirect (type $FUNCSIG$iii)
end
i32.const 2
global.set $~lib/argc
i32.const 1
i32.const 2
call $function-expression/testOmittedReturn3
call_indirect (type $FUNCSIG$iii)
i32.const 42
i32.eq
i32.eqz

View File

@ -91,14 +91,12 @@
(func $start:function-types (; 12 ;) (type $FUNCSIG$v)
call $function-types/makeAdder<i32>
global.set $function-types/i32Adder
block (result i32)
i32.const 2
global.set $~lib/argc
i32.const 1
i32.const 2
global.get $function-types/i32Adder
call_indirect (type $FUNCSIG$iii)
end
i32.const 2
global.set $~lib/argc
i32.const 1
i32.const 2
global.get $function-types/i32Adder
call_indirect (type $FUNCSIG$iii)
i32.const 3
i32.eq
i32.eqz
@ -112,14 +110,12 @@
end
call $function-types/makeAdder<i64>
global.set $function-types/i64Adder
block (result i64)
i32.const 2
global.set $~lib/argc
i64.const 10
i64.const 20
global.get $function-types/i64Adder
call_indirect (type $FUNCSIG$jjj)
end
i32.const 2
global.set $~lib/argc
i64.const 10
i64.const 20
global.get $function-types/i64Adder
call_indirect (type $FUNCSIG$jjj)
i64.const 30
i64.eq
i32.eqz
@ -131,14 +127,12 @@
call $~lib/builtins/abort
unreachable
end
block (result f64)
i32.const 2
global.set $~lib/argc
f64.const 1.5
f64.const 2.5
call $function-types/makeAdder<f64>
call_indirect (type $FUNCSIG$ddd)
end
i32.const 2
global.set $~lib/argc
f64.const 1.5
f64.const 2.5
call $function-types/makeAdder<f64>
call_indirect (type $FUNCSIG$ddd)
f64.const 4
f64.eq
i32.eqz
@ -194,14 +188,12 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
i32.const 2
global.set $~lib/argc
i32.const 1
i32.const 2
i32.const 0
call $function-types/makeAndAdd<i32>|trampoline
end
i32.const 2
global.set $~lib/argc
i32.const 1
i32.const 2
i32.const 0
call $function-types/makeAndAdd<i32>|trampoline
i32.const 3
i32.eq
i32.eqz

View File

@ -136,13 +136,11 @@
i32.const 0
call $getter-call/C#constructor
local.set $0
block (result i32)
i32.const 0
global.set $~lib/argc
local.get $0
call $getter-call/C#get:x
call_indirect (type $FUNCSIG$i)
end
i32.const 0
global.set $~lib/argc
local.get $0
call $getter-call/C#get:x
call_indirect (type $FUNCSIG$i)
local.set $1
local.get $0
call $~lib/rt/stub/__release

View File

@ -45,11 +45,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
i32.const 2
call $getter-setter/Foo.bar.set:bar
call $getter-setter/Foo.bar.get:bar
end
i32.const 2
call $getter-setter/Foo.bar.set:bar
call $getter-setter/Foo.bar.get:bar
i32.const 2
i32.eq
i32.eqz

View File

@ -24,7 +24,6 @@
return
end
unreachable
unreachable
)
(func $if/ifThen (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
local.get $0
@ -44,7 +43,6 @@
return
end
unreachable
unreachable
)
(func $start:if (; 4 ;) (type $FUNCSIG$v)
i32.const 0
@ -140,7 +138,6 @@
unreachable
end
unreachable
unreachable
)
(func $start (; 6 ;) (type $FUNCSIG$v)
call $start:if

View File

@ -18,7 +18,7 @@
global.set $infer-type/rf
f64.const 0
global.set $infer-type/rF
loop $repeat|0
loop $loop|0
local.get $0
i32.const 10
i32.lt_s
@ -27,7 +27,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|0
br $loop|0
end
end
)

View File

@ -80,13 +80,11 @@
global.get $infer-type/rF
drop
block $break|0
block
i32.const 0
local.set $0
i32.const 10
local.set $1
end
loop $repeat|0
i32.const 0
local.set $0
i32.const 10
local.set $1
loop $loop|0
local.get $0
local.get $1
i32.lt_s
@ -96,8 +94,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|0
unreachable
br $loop|0
end
unreachable
end

View File

@ -19,37 +19,31 @@
(local $3 i32)
i32.const 1
local.set $0
block $inlining-blocklocals/theCall|inlined.0
block (result i32)
local.get $0
local.tee $1
i32.const 1
i32.add
local.set $0
local.get $1
end
local.set $3
block (result i32)
global.get $inlining-blocklocals/b
local.tee $1
i32.const 1
i32.add
global.set $inlining-blocklocals/b
local.get $1
end
local.set $2
local.get $0
i32.const 1
i32.add
local.tee $0
local.set $1
local.get $3
global.set $inlining-blocklocals/theCall_a
local.get $2
global.set $inlining-blocklocals/theCall_b
local.get $1
global.set $inlining-blocklocals/theCall_c
end
local.get $0
local.tee $1
i32.const 1
i32.add
local.set $0
local.get $1
local.set $3
global.get $inlining-blocklocals/b
local.tee $1
i32.const 1
i32.add
global.set $inlining-blocklocals/b
local.get $1
local.set $2
local.get $0
i32.const 1
i32.add
local.tee $0
local.set $1
local.get $3
global.set $inlining-blocklocals/theCall_a
local.get $2
global.set $inlining-blocklocals/theCall_b
local.get $1
global.set $inlining-blocklocals/theCall_c
global.get $inlining-blocklocals/theCall_a
i32.const 1
i32.eq

View File

@ -14,9 +14,7 @@
call $inlining-recursive/bar
)
(func $inlining-recursive/bar (; 2 ;) (type $FUNCSIG$v)
block $inlining-recursive/bar|inlined.0
call $inlining-recursive/baz
end
call $inlining-recursive/baz
)
(func $null (; 3 ;) (type $FUNCSIG$v)
)

View File

@ -135,11 +135,9 @@
call $~lib/builtins/abort
unreachable
end
block $inlining/func_ii_opt|inlined.0 (result i32)
i32.const 0
local.set $2
local.get $2
end
i32.const 0
local.set $2
local.get $2
i32.const 0
i32.eq
i32.eqz
@ -151,11 +149,9 @@
call $~lib/builtins/abort
unreachable
end
block $inlining/func_ii_opt|inlined.1 (result i32)
i32.const 1
local.set $2
local.get $2
end
i32.const 1
local.set $2
local.get $2
i32.const 1
i32.eq
i32.eqz
@ -167,21 +163,19 @@
call $~lib/builtins/abort
unreachable
end
block $inlining/func_ii_loc|inlined.0 (result i32)
i32.const 2
local.set $2
local.get $2
local.set $3
local.get $3
local.set $5
local.get $5
local.set $6
local.get $6
i32.const 1
i32.add
local.set $4
local.get $4
end
i32.const 2
local.set $2
local.get $2
local.set $3
local.get $3
local.set $5
local.get $5
local.set $6
local.get $6
i32.const 1
i32.add
local.set $4
local.get $4
i32.const 3
i32.eq
i32.eqz
@ -193,21 +187,19 @@
call $~lib/builtins/abort
unreachable
end
block $inlining/func_ii_loc|inlined.1 (result i32)
i32.const 3
local.set $5
local.get $5
local.set $4
local.get $4
local.set $2
local.get $2
local.set $6
local.get $6
i32.const 1
i32.add
local.set $3
local.get $3
end
i32.const 3
local.set $5
local.get $5
local.set $4
local.get $4
local.set $2
local.get $2
local.set $6
local.get $6
i32.const 1
i32.add
local.set $3
local.get $3
i32.const 4
i32.eq
i32.eqz
@ -219,19 +211,13 @@
call $~lib/builtins/abort
unreachable
end
block $inlining/func_iv|inlined.0
i32.const 0
local.set $2
end
block (result i32)
i32.const 1
global.set $~lib/argc
i32.const 2
block $inlining/func_fe|inlined.0 (result i32)
i32.const 1
end
call_indirect (type $FUNCSIG$ii)
end
i32.const 0
local.set $2
i32.const 1
global.set $~lib/argc
i32.const 2
i32.const 1
call_indirect (type $FUNCSIG$ii)
i32.const 2
i32.eq
i32.eqz
@ -243,15 +229,13 @@
call $~lib/builtins/abort
unreachable
end
block $inlining/Foo.method_static|inlined.0 (result i32)
i32.const 42
local.set $6
i32.const 2
local.set $2
local.get $6
local.get $2
i32.add
end
i32.const 42
local.set $6
i32.const 2
local.set $2
local.get $6
local.get $2
i32.add
i32.const 44
i32.eq
i32.eqz
@ -266,16 +250,14 @@
i32.const 123
call $~lib/rt/stub/__retain
local.set $7
block $inlining/Foo#method_this|inlined.0 (result i32)
local.get $7
local.set $4
i32.const 43
local.set $5
i32.const 3
local.set $2
local.get $4
call $~lib/rt/stub/__retain
end
local.get $7
local.set $4
i32.const 43
local.set $5
i32.const 3
local.set $2
local.get $4
call $~lib/rt/stub/__retain
local.tee $2
i32.const 123
i32.eq
@ -391,58 +373,52 @@
(local $2 i32)
(local $3 i32)
(local $4 i32)
block $inlining/Bar#constructor|inlined.0 (result i32)
i32.const 0
local.set $1
i32.const 4
local.set $0
block $inlining/Baz#constructor|inlined.0 (result i32)
local.get $1
if (result i32)
local.get $1
else
i32.const 16
i32.const 5
call $~lib/rt/stub/__alloc
call $~lib/rt/stub/__retain
end
local.set $3
i32.const 2
local.set $2
block (result i32)
local.get $3
i32.eqz
if
i32.const 8
i32.const 4
call $~lib/rt/stub/__alloc
call $~lib/rt/stub/__retain
local.set $3
end
local.get $3
i32.const 1
i32.store
local.get $3
i32.const 0
i32.store offset=4
local.get $3
end
local.get $2
i32.store offset=4
local.get $3
end
local.set $1
local.get $1
i32.const 3
i32.store offset=8
local.get $1
i32.const 0
i32.store offset=12
local.get $1
local.get $0
i32.store offset=12
i32.const 0
local.set $1
i32.const 4
local.set $0
local.get $1
if (result i32)
local.get $1
else
i32.const 16
i32.const 5
call $~lib/rt/stub/__alloc
call $~lib/rt/stub/__retain
end
local.set $3
i32.const 2
local.set $2
local.get $3
i32.eqz
if
i32.const 8
i32.const 4
call $~lib/rt/stub/__alloc
call $~lib/rt/stub/__retain
local.set $3
end
local.get $3
i32.const 1
i32.store
local.get $3
i32.const 0
i32.store offset=4
local.get $3
local.get $2
i32.store offset=4
local.get $3
local.set $1
local.get $1
i32.const 3
i32.store offset=8
local.get $1
i32.const 0
i32.store offset=12
local.get $1
local.get $0
i32.store offset=12
local.get $1
local.set $4
local.get $4
i32.load

View File

@ -19,11 +19,9 @@
(export "memory" (memory $0))
(start $start)
(func $instanceof/isI32<i32> (; 1 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
block (result i32)
local.get $0
drop
i32.const 1
end
local.get $0
drop
i32.const 1
if
i32.const 1
return
@ -32,14 +30,11 @@
return
end
unreachable
unreachable
)
(func $instanceof/isI32<f64> (; 2 ;) (type $FUNCSIG$id) (param $0 f64) (result i32)
block (result i32)
local.get $0
drop
i32.const 0
end
local.get $0
drop
i32.const 0
if
i32.const 1
return
@ -48,14 +43,11 @@
return
end
unreachable
unreachable
)
(func $instanceof/isI32<u32> (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
block (result i32)
local.get $0
drop
i32.const 0
end
local.get $0
drop
i32.const 0
if
i32.const 1
return
@ -64,14 +56,11 @@
return
end
unreachable
unreachable
)
(func $instanceof/isI32<u16> (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
block (result i32)
local.get $0
drop
i32.const 0
end
local.get $0
drop
i32.const 0
if
i32.const 1
return
@ -80,7 +69,6 @@
return
end
unreachable
unreachable
)
(func $~lib/rt/stub/__retain (; 5 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
local.get $0
@ -91,11 +79,9 @@
(func $start:instanceof (; 7 ;) (type $FUNCSIG$v)
(local $0 i32)
(local $1 i32)
block (result i32)
global.get $instanceof/a
drop
i32.const 1
end
global.get $instanceof/a
drop
i32.const 1
i32.eqz
if
i32.const 0
@ -105,11 +91,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/b
drop
i32.const 1
end
global.get $instanceof/b
drop
i32.const 1
i32.eqz
if
i32.const 0
@ -119,11 +103,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/i
drop
i32.const 0
end
global.get $instanceof/i
drop
i32.const 0
i32.eqz
i32.eqz
if
@ -134,11 +116,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/I
drop
i32.const 0
end
global.get $instanceof/I
drop
i32.const 0
i32.eqz
i32.eqz
if
@ -149,11 +129,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/f
drop
i32.const 0
end
global.get $instanceof/f
drop
i32.const 0
i32.eqz
i32.eqz
if
@ -164,11 +142,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/F
drop
i32.const 0
end
global.get $instanceof/F
drop
i32.const 0
i32.eqz
i32.eqz
if
@ -179,11 +155,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/b
drop
i32.const 1
end
global.get $instanceof/b
drop
i32.const 1
i32.eqz
if
i32.const 0
@ -193,11 +167,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/i
drop
i32.const 0
end
global.get $instanceof/i
drop
i32.const 0
i32.eqz
i32.eqz
if
@ -208,11 +180,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/I
drop
i32.const 0
end
global.get $instanceof/I
drop
i32.const 0
i32.eqz
i32.eqz
if
@ -223,11 +193,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/f
drop
i32.const 0
end
global.get $instanceof/f
drop
i32.const 0
i32.eqz
i32.eqz
if
@ -238,11 +206,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/F
drop
i32.const 0
end
global.get $instanceof/F
drop
i32.const 0
i32.eqz
i32.eqz
if
@ -253,11 +219,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/a
drop
i32.const 0
end
global.get $instanceof/a
drop
i32.const 0
i32.eqz
i32.eqz
if
@ -268,11 +232,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/b
drop
i32.const 0
end
global.get $instanceof/b
drop
i32.const 0
i32.eqz
i32.eqz
if
@ -283,11 +245,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/i
drop
i32.const 1
end
global.get $instanceof/i
drop
i32.const 1
i32.eqz
if
i32.const 0
@ -297,11 +257,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/I
drop
i32.const 0
end
global.get $instanceof/I
drop
i32.const 0
i32.eqz
i32.eqz
if
@ -312,11 +270,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/f
drop
i32.const 0
end
global.get $instanceof/f
drop
i32.const 0
i32.eqz
i32.eqz
if
@ -327,11 +283,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/F
drop
i32.const 0
end
global.get $instanceof/F
drop
i32.const 0
i32.eqz
i32.eqz
if
@ -342,11 +296,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/a
drop
i32.const 0
end
global.get $instanceof/a
drop
i32.const 0
i32.eqz
i32.eqz
if
@ -357,11 +309,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/b
drop
i32.const 0
end
global.get $instanceof/b
drop
i32.const 0
i32.eqz
i32.eqz
if
@ -372,11 +322,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/i
drop
i32.const 0
end
global.get $instanceof/i
drop
i32.const 0
i32.eqz
i32.eqz
if
@ -387,11 +335,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/I
drop
i32.const 1
end
global.get $instanceof/I
drop
i32.const 1
i32.eqz
if
i32.const 0
@ -401,11 +347,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/f
drop
i32.const 0
end
global.get $instanceof/f
drop
i32.const 0
i32.eqz
i32.eqz
if
@ -416,11 +360,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/F
drop
i32.const 0
end
global.get $instanceof/F
drop
i32.const 0
i32.eqz
i32.eqz
if
@ -431,11 +373,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/a
drop
i32.const 0
end
global.get $instanceof/a
drop
i32.const 0
i32.eqz
i32.eqz
if
@ -446,11 +386,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/b
drop
i32.const 0
end
global.get $instanceof/b
drop
i32.const 0
i32.eqz
i32.eqz
if
@ -461,11 +399,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/i
drop
i32.const 0
end
global.get $instanceof/i
drop
i32.const 0
i32.eqz
i32.eqz
if
@ -476,11 +412,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/I
drop
i32.const 0
end
global.get $instanceof/I
drop
i32.const 0
i32.eqz
i32.eqz
if
@ -491,11 +425,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/f
drop
i32.const 1
end
global.get $instanceof/f
drop
i32.const 1
i32.eqz
if
i32.const 0
@ -505,11 +437,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/F
drop
i32.const 0
end
global.get $instanceof/F
drop
i32.const 0
i32.eqz
i32.eqz
if
@ -520,11 +450,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/a
drop
i32.const 0
end
global.get $instanceof/a
drop
i32.const 0
i32.eqz
i32.eqz
if
@ -535,11 +463,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/b
drop
i32.const 0
end
global.get $instanceof/b
drop
i32.const 0
i32.eqz
i32.eqz
if
@ -550,11 +476,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/i
drop
i32.const 0
end
global.get $instanceof/i
drop
i32.const 0
i32.eqz
i32.eqz
if
@ -565,11 +489,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/I
drop
i32.const 0
end
global.get $instanceof/I
drop
i32.const 0
i32.eqz
i32.eqz
if
@ -580,11 +502,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/f
drop
i32.const 0
end
global.get $instanceof/f
drop
i32.const 0
i32.eqz
i32.eqz
if
@ -595,11 +515,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/F
drop
i32.const 1
end
global.get $instanceof/F
drop
i32.const 1
i32.eqz
if
i32.const 0
@ -669,11 +587,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/an
drop
i32.const 1
end
global.get $instanceof/an
drop
i32.const 1
i32.eqz
if
i32.const 0
@ -683,21 +599,19 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
i32.const 1
local.tee $0
global.get $instanceof/an
local.tee $1
i32.ne
if
local.get $0
call $~lib/rt/stub/__retain
drop
local.get $1
call $~lib/rt/stub/__release
end
i32.const 1
local.tee $0
global.get $instanceof/an
local.tee $1
i32.ne
if
local.get $0
call $~lib/rt/stub/__retain
drop
local.get $1
call $~lib/rt/stub/__release
end
local.get $0
global.set $instanceof/an
global.get $instanceof/an
i32.const 0
@ -711,11 +625,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $instanceof/an
drop
i32.const 1
end
global.get $instanceof/an
drop
i32.const 1
i32.eqz
if
i32.const 0

View File

@ -25,8 +25,6 @@
f64.ne
if (result i32)
unreachable
f64.const 0
unreachable
else
i32.const 0
end
@ -45,8 +43,6 @@
i32.const 1
else
unreachable
f64.const 0
unreachable
end
drop
i32.const 1
@ -75,8 +71,6 @@
i32.const 1
else
unreachable
f64.const 0
unreachable
end
drop
i32.const 1

View File

@ -0,0 +1,5 @@
{
"asc_flags": [
"--runtime none"
]
}

View File

@ -0,0 +1,165 @@
(module
(type $FUNCSIG$i (func (result i32)))
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(type $FUNCSIG$ii (func (param i32) (result i32)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\18\00\00\00\01\00\00\00\01\00\00\00\18\00\00\00l\00o\00o\00p\00-\00f\00l\00o\00w\00.\00t\00s")
(data (i32.const 48) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00t\00e\00r\00m")
(export "memory" (memory $0))
(export "whileReturn" (func $loop-flow/whileReturn))
(export "whileThrow" (func $loop-flow/whileThrow))
(export "whileContinue" (func $loop-flow/whileContinue))
(export "whileAny" (func $loop-flow/whileAny))
(export "forReturn" (func $loop-flow/whileReturn))
(export "forThrow" (func $loop-flow/forThrow))
(export "forContinue" (func $loop-flow/whileContinue))
(export "forAny" (func $loop-flow/forAny))
(export "doReturn" (func $loop-flow/whileReturn))
(export "doThrow" (func $loop-flow/doThrow))
(export "doAny" (func $loop-flow/doAny))
(start $start)
(func $loop-flow/whileReturn (; 1 ;) (type $FUNCSIG$i) (result i32)
i32.const 1
)
(func $loop-flow/whileAny (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
loop $continue|0 (result i32)
local.get $0
i32.const 1
i32.eq
if (result i32)
i32.const 1
else
local.get $0
i32.const 2
i32.ne
br_if $continue|0
i32.const 64
i32.const 24
i32.const 24
i32.const 21
call $~lib/builtins/abort
unreachable
end
end
)
(func $loop-flow/forAny (; 3 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
loop $loop|0 (result i32)
local.get $0
i32.const 1
i32.eq
if (result i32)
i32.const 1
else
local.get $0
i32.const 2
i32.eq
if
i32.const 64
i32.const 24
i32.const 54
i32.const 21
call $~lib/builtins/abort
unreachable
end
br $loop|0
end
end
)
(func $loop-flow/doAny (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
loop $continue|0 (result i32)
local.get $0
i32.const 1
i32.eq
if (result i32)
i32.const 1
else
local.get $0
i32.const 2
i32.ne
br_if $continue|0
i32.const 64
i32.const 24
i32.const 78
i32.const 21
call $~lib/builtins/abort
unreachable
end
end
)
(func $start:loop-flow (; 5 ;) (type $FUNCSIG$v)
i32.const 1
call $loop-flow/whileAny
i32.const 1
i32.ne
if
i32.const 0
i32.const 24
i32.const 29
i32.const 0
call $~lib/builtins/abort
unreachable
end
i32.const 1
call $loop-flow/forAny
i32.const 1
i32.ne
if
i32.const 0
i32.const 24
i32.const 59
i32.const 0
call $~lib/builtins/abort
unreachable
end
i32.const 1
call $loop-flow/doAny
i32.const 1
i32.ne
if
i32.const 0
i32.const 24
i32.const 83
i32.const 0
call $~lib/builtins/abort
unreachable
end
)
(func $loop-flow/whileThrow (; 6 ;) (type $FUNCSIG$i) (result i32)
i32.const 64
i32.const 24
i32.const 11
i32.const 4
call $~lib/builtins/abort
unreachable
)
(func $loop-flow/whileContinue (; 7 ;) (type $FUNCSIG$i) (result i32)
loop $continue|0
br $continue|0
end
unreachable
)
(func $loop-flow/forThrow (; 8 ;) (type $FUNCSIG$i) (result i32)
i32.const 64
i32.const 24
i32.const 41
i32.const 4
call $~lib/builtins/abort
unreachable
)
(func $loop-flow/doThrow (; 9 ;) (type $FUNCSIG$i) (result i32)
i32.const 64
i32.const 24
i32.const 71
i32.const 4
call $~lib/builtins/abort
unreachable
)
(func $start (; 10 ;) (type $FUNCSIG$v)
call $start:loop-flow
)
(func $null (; 11 ;) (type $FUNCSIG$v)
nop
)
)

View File

@ -0,0 +1,83 @@
export function whileReturn(): i32 {
while (true) {
return 1;
}
}
assert(whileReturn() == 1);
export function whileThrow(): i32 {
while (true) {
throw new Error("term");
}
}
export function whileContinue(): i32 {
while (true) {
continue;
}
}
export function whileAny(a: i32): i32 {
while (true) {
if (a == 1) return 1;
else if (a == 2) throw new Error("term");
else continue;
}
}
assert(whileAny(1) == 1);
export function forReturn(): i32 {
for (;;) {
return 1;
}
}
assert(forReturn() == 1);
export function forThrow(): i32 {
for (;;) {
throw new Error("term");
}
}
export function forContinue(): i32 {
for (;;) {
continue;
}
}
export function forAny(a: i32): i32 {
for (;;) {
if (a == 1) return 1;
else if (a == 2) throw new Error("term");
else continue;
}
}
assert(forAny(1) == 1);
export function doReturn(): i32 {
do {
return 1;
} while (true);
}
assert(doReturn() == 1);
export function doThrow(): i32 {
do {
throw new Error("term");
} while (true);
}
export function doAny(a: i32): i32 {
do {
if (a == 1) return 1;
else if (a == 2) throw new Error("term");
else continue;
} while (true);
}
assert(doAny(1) == 1);

View File

@ -0,0 +1,242 @@
(module
(type $FUNCSIG$i (func (result i32)))
(type $FUNCSIG$viiii (func (param i32 i32 i32 i32)))
(type $FUNCSIG$ii (func (param i32) (result i32)))
(type $FUNCSIG$v (func))
(import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
(memory $0 1)
(data (i32.const 8) "\18\00\00\00\01\00\00\00\01\00\00\00\18\00\00\00l\00o\00o\00p\00-\00f\00l\00o\00w\00.\00t\00s\00")
(data (i32.const 48) "\08\00\00\00\01\00\00\00\01\00\00\00\08\00\00\00t\00e\00r\00m\00")
(table $0 1 funcref)
(elem (i32.const 0) $null)
(export "memory" (memory $0))
(export "whileReturn" (func $loop-flow/whileReturn))
(export "whileThrow" (func $loop-flow/whileThrow))
(export "whileContinue" (func $loop-flow/whileContinue))
(export "whileAny" (func $loop-flow/whileAny))
(export "forReturn" (func $loop-flow/forReturn))
(export "forThrow" (func $loop-flow/forThrow))
(export "forContinue" (func $loop-flow/forContinue))
(export "forAny" (func $loop-flow/forAny))
(export "doReturn" (func $loop-flow/doReturn))
(export "doThrow" (func $loop-flow/doThrow))
(export "doAny" (func $loop-flow/doAny))
(start $start)
(func $loop-flow/whileReturn (; 1 ;) (type $FUNCSIG$i) (result i32)
i32.const 1
return
)
(func $loop-flow/whileAny (; 2 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
loop $continue|0
local.get $0
i32.const 1
i32.eq
if
i32.const 1
return
else
local.get $0
i32.const 2
i32.eq
if
i32.const 64
i32.const 24
i32.const 24
i32.const 21
call $~lib/builtins/abort
unreachable
else
br $continue|0
end
unreachable
end
unreachable
end
unreachable
)
(func $loop-flow/forReturn (; 3 ;) (type $FUNCSIG$i) (result i32)
i32.const 1
return
)
(func $loop-flow/forAny (; 4 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
loop $loop|0
block $continue|0
local.get $0
i32.const 1
i32.eq
if
i32.const 1
return
else
local.get $0
i32.const 2
i32.eq
if
i32.const 64
i32.const 24
i32.const 54
i32.const 21
call $~lib/builtins/abort
unreachable
else
br $continue|0
end
unreachable
end
unreachable
end
br $loop|0
end
unreachable
)
(func $loop-flow/doReturn (; 5 ;) (type $FUNCSIG$i) (result i32)
i32.const 1
return
)
(func $loop-flow/doAny (; 6 ;) (type $FUNCSIG$ii) (param $0 i32) (result i32)
loop $continue|0
local.get $0
i32.const 1
i32.eq
if
i32.const 1
return
else
local.get $0
i32.const 2
i32.eq
if
i32.const 64
i32.const 24
i32.const 78
i32.const 21
call $~lib/builtins/abort
unreachable
else
br $continue|0
end
unreachable
end
unreachable
end
unreachable
)
(func $start:loop-flow (; 7 ;) (type $FUNCSIG$v)
call $loop-flow/whileReturn
i32.const 1
i32.eq
i32.eqz
if
i32.const 0
i32.const 24
i32.const 7
i32.const 0
call $~lib/builtins/abort
unreachable
end
i32.const 1
call $loop-flow/whileAny
i32.const 1
i32.eq
i32.eqz
if
i32.const 0
i32.const 24
i32.const 29
i32.const 0
call $~lib/builtins/abort
unreachable
end
call $loop-flow/forReturn
i32.const 1
i32.eq
i32.eqz
if
i32.const 0
i32.const 24
i32.const 37
i32.const 0
call $~lib/builtins/abort
unreachable
end
i32.const 1
call $loop-flow/forAny
i32.const 1
i32.eq
i32.eqz
if
i32.const 0
i32.const 24
i32.const 59
i32.const 0
call $~lib/builtins/abort
unreachable
end
call $loop-flow/doReturn
i32.const 1
i32.eq
i32.eqz
if
i32.const 0
i32.const 24
i32.const 67
i32.const 0
call $~lib/builtins/abort
unreachable
end
i32.const 1
call $loop-flow/doAny
i32.const 1
i32.eq
i32.eqz
if
i32.const 0
i32.const 24
i32.const 83
i32.const 0
call $~lib/builtins/abort
unreachable
end
)
(func $loop-flow/whileThrow (; 8 ;) (type $FUNCSIG$i) (result i32)
i32.const 64
i32.const 24
i32.const 11
i32.const 4
call $~lib/builtins/abort
unreachable
)
(func $loop-flow/whileContinue (; 9 ;) (type $FUNCSIG$i) (result i32)
loop $continue|0
br $continue|0
end
unreachable
)
(func $loop-flow/forThrow (; 10 ;) (type $FUNCSIG$i) (result i32)
i32.const 64
i32.const 24
i32.const 41
i32.const 4
call $~lib/builtins/abort
unreachable
)
(func $loop-flow/forContinue (; 11 ;) (type $FUNCSIG$i) (result i32)
loop $loop|0
br $loop|0
end
unreachable
)
(func $loop-flow/doThrow (; 12 ;) (type $FUNCSIG$i) (result i32)
i32.const 64
i32.const 24
i32.const 71
i32.const 4
call $~lib/builtins/abort
unreachable
)
(func $start (; 13 ;) (type $FUNCSIG$v)
call $start:loop-flow
)
(func $null (; 14 ;) (type $FUNCSIG$v)
)
)

View File

@ -430,7 +430,7 @@
f64.convert_i32_u
f64.min
local.set $14
loop $repeat|0
loop $loop|0
block $break|0
local.get $7
local.get $1
@ -450,43 +450,43 @@
i32.const 0
local.set $6
loop $continue|1
local.get $4
local.get $4
f64.mul
local.tee $15
local.get $5
local.get $5
f64.mul
local.tee $8
f64.add
f64.const 4
f64.le
if
block $break|1
f64.const 2
local.get $4
f64.mul
local.get $5
f64.mul
local.get $10
f64.add
local.set $5
local.get $15
local.get $8
f64.sub
local.get $11
f64.add
local.set $4
local.get $6
local.get $3
i32.ge_u
br_if $break|1
local.get $6
i32.const 1
i32.add
local.set $6
br $continue|1
end
block $break|1
local.get $4
local.get $4
f64.mul
local.tee $15
local.get $5
local.get $5
f64.mul
local.tee $8
f64.add
f64.const 4
f64.le
i32.eqz
br_if $break|1
f64.const 2
local.get $4
f64.mul
local.get $5
f64.mul
local.get $10
f64.add
local.set $5
local.get $15
local.get $8
f64.sub
local.get $11
f64.add
local.set $4
local.get $6
local.get $3
i32.ge_u
br_if $break|1
local.get $6
i32.const 1
i32.add
local.set $6
br $continue|1
end
end
loop $continue|2
@ -504,7 +504,6 @@
f64.sub
local.get $11
f64.add
local.set $8
f64.const 2
local.get $4
f64.mul
@ -513,7 +512,6 @@
local.get $10
f64.add
local.set $5
local.get $8
local.set $4
local.get $6
i32.const 1
@ -567,7 +565,7 @@
i32.const 1
i32.add
local.set $7
br $repeat|0
br $loop|0
end
end
)

View File

@ -549,7 +549,7 @@
block $break|0
i32.const 0
local.set $12
loop $repeat|0
loop $loop|0
local.get $12
local.get $1
i32.lt_u
@ -581,34 +581,35 @@
f64.add
f64.const 4
f64.le
i32.eqz
br_if $break|1
f64.const 2
local.get $14
f64.mul
local.get $15
f64.mul
local.get $7
f64.add
local.set $15
local.get $16
local.get $17
f64.sub
local.get $13
f64.add
local.set $14
local.get $18
local.get $3
i32.ge_u
if
f64.const 2
local.get $14
f64.mul
local.get $15
f64.mul
local.get $7
f64.add
local.set $15
local.get $16
local.get $17
f64.sub
local.get $13
f64.add
local.set $14
local.get $18
local.get $3
i32.ge_u
if
br $break|1
end
local.get $18
i32.const 1
i32.add
local.set $18
br $continue|1
br $break|1
end
local.get $18
i32.const 1
i32.add
local.set $18
br $continue|1
end
unreachable
end
block $break|2
loop $continue|2
@ -616,34 +617,35 @@
f64.convert_i32_u
local.get $11
f64.lt
if
local.get $14
local.get $14
f64.mul
local.get $15
local.get $15
f64.mul
f64.sub
local.get $13
f64.add
local.set $19
f64.const 2
local.get $14
f64.mul
local.get $15
f64.mul
local.get $7
f64.add
local.set $15
local.get $19
local.set $14
local.get $18
i32.const 1
i32.add
local.set $18
br $continue|2
end
i32.eqz
br_if $break|2
local.get $14
local.get $14
f64.mul
local.get $15
local.get $15
f64.mul
f64.sub
local.get $13
f64.add
local.set $19
f64.const 2
local.get $14
f64.mul
local.get $15
f64.mul
local.get $7
f64.add
local.set $15
local.get $19
local.set $14
local.get $18
i32.const 1
i32.add
local.set $18
br $continue|2
end
unreachable
end
global.get $../../examples/mandelbrot/assembly/index/NUM_COLORS
i32.const 1
@ -671,26 +673,24 @@
i32.const 1
i32.sub
f64.convert_i32_s
block $../../examples/mandelbrot/assembly/index/clamp<f64>|inlined.0 (result f64)
local.get $18
i32.const 1
i32.add
f64.convert_i32_u
local.get $21
f64.sub
local.get $10
f64.mul
local.set $24
f64.const 0
local.set $23
f64.const 1
local.set $22
local.get $24
local.get $23
f64.max
local.get $22
f64.min
end
local.get $18
i32.const 1
i32.add
f64.convert_i32_u
local.get $21
f64.sub
local.get $10
f64.mul
local.set $24
f64.const 0
local.set $23
f64.const 1
local.set $22
local.get $24
local.get $23
f64.max
local.get $22
f64.min
f64.mul
i32.trunc_f64_u
local.set $20
@ -706,8 +706,7 @@
i32.const 1
i32.add
local.set $12
br $repeat|0
unreachable
br $loop|0
end
unreachable
end

View File

@ -53,7 +53,8 @@
loop $continue|1
local.get $2
i32.const 16
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $1
@ -235,7 +236,8 @@
loop $continue|3
local.get $2
i32.const 17
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $1
@ -344,7 +346,8 @@
loop $continue|4
local.get $2
i32.const 18
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $1
@ -445,7 +448,8 @@
loop $continue|5
local.get $2
i32.const 19
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $1

File diff suppressed because it is too large Load Diff

View File

@ -39,36 +39,38 @@
i32.and
if
local.get $2
i32.eqz
if
local.get $2
i32.const 1
i32.sub
local.set $2
local.get $0
local.tee $4
i32.const 1
i32.add
local.set $0
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $4
local.get $5
i32.load8_u
i32.store8
br $continue|0
else
local.get $3
return
end
local.get $2
i32.const 1
i32.sub
local.set $2
local.get $0
local.tee $4
i32.const 1
i32.add
local.set $0
local.get $1
local.tee $5
i32.const 1
i32.add
local.set $1
local.get $4
local.get $5
i32.load8_u
i32.store8
br $continue|0
unreachable
end
end
loop $continue|1
local.get $2
i32.const 8
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $1
@ -131,29 +133,31 @@
i32.and
if
local.get $2
i32.eqz
if
local.get $2
i32.const 1
i32.sub
local.tee $2
local.get $0
i32.add
local.get $1
local.get $2
i32.add
i32.load8_u
i32.store8
br $continue|3
else
local.get $3
return
end
local.get $2
i32.const 1
i32.sub
local.tee $2
local.get $0
i32.add
local.get $1
local.get $2
i32.add
i32.load8_u
i32.store8
br $continue|3
unreachable
end
end
loop $continue|4
local.get $2
i32.const 8
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $2
i32.const 8

View File

@ -40,95 +40,90 @@
local.get $0
i32.const 8
i32.rem_u
i32.eqz
br_if $break|0
local.get $2
i32.eqz
if
local.get $2
i32.eqz
if
local.get $3
return
end
local.get $2
i32.const 1
i32.sub
local.set $2
block (result i32)
local.get $0
local.tee $4
i32.const 1
i32.add
local.set $0
local.get $4
end
block (result i32)
local.get $1
local.tee $4
i32.const 1
i32.add
local.set $1
local.get $4
end
i32.load8_u
i32.store8
br $continue|0
local.get $3
return
end
local.get $2
i32.const 1
i32.sub
local.set $2
local.get $0
local.tee $4
i32.const 1
i32.add
local.set $0
local.get $4
local.get $1
local.tee $4
i32.const 1
i32.add
local.set $1
local.get $4
i32.load8_u
i32.store8
br $continue|0
end
unreachable
end
block $break|1
loop $continue|1
local.get $2
i32.const 8
i32.ge_u
if
local.get $0
local.get $1
i64.load
i64.store
local.get $2
i32.const 8
i32.sub
local.set $2
local.get $0
i32.const 8
i32.add
local.set $0
local.get $1
i32.const 8
i32.add
local.set $1
br $continue|1
end
i32.eqz
br_if $break|1
local.get $0
local.get $1
i64.load
i64.store
local.get $2
i32.const 8
i32.sub
local.set $2
local.get $0
i32.const 8
i32.add
local.set $0
local.get $1
i32.const 8
i32.add
local.set $1
br $continue|1
end
unreachable
end
end
block $break|2
loop $continue|2
local.get $2
if
block (result i32)
local.get $0
local.tee $4
i32.const 1
i32.add
local.set $0
local.get $4
end
block (result i32)
local.get $1
local.tee $4
i32.const 1
i32.add
local.set $1
local.get $4
end
i32.load8_u
i32.store8
local.get $2
i32.const 1
i32.sub
local.set $2
br $continue|2
end
i32.eqz
br_if $break|2
local.get $0
local.tee $4
i32.const 1
i32.add
local.set $0
local.get $4
local.get $1
local.tee $4
i32.const 1
i32.add
local.set $1
local.get $4
i32.load8_u
i32.store8
local.get $2
i32.const 1
i32.sub
local.set $2
br $continue|2
end
unreachable
end
else
local.get $1
@ -146,55 +141,14 @@
i32.add
i32.const 8
i32.rem_u
if
local.get $2
i32.eqz
if
local.get $3
return
end
local.get $0
local.get $2
i32.const 1
i32.sub
local.tee $2
i32.add
local.get $1
local.get $2
i32.add
i32.load8_u
i32.store8
br $continue|3
end
end
end
block $break|4
loop $continue|4
i32.eqz
br_if $break|3
local.get $2
i32.const 8
i32.ge_u
i32.eqz
if
local.get $2
i32.const 8
i32.sub
local.set $2
local.get $0
local.get $2
i32.add
local.get $1
local.get $2
i32.add
i64.load
i64.store
br $continue|4
local.get $3
return
end
end
end
end
block $break|5
loop $continue|5
local.get $2
if
local.get $0
local.get $2
i32.const 1
@ -206,9 +160,53 @@
i32.add
i32.load8_u
i32.store8
br $continue|5
br $continue|3
end
unreachable
end
block $break|4
loop $continue|4
local.get $2
i32.const 8
i32.ge_u
i32.eqz
br_if $break|4
local.get $2
i32.const 8
i32.sub
local.set $2
local.get $0
local.get $2
i32.add
local.get $1
local.get $2
i32.add
i64.load
i64.store
br $continue|4
end
unreachable
end
end
block $break|5
loop $continue|5
local.get $2
i32.eqz
br_if $break|5
local.get $0
local.get $2
i32.const 1
i32.sub
local.tee $2
i32.add
local.get $1
local.get $2
i32.add
i32.load8_u
i32.store8
br $continue|5
end
unreachable
end
end
local.get $3

View File

@ -80,7 +80,6 @@
i32.and
local.tee $2
i32.sub
local.set $3
local.get $0
local.get $2
i32.add
@ -92,7 +91,6 @@
i32.mul
local.tee $1
i32.store
local.get $3
i32.const -4
i32.and
local.tee $2

View File

@ -240,36 +240,37 @@
local.get $2
i32.const 32
i32.ge_u
if
local.get $0
local.get $6
i64.store
local.get $0
i32.const 8
i32.add
local.get $6
i64.store
local.get $0
i32.const 16
i32.add
local.get $6
i64.store
local.get $0
i32.const 24
i32.add
local.get $6
i64.store
local.get $2
i32.const 32
i32.sub
local.set $2
local.get $0
i32.const 32
i32.add
local.set $0
br $continue|0
end
i32.eqz
br_if $break|0
local.get $0
local.get $6
i64.store
local.get $0
i32.const 8
i32.add
local.get $6
i64.store
local.get $0
i32.const 16
i32.add
local.get $6
i64.store
local.get $0
i32.const 24
i32.add
local.get $6
i64.store
local.get $2
i32.const 32
i32.sub
local.set $2
local.get $0
i32.const 32
i32.add
local.set $0
br $continue|0
end
unreachable
end
local.get $3
)

View File

@ -171,8 +171,12 @@
loop $continue|0
local.get $1
i32.const 10
i32.div_u
i32.rem_u
local.set $3
local.get $1
i32.const 10
i32.div_u
local.set $1
local.get $2
i32.const 1
i32.sub
@ -181,14 +185,11 @@
i32.shl
local.get $0
i32.add
local.get $1
i32.const 10
i32.rem_u
local.get $3
i32.const 48
i32.add
i32.store16
local.get $3
local.tee $1
local.get $1
br_if $continue|0
end
)
@ -523,79 +524,77 @@
i64.add
local.tee $1
local.get $5
i64.le_u
if
global.get $~lib/util/number/_K
local.get $4
i32.add
global.set $~lib/util/number/_K
local.get $4
i32.const 2
i32.shl
local.get $12
i32.add
i64.load32_u
local.get $10
i64.extend_i32_s
i64.shl
local.set $3
local.get $2
i64.gt_u
br_if $continue|0
global.get $~lib/util/number/_K
local.get $4
i32.add
global.set $~lib/util/number/_K
local.get $4
i32.const 2
i32.shl
local.get $12
i32.add
i64.load32_u
local.get $10
i64.extend_i32_s
i64.shl
local.set $3
local.get $2
i32.const 1
i32.sub
i32.const 1
i32.shl
local.get $0
i32.add
local.tee $0
i32.load16_u
local.set $4
loop $continue|2
i32.const 1
i32.sub
i32.const 1
i32.shl
local.get $0
i32.add
local.tee $0
i32.load16_u
local.set $4
loop $continue|2
local.get $9
local.get $1
i64.sub
local.get $1
local.get $3
i64.add
local.tee $8
local.get $9
i64.sub
i64.gt_u
local.get $8
local.get $9
i64.lt_u
select
i32.const 0
local.get $5
local.get $1
i64.sub
local.get $3
i64.ge_u
i32.const 0
local.get $1
local.get $9
i64.lt_u
select
select
if
local.get $4
i32.const 1
local.get $9
local.get $1
i64.sub
i32.sub
local.set $4
local.get $1
local.get $3
i64.add
local.tee $8
local.get $9
i64.sub
i64.gt_u
local.get $8
local.get $9
i64.lt_u
select
i32.const 0
local.get $5
local.get $1
i64.sub
local.get $3
i64.ge_u
i32.const 0
local.get $1
local.get $9
i64.lt_u
select
select
if
local.get $4
i32.const 1
i32.sub
local.set $4
local.get $1
local.get $3
i64.add
local.set $1
br $continue|2
end
local.set $1
br $continue|2
end
local.get $0
local.get $4
i32.store16
local.get $2
return
end
br $continue|0
local.get $0
local.get $4
i32.store16
local.get $2
return
end
end
loop $continue|3
@ -773,7 +772,8 @@
loop $continue|1
local.get $3
i32.const 8
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $1
@ -855,7 +855,8 @@
loop $continue|4
local.get $3
i32.const 8
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $3
@ -923,7 +924,7 @@
i32.const 0
end
if (result i32)
loop $repeat|0
loop $loop|0
block $break|0
local.get $1
local.get $3
@ -940,7 +941,7 @@
i32.const 1
i32.add
local.set $1
br $repeat|0
br $loop|0
end
end
local.get $3
@ -1012,7 +1013,7 @@
i32.store
i32.const 2
local.set $2
loop $repeat|1
loop $loop|1
block $break|1
local.get $2
local.get $3
@ -1029,7 +1030,7 @@
i32.const 1
i32.add
local.set $2
br $repeat|1
br $loop|1
end
end
local.get $1
@ -1047,23 +1048,21 @@
i32.const 4
i32.add
local.tee $0
block (result i32)
local.get $3
i32.const 1
i32.sub
local.tee $2
local.get $3
i32.const 1
i32.sub
local.tee $2
i32.const 0
i32.lt_s
local.tee $1
if
i32.const 0
i32.lt_s
local.tee $1
if
i32.const 0
local.get $2
i32.sub
local.set $2
end
local.get $2
i32.sub
local.set $2
end
local.get $2
local.get $2
call $~lib/util/number/decimalCount32
i32.const 1
i32.add
@ -1105,23 +1104,21 @@
i32.const 4
i32.add
local.tee $2
block (result i32)
local.get $3
i32.const 1
i32.sub
local.tee $0
local.get $3
i32.const 1
i32.sub
local.tee $0
i32.const 0
i32.lt_s
local.tee $3
if
i32.const 0
i32.lt_s
local.tee $3
if
i32.const 0
local.get $0
i32.sub
local.set $0
end
local.get $0
i32.sub
local.set $0
end
local.get $0
local.get $0
call $~lib/util/number/decimalCount32
i32.const 1
i32.add

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -174,26 +174,25 @@
block $break|0
loop $continue|0
local.get $0
i32.eqz
br_if $break|0
i32.const 0
local.tee $1
local.get $0
local.tee $2
i32.ne
if
block (result i32)
i32.const 0
local.tee $1
local.get $0
local.tee $2
i32.ne
if
local.get $1
call $~lib/rt/stub/__retain
drop
local.get $2
call $~lib/rt/stub/__release
end
local.get $1
end
local.set $0
br $continue|0
local.get $1
call $~lib/rt/stub/__retain
drop
local.get $2
call $~lib/rt/stub/__release
end
local.get $1
local.set $0
br $continue|0
end
unreachable
end
local.get $0
call $~lib/rt/stub/__release
@ -210,26 +209,25 @@
block $break|0
loop $continue|0
local.get $0
i32.eqz
br_if $break|0
local.get $1
local.tee $2
local.get $0
local.tee $3
i32.ne
if
block (result i32)
local.get $1
local.tee $2
local.get $0
local.tee $3
i32.ne
if
local.get $2
call $~lib/rt/stub/__retain
drop
local.get $3
call $~lib/rt/stub/__release
end
local.get $2
end
local.set $0
br $continue|0
local.get $2
call $~lib/rt/stub/__retain
drop
local.get $3
call $~lib/rt/stub/__release
end
local.get $2
local.set $0
br $continue|0
end
unreachable
end
local.get $0
call $~lib/rt/stub/__release
@ -248,29 +246,28 @@
block $break|0
loop $continue|0
local.get $0
i32.eqz
br_if $break|0
local.get $1
if
local.get $1
local.tee $2
local.get $0
local.tee $3
i32.ne
if
block (result i32)
local.get $1
local.tee $2
local.get $0
local.tee $3
i32.ne
if
local.get $2
call $~lib/rt/stub/__retain
drop
local.get $3
call $~lib/rt/stub/__release
end
local.get $2
end
local.set $0
local.get $2
call $~lib/rt/stub/__retain
drop
local.get $3
call $~lib/rt/stub/__release
end
br $continue|0
local.get $2
local.set $0
end
br $continue|0
end
unreachable
end
local.get $0
call $~lib/rt/stub/__release
@ -387,21 +384,19 @@
local.get $1
call $~lib/rt/stub/__retain
drop
block (result i32)
local.get $1
local.tee $2
local.get $0
local.tee $3
i32.ne
if
local.get $2
call $~lib/rt/stub/__retain
drop
local.get $3
call $~lib/rt/stub/__release
end
local.get $1
local.tee $2
local.get $0
local.tee $3
i32.ne
if
local.get $2
call $~lib/rt/stub/__retain
drop
local.get $3
call $~lib/rt/stub/__release
end
local.get $2
local.set $0
local.get $0
call $~lib/rt/stub/__release

View File

@ -719,7 +719,7 @@
i32.store
i32.const 0
local.set $0
loop $repeat|0
loop $loop|0
block $break|0
local.get $0
i32.const 23
@ -734,7 +734,7 @@
i32.store offset=4
i32.const 0
local.set $1
loop $repeat|1
loop $loop|1
block $break|1
local.get $1
i32.const 16
@ -755,14 +755,14 @@
i32.const 1
i32.add
local.set $1
br $repeat|1
br $loop|1
end
end
local.get $0
i32.const 1
i32.add
local.set $0
br $repeat|0
br $loop|0
end
end
i32.const 304
@ -1175,7 +1175,8 @@
loop $continue|1
local.get $3
i32.const 8
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $1
@ -1257,7 +1258,8 @@
loop $continue|4
local.get $3
i32.const 8
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $3

File diff suppressed because it is too large Load Diff

View File

@ -717,7 +717,7 @@
i32.store
i32.const 0
local.set $0
loop $repeat|0
loop $loop|0
block $break|0
local.get $0
i32.const 23
@ -732,7 +732,7 @@
i32.store offset=4
i32.const 0
local.set $1
loop $repeat|1
loop $loop|1
block $break|1
local.get $1
i32.const 16
@ -753,14 +753,14 @@
i32.const 1
i32.add
local.set $1
br $repeat|1
br $loop|1
end
end
local.get $0
i32.const 1
i32.add
local.set $0
br $repeat|0
br $loop|0
end
end
i32.const 320
@ -1172,7 +1172,8 @@
loop $continue|1
local.get $3
i32.const 8
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $1
@ -1254,7 +1255,8 @@
loop $continue|4
local.get $3
i32.const 8
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $3

File diff suppressed because it is too large Load Diff

View File

@ -619,7 +619,7 @@
i32.store
i32.const 0
local.set $0
loop $repeat|0
loop $loop|0
block $break|0
local.get $0
i32.const 23
@ -634,7 +634,7 @@
i32.store offset=4
i32.const 0
local.set $1
loop $repeat|1
loop $loop|1
block $break|1
local.get $1
i32.const 16
@ -655,14 +655,14 @@
i32.const 1
i32.add
local.set $1
br $repeat|1
br $loop|1
end
end
local.get $0
i32.const 1
i32.add
local.set $0
br $repeat|0
br $loop|0
end
end
i32.const 304
@ -1179,7 +1179,8 @@
loop $continue|1
local.get $3
i32.const 8
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $1
@ -1261,7 +1262,8 @@
loop $continue|4
local.get $3
i32.const 8
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $3

File diff suppressed because it is too large Load Diff

View File

@ -619,7 +619,7 @@
i32.store
i32.const 0
local.set $0
loop $repeat|0
loop $loop|0
block $break|0
local.get $0
i32.const 23
@ -634,7 +634,7 @@
i32.store offset=4
i32.const 0
local.set $1
loop $repeat|1
loop $loop|1
block $break|1
local.get $1
i32.const 16
@ -655,14 +655,14 @@
i32.const 1
i32.add
local.set $1
br $repeat|1
br $loop|1
end
end
local.get $0
i32.const 1
i32.add
local.set $0
br $repeat|0
br $loop|0
end
end
i32.const 304
@ -1179,7 +1179,8 @@
loop $continue|1
local.get $3
i32.const 8
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $1
@ -1261,7 +1262,8 @@
loop $continue|4
local.get $3
i32.const 8
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $3

File diff suppressed because it is too large Load Diff

View File

@ -619,7 +619,7 @@
i32.store
i32.const 0
local.set $0
loop $repeat|0
loop $loop|0
block $break|0
local.get $0
i32.const 23
@ -634,7 +634,7 @@
i32.store offset=4
i32.const 0
local.set $1
loop $repeat|1
loop $loop|1
block $break|1
local.get $1
i32.const 16
@ -655,14 +655,14 @@
i32.const 1
i32.add
local.set $1
br $repeat|1
br $loop|1
end
end
local.get $0
i32.const 1
i32.add
local.set $0
br $repeat|0
br $loop|0
end
end
i32.const 304
@ -1167,7 +1167,8 @@
loop $continue|1
local.get $3
i32.const 8
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $1
@ -1249,7 +1250,8 @@
loop $continue|4
local.get $3
i32.const 8
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $3
@ -1595,7 +1597,7 @@
local.set $3
global.get $~lib/rt/pure/CUR
local.set $0
loop $repeat|0
loop $loop|0
block $break|0
local.get $3
local.get $0
@ -1655,14 +1657,14 @@
i32.const 4
i32.add
local.set $3
br $repeat|0
br $loop|0
end
end
local.get $2
global.set $~lib/rt/pure/CUR
local.get $5
local.set $0
loop $repeat|1
loop $loop|1
block $break|1
local.get $0
local.get $2
@ -1675,12 +1677,12 @@
i32.const 4
i32.add
local.set $0
br $repeat|1
br $loop|1
end
end
local.get $5
local.set $0
loop $repeat|2
loop $loop|2
block $break|2
local.get $0
local.get $2
@ -1700,7 +1702,7 @@
i32.const 4
i32.add
local.set $0
br $repeat|2
br $loop|2
end
end
local.get $5

File diff suppressed because it is too large Load Diff

View File

@ -621,7 +621,7 @@
i32.store
i32.const 0
local.set $0
loop $repeat|0
loop $loop|0
block $break|0
local.get $0
i32.const 23
@ -636,7 +636,7 @@
i32.store offset=4
i32.const 0
local.set $1
loop $repeat|1
loop $loop|1
block $break|1
local.get $1
i32.const 16
@ -657,14 +657,14 @@
i32.const 1
i32.add
local.set $1
br $repeat|1
br $loop|1
end
end
local.get $0
i32.const 1
i32.add
local.set $0
br $repeat|0
br $loop|0
end
end
i32.const 304
@ -1190,7 +1190,8 @@
loop $continue|1
local.get $3
i32.const 8
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $1
@ -1272,7 +1273,8 @@
loop $continue|4
local.get $3
i32.const 8
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $3

File diff suppressed because it is too large Load Diff

View File

@ -12,7 +12,7 @@
(local $0 i32)
i32.const -128
local.set $0
loop $repeat|0
loop $loop|0
local.get $0
i32.const 255
i32.le_s
@ -21,7 +21,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|0
br $loop|0
end
end
i32.const -1

View File

@ -404,7 +404,7 @@
block $break|0
global.get $~lib/builtins/i8.MIN_VALUE
local.set $0
loop $repeat|0
loop $loop|0
local.get $0
i32.const 255
i32.le_s
@ -450,8 +450,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|0
unreachable
br $loop|0
end
unreachable
end

View File

@ -628,7 +628,7 @@
i32.store
i32.const 0
local.set $0
loop $repeat|0
loop $loop|0
block $break|0
local.get $0
i32.const 23
@ -643,7 +643,7 @@
i32.store offset=4
i32.const 0
local.set $1
loop $repeat|1
loop $loop|1
block $break|1
local.get $1
i32.const 16
@ -664,14 +664,14 @@
i32.const 1
i32.add
local.set $1
br $repeat|1
br $loop|1
end
end
local.get $0
i32.const 1
i32.add
local.set $0
br $repeat|0
br $loop|0
end
end
i32.const 752
@ -1182,7 +1182,8 @@
loop $continue|1
local.get $3
i32.const 8
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $1
@ -1264,7 +1265,8 @@
loop $continue|4
local.get $3
i32.const 8
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $3
@ -1786,14 +1788,12 @@
i32.and
local.tee $1
i32.sub
local.set $2
local.get $0
local.get $1
i32.add
local.tee $0
i32.const 0
i32.store
local.get $2
i32.const -4
i32.and
local.tee $1
@ -2110,10 +2110,8 @@
if
i32.const 584
call $~lib/rt/pure/__retain
local.set $0
local.get $1
call $~lib/rt/pure/__release
local.get $0
return
end
local.get $2
@ -2148,12 +2146,10 @@
select
local.get $1
call $~lib/string/String#concat
local.set $2
local.get $0
call $~lib/rt/pure/__release
local.get $1
call $~lib/rt/pure/__release
local.get $2
)
(func $~lib/rt/pure/markGray (; 36 ;) (type $FUNCSIG$vi) (param $0 i32)
(local $1 i32)
@ -2272,7 +2268,7 @@
local.set $3
global.get $~lib/rt/pure/CUR
local.set $0
loop $repeat|0
loop $loop|0
block $break|0
local.get $3
local.get $0
@ -2332,14 +2328,14 @@
i32.const 4
i32.add
local.set $3
br $repeat|0
br $loop|0
end
end
local.get $2
global.set $~lib/rt/pure/CUR
local.get $5
local.set $0
loop $repeat|1
loop $loop|1
block $break|1
local.get $0
local.get $2
@ -2352,12 +2348,12 @@
i32.const 4
i32.add
local.set $0
br $repeat|1
br $loop|1
end
end
local.get $5
local.set $0
loop $repeat|2
loop $loop|2
block $break|2
local.get $0
local.get $2
@ -2377,7 +2373,7 @@
i32.const 4
i32.add
local.set $0
br $repeat|2
br $loop|2
end
end
local.get $5
@ -2422,8 +2418,7 @@
i32.const 0
i32.store offset=12
local.get $0
local.set $1
loop $repeat|0
loop $loop|0
local.get $3
i32.const 10
i32.lt_s
@ -2442,7 +2437,7 @@
i32.store offset=12
i32.const 0
local.set $2
loop $repeat|1
loop $loop|1
local.get $2
i32.const 10
i32.lt_s
@ -2453,19 +2448,18 @@
i32.const 1
i32.add
local.set $2
br $repeat|1
br $loop|1
end
end
local.get $0
call $~lib/rt/pure/__release
local.get $3
i32.const 1
i32.add
local.set $3
br $repeat|0
local.get $0
call $~lib/rt/pure/__release
br $loop|0
end
end
local.get $1
call $~lib/rt/pure/__release
i32.const 600
call $~lib/rt/pure/__retain
@ -2477,14 +2471,12 @@
local.tee $2
i32.const 672
call $~lib/string/String.__concat
local.set $3
local.get $0
call $~lib/rt/pure/__release
local.get $1
call $~lib/rt/pure/__release
local.get $2
call $~lib/rt/pure/__release
local.get $3
call $~lib/rt/pure/__release
i32.const 4
i32.const 6
@ -2494,7 +2486,6 @@
i32.const 0
i32.store
local.get $0
local.set $3
i32.const 4
i32.const 7
call $~lib/rt/tlsf/__alloc
@ -2516,7 +2507,6 @@
local.get $4
call $~lib/rt/pure/__release
end
local.get $3
local.get $2
i32.store
local.get $0

File diff suppressed because it is too large Load Diff

View File

@ -152,8 +152,6 @@
(func $retain-release/assignGlobal (; 8 ;) (type $FUNCSIG$v)
(local $0 i32)
global.get $retain-release/REF
local.set $0
local.get $0
global.set $retain-release/glo
)
(func $retain-release/assignField (; 9 ;) (type $FUNCSIG$v)

View File

@ -257,21 +257,19 @@
(func $retain-release/assignGlobal (; 16 ;) (type $FUNCSIG$v)
(local $0 i32)
(local $1 i32)
block (result i32)
global.get $retain-release/REF
local.tee $0
global.get $retain-release/glo
local.tee $1
i32.ne
if
local.get $0
call $~lib/rt/stub/__retain
drop
local.get $1
call $~lib/rt/stub/__release
end
global.get $retain-release/REF
local.tee $0
global.get $retain-release/glo
local.tee $1
i32.ne
if
local.get $0
call $~lib/rt/stub/__retain
drop
local.get $1
call $~lib/rt/stub/__release
end
local.get $0
global.set $retain-release/glo
)
(func $retain-release/assignField (; 17 ;) (type $FUNCSIG$v)
@ -279,22 +277,20 @@
(local $1 i32)
global.get $retain-release/TARGET
local.tee $0
block (result i32)
global.get $retain-release/REF
local.tee $1
local.get $0
i32.load
local.tee $0
i32.ne
if
local.get $1
call $~lib/rt/stub/__retain
drop
local.get $0
call $~lib/rt/stub/__release
end
global.get $retain-release/REF
local.tee $1
local.get $0
i32.load
local.tee $0
i32.ne
if
local.get $1
call $~lib/rt/stub/__retain
drop
local.get $0
call $~lib/rt/stub/__release
end
local.get $1
i32.store
)
(func $retain-release/scopeBlock (; 18 ;) (type $FUNCSIG$v)
@ -315,21 +311,19 @@
global.get $retain-release/REF
call $~lib/rt/stub/__retain
local.set $1
block (result i32)
local.get $1
local.tee $2
local.get $0
local.tee $3
i32.ne
if
local.get $2
call $~lib/rt/stub/__retain
drop
local.get $3
call $~lib/rt/stub/__release
end
local.get $1
local.tee $2
local.get $0
local.tee $3
i32.ne
if
local.get $2
call $~lib/rt/stub/__retain
drop
local.get $3
call $~lib/rt/stub/__release
end
local.get $2
local.set $0
local.get $1
call $~lib/rt/stub/__release
@ -347,21 +341,19 @@
global.get $retain-release/REF
call $~lib/rt/stub/__retain
local.set $1
block (result i32)
local.get $1
local.tee $2
local.get $0
local.tee $3
i32.ne
if
local.get $2
call $~lib/rt/stub/__retain
drop
local.get $3
call $~lib/rt/stub/__release
end
local.get $1
local.tee $2
local.get $0
local.tee $3
i32.ne
if
local.get $2
call $~lib/rt/stub/__retain
drop
local.get $3
call $~lib/rt/stub/__release
end
local.get $2
local.set $0
local.get $1
call $~lib/rt/stub/__release
@ -377,41 +369,37 @@
local.set $1
local.get $0
if
block (result i32)
global.get $retain-release/REF
local.tee $2
local.get $1
local.tee $3
i32.ne
if
local.get $2
call $~lib/rt/stub/__retain
drop
local.get $3
call $~lib/rt/stub/__release
end
global.get $retain-release/REF
local.tee $2
local.get $1
local.tee $3
i32.ne
if
local.get $2
call $~lib/rt/stub/__retain
drop
local.get $3
call $~lib/rt/stub/__release
end
local.get $2
local.set $1
end
global.get $retain-release/REF
call $~lib/rt/stub/__retain
local.set $2
block (result i32)
local.get $2
local.tee $3
local.get $1
local.tee $4
i32.ne
if
local.get $3
call $~lib/rt/stub/__retain
drop
local.get $4
call $~lib/rt/stub/__release
end
local.get $2
local.tee $3
local.get $1
local.tee $4
i32.ne
if
local.get $3
call $~lib/rt/stub/__retain
drop
local.get $4
call $~lib/rt/stub/__release
end
local.get $3
local.set $1
local.get $2
call $~lib/rt/stub/__release
@ -441,21 +429,19 @@
local.set $1
local.get $0
if
block (result i32)
global.get $retain-release/REF
local.tee $2
local.get $1
local.tee $3
i32.ne
if
local.get $2
call $~lib/rt/stub/__retain
drop
local.get $3
call $~lib/rt/stub/__release
end
global.get $retain-release/REF
local.tee $2
local.get $1
local.tee $3
i32.ne
if
local.get $2
call $~lib/rt/stub/__retain
drop
local.get $3
call $~lib/rt/stub/__release
end
local.get $2
local.set $1
end
local.get $1
@ -490,37 +476,9 @@
end
)
(func $retain-release/scopeWhile (; 27 ;) (type $FUNCSIG$vi) (param $0 i32)
(local $1 i32)
loop $continue|0
local.get $0
if
global.get $retain-release/REF
call $~lib/rt/stub/__retain
local.set $1
local.get $1
call $~lib/rt/stub/__release
br $continue|0
end
end
)
(func $retain-release/scopeDo (; 28 ;) (type $FUNCSIG$vi) (param $0 i32)
(local $1 i32)
loop $continue|0
block
global.get $retain-release/REF
call $~lib/rt/stub/__retain
local.set $1
local.get $1
call $~lib/rt/stub/__release
end
local.get $0
br_if $continue|0
end
)
(func $retain-release/scopeFor (; 29 ;) (type $FUNCSIG$vi) (param $0 i32)
(local $1 i32)
block $break|0
loop $repeat|0
loop $continue|0
local.get $0
i32.eqz
br_if $break|0
@ -529,8 +487,34 @@
local.set $1
local.get $1
call $~lib/rt/stub/__release
br $repeat|0
unreachable
br $continue|0
end
unreachable
end
)
(func $retain-release/scopeDo (; 28 ;) (type $FUNCSIG$vi) (param $0 i32)
(local $1 i32)
loop $continue|0
global.get $retain-release/REF
call $~lib/rt/stub/__retain
local.set $1
local.get $0
br_if $continue|0
end
)
(func $retain-release/scopeFor (; 29 ;) (type $FUNCSIG$vi) (param $0 i32)
(local $1 i32)
block $break|0
loop $loop|0
local.get $0
i32.eqz
br_if $break|0
global.get $retain-release/REF
call $~lib/rt/stub/__retain
local.set $1
local.get $1
call $~lib/rt/stub/__release
br $loop|0
end
unreachable
end
@ -538,24 +522,24 @@
(func $retain-release/scopeBreak (; 30 ;) (type $FUNCSIG$vi) (param $0 i32)
(local $1 i32)
block $break|0
loop $continue|0
local.get $0
if
global.get $retain-release/REF
call $~lib/rt/stub/__retain
local.set $1
local.get $1
call $~lib/rt/stub/__release
br $break|0
end
end
local.get $0
i32.eqz
br_if $break|0
global.get $retain-release/REF
call $~lib/rt/stub/__retain
local.set $1
local.get $1
call $~lib/rt/stub/__release
br $break|0
end
)
(func $retain-release/scopeContinue (; 31 ;) (type $FUNCSIG$vi) (param $0 i32)
(local $1 i32)
loop $continue|0
local.get $0
if
block $break|0
loop $continue|0
local.get $0
i32.eqz
br_if $break|0
global.get $retain-release/REF
call $~lib/rt/stub/__retain
local.set $1
@ -563,44 +547,41 @@
call $~lib/rt/stub/__release
br $continue|0
end
unreachable
end
)
(func $retain-release/scopeThrow (; 32 ;) (type $FUNCSIG$vi) (param $0 i32)
(local $1 i32)
loop $continue|0
block $break|0
local.get $0
if
global.get $retain-release/REF
call $~lib/rt/stub/__retain
local.set $1
local.get $1
call $~lib/rt/stub/__release
block
i32.const 24
i32.const 56
i32.const 313
i32.const 4
call $~lib/builtins/abort
unreachable
unreachable
end
unreachable
end
i32.eqz
br_if $break|0
global.get $retain-release/REF
call $~lib/rt/stub/__retain
local.set $1
local.get $1
call $~lib/rt/stub/__release
i32.const 24
i32.const 56
i32.const 313
i32.const 4
call $~lib/builtins/abort
unreachable
end
)
(func $retain-release/scopeUnreachable (; 33 ;) (type $FUNCSIG$vi) (param $0 i32)
(local $1 i32)
loop $continue|0
local.get $0
if
block $break|0
loop $continue|0
local.get $0
i32.eqz
br_if $break|0
global.get $retain-release/REF
call $~lib/rt/stub/__retain
local.set $1
unreachable
local.get $1
call $~lib/rt/stub/__release
br $continue|0
end
unreachable
end
)
(func $retain-release/callInline (; 34 ;) (type $FUNCSIG$v)
@ -621,10 +602,8 @@
)
(func $retain-release/receiveRefInline (; 36 ;) (type $FUNCSIG$v)
(local $0 i32)
block $retain-release/returnRefInline|inlined.0 (result i32)
global.get $retain-release/REF
call $~lib/rt/stub/__retain
end
global.get $retain-release/REF
call $~lib/rt/stub/__retain
local.tee $0
i32.eqz
drop
@ -632,10 +611,8 @@
call $~lib/rt/stub/__release
)
(func $retain-release/receiveRefInlineDrop (; 37 ;) (type $FUNCSIG$v)
block $retain-release/returnRefInline|inlined.1 (result i32)
global.get $retain-release/REF
call $~lib/rt/stub/__retain
end
global.get $retain-release/REF
call $~lib/rt/stub/__retain
call $~lib/rt/stub/__release
)
(func $retain-release/provideRefIndirect (; 38 ;) (type $FUNCSIG$vi) (param $0 i32)
@ -647,13 +624,11 @@
)
(func $retain-release/receiveRefIndirect (; 39 ;) (type $FUNCSIG$vi) (param $0 i32)
(local $1 i32)
block (result i32)
i32.const 0
global.set $~lib/argc
local.get $0
call_indirect (type $FUNCSIG$i)
local.tee $1
end
i32.const 0
global.set $~lib/argc
local.get $0
call_indirect (type $FUNCSIG$i)
local.tee $1
i32.eqz
drop
local.get $1

View File

@ -238,11 +238,9 @@
i32.const 0
call $rt/instanceof/BlackCat#constructor
global.set $rt/instanceof/blackcat
block (result i32)
global.get $rt/instanceof/animal
drop
i32.const 1
end
global.get $rt/instanceof/animal
drop
i32.const 1
i32.eqz
if
i32.const 0
@ -292,11 +290,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $rt/instanceof/cat
drop
i32.const 1
end
global.get $rt/instanceof/cat
drop
i32.const 1
i32.eqz
if
i32.const 0
@ -345,11 +341,9 @@
call $~lib/builtins/abort
unreachable
end
block (result i32)
global.get $rt/instanceof/blackcat
drop
i32.const 1
end
global.get $rt/instanceof/blackcat
drop
i32.const 1
i32.eqz
if
i32.const 0

View File

@ -618,7 +618,7 @@
i32.store
i32.const 0
local.set $0
loop $repeat|0
loop $loop|0
block $break|0
local.get $0
i32.const 23
@ -633,7 +633,7 @@
i32.store offset=4
i32.const 0
local.set $1
loop $repeat|1
loop $loop|1
block $break|1
local.get $1
i32.const 16
@ -654,14 +654,14 @@
i32.const 1
i32.add
local.set $1
br $repeat|1
br $loop|1
end
end
local.get $0
i32.const 1
i32.add
local.set $0
br $repeat|0
br $loop|0
end
end
i32.const 288
@ -1166,7 +1166,8 @@
loop $continue|1
local.get $3
i32.const 8
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $1
@ -1248,7 +1249,8 @@
loop $continue|4
local.get $3
i32.const 8
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $3
@ -1594,7 +1596,7 @@
local.set $3
global.get $~lib/rt/pure/CUR
local.set $0
loop $repeat|0
loop $loop|0
block $break|0
local.get $3
local.get $0
@ -1654,14 +1656,14 @@
i32.const 4
i32.add
local.set $3
br $repeat|0
br $loop|0
end
end
local.get $2
global.set $~lib/rt/pure/CUR
local.get $5
local.set $0
loop $repeat|1
loop $loop|1
block $break|1
local.get $0
local.get $2
@ -1674,12 +1676,12 @@
i32.const 4
i32.add
local.set $0
br $repeat|1
br $loop|1
end
end
local.get $5
local.set $0
loop $repeat|2
loop $loop|2
block $break|2
local.get $0
local.get $2
@ -1699,7 +1701,7 @@
i32.const 4
i32.add
local.set $0
br $repeat|2
br $loop|2
end
end
local.get $5

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,7 @@
(start $start)
(func $start:scoped (; 0 ;) (type $FUNCSIG$v)
(local $0 i32)
loop $repeat|0
loop $loop|0
local.get $0
i32.const 1
i32.lt_s
@ -14,12 +14,12 @@
i32.const 1
i32.add
local.set $0
br $repeat|0
br $loop|0
end
end
i32.const 0
local.set $0
loop $repeat|1
loop $loop|1
local.get $0
i32.const 1
i32.lt_s
@ -28,7 +28,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|1
br $loop|1
end
end
)

View File

@ -24,7 +24,7 @@
block $break|0
i32.const 0
local.set $0
loop $repeat|0
loop $loop|0
local.get $0
i32.const 1
i32.lt_s
@ -35,15 +35,14 @@
i32.const 1
i32.add
local.set $0
br $repeat|0
unreachable
br $loop|0
end
unreachable
end
block $break|1
i32.const 0
local.set $1
loop $repeat|1
loop $loop|1
local.get $1
i32.const 1
i32.lt_s
@ -55,17 +54,14 @@
i32.const 1
i32.add
local.set $1
br $repeat|1
unreachable
br $loop|1
end
unreachable
end
block
i64.const 5
local.set $2
f32.const 10
local.set $3
end
i64.const 5
local.set $2
f32.const 10
local.set $3
i32.const 42
call $scoped/fn
)

View File

@ -222,22 +222,23 @@
else
i32.const 0
end
if
local.get $4
i32.const 1
i32.sub
local.set $4
local.get $6
i32.const 2
i32.add
local.set $6
local.get $7
i32.const 2
i32.add
local.set $7
br $continue|0
end
i32.eqz
br_if $break|0
local.get $4
i32.const 1
i32.sub
local.set $4
local.get $6
i32.const 2
i32.add
local.set $6
local.get $7
i32.const 2
i32.add
local.set $7
br $continue|0
end
unreachable
end
local.get $5
local.set $8
@ -272,21 +273,19 @@
i32.const 0
i32.eq
if
block (result i32)
i32.const 304
local.tee $3
local.get $1
local.tee $4
i32.ne
if
local.get $3
call $~lib/rt/stub/__retain
drop
local.get $4
call $~lib/rt/stub/__release
end
i32.const 304
local.tee $3
local.get $1
local.tee $4
i32.ne
if
local.get $3
call $~lib/rt/stub/__retain
drop
local.get $4
call $~lib/rt/stub/__release
end
local.get $3
local.set $1
end
local.get $0

View File

@ -674,7 +674,7 @@
i32.store
i32.const 0
local.set $0
loop $repeat|0
loop $loop|0
block $break|0
local.get $0
i32.const 23
@ -689,7 +689,7 @@
i32.store offset=4
i32.const 0
local.set $1
loop $repeat|1
loop $loop|1
block $break|1
local.get $1
i32.const 16
@ -710,14 +710,14 @@
i32.const 1
i32.add
local.set $1
br $repeat|1
br $loop|1
end
end
local.get $0
i32.const 1
i32.add
local.set $0
br $repeat|0
br $loop|0
end
end
i32.const 608
@ -1182,7 +1182,8 @@
loop $continue|1
local.get $3
i32.const 8
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $1
@ -1264,7 +1265,8 @@
loop $continue|4
local.get $3
i32.const 8
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $3

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -625,7 +625,7 @@
i32.store
i32.const 0
local.set $0
loop $repeat|0
loop $loop|0
block $break|0
local.get $0
i32.const 23
@ -640,7 +640,7 @@
i32.store offset=4
i32.const 0
local.set $1
loop $repeat|1
loop $loop|1
block $break|1
local.get $1
i32.const 16
@ -661,14 +661,14 @@
i32.const 1
i32.add
local.set $1
br $repeat|1
br $loop|1
end
end
local.get $0
i32.const 1
i32.add
local.set $0
br $repeat|0
br $loop|0
end
end
i32.const 624
@ -1183,7 +1183,8 @@
loop $continue|1
local.get $3
i32.const 8
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $1
@ -1265,7 +1266,8 @@
loop $continue|4
local.get $3
i32.const 8
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $3
@ -1873,10 +1875,8 @@
i32.const -1
i32.const 1073741808
call $~lib/arraybuffer/ArrayBuffer#slice
local.set $0
local.get $1
call $~lib/rt/pure/__release
local.get $0
local.tee $1
call $~lib/arraybuffer/ArrayBuffer#get:byteLength
i32.const 1
@ -1893,10 +1893,8 @@
i32.const 1
i32.const 3
call $~lib/arraybuffer/ArrayBuffer#slice
local.set $0
local.get $1
call $~lib/rt/pure/__release
local.get $0
local.tee $1
call $~lib/arraybuffer/ArrayBuffer#get:byteLength
i32.const 2
@ -1913,10 +1911,8 @@
i32.const 1
i32.const -1
call $~lib/arraybuffer/ArrayBuffer#slice
local.set $0
local.get $1
call $~lib/rt/pure/__release
local.get $0
local.tee $1
call $~lib/arraybuffer/ArrayBuffer#get:byteLength
i32.const 6
@ -2071,7 +2067,6 @@
i32.const 2
call $~lib/arraybuffer/ArrayBufferView#constructor
local.tee $0
local.set $6
local.get $0
call $~lib/arraybuffer/ArrayBuffer.isView<~lib/typedarray/Uint8Array>
i32.eqz
@ -2128,7 +2123,6 @@
call $~lib/rt/pure/__release
local.get $5
call $~lib/rt/pure/__release
local.get $6
call $~lib/rt/pure/__release
local.get $7
call $~lib/rt/pure/__release

File diff suppressed because it is too large Load Diff

View File

@ -631,7 +631,7 @@
i32.store
i32.const 0
local.set $0
loop $repeat|0
loop $loop|0
block $break|0
local.get $0
i32.const 23
@ -646,7 +646,7 @@
i32.store offset=4
i32.const 0
local.set $1
loop $repeat|1
loop $loop|1
block $break|1
local.get $1
i32.const 16
@ -667,14 +667,14 @@
i32.const 1
i32.add
local.set $1
br $repeat|1
br $loop|1
end
end
local.get $0
i32.const 1
i32.add
local.set $0
br $repeat|0
br $loop|0
end
end
i32.const 560
@ -1185,7 +1185,8 @@
loop $continue|1
local.get $3
i32.const 8
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $1
@ -1267,7 +1268,8 @@
loop $continue|4
local.get $3
i32.const 8
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $3

File diff suppressed because it is too large Load Diff

View File

@ -118,21 +118,19 @@
local.get $0
)
(func $~lib/date/Date#constructor (; 5 ;) (type $FUNCSIG$iij) (param $0 i32) (param $1 i64) (result i32)
block (result i32)
local.get $0
i32.eqz
if
i32.const 8
i32.const 3
call $~lib/rt/stub/__alloc
call $~lib/rt/stub/__retain
local.set $0
end
local.get $0
i64.const 0
i64.store
local.get $0
local.get $0
i32.eqz
if
i32.const 8
i32.const 3
call $~lib/rt/stub/__alloc
call $~lib/rt/stub/__retain
local.set $0
end
local.get $0
i64.const 0
i64.store
local.get $0
local.get $1
i64.store
local.get $0
@ -155,32 +153,30 @@
(local $4 i32)
(local $5 i32)
(local $6 i64)
block $~lib/date/Date.UTC|inlined.0 (result i64)
i32.const 1970
local.set $2
i32.const 0
local.set $1
i32.const 1
local.set $0
i32.const 0
local.set $3
i32.const 0
local.set $4
i32.const 0
local.set $5
i64.const 0
local.set $6
local.get $2
local.get $1
local.get $0
local.get $3
local.get $4
local.get $5
local.get $6
f64.convert_i64_s
call $~lib/bindings/Date/UTC
i64.trunc_f64_s
end
i32.const 1970
local.set $2
i32.const 0
local.set $1
i32.const 1
local.set $0
i32.const 0
local.set $3
i32.const 0
local.set $4
i32.const 0
local.set $5
i64.const 0
local.set $6
local.get $2
local.get $1
local.get $0
local.get $3
local.get $4
local.get $5
local.get $6
f64.convert_i64_s
call $~lib/bindings/Date/UTC
i64.trunc_f64_s
i64.const 0
i64.eq
i32.eqz
@ -192,32 +188,30 @@
call $~lib/builtins/abort
unreachable
end
block $~lib/date/Date.UTC|inlined.1 (result i64)
i32.const 1970
local.set $5
i32.const 0
local.set $4
i32.const 1
local.set $3
i32.const 0
local.set $2
i32.const 0
local.set $1
i32.const 0
local.set $0
i64.const 0
local.set $6
local.get $5
local.get $4
local.get $3
local.get $2
local.get $1
local.get $0
local.get $6
f64.convert_i64_s
call $~lib/bindings/Date/UTC
i64.trunc_f64_s
end
i32.const 1970
local.set $5
i32.const 0
local.set $4
i32.const 1
local.set $3
i32.const 0
local.set $2
i32.const 0
local.set $1
i32.const 0
local.set $0
i64.const 0
local.set $6
local.get $5
local.get $4
local.get $3
local.get $2
local.get $1
local.get $0
local.get $6
f64.convert_i64_s
call $~lib/bindings/Date/UTC
i64.trunc_f64_s
i64.const 0
i64.eq
i32.eqz
@ -229,32 +223,30 @@
call $~lib/builtins/abort
unreachable
end
block $~lib/date/Date.UTC|inlined.2 (result i64)
i32.const 2018
local.set $5
i32.const 10
local.set $4
i32.const 10
local.set $3
i32.const 11
local.set $2
i32.const 0
local.set $1
i32.const 0
local.set $0
i64.const 1
local.set $6
local.get $5
local.get $4
local.get $3
local.get $2
local.get $1
local.get $0
local.get $6
f64.convert_i64_s
call $~lib/bindings/Date/UTC
i64.trunc_f64_s
end
i32.const 2018
local.set $5
i32.const 10
local.set $4
i32.const 10
local.set $3
i32.const 11
local.set $2
i32.const 0
local.set $1
i32.const 0
local.set $0
i64.const 1
local.set $6
local.get $5
local.get $4
local.get $3
local.get $2
local.get $1
local.get $0
local.get $6
f64.convert_i64_s
call $~lib/bindings/Date/UTC
i64.trunc_f64_s
global.set $std/date/creationTime
global.get $std/date/creationTime
i64.const 1541847600001
@ -268,10 +260,8 @@
call $~lib/builtins/abort
unreachable
end
block $~lib/date/Date.now|inlined.0 (result i64)
call $~lib/bindings/Date/now
i64.trunc_f64_s
end
call $~lib/bindings/Date/now
i64.trunc_f64_s
global.get $std/date/creationTime
i64.gt_s
i32.eqz

View File

@ -27,7 +27,7 @@
i32.const 1
i32.shl
local.set $3
loop $repeat|0
loop $loop|0
local.get $2
local.get $3
i32.ge_u
@ -45,8 +45,7 @@
i32.const 1
i32.add
local.set $2
br $repeat|0
unreachable
br $loop|0
end
unreachable
end

View File

@ -40,16 +40,14 @@
i32.ne
if
block $break|0
block
i32.const 0
local.set $2
local.get $0
call $~lib/string/String#get:length
i32.const 1
i32.shl
local.set $3
end
loop $repeat|0
i32.const 0
local.set $2
local.get $0
call $~lib/string/String#get:length
i32.const 1
i32.shl
local.set $3
loop $loop|0
local.get $2
local.get $3
i32.lt_u
@ -68,8 +66,7 @@
i32.const 1
i32.add
local.set $2
br $repeat|0
unreachable
br $loop|0
end
unreachable
end

View File

@ -2260,10 +2260,8 @@
i64.lt_u
if
local.get $4
local.set $11
local.get $2
local.set $4
local.get $11
local.set $2
end
local.get $4
@ -6117,10 +6115,8 @@
i32.lt_u
if
local.get $3
local.set $5
local.get $2
local.set $3
local.get $5
local.set $2
end
local.get $3
@ -7959,7 +7955,6 @@
local.get $9
select
end
local.set $2
global.get $~lib/math/rempio2f_y
local.tee $3
local.get $3
@ -7999,7 +7994,6 @@
f64.mul
f64.add
local.set $1
local.get $2
i32.const 1
i32.and
if

File diff suppressed because it is too large Load Diff

View File

@ -635,7 +635,7 @@
i32.store
i32.const 0
local.set $0
loop $repeat|0
loop $loop|0
block $break|0
local.get $0
i32.const 23
@ -650,7 +650,7 @@
i32.store offset=4
i32.const 0
local.set $1
loop $repeat|1
loop $loop|1
block $break|1
local.get $1
i32.const 16
@ -671,14 +671,14 @@
i32.const 1
i32.add
local.set $1
br $repeat|1
br $loop|1
end
end
local.get $0
i32.const 1
i32.add
local.set $0
br $repeat|0
br $loop|0
end
end
i32.const 512
@ -1160,14 +1160,12 @@
i32.and
local.tee $1
i32.sub
local.set $2
local.get $0
local.get $1
i32.add
local.tee $0
i32.const 0
i32.store
local.get $2
i32.const -4
i32.and
local.tee $1
@ -1422,7 +1420,8 @@
loop $continue|1
local.get $3
i32.const 8
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $1
@ -1504,7 +1503,8 @@
loop $continue|4
local.get $3
i32.const 8
i32.ge_u
i32.lt_u
i32.eqz
if
local.get $0
local.get $3
@ -1843,13 +1843,15 @@
if
local.get $0
return
else
local.get $0
i32.load offset=8
i32.const -2
i32.and
local.set $0
br $continue|0
end
local.get $0
i32.load offset=8
i32.const -2
i32.and
local.set $0
br $continue|0
unreachable
end
end
i32.const 0
@ -1907,7 +1909,8 @@
loop $continue|0
local.get $4
local.get $7
i32.ne
i32.eq
i32.eqz
if
local.get $4
i32.load offset=8
@ -2179,7 +2182,7 @@
(local $1 i32)
call $~lib/map/Map<i8,i32>#constructor
local.set $1
loop $repeat|0
loop $loop|0
local.get $0
i32.const 100
i32.lt_s
@ -2240,7 +2243,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|0
br $loop|0
end
unreachable
end
@ -2259,7 +2262,7 @@
end
i32.const 0
local.set $0
loop $repeat|1
loop $loop|1
local.get $0
i32.const 100
i32.lt_s
@ -2340,7 +2343,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|1
br $loop|1
end
unreachable
end
@ -2359,7 +2362,7 @@
end
i32.const 0
local.set $0
loop $repeat|2
loop $loop|2
local.get $0
i32.const 50
i32.lt_s
@ -2413,7 +2416,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|2
br $loop|2
end
unreachable
end
@ -2432,7 +2435,7 @@
end
i32.const 0
local.set $0
loop $repeat|3
loop $loop|3
local.get $0
i32.const 50
i32.lt_s
@ -2488,7 +2491,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|3
br $loop|3
end
unreachable
end
@ -2599,7 +2602,8 @@
loop $continue|0
local.get $4
local.get $7
i32.ne
i32.eq
i32.eqz
if
local.get $4
i32.load offset=8
@ -2865,7 +2869,7 @@
(local $1 i32)
call $~lib/map/Map<u8,i32>#constructor
local.set $1
loop $repeat|0
loop $loop|0
local.get $0
i32.const 100
i32.lt_u
@ -2922,7 +2926,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|0
br $loop|0
end
unreachable
end
@ -2941,7 +2945,7 @@
end
i32.const 0
local.set $0
loop $repeat|1
loop $loop|1
local.get $0
i32.const 100
i32.lt_u
@ -3016,7 +3020,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|1
br $loop|1
end
unreachable
end
@ -3035,7 +3039,7 @@
end
i32.const 0
local.set $0
loop $repeat|2
loop $loop|2
local.get $0
i32.const 50
i32.lt_u
@ -3087,7 +3091,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|2
br $loop|2
end
unreachable
end
@ -3106,7 +3110,7 @@
end
i32.const 0
local.set $0
loop $repeat|3
loop $loop|3
local.get $0
i32.const 50
i32.lt_u
@ -3160,7 +3164,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|3
br $loop|3
end
unreachable
end
@ -3267,13 +3271,15 @@
if
local.get $0
return
else
local.get $0
i32.load offset=8
i32.const -2
i32.and
local.set $0
br $continue|0
end
local.get $0
i32.load offset=8
i32.const -2
i32.and
local.set $0
br $continue|0
unreachable
end
end
i32.const 0
@ -3331,7 +3337,8 @@
loop $continue|0
local.get $4
local.get $7
i32.ne
i32.eq
i32.eqz
if
local.get $4
i32.load offset=8
@ -3603,7 +3610,7 @@
(local $1 i32)
call $~lib/map/Map<i16,i32>#constructor
local.set $1
loop $repeat|0
loop $loop|0
local.get $0
i32.const 100
i32.lt_s
@ -3664,7 +3671,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|0
br $loop|0
end
unreachable
end
@ -3683,7 +3690,7 @@
end
i32.const 0
local.set $0
loop $repeat|1
loop $loop|1
local.get $0
i32.const 100
i32.lt_s
@ -3764,7 +3771,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|1
br $loop|1
end
unreachable
end
@ -3783,7 +3790,7 @@
end
i32.const 0
local.set $0
loop $repeat|2
loop $loop|2
local.get $0
i32.const 50
i32.lt_s
@ -3837,7 +3844,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|2
br $loop|2
end
unreachable
end
@ -3856,7 +3863,7 @@
end
i32.const 0
local.set $0
loop $repeat|3
loop $loop|3
local.get $0
i32.const 50
i32.lt_s
@ -3912,7 +3919,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|3
br $loop|3
end
unreachable
end
@ -4023,7 +4030,8 @@
loop $continue|0
local.get $4
local.get $7
i32.ne
i32.eq
i32.eqz
if
local.get $4
i32.load offset=8
@ -4289,7 +4297,7 @@
(local $1 i32)
call $~lib/map/Map<u16,i32>#constructor
local.set $1
loop $repeat|0
loop $loop|0
local.get $0
i32.const 100
i32.lt_u
@ -4346,7 +4354,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|0
br $loop|0
end
unreachable
end
@ -4365,7 +4373,7 @@
end
i32.const 0
local.set $0
loop $repeat|1
loop $loop|1
local.get $0
i32.const 100
i32.lt_u
@ -4440,7 +4448,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|1
br $loop|1
end
unreachable
end
@ -4459,7 +4467,7 @@
end
i32.const 0
local.set $0
loop $repeat|2
loop $loop|2
local.get $0
i32.const 50
i32.lt_u
@ -4511,7 +4519,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|2
br $loop|2
end
unreachable
end
@ -4530,7 +4538,7 @@
end
i32.const 0
local.set $0
loop $repeat|3
loop $loop|3
local.get $0
i32.const 50
i32.lt_u
@ -4584,7 +4592,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|3
br $loop|3
end
unreachable
end
@ -4705,13 +4713,15 @@
if
local.get $0
return
else
local.get $0
i32.load offset=8
i32.const -2
i32.and
local.set $0
br $continue|0
end
local.get $0
i32.load offset=8
i32.const -2
i32.and
local.set $0
br $continue|0
unreachable
end
end
i32.const 0
@ -4765,7 +4775,8 @@
loop $continue|0
local.get $4
local.get $7
i32.ne
i32.eq
i32.eqz
if
local.get $4
i32.load offset=8
@ -5025,7 +5036,7 @@
(local $1 i32)
call $~lib/map/Map<i32,i32>#constructor
local.set $1
loop $repeat|0
loop $loop|0
local.get $0
i32.const 100
i32.lt_s
@ -5078,7 +5089,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|0
br $loop|0
end
unreachable
end
@ -5097,7 +5108,7 @@
end
i32.const 0
local.set $0
loop $repeat|1
loop $loop|1
local.get $0
i32.const 100
i32.lt_s
@ -5166,7 +5177,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|1
br $loop|1
end
unreachable
end
@ -5185,7 +5196,7 @@
end
i32.const 0
local.set $0
loop $repeat|2
loop $loop|2
local.get $0
i32.const 50
i32.lt_s
@ -5235,7 +5246,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|2
br $loop|2
end
unreachable
end
@ -5254,7 +5265,7 @@
end
i32.const 0
local.set $0
loop $repeat|3
loop $loop|3
local.get $0
i32.const 50
i32.lt_s
@ -5306,7 +5317,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|3
br $loop|3
end
unreachable
end
@ -5371,7 +5382,7 @@
(local $1 i32)
call $~lib/map/Map<u32,i32>#constructor
local.set $1
loop $repeat|0
loop $loop|0
local.get $0
i32.const 100
i32.lt_u
@ -5424,7 +5435,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|0
br $loop|0
end
unreachable
end
@ -5443,7 +5454,7 @@
end
i32.const 0
local.set $0
loop $repeat|1
loop $loop|1
local.get $0
i32.const 100
i32.lt_u
@ -5512,7 +5523,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|1
br $loop|1
end
unreachable
end
@ -5531,7 +5542,7 @@
end
i32.const 0
local.set $0
loop $repeat|2
loop $loop|2
local.get $0
i32.const 50
i32.lt_u
@ -5581,7 +5592,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|2
br $loop|2
end
unreachable
end
@ -5600,7 +5611,7 @@
end
i32.const 0
local.set $0
loop $repeat|3
loop $loop|3
local.get $0
i32.const 50
i32.lt_u
@ -5652,7 +5663,7 @@
i32.const 1
i32.add
local.set $0
br $repeat|3
br $loop|3
end
unreachable
end
@ -5841,13 +5852,15 @@
if
local.get $0
return
else
local.get $0
i32.load offset=12
i32.const -2
i32.and
local.set $0
br $continue|0
end
local.get $0
i32.load offset=12
i32.const -2
i32.and
local.set $0
br $continue|0
unreachable
end
end
i32.const 0
@ -5901,7 +5914,8 @@
loop $continue|0
local.get $4
local.get $7
i32.ne
i32.eq
i32.eqz
if
local.get $4
i32.load offset=12
@ -6162,7 +6176,7 @@
(local $1 i32)
call $~lib/map/Map<i64,i32>#constructor
local.set $1
loop $repeat|0
loop $loop|0
local.get $0
i64.const 100
i64.lt_s
@ -6217,7 +6231,7 @@
i64.const 1
i64.add
local.set $0
br $repeat|0
br $loop|0
end
unreachable
end
@ -6236,7 +6250,7 @@
end
i64.const 0
local.set $0
loop $repeat|1
loop $loop|1
local.get $0
i64.const 100
i64.lt_s
@ -6308,7 +6322,7 @@
i64.const 1
i64.add
local.set $0
br $repeat|1
br $loop|1
end
unreachable
end
@ -6327,7 +6341,7 @@
end
i64.const 0
local.set $0
loop $repeat|2
loop $loop|2
local.get $0
i64.const 50
i64.lt_s
@ -6378,7 +6392,7 @@
i64.const 1
i64.add
local.set $0
br $repeat|2
br $loop|2
end
unreachable
end
@ -6397,7 +6411,7 @@
end
i64.const 0
local.set $0
loop $repeat|3
loop $loop|3
local.get $0
i64.const 50
i64.lt_s
@ -6450,7 +6464,7 @@
i64.const 1
i64.add
local.set $0
br $repeat|3
br $loop|3
end
unreachable
end
@ -6515,7 +6529,7 @@
(local $1 i32)
call $~lib/map/Map<u64,i32>#constructor
local.set $1
loop $repeat|0
loop $loop|0
local.get $0
i64.const 100
i64.lt_u
@ -6570,7 +6584,7 @@
i64.const 1
i64.add
local.set $0
br $repeat|0
br $loop|0
end
unreachable
end
@ -6589,7 +6603,7 @@
end
i64.const 0
local.set $0
loop $repeat|1
loop $loop|1
local.get $0
i64.const 100
i64.lt_u
@ -6661,7 +6675,7 @@
i64.const 1
i64.add
local.set $0
br $repeat|1
br $loop|1
end
unreachable
end
@ -6680,7 +6694,7 @@
end
i64.const 0
local.set $0
loop $repeat|2
loop $loop|2
local.get $0
i64.const 50
i64.lt_u
@ -6731,7 +6745,7 @@
i64.const 1
i64.add
local.set $0
br $repeat|2
br $loop|2
end
unreachable
end
@ -6750,7 +6764,7 @@
end
i64.const 0
local.set $0
loop $repeat|3
loop $loop|3
local.get $0
i64.const 50
i64.lt_u
@ -6803,7 +6817,7 @@
i64.const 1
i64.add
local.set $0
br $repeat|3
br $loop|3
end
unreachable
end
@ -6893,13 +6907,15 @@
if
local.get $0
return
else
local.get $0
i32.load offset=8
i32.const -2
i32.and
local.set $0
br $continue|0
end
local.get $0
i32.load offset=8
i32.const -2
i32.and
local.set $0
br $continue|0
unreachable
end
end
i32.const 0
@ -6954,7 +6970,8 @@
loop $continue|0
local.get $4
local.get $7
i32.ne
i32.eq
i32.eqz
if
local.get $4
i32.load offset=8
@ -7219,7 +7236,7 @@
(local $1 i32)
call $~lib/map/Map<f32,i32>#constructor
local.set $1
loop $repeat|0
loop $loop|0
local.get $0
f32.const 100
f32.lt
@ -7274,7 +7291,7 @@
f32.const 1
f32.add
local.set $0
br $repeat|0
br $loop|0
end
unreachable
end
@ -7293,7 +7310,7 @@
end
f32.const 0
local.set $0
loop $repeat|1
loop $loop|1
local.get $0
f32.const 100
f32.lt
@ -7365,7 +7382,7 @@
f32.const 1
f32.add
local.set $0
br $repeat|1
br $loop|1
end
unreachable
end
@ -7384,7 +7401,7 @@
end
f32.const 0
local.set $0
loop $repeat|2
loop $loop|2
local.get $0
f32.const 50
f32.lt
@ -7435,7 +7452,7 @@
f32.const 1
f32.add
local.set $0
br $repeat|2
br $loop|2
end
unreachable
end
@ -7454,7 +7471,7 @@
end
f32.const 0
local.set $0
loop $repeat|3
loop $loop|3
local.get $0
f32.const 50
f32.lt
@ -7507,7 +7524,7 @@
f32.const 1
f32.add
local.set $0
br $repeat|3
br $loop|3
end
unreachable
end
@ -7597,13 +7614,15 @@
if
local.get $0
return
else
local.get $0
i32.load offset=12
i32.const -2
i32.and
local.set $0
br $continue|0
end
local.get $0
i32.load offset=12
i32.const -2
i32.and
local.set $0
br $continue|0
unreachable
end
end
i32.const 0
@ -7658,7 +7677,8 @@
loop $continue|0
local.get $4
local.get $7
i32.ne
i32.eq
i32.eqz
if
local.get $4
i32.load offset=12
@ -7923,7 +7943,7 @@
(local $1 i32)
call $~lib/map/Map<f64,i32>#constructor
local.set $1
loop $repeat|0
loop $loop|0
local.get $0
f64.const 100
f64.lt
@ -7978,7 +7998,7 @@
f64.const 1
f64.add
local.set $0
br $repeat|0
br $loop|0
end
unreachable
end
@ -7997,7 +8017,7 @@
end
f64.const 0
local.set $0
loop $repeat|1
loop $loop|1
local.get $0
f64.const 100
f64.lt
@ -8069,7 +8089,7 @@
f64.const 1
f64.add
local.set $0
br $repeat|1
br $loop|1
end
unreachable
end
@ -8088,7 +8108,7 @@
end
f64.const 0
local.set $0
loop $repeat|2
loop $loop|2
local.get $0
f64.const 50
f64.lt
@ -8139,7 +8159,7 @@
f64.const 1
f64.add
local.set $0
br $repeat|2
br $loop|2
end
unreachable
end
@ -8158,7 +8178,7 @@
end
f64.const 0
local.set $0
loop $repeat|3
loop $loop|3
local.get $0
f64.const 50
f64.lt
@ -8211,7 +8231,7 @@
f64.const 1
f64.add
local.set $0
br $repeat|3
br $loop|3
end
unreachable
end

Some files were not shown because too many files have changed in this diff Show More