Skip to content

x86-64 Stack Compression - #647

Merged
titzer merged 1 commit into
titzer:masterfrom
linxuanm:x86-compression-backend
Sep 1, 2026
Merged

x86-64 Stack Compression#647
titzer merged 1 commit into
titzer:masterfrom
linxuanm:x86-compression-backend

Conversation

@linxuanm

@linxuanm linxuanm commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Stack compression backend for x86-64.

@linxuanm
linxuanm force-pushed the x86-compression-backend branch from 8100734 to 8160ffc Compare August 25, 2026 22:02
type RelocatableFrame(data: WasmFrameData, is_spc: bool, bytecode_ip: u64) #unboxed { }
// {bytecode_offset} is the byte offset into {data.func.decl.cur_bytecode} at which the interpreter
// resumes (unused when {is_spc} is true).
type RelocatableFrame(data: WasmFrameData, is_spc: bool, bytecode_offset: int) #unboxed { }

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use "pc" instead of "bytecode_offset"--that matches the rest of the code.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe bytecode_offset is different from pc here. bytecode_offset was initially referring to ip, which differs from pc because a non-top stack in the chain has pc pointed at the start of its resume call while ip is advanced forward. It was initially named bytecode_ip to store the partial ip as a pointer casted to a u64, but this will fail if the cur_bytecodes has been moved by the GC and the bytecode_ip will point to recycled memory after a GC call. Due to this I changed it to store the offset of ip from cur_bytecodes instead. Should I name this to ip_offset or something?

Comment thread src/engine/x86-64/X86_64Stack.v3 Outdated
Comment thread src/engine/x86-64/X86_64Stack.v3
Comment thread test/unittest/x86-64-linux/X86_64CompressionTest.v3 Outdated
Comment thread test/unittest/x86-64-linux/X86_64CompressionTest.v3 Outdated
Comment thread test/unittest/SidetableTest.v3 Outdated
@linxuanm
linxuanm force-pushed the x86-compression-backend branch from 97f7128 to 650c0ef Compare August 26, 2026 17:18
@linxuanm
linxuanm marked this pull request as draft August 29, 2026 19:50
@linxuanm
linxuanm force-pushed the x86-compression-backend branch from efd4f14 to 6f2fb92 Compare August 29, 2026 20:38
@linxuanm
linxuanm marked this pull request as ready for review August 31, 2026 03:23
@titzer
titzer merged commit c0ab0a7 into titzer:master Sep 1, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants