Introduce the javy-profiler-lib crate#1208
Open
saulecabrera wants to merge 3 commits into
Open
Conversation
Part of bytecodealliance#1206 This is the first change towards a Wasm-native profiler for Javy generated modules. Particularly, this change introduces the profiler library crate, which will be used as a user-provided library by [Whamm](https://github.com/ejrgilbert/whamm). The library will be compiled to wasm32-wasip1 and will have the following responsibilities: * Detecting the Wasm function in the target app holding the interpreter dispatch loop * Detecting the byte-load provenance used to dispatch to the next opcode (index argument to `br_table`) * Holing the necessary state to construct the JS execution trace * Generating the execution trace output for analysis This change includes, point 1 and 2. The remaining functionality will be done in separate pull requests. Note that, as stated in the issue above, this work is deemed experimental for the time being and this crate will be included through a feature flag when added to the CLI.
saulecabrera
commented
May 12, 2026
| use state::State; | ||
| use std::sync::LazyLock; | ||
|
|
||
| // TODO: Passing empty bytes is temporary. Whamm currently does not |
Member
Author
There was a problem hiding this comment.
I am currently working on adding support for this upstream.
Member
Author
|
Hmm, taking a look at the clippy failures, I was not able to repro locally. |
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.
Part of #1206
This is the first change towards a Wasm-native profiler for Javy generated modules.
Particularly, this change introduces the profiler library crate, which will be used as a user-provided library by
Whamm.
The library will be compiled to wasm32-wasip1 and will have the following responsibilities:
br_table)This change includes, point 1 and 2. The remaining functionality will be done in separate pull requests.
Note that, as stated in the issue above, this work is deemed experimental for the time being and this crate will be included through a feature flag when added to the CLI.
javy-plugin-apiif the QuickJS bytecode has changed.javy-cli,javy-plugin, andjavy-plugin-processingdo not require updating CHANGELOG files.