Add binding anchors; make profile-all use srcspan from anchors#7730
Open
SeungheonOh wants to merge 1 commit intomasterfrom
Open
Add binding anchors; make profile-all use srcspan from anchors#7730SeungheonOh wants to merge 1 commit intomasterfrom
profile-all use srcspan from anchors#7730SeungheonOh wants to merge 1 commit intomasterfrom
Conversation
Contributor
Execution Budget Golden Diffoutputplutus-tx-plugin/test/CallTrace/9.6/successfullEvaluationYieldsNoTraceLog.golden.eval
This comment will get updated when changes are made. |
SeungheonOh
commented
Apr 21, 2026
| anchor for every hoisted binding, so profile-trace output identifies which | ||
| function was entered (the span points to the binder, not an arbitrary | ||
| sub-expression). See issue #7722. -} | ||
| anchorBinding |
Collaborator
Author
There was a problem hiding this comment.
we are using same anchor function that's being used for anchoring expressions. It's working okay at the moment, but maybe in the future we want to separate binding anchors with some other anchor function like bindingAnchor so that it can be distinguished more easily
zliu41
reviewed
Apr 21, 2026
|
|
||
| {-| Find the first @anchor@-carried 'RealSrcSpan' anywhere inside a 'CoreExpr', | ||
| descending through applications, lambdas, lets, cases, casts, and ticks. | ||
| Useful when the immediate head of the expression is not an anchor call |
Member
There was a problem hiding this comment.
Do you have an example where the immediate head of the expression is not an anchor call, because it was hoisted?
Collaborator
Author
There was a problem hiding this comment.
Looking back, I don't think this is the case anymore after adding binding anchor.
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.
closes #7722
Added anchors to bindings; added anchors can be used in
profile-allwhich is used for profiling and call tracing to mark function entrance/exit source span.Previously, function entrance and exit source span was extracted from GHC.Var which only gave source span when the module was freshly compiled. When module was not compiled and cache was used from previous compilation, GHC.Var will not provide any source span. New anchor based source span fixes this and provide correct source span even when module compilation is cached.