-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Investigate coroutines #1957
Comments
OK, so it was not easy, and this is all still very experimental, but:
Which is the cause of the issue I was talking about earlier, with generated exception tables such as:
Where both try blocks point to the same catch block. We will need to tweak Quasar to duplicate the try blocks. |
You can take this over in https://github.com/FroMage/quarkus/tree/quasi-hacking @dmlloyd |
BTW, the biggest differences IMO between Quarkus are:
|
It's really interesting/strange that SVM complains about this; I wonder if they make some special assumptions. But yeah theoretically it should be possible to duplicate the exception handler blob. |
Ah yes, right, it's the handler we need to duplicate, not the try block, of course :) |
So I tried EA-Async in https://github.com/FroMage/quarkus/tree/ea-async and it Just Works™. With the caveats that I mentioned earlier, but still. |
Ferget the other branch: use https://github.com/FroMage/quarkus/tree/coroutines to get |
Well, I tried ea-coroutines in panache-rx and that turned out pretty amazing: FroMage@cbe1aca?diff=split |
Ah no, sometimes ea-async does not work in SVM:
|
DAMNIT. |
Appears to be similar to oracle/graal#366 because I can get around it by inlining my loop (as a workaround). |
Coroutines should work well now with |
@FroMage Any plans on retesting with GraalVM 2.1? |
Not ATM, no, I've no time. But if you want to try, let us know :) |
I tested with 20.3.1 and I still get the same issue. It looks like they didn't fix it in general. Perhaps they special-cased Kotlin patterns, or Kotlin changed their implementation?
|
It's interesting that they care whether an exception handler is reachable via normal control flow. Especially since the distinction between an exception handler and normal control flow is so fine: for example, what if my exception handler were simply a I wonder whether it would be worth figuring out a change to the Quasar code to vector the exception code through a |
At the time, we thought about it, or perhaps a variation such as duplicating the exception blocks. But yeah, moving it out and using a GOTO could work, but also means having to pass access to local variables, some of which are not mutable and may require mutation. At the time, we though that was too much trouble to fix. I still feel like, at least for me, it'd be a rabbit hole full of traps. |
Hello, |
The text was updated successfully, but these errors were encountered: