Convert raise_notrace non-escaping exceptions into jumps#451
Merged
mshinwell merged 3 commits intoocaml-flambda:flambda2.0-stablefrom May 18, 2021
Merged
Conversation
60cea36 to
b98e083
Compare
Author
|
@lthls Would you be able to look at this one? It shouldn't take too long. |
lthls
approved these changes
May 18, 2021
lthls
left a comment
There was a problem hiding this comment.
Looks good. A few comments:
- A number of calls to
Continuation.create ~sort:Exnhave been converted toContinuation.create ~sort:Normal_or_exn, butNormal_or_exnis the default value so the optionalsortargument could be omitted. - During Cmm generation, if
Clflags.debugis set to false then all raises will be compiled innotracemode (seeCmm_helpers.raise_prim). We could do the same here.
Author
|
@lthls Comments addressed, thanks -- please merge once CI passes if you are happy. |
|
A small question: what's the meaning of a |
Author
|
Funnily enough I wondered the same thing this morning. I'll make a separate PR. |
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.
I was discussing this with @gretay-js today and decided to write the code down. I thought it would take one hour but it took two, even so, not too bad. This exercise was quite useful for code review purposes, as there are some tricky details in this area.
There are no doubt still problems with this patch. However some small examples work. Example number 4 in the new test file even correctly unboxes the two arguments to the exception constructor.
In the future we should write some code to add to the backtrace buffer. Then this could be used for regular exception raises too, not just
notraceones.