-
-
Notifications
You must be signed in to change notification settings - Fork 736
refactor(transformer/class-properties): re-order fields and expand comments #10447
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
refactor(transformer/class-properties): re-order fields and expand comments #10447
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
CodSpeed Instrumentation Performance ReportMerging #10447 will create unknown performance changesComparing Summary
Benchmarks breakdown
|
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.
Looks good!
By the way, I forgot one thing in my PR: to add a debug_assert_eq!(self.private_field_count, 0) in exit_program or elsewhere to ensure we are correctly handling private_field_count so that we can catch any potential bug related to this in the future if we do a huge refactor in class_properties.
Merge activity
|
…mments (#10447) Follow-on after #10418. Pure refactor. `private_field_count` is accessed in both the entry and exit phases of the transform, so move that field up to be with the other fields which are in that same category. Expand the comment which explains how this optimization works. Also, when reviewing #10418, I had to trace through the logic to make sure that it wasn't possible for decreasing `private_field_count` on exit to get skipped if `is_transform_required` is `false`. Turns out it's not a problem - `is_transform_required` is always `true` if class has any private properties/methods. Add comments to clarify that.
ae08f67 to
3ebd494
Compare
…ount` is 0 at end of transform (#10457) `private_field_count` is incremented when entering a class with private properties/methods and decremented when leaving it. Make sure this is working correctly by ensuring `private_field_count == 0` at the end of the transform. As suggested in #10447 (review).

Follow-on after #10418. Pure refactor.
private_field_countis accessed in both the entry and exit phases of the transform, so move that field up to be with the other fields which are in that same category.Expand the comment which explains how this optimization works.
Also, when reviewing #10418, I had to trace through the logic to make sure that it wasn't possible for decreasing
private_field_counton exit to get skipped ifis_transform_requiredisfalse. Turns out it's not a problem -is_transform_requiredis alwaystrueif class has any private properties/methods. Add comments to clarify that.