-
Notifications
You must be signed in to change notification settings - Fork 323
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
Removing useless GraphOccurrence.Global
& some encapsulation
#11419
Conversation
GraphOccurrence.Global
GraphOccurrence.Global
& encapsulation
GraphOccurrence.Global
& encapsulationGraphOccurrence.Global
& some encapsulation
Jaroslav Tulach reports a new STANDUP for yesterday (2024-10-27): Progress: .
Next Day: Bank holiday. Establishment of Czechoslovakia. |
@@ -25,9 +25,15 @@ case class InlineContext( | |||
freshNameSupply: Option[FreshNameSupply] = None, | |||
passConfiguration: Option[PassConfiguration] = None, | |||
pkgRepo: Option[PackageRepository] = None | |||
) { | |||
) extends AutoCloseable { |
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.
Isn't it easier to make the InlineContext
closable than wrap it into InlineContextResource
?
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.
Nice simplifications.
@@ -143,7 +143,6 @@ protected Graph readObject(Input in) throws IOException { | |||
|
|||
var nextIdCounter = in.readInt(); | |||
var g = new Graph(rootScope, nextIdCounter, links); | |||
g.freeze(); |
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.
Why remove g.freeze()
from here? Is it because of failing tests? Is it not needed anymore?
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, this is weird.
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.
Is it because of failing tests?
No, it is not because of a test. Rather:
- Avoid using
assert
in Scala, useassertInJvm
to elide it in production #11027 - assert in AliasAnalysis when
runEngineDistribution --debug
#11022
Is it not needed anymore?
freeze
ing doesn't work with DebugEvalNode
right now.
val nextId = _nextIdCounter | ||
if (nextId < 0) { | ||
throw new IllegalStateException("Cannot emit new IDs. Frozen!") |
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.
IMHO it is better to have the explicit boolean frozen
field, than encoding the frozen state as nextId == -1
.
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 guess, my original idea was to not serialize nextIdCounter
in serde, but initialize it to -1
after deserialization - e.g. freeze it. But (as freezing doesn't work - #11022) I had to give up on that idea. Now the code is ready for freezing (by assigning the counter to -1), but there is no freezing happening. Hopefully it will, one day.
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.
Similar comments to @Akirathan, otherwise LGTM
Pull Request Description
Work on #11365 made me realize that
GraphOccurrence.Global
isn't really used anywhere. Simplifying the code by removing it and associated methods.Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,