-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize internal calls by passing only stack end for arguments #642
base: skip_nop_instructions
Are you sure you want to change the base?
Conversation
986808c
to
254e779
Compare
Codecov Report
@@ Coverage Diff @@
## skip_nop_instructions #642 +/- ##
======================================================
Coverage 98.36% 98.37%
======================================================
Files 69 69
Lines 9626 9668 +42
======================================================
+ Hits 9469 9511 +42
Misses 157 157 |
EXPECT_THAT(execute(parse(wasm), 1, {}), Result(1)); | ||
} | ||
|
||
TEST(execute_call, call_void_with_one_argument) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chfast I think these tests could be merged anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#641.
Instead of passing the reference to the call arguments (a span on the top of the stack) just pass the pointer to the stack end.
Also, don't get the result by
ExecutionResult
, just expect the result being set toargs[0]
and the new stack end pointer to be returned.By this change, the caller does not need to know what the type of the callee function is. See
invoke_function()
simplification. It only passes the stack pointer and updates the stack pointer after the call.execute()
wrapping currently. But they may and probably should be updated.nullptr
means trap, but this may be a trap for call without arguments wherenullptr
could be passed as the "no arguments" value. Currently the wrapper handles that nicely (seefake_arg
). But we can consider some sentinel address values.call
implementation, not in theexecute()
. I realized this to late to change the design in the prototype.