Add method reference to FuncOp#992
Conversation
|
👋 Welcome back mabbay! A progress list of the required criteria for merging this PR into |
|
@mabbay This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 1 new commit pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
|
@mabbay this pull request can not be integrated into git checkout funcop-mref
git fetch https://git.openjdk.org/babylon.git code-reflection
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge code-reflection"
git push |
# Conflicts: # src/jdk.incubator.code/share/classes/jdk/incubator/code/dialect/core/CoreOp.java
|
/template append |
|
@mabbay The pull request template has been appended to the pull request body |
# Conflicts: # src/jdk.incubator.code/share/classes/jdk/incubator/code/dialect/core/CoreOp.java
This reverts commit c634d41.
|
@mabbay This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply issue a |
# Conflicts: # src/jdk.incubator.code/share/classes/jdk/incubator/code/dialect/core/CoreOp.java
PaulSandoz
left a comment
There was a problem hiding this comment.
Check for canonicalization of models in runtime tests.
| } | ||
|
|
||
| private boolean isFakeSource() { | ||
| return !source.refType().equals(JavaType.VOID); |
There was a problem hiding this comment.
The method name seems to describe the inversion of its implementation. Perhaps change to:
private boolean isSyntheticSourceRef() {
return source.refType().equals(JavaType.VOID);
}
| * @return the reference to the method this function operation models. | ||
| */ | ||
| public Optional<MethodRef> sourceRef() { | ||
| return isFakeSource() ? Optional.of(source) : Optional.empty(); |
There was a problem hiding this comment.
Change to:
/**
* {@return the source reference to the method this operation models, otherwise an empty optional if the reference is unavailable.}
*/
public Optional<MethodRef> sourceRef() {
return isSyntheticSourceRef() ? Optional.empty() : Optional.of(source);
}
| if (!method.isAnnotationPresent(Reflect.class)) return; | ||
| String found = canonicalizeModel(method, Op.ofMethod(method).orElseThrow()); | ||
| CoreOp.FuncOp op = Op.ofMethod(method).orElseThrow(); | ||
| String found = canonicalizeModel(method, removeSourceAttribute(op)); |
There was a problem hiding this comment.
Make note this is a work around to avoid updating the tests, which we will do later.
Allow user to attach a MethodRef to a FuncOp.
Compiler tests are failing because of these changes, instead of updating the tests, we remove the source attribute from the
javacmodel before testing.Attaching MethodRef to FuncOp will allow us to access the original j.l.r.Method from which we extracted a FuncOp -JDK-8376824
Progress
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/babylon.git pull/992/head:pull/992$ git checkout pull/992Update a local copy of the PR:
$ git checkout pull/992$ git pull https://git.openjdk.org/babylon.git pull/992/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 992View PR using the GUI difftool:
$ git pr show -t 992Using diff file
Download this PR as a diff file:
https://git.openjdk.org/babylon/pull/992.diff
Using Webrev
Link to Webrev Comment