You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 11, 2020. It is now read-only.
Just thinking aloud here, would appreciate any thoughts/feedback.
It would be good for native code to be able to return early to signal different states back to the interpreter.
Debug: Stack/local handling code can do bounds checks and return a value if bounds are every violated. We dont expect this to happen for verified modules, but it would be good to have this as a build flag like we have for the interpreter (to be sure).
(in the future) Branching: we can compute/store an 'outgoing branch table' for each native code sequence, and the native section can return back a specific code to signal a branch to another function, or even stuff like function calls.
Keeping things simple, I think we should implement this signalling through a int64 value on the stack, and by the native code returning. The int64 value can be packed something like this:
04 Bits: Return code (0 = no error, 1 = bounds check failed, 2 = unreachable, 3 = function call, 4 = branch, 5 = fatal error, remaining codes reserved
04 Bits: Reserved for future flags.
24 Bits: Index of the WASM instruction where the bail-out happened (ie: index into `BytecodeMetadata.Instructions`)
32 Bits: Jump target / Branch index / Code-specific-data.
The text was updated successfully, but these errors were encountered:
twitchyliquid64
changed the title
Support 'bail-out'
Support 'bail-out' from native code to signal debug/error-states/branches.
Apr 7, 2019
Just thinking aloud here, would appreciate any thoughts/feedback.
It would be good for native code to be able to return early to signal different states back to the interpreter.
Keeping things simple, I think we should implement this signalling through a int64 value on the stack, and by the native code returning. The int64 value can be packed something like this:
The text was updated successfully, but these errors were encountered: