Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
94855b1
Add SpcInlinedFrame
matthew-mojira Mar 20, 2026
9a38ea7
Add frame reconstructions methods and guard reconstruction points
matthew-mojira Mar 23, 2026
e5e4f05
Merge branch 'master' into pr/reconstruction
matthew-mojira Mar 23, 2026
731c9e7
Move function to a more sensible spot
matthew-mojira Mar 23, 2026
194f26d
Make the if statement one line
matthew-mojira Mar 25, 2026
f021600
Compute vfp for every inlined frame
matthew-mojira Mar 26, 2026
9bf2aeb
Uncomment stack reconstruction metrics
matthew-mojira Mar 26, 2026
e4b2d4a
Use optimized vfp calculation
matthew-mojira Mar 26, 2026
a7044bb
Use a single `rsp` adjustment in reconstructing stack frames
matthew-mojira Mar 31, 2026
7b8ae6d
Separate single-frame reconstruction into its own method
matthew-mojira Mar 31, 2026
036753d
Revert "Separate single-frame reconstruction into its own method"
matthew-mojira Mar 31, 2026
296ea0f
Fix wrong way indexing
matthew-mojira Mar 31, 2026
6b26972
Reapply "Separate single-frame reconstruction into its own method"
matthew-mojira Mar 31, 2026
a96f168
Restore vfp after out call
matthew-mojira Mar 31, 2026
3fb2fd1
The first of the final inlinings
matthew-mojira Mar 23, 2026
4ad0cbd
Remove dead lines
matthew-mojira Mar 23, 2026
3f9b030
Remove extra metric increment
matthew-mojira Mar 23, 2026
c0ce246
Fix osr bug on dyn
matthew-mojira Mar 23, 2026
364664a
Support RETURN instruction
matthew-mojira Mar 25, 2026
437da05
Remove manual result slot cleanup (using merge state transfer instead)
matthew-mojira Mar 25, 2026
644ba20
Revert "Remove manual result slot cleanup (using merge state transfer…
matthew-mojira Mar 25, 2026
9a1af46
Fix whamm arg for merge state
matthew-mojira Mar 25, 2026
e1eb4cd
Reapply "Remove manual result slot cleanup (using merge state transfe…
matthew-mojira Mar 25, 2026
072d51c
Add return test to failures on dyn
matthew-mojira Mar 25, 2026
8df10de
Use withReconstruct on inlined function entry probes
matthew-mojira Mar 31, 2026
6fa3289
Prohibit nested frame reconstruction (Whamm probe hackfix when nestin…
matthew-mojira Apr 1, 2026
44e8bab
Increase code size estimate when inlining is enabled
matthew-mojira Apr 1, 2026
884b8cc
Move vfp fixing to emitWhammProbe
matthew-mojira Apr 1, 2026
3a66aaa
Add FAST_CALL instruction
matthew-mojira Oct 6, 2025
a8c9753
Update tag for fast_call
matthew-mojira Oct 6, 2025
7e102d8
Separate more fast call behavior
matthew-mojira Oct 8, 2025
6a771ff
Add CallProperty to distinguish between tail call and fast call
matthew-mojira Oct 14, 2025
f80bb2b
Add stubs/initialization for fast call entries and no-op FAST_CALL in…
matthew-mojira Jan 5, 2026
d82b203
Clean up unused dispatch function and specify goals
matthew-mojira Jan 5, 2026
4cc8807
Work on SPC accepting fast mode and emitting dispatch sequence
matthew-mojira Jan 5, 2026
4e194c7
macro dispatch, add fast_target_code correctly, better stub caller di…
matthew-mojira Jan 14, 2026
4c2e31c
Fix vsp in fast spc
matthew-mojira Jan 15, 2026
e302f07
Replace CALL with FAST_CALL when function is exported with "fast:" pr…
matthew-mojira Jan 15, 2026
2e3f271
AOT compile fast functions declared in export name
matthew-mojira Jan 21, 2026
b792c67
Add fast prologue/epilogue stubs
matthew-mojira Jan 21, 2026
71c737d
Add small frame in fast call to save vfp (for local variables)
matthew-mojira Jan 22, 2026
5ce31ec
Add test files/programs
matthew-mojira Jan 23, 2026
c7fa4ff
Add logic for specialized FAST_CALL bytecodes
matthew-mojira Jan 23, 2026
04f8878
Add more instructions
matthew-mojira Mar 11, 2026
13799d0
Remove use of fast frame
matthew-mojira Mar 18, 2026
9fbccb5
Add FAST_CALL 0-47 for each unused bytecode, and minor merge fixes
matthew-mojira Apr 1, 2026
15f87ea
Patch the dispatch table with fast-compiled functions (and use them) …
matthew-mojira Apr 1, 2026
e0a2adb
Cleaned up some stuff
matthew-mojira Apr 2, 2026
cd2e243
Remove unused stubs and deps
matthew-mojira Apr 2, 2026
db986c2
Build fast SPC exec env at the same time as other exec envs, remove dup
matthew-mojira Apr 2, 2026
c6e6a5d
Remove unused functions
matthew-mojira Apr 2, 2026
2b4e4d5
save/restore caller IVars in SPC and across frame reconstruction
matthew-mojira Apr 2, 2026
84e8b99
Complete stack reconstruction around fast compilation
matthew-mojira Apr 3, 2026
62cb3ab
Remove FAST_CALL47 and opcode mapped to 0xFF
matthew-mojira Apr 3, 2026
b487e6b
Remove more FAST_CALLs contradicting stack switching
matthew-mojira Apr 3, 2026
71194b8
Move fast_target_code and fast_call_idx (conflict in internal offset!…
matthew-mojira Apr 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added fast_call.wasm
Binary file not shown.
10 changes: 10 additions & 0 deletions fast_call.wat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
(module
(import "wizeng" "puti" (func $puti (param i32)))
(func $f (result i32)
i32.const 10)
(func (export "main") (result i32)
call $f
call $puti
i32.const 0
)
)
Binary file added fast_call2.wasm
Binary file not shown.
7 changes: 7 additions & 0 deletions fast_call2.wat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(module
(func $f (result i32)
i32.const 10)
(func (export "main") (result i32)
call $f
)
)
Binary file added fast_call_export.wasm
Binary file not shown.
10 changes: 10 additions & 0 deletions fast_call_export.wat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
;; export name holds fast information, we don't modify binary ahead of time

(module
(func $fast (export "fast:foo") (result i32)
(i32.const 2)
)
(func (export "main") (result i32)
(call $fast)
)
)
Binary file added fast_call_nop.wasm
Binary file not shown.
10 changes: 10 additions & 0 deletions fast_call_nop.wat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
(module
(func $f)
(func $g)
(func (export "main") (result i32)
i64.const 11
drop
call $g
i32.const 0
)
)
Binary file added fast_call_param.wasm
Binary file not shown.
18 changes: 18 additions & 0 deletions fast_call_param.wat
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
(module
(import "wizeng" "puti" (func $puti (param i32)))
(func $f (param i32) (result i32)
local.get 0
if (result i32)
i32.const 999
else
i32.const -216
end
)
(func (export "main") (result i32)
(call $f (i32.const 1))
call $puti
(call $f (i32.const 0))
call $puti
i32.const 0
)
)
9 changes: 9 additions & 0 deletions int/Export
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
S=${BASH_SOURCE[0]}
while [ -h "$S" ]; do
DIR=$(cd -P $(dirname "$S") >/dev/null 2>&1 && pwd)
S=$(readlink "$S")
[[ $S != /* ]] && S=$DIR/$S
done
DIR=$(cd -P $(dirname "$S") >/dev/null 2>&1 && pwd)
wizeng $DIR/Export.wasm "$@"
12 changes: 12 additions & 0 deletions int/Export.v3
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export "fast:foo" def foo(x: int, y: int) -> int {
var val = y;
for (i < x) {
val += i * y;
}
return val;
}

export "main" def main() -> int {
System.puts(Strings.format1("%d\n", foo(11, 2)));
return 0;
}
Binary file added int/Export.wasm
Binary file not shown.
9 changes: 9 additions & 0 deletions int/Interpreter
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
S=${BASH_SOURCE[0]}
while [ -h "$S" ]; do
DIR=$(cd -P $(dirname "$S") >/dev/null 2>&1 && pwd)
S=$(readlink "$S")
[[ $S != /* ]] && S=$DIR/$S
done
DIR=$(cd -P $(dirname "$S") >/dev/null 2>&1 && pwd)
wizeng $DIR/Interpreter.wasm "$@"
Loading