-
Notifications
You must be signed in to change notification settings - Fork 6k
8273278: Support XSLT on GraalVM Native Image--deterministic bytecode generation in XSLT #5331
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
8273278: Support XSLT on GraalVM Native Image--deterministic bytecode generation in XSLT #5331
Conversation
Hi @jovanstevanovic, welcome to this OpenJDK project and thanks for contributing! We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user jovanstevanovic" as summary for the issue. If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing |
@jovanstevanovic The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
|
I guess a question here will be whether this should be contributed to the upstream Xalan project to keep the changes in the JDK in sync, or maybe the JDK has diverged too much already for this to matter. |
It seems that both repositories for Xalan on Apache's GH (https://github.com/apache/xalan-java and https://github.com/apache/xalan-j) are inactive for two and a half years. |
Yeah, there hasn't been any major activities (i.e. a minor release) for 7 years. It's also true that the JDK has diverged. |
|
@jovanstevanovic 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 27 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@JoeWang-Java) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
@JoeWang-Java We need to backport this to JDK 11 as well. How can we do that? Also, is there anything else I should do to merge these changes after approval? |
I'm not involved in any older releases. You'll need to find the right channel for a particular backport you want to make and ask there. As for merging the change in the current release, please update the copyright header and the LastModified date for each of the classes. The github interface unfortunately won't allow me to add comments directly to the unchanged code area. Once that's done, you'll need to issue an integrate command. I'll sponsor your change. |
Okay, I'll take a look for a proper channel. Also, copyright headers and LastModified dates are not up to date. |
The headers look good now. Thanks. |
Great! |
/integrate |
/sponsor |
@JoeWang-Java The change author (@jovanstevanovic) must issue an |
@jovanstevanovic |
@JoeWang-Java Looks like the OpenJDK bot is bugging, so I think you need to comment again with the same sponsor command. |
/sponsor |
Going to push as commit f690a01.
Your commit was automatically rebased without conflicts. |
@JoeWang-Java @jovanstevanovic Pushed as commit f690a01. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
GraalVM Native Image supports loading classes at runtime if they are known during image build (class predefinition). This is achieved by the JVMTI agent that registers dynamically generated classes in a regular HotSpot run. The Native Image build uses these registered classes to embed them into the produced binary so they can be loaded at runtime. Loading at runtime is achieved by matching the unique hash of generated classes.
If the generated bytecode is unstable across runs, the generated native image can not match the hash of the runtime-generated bytecode to the pre-defined classes. The execution failure happens here:
https://github.com/oracle/graal/blob/master/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/hub/PredefinedClassesSupport.java#L127-L131.
In XSLT the produced bytecode is unstable for the following reasons:
Methods like
HashMap#values
andHashMap#keySet
result in different traversal orders of its elements yielding a different order of methods and fields.The default
Object#toString
includes the current memory reference ofcom.sun.org.apache.xalan.internal.xsltc.compiler.Number
in the generated class.Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/5331/head:pull/5331
$ git checkout pull/5331
Update a local copy of the PR:
$ git checkout pull/5331
$ git pull https://git.openjdk.java.net/jdk pull/5331/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 5331
View PR using the GUI difftool:
$ git pr show -t 5331
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/5331.diff