-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[EH] Move EH status management to exceptions.js #27528
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
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8773f0c
[EH] Move EH status management to exceptions.js (NFC)
aheejin da4a2d1
ptr = exceptionLast ??= new CppException(ptr)
aheejin 90ed37f
Merge branch 'main' into eh_status_manage
aheejin 49803bd
Remove unexpected change
aheejin b3b0d7f
dummy
aheejin c623646
Revert "dummy"
aheejin 223c6ec
Missing semicolon?
aheejin b6b3bb2
Use ptr = exceptionLast = new CppException(ptr)
aheejin d09c244
$uncaughtExceptionCount: 0
aheejin 98b8aeb
Automatic rebaseline of codesize expectations. NFC
aheejin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,16 @@ | ||
| { | ||
| "hello_world.js": 54578, | ||
| "hello_world.js.gz": 17345, | ||
| "hello_world.js": 54550, | ||
| "hello_world.js.gz": 17328, | ||
| "hello_world.wasm": 15115, | ||
| "hello_world.wasm.gz": 7464, | ||
| "no_asserts.js": 23629, | ||
| "no_asserts.js.gz": 8288, | ||
| "no_asserts.wasm": 12229, | ||
| "no_asserts.wasm.gz": 6004, | ||
| "strict.js": 51729, | ||
| "strict.js.gz": 16348, | ||
| "strict.js": 51701, | ||
| "strict.js.gz": 16338, | ||
| "strict.wasm": 15115, | ||
| "strict.wasm.gz": 7461, | ||
| "total": 172395, | ||
| "total_gz": 62910 | ||
| "total": 172339, | ||
| "total_gz": 62883 | ||
| } |
Oops, something went wrong.
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.
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.
I wonder if the
new CppExceptionstuff should go in libunwind ? Doesn't have to part of this PR, but reallyCppExceptionhere should probably be called something likeNativeExceptionright?Maybe
CppExceptionis fine since we already have__cpp_exceptiontag (which is used for all LLVM languages not just c++)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.
CppExceptionis in the area of libcxxabi, which manages C++ exceptions, no? libunwind is basically language-agnostic; it just provides the low-level functions to throw something and unwind stack.The reason Rust team proposed to move
__cpp_exceptionto libunwind was for some other reasons (llvm/llvm-project#185770). Also they seem to be using__cpp_exceptionstag for Rust exceptions too (rust-lang/rust#160067 (comment)), presumably because it was easier for them to use it than adding another tag.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.
Thats what I'm saying. I think that
CppExceptionis just and object we use the wrap native exceptions, as in any exception that comes out of wasm/llvm. So both rust and C++ share libunwind they probably both want the JS wrapper object around the native exception (to get backtraces).I think
CppExceptionand__cpp_exceptionare both just slightly unfortunately named. They probably should have been called__libunwind_exceptionandLibunwindExceptionmaybe? Or something else that is not C++ specific I guess?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.
The purpose of
CppExceptionif really most likeJSWrapperForNativeExceptionI think??Uh oh!
There was an error while loading. Please reload this page.
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.
I think they were intended to represent C++ exceptions.
__cpp_exceptionis a tag, and EH instructions use it to check whether the current exception is a C++ exception or a foreign one. AndCppExceptionis a container to manage EH stack traces (which libunwind is not really supposed to know about) and also it is to distinguish the exception fromEmscriptenSjLj: https://github.com/emscripten-core/emscripten/blob/main/src/runtime_exceptions.js