Skip to content

Conversation

@zherczeg
Copy link
Collaborator

Large patch (4200 lines) which implements the Memory 64 variant for all memory / load store opcodes in the interpreter. This is not a full support, the memory.grow, memory.init etc. are not implemented yet.

The patch contains a lot of code duplications. Also #394 should land first.

There was no test for simd / atomic + memidx opcode variants, and this patch adds them. There were typos in the code for these variants.

@zherczeg zherczeg force-pushed the memory64 branch 5 times, most recently from c4347e6 to 17deffd Compare January 19, 2026 13:02
@zherczeg zherczeg marked this pull request as ready for review January 19, 2026 13:15
@zherczeg
Copy link
Collaborator Author

The patch is working now. Unfortunately the stack limit needs to be increased to 7MB, because the interpreter stack consumption for debug builds increased a lot. I suspect the new code paths introduced several local variables, and their space is not reused in debug mode.

The reason for the code duplications: memory64 uses 64 bit offsets instead of 32 bit ones, which increases the byte code size, so the original byte codes cannot be reused.

@ksh8281
Copy link
Collaborator

ksh8281 commented Jan 22, 2026

Can we allocate stack through bdwgc(we need to support gc, if needs)
when allocate large stack memory for function?

@zherczeg
Copy link
Collaborator Author

Unfortunately, this is not the WebAssembly function. This is the normal C++ interpret function. And only in debug mode. Perhaps I could try to change the macros to reduce the space.

@zherczeg
Copy link
Collaborator Author

On my machine the debug stack space of the interpreter (x86-64) is increased from 0x5bb8 to 0x8098. This is a compiler decision. Perhaps we could try to use less local variables.

Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
@zherczeg
Copy link
Collaborator Author

I have checked the release mode. There is a small stack increase there as well: from 0x128 to 0x1a8 bytes. This amount is negligible compared to the debug stack consumption.

@ksh8281
Copy link
Collaborator

ksh8281 commented Jan 22, 2026

I see

@ksh8281 ksh8281 merged commit 421158a into Samsung:main Jan 22, 2026
89 checks passed
@zherczeg zherczeg deleted the memory64 branch January 22, 2026 13:22
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