-
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
[mono][wasm] Allow AOTing methods with catch/filter clauses. #64867
Merged
Conversation
This file contains 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
vargaz
requested review from
BrzVlad,
EgorBo,
imhameed,
lambdageek,
SamMonoRT and
thaystg
as code owners
February 6, 2022 07:00
ghost
assigned vargaz
Feb 6, 2022
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
Running the console benchmark: BEFORE:
AFTER:
|
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
BrzVlad
reviewed
Feb 21, 2022
This works as follows: * During EH, when a catch clause is found in an AOTed method, the EH state is saved into TLS and a c++ exception is thrown. * The C++ exception is caught by the AOTed method, and the landing pad code calls mono_llvm_resume_exception_il_state (). * That call will run the catch clause and the rest of the method code using the interpreter, storing the possible return value back into the AOTed method's stack frame. * After the call, the method skips the rest of its code, and returns immediately to its caller.
…clean up the interpreter stack.
/azp run runtime-wasm |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
CI failures look unrelated. |
BrzVlad
reviewed
Feb 28, 2022
BrzVlad
approved these changes
Feb 28, 2022
Instead of throwing a c++ exception from mono_handle_exception () when an exception is caught in AOTed code, set context->has_resume_state, so the intepreter will normally unwind until exiting interpreted code. Then throw the c++ exception after the call to interp_exec_method () to unwind through the runtime code and the AOTed frames which can't handle the exception.
/azp run runtime-wasm |
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
1 similar comment
Azure Pipelines successfully started running 1 pipeline(s). |
CI failures look unrelated. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This works as follows:
EH state is saved into TLS and a c++ exception is thrown.
pad code calls mono_llvm_resume_exception_il_state ().
code using the interpreter, storing the possible return value
back into the AOTed method's stack frame.
returns immediately to its caller.