bytecodealliance / wasm-micro-runtime

WebAssembly Micro Runtime (WAMR)
Apache License 2.0
4.66k stars 577 forks source link

What's the difference between bound check of fast interpreter mode and bound check of classic interpreter mode #3553

Open WenLY1 opened 1 week ago

WenLY1 commented 1 week ago

The bound check of classic interpreter mode will do extra work if WASM_ENABLE_MEMORY64 is enabled https://github.com/bytecodealliance/wasm-micro-runtime/blob/9b9e938bee7b41f026fa9aeee988a5bfc63d55ed/core/iwasm/interpreter/wasm_interp_classic.c#L89-L102

In fast interp mode, bound check does not do extra work if WASM_ENABLE_MEMORY64 is enabled https://github.com/bytecodealliance/wasm-micro-runtime/blob/9b9e938bee7b41f026fa9aeee988a5bfc63d55ed/core/iwasm/interpreter/wasm_interp_fast.c#L40-L62

Why the bound check of fast interp mdoe is different from that of classic mode?

TianlongLiang commented 2 days ago

The fast interp mode hasn't supported the memory64 proposal yet, so the boundary check is unmodified and won't check the overflow condition that only occurs in memory64

WenLY1 commented 1 hour ago

The fast interp mode hasn't supported the memory64 proposal yet, so the boundary check is unmodified and won't check the overflow condition that only occurs in memory64 Thanks, got it