Optimize internal calls by passing only stack end for arguments#642
Draft
chfast wants to merge 8 commits intoskip_nop_instructionsfrom
Draft
Optimize internal calls by passing only stack end for arguments#642chfast wants to merge 8 commits intoskip_nop_instructionsfrom
chfast wants to merge 8 commits intoskip_nop_instructionsfrom
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 |
axic
reviewed
May 23, 2022
| EXPECT_THAT(execute(parse(wasm), 1, {}), Result(1)); | ||
| } | ||
|
|
||
| TEST(execute_call, call_void_with_one_argument) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.nullptrmeans trap, but this may be a trap for call without arguments wherenullptrcould be passed as the "no arguments" value. Currently the wrapper handles that nicely (seefake_arg). But we can consider some sentinel address values.callimplementation, not in theexecute(). I realized this to late to change the design in the prototype.