Skip to content

Delete unused raw_context arg in host functions. #183

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

Merged
merged 3 commits into from
Aug 2, 2021

Conversation

mathetake
Copy link
Contributor

@mathetake mathetake commented Jul 30, 2021

This PR deletes unused raw_context arg in host functions which theoretically reduces the cost of each host calls from Wasm VMs.

Signed-off-by: Takeshi Yoneda [email protected]

Signed-off-by: Takeshi Yoneda <[email protected]>
@mathetake mathetake marked this pull request as ready for review July 30, 2021 12:18
@mathetake mathetake requested a review from PiotrSikora as a code owner July 30, 2021 12:18
@mathetake
Copy link
Contributor Author

Envoy test passed: envoyproxy/envoy#17547

@PiotrSikora
Copy link
Member

What's the reasoning behind this change? Do you need it for something or is it a generic cleanup?

It's fine in principle, but I'm asking because the next iteration of the ABI is most likely going to explicitly include handles to host resources (i.e. context) in parameters, at which point we might need to revert this change (I'm not 100% sure yet, since it's not fully fleshed out).

@mathetake
Copy link
Contributor Author

This is the general cleanup.

What do you mean by explicitly include handles to host resources (i.e. context) in parameters? The host functions in ABI, for example proxy_get_header_map_pairs will have the signature like (*void, map_type, return_ptr, return_size)? I think this change is about the interface on the host defined functions in C++ and the host defined functions in the ABI, and I don't really understand why do we need to revert if the ABI changes. Sorry if I'm missing something.

@mathetake
Copy link
Contributor Author

If this is about context_id as I see in https://github.com/WebAssembly/WASI/blob/b35c78afd6224e5d27484c7613ca0fa46d9ac4c1/meetings/2021/presentations/2021-04-22-PiotrSikora-Proxy-Wasm.pdf, then the revert won't be needed because we can just treat it as Word like we do for other args now.

@PiotrSikora
Copy link
Member

If this is about context_id as I see in https://github.com/WebAssembly/WASI/blob/b35c78afd6224e5d27484c7613ca0fa46d9ac4c1/meetings/2021/presentations/2021-04-22-PiotrSikora-Proxy-Wasm.pdf, then the revert won't be needed because we can just treat it as Word like we do for other args now.

It is. My point was that with that change we could simply replace void *raw_context with Word context_id, whereas if we remove it in this PR, then we'd need to re-add in the future, which seems a bit inconvinient... but not too much of an issue, so let's ignore it after all. Sorry for the noise!

@mathetake mathetake merged commit d32cb05 into proxy-wasm:master Aug 2, 2021
@mathetake mathetake deleted the raw-context-unused branch August 2, 2021 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants