-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Wasm jiterpreter cleanup and bug fixes pt. 3 #78782
Conversation
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsBlocks #78428
|
Tagging subscribers to this area: @BrzVlad Issue DetailsBlocks #78428
|
if (!isF64) | ||
builder.appendU8(intrinsicFpBinop); | ||
builder.i32_const(<any>opcode); | ||
builder.callImport("relop_fp"); |
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.
Do I understand correctly this is call from generated wasm into main wasm file ? is this expensive ?
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.
Yes, it's calling into dotnet.wasm - in this case, mono_jiterp_relop_fp. It is somewhat expensive, but the alternative is painful. In the long run if the performance of these comparisons was sensitive we'd generate all the ordering comparison logic inline.
// in the correct place and compute the stack offset, then it passes that in to this | ||
// function in order to actually enter the interpreter and process the return value | ||
EMSCRIPTEN_KEEPALIVE void | ||
mono_jiterp_interp_entry (JiterpEntryData *_data, stackval *sp_args, void *res) |
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.
Another option here would have been to make interp_exec_method
static again as it was before the original jiterpreter commit and then have a global mono_interp_exec_method
that calls it.
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.
Do you want me to change it? I originally had a wrapper like you describe, but the performance impact was measurable so that's how we ended up here. I might be able to get it to inline though, I don't think I spent much time trying when I was first prototyping.
Blocks #78428