-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
ensure source position for new instance node is tracked #3621
Conversation
Why not apply a similar fix to other places where |
@tkrodriguez Thanks for looking at this.
In that case would we not already have a source node position on the virtual object? i.e. can we not finesse this by setting the source node position only if the current one is either null or a place holder. I'm assuming that this case only happens when the 'same' virtual object can be reused for multiple virtualizations? If so then leaving the original source node position would be a way to record something useful about the provenance of this 'same' object at all points of use even if it related that provenance to a source location where an original version of that object was created rather than some later source point where an equivalent copy would have been created. |
Yes |
d8a0179
to
46206c7
Compare
@tkrodriguez Hi Tom. I just pushed a new fix where I modified createVirtualObject to accept a source position and,if non-null, set it on the VirtualNode (in which case it asserts a position is not already set). I changed all callers to pass what I think is the appropriate source position. There were 2 special cases:
Well, there is a third case, actually. I'm not 100% clear I have done the right thing in NewFrameNode. I'm assuming the NewFrameNode has a source position at the point where its virtual references are processed by calling createVirtualObject and propagating the NewFrameNode position to them. I don't really know enough about Truffle to know if this is appropriate or not. |
One more tricky case corrected -- ObjectClone should not try to reset the source position when it duplicates an existing virtual node. |
.../org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/CommitAllocationNode.java
Outdated
Show resolved
Hide resolved
...ler.truffle.compiler/src/org/graalvm/compiler/truffle/compiler/nodes/frame/NewFrameNode.java
Show resolved
Hide resolved
...graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualizerToolImpl.java
Outdated
Show resolved
Hide resolved
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.
What's here looks good to me. I'm going to be away for a week and a half so I won't be able to give further feedback after today.
@adinn CodeFormatCheck failed in GraalVM Gate / labsjdk-ce-11 style,fullbuild compiler (pull_request) , can you please run "mx eclipseformat", check in changes and repush?
|
@mcraj017 Hi Munish. I've fixed the style errors and also made the corrections Tom suggested. |
LGTM |
@dougxc Thanks for the review! |
Hi @dougxc Is this PR going through the internal gate or has it got stuck for some reason? |
I’m on vacation for 2 weeks but believe @mcraj017 is in the process of merging it. |
@dougxc sorry to interrupt your hols. thanks for the update! |
@mcraj017 gentle ping: is this still waiting to be merged? |
@adinn Yes, still waiting for merge, it will get merged by this week |
This is proposed as a simple fix for the problem reported in issue #3620.