Skip to content

Commit e08a07e

Browse files
committed
Merge branch 'main' into v0.29
2 parents 6dbef4e + 7e237cc commit e08a07e

165 files changed

Lines changed: 907 additions & 980 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ jobs:
132132
- uses: actions/checkout@v6
133133
- uses: actions/setup-node@v6
134134
with:
135-
node-version: current
135+
node-version: 24
136136
- name: Install dependencies
137137
run: npm ci --no-audit
138138
- name: Build

std/assembly/rt/itcms.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,12 @@ function interrupt(): void {
403403
budget -= step();
404404
if (state == STATE_IDLE) {
405405
if (TRACE) trace("└ GC (auto) done at cur/max", 2, total, memory.size() << 16);
406-
threshold = <usize>(<u64>total * IDLEFACTOR / 100) + GRANULARITY;
406+
if (IDLEFACTOR % 100 == 0) {
407+
// optimization for the default GC parameters which idle factor is 200%
408+
threshold = total * (IDLEFACTOR / 100) + GRANULARITY;
409+
} else {
410+
threshold = <usize>((<u64>total * IDLEFACTOR) / 100) + GRANULARITY;
411+
}
407412
if (PROFILE) onyield(total);
408413
return;
409414
}

tests/compiler/assignment-chain.debug.wat

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2072,14 +2072,17 @@
20722072
if
20732073
i32.const 0
20742074
drop
2075+
i32.const 200
2076+
i32.const 100
2077+
i32.rem_u
2078+
i32.const 0
2079+
i32.eq
2080+
drop
20752081
global.get $~lib/rt/itcms/total
2076-
i64.extend_i32_u
20772082
i32.const 200
2078-
i64.extend_i32_u
2079-
i64.mul
2080-
i64.const 100
2081-
i64.div_u
2082-
i32.wrap_i64
2083+
i32.const 100
2084+
i32.div_u
2085+
i32.mul
20832086
i32.const 1024
20842087
i32.add
20852088
global.set $~lib/rt/itcms/threshold

tests/compiler/assignment-chain.release.wat

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,12 +1465,8 @@
14651465
i32.eqz
14661466
if
14671467
global.get $~lib/rt/itcms/total
1468-
i64.extend_i32_u
1469-
i64.const 200
1470-
i64.mul
1471-
i64.const 100
1472-
i64.div_u
1473-
i32.wrap_i64
1468+
i32.const 1
1469+
i32.shl
14741470
i32.const 1024
14751471
i32.add
14761472
global.set $~lib/rt/itcms/threshold

tests/compiler/bindings/esm.debug.wat

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1777,14 +1777,17 @@
17771777
if
17781778
i32.const 0
17791779
drop
1780+
i32.const 200
1781+
i32.const 100
1782+
i32.rem_u
1783+
i32.const 0
1784+
i32.eq
1785+
drop
17801786
global.get $~lib/rt/itcms/total
1781-
i64.extend_i32_u
17821787
i32.const 200
1783-
i64.extend_i32_u
1784-
i64.mul
1785-
i64.const 100
1786-
i64.div_u
1787-
i32.wrap_i64
1788+
i32.const 100
1789+
i32.div_u
1790+
i32.mul
17881791
i32.const 1024
17891792
i32.add
17901793
global.set $~lib/rt/itcms/threshold

tests/compiler/bindings/esm.release.wat

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,12 +1385,8 @@
13851385
i32.eqz
13861386
if
13871387
global.get $~lib/rt/itcms/total
1388-
i64.extend_i32_u
1389-
i64.const 200
1390-
i64.mul
1391-
i64.const 100
1392-
i64.div_u
1393-
i32.wrap_i64
1388+
i32.const 1
1389+
i32.shl
13941390
i32.const 1024
13951391
i32.add
13961392
global.set $~lib/rt/itcms/threshold

tests/compiler/bindings/noExportRuntime.debug.wat

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1676,14 +1676,17 @@
16761676
if
16771677
i32.const 0
16781678
drop
1679+
i32.const 200
1680+
i32.const 100
1681+
i32.rem_u
1682+
i32.const 0
1683+
i32.eq
1684+
drop
16791685
global.get $~lib/rt/itcms/total
1680-
i64.extend_i32_u
16811686
i32.const 200
1682-
i64.extend_i32_u
1683-
i64.mul
1684-
i64.const 100
1685-
i64.div_u
1686-
i32.wrap_i64
1687+
i32.const 100
1688+
i32.div_u
1689+
i32.mul
16871690
i32.const 1024
16881691
i32.add
16891692
global.set $~lib/rt/itcms/threshold

tests/compiler/bindings/noExportRuntime.release.wat

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,12 +1318,8 @@
13181318
i32.eqz
13191319
if
13201320
global.get $~lib/rt/itcms/total
1321-
i64.extend_i32_u
1322-
i64.const 200
1323-
i64.mul
1324-
i64.const 100
1325-
i64.div_u
1326-
i32.wrap_i64
1321+
i32.const 1
1322+
i32.shl
13271323
i32.const 1024
13281324
i32.add
13291325
global.set $~lib/rt/itcms/threshold

tests/compiler/bindings/raw.debug.wat

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1780,14 +1780,17 @@
17801780
if
17811781
i32.const 0
17821782
drop
1783+
i32.const 200
1784+
i32.const 100
1785+
i32.rem_u
1786+
i32.const 0
1787+
i32.eq
1788+
drop
17831789
global.get $~lib/rt/itcms/total
1784-
i64.extend_i32_u
17851790
i32.const 200
1786-
i64.extend_i32_u
1787-
i64.mul
1788-
i64.const 100
1789-
i64.div_u
1790-
i32.wrap_i64
1791+
i32.const 100
1792+
i32.div_u
1793+
i32.mul
17911794
i32.const 1024
17921795
i32.add
17931796
global.set $~lib/rt/itcms/threshold

tests/compiler/bindings/raw.release.wat

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,12 +1385,8 @@
13851385
i32.eqz
13861386
if
13871387
global.get $~lib/rt/itcms/total
1388-
i64.extend_i32_u
1389-
i64.const 200
1390-
i64.mul
1391-
i64.const 100
1392-
i64.div_u
1393-
i32.wrap_i64
1388+
i32.const 1
1389+
i32.shl
13941390
i32.const 1024
13951391
i32.add
13961392
global.set $~lib/rt/itcms/threshold

0 commit comments

Comments
 (0)