Sergei Shulepov

Results 133 comments of Sergei Shulepov

Ah, regarding the fuel register being initialized, I think it should already work. [Here](https://github.com/bytecodealliance/wasmtime/pull/4466/files#diff-9d82b907a78ab6fb3a70e80a5d999294511e55cda60bc01a2d643b078f3d9af7R260) we ask for the `DefinedFunctionIndex` which is available only for functions defined by a wasm module....

> I'm pretty sure our dwarf unwind information is not "async correct" where every single ip in a function guarantees a correct backtrace. With the fast-stack-walking branch and fp-based unwinds...

> Oh right yeah with the trampoline you gisted above I was wondering how backtrace info would work out and it seems like it doesn't. I don't know how to...

> In some sense though what it seems like you're looking for is a hybrid of epochs (asynchronous cancellation, low overhead) and fuel (the measure of cancellation being how much...

> Ah, sorry, I had missed that note; but it's a little surprising given that [here](https://github.com/bytecodealliance/wasmtime/blob/4e6f3ea899efd6bbe8e77235fcba69b73257d23c/crates/cranelift/src/func_environ.rs#L377) we call `fuel_save_from_var` to store the value back to memory, and this is invoked...

FWIW, enabling epoch interrupts and consuming fuel (but without fuel interrupts) gives 28-40% overhead.

> So, some fairly complex ideas incoming... Oh, right, something like this also crossed my mind. It looks that the ABI idea is easier to hack though. You don't mean...

Well, I went ahead and implemented the explicit value passing. It's messy and now I stumbled upon some problem in the wasm translation code. I suspect there is some hidden...

Hacking on the explicit passing of the fuel counter without storing it in the memory, I bumped on a bug. It manifests with fuel metering and the `unreachable` instruction. Basically,...

I've hacked a version that uses the pinned_reg approach. I did not bother implementing extracting fuel in the signal handler, though. I just checked that it is possible, and it...