-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
Further Truffle-related clean ups and simplifications. #2425
Conversation
…he end of the loops.
… remove from fast path.
…ys.copyOfRange with simplified semantics.
@@ -67,6 +65,7 @@ public boolean executeRepeating(VirtualFrame frame) { | |||
break; | |||
} catch (RedoException e) { | |||
// Just continue in the while(true) loop. | |||
context.getSafepointManager().poll(); |
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.
We do not need a safepoint if the block is executed only once. In general, doing the safepoint only after the first iteration reduces the number of safepoints compiled/executed.
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.
But the RedoException branch is only taken when using the redo
, keyword, no?
And that is quite rare, so there is no more safepoint in a typical loop with this code if I see right (or is it done with instrumentation by the LoopNode?).
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 redo
is unusual - most loops will run this inner while loop just once per actual loop iteration. I think we need to poll the safepoint before the return as well. This duplication of safepoints might be why I put it at the head in the first place.
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.
You are right. I will put the safepoints back to the original places.
Perhaps we want an |
Can we merge this? |
Further Truffle-related clean ups and simplifications.
Please review, @chrisseaton @nirvdrum @eregon.