Skip to content
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

8260193: Remove JVM_GetInterfaceVersion() and JVM_DTraceXXX #2338

Conversation

@iklam
Copy link
Member

@iklam iklam commented Feb 1, 2021

  • JVM_GetInterfaceVersion() was used by "HotSpot Express" (HSX) which allowed the same JDK library to use different version of HotSpot. However, HSX is no longer supported so this API should be removed.
  • Implementations of APIs such as JVM_DTraceActivate, were removed in JDK-8068976, so their declarations should be removed from jvm.h

Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8260193: Remove JVM_GetInterfaceVersion() and JVM_DTraceXXX

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/2338/head:pull/2338
$ git checkout pull/2338

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Feb 1, 2021

👋 Welcome back iklam! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Feb 1, 2021

@iklam The following labels will be automatically applied to this pull request:

  • core-libs
  • hotspot

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

Loading

@iklam iklam marked this pull request as ready for review Feb 1, 2021
@openjdk openjdk bot added the rfr label Feb 1, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Feb 1, 2021

Webrevs

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Feb 1, 2021

@iklam 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:

8260193: Remove JVM_GetInterfaceVersion() and JVM_DTraceXXX

Reviewed-by: alanb, lfoltan, gziemski, ihse

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 15 new commits pushed to the master branch:

  • 0093183: 8260368: [PPC64] GC interface needs enhancement to support GCs with load barriers
  • defcb04: 8260867: ProblemList java/awt/FullScreen/TranslucentWindow/TranslucentWindow.java on linux
  • a421bfa: 8259839: SystemDictionary exports too much implementation
  • 189b65b: 8260264: Move common os_ inline methods to a common posix source file
  • 288a4fe: 8260643: Remove parallel version handling in CardTableRS::younger_refs_in_space_iterate()
  • ddd2951: 8260571: Add PrintMetaspaceStatistics to print metaspace statistics upon VM exit
  • fe407cf: 8260420: C2 compilation fails with assert(found_sfpt) failed: no node in loop that's not input to safepoint
  • 474dba2: 8257086: Clarify differences between {Float, Double}.equals and ==
  • 54e7a64: 8260576: Typo in compiler/runtime/safepoints/TestRegisterRestoring.java
  • a6d9505: 8260864: ProblemList two security/krb5 tests on Linux
  • ... and 5 more: https://git.openjdk.java.net/jdk/compare/df33595e9fb32267da9702863ab131d98ab71422...master

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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

Loading

@openjdk openjdk bot added the ready label Feb 1, 2021
lfoltan
lfoltan approved these changes Feb 1, 2021
@openjdk openjdk bot added the build label Feb 1, 2021
DEF_JNI_OnLoad(JavaVM *vm, void *reserved)
{
jint vm_version = JVM_GetInterfaceVersion();
if (vm_version != JVM_INTERFACE_VERSION) {
JNIEnv *env;
char buf[128];
sprintf(buf, "JVM interface version mismatch: expecting %d, got %d.",
JVM_INTERFACE_VERSION, (int)vm_version);
(*vm)->GetEnv(vm, (void **)&env, JNI_VERSION_1_2);
if (env) {
(*env)->FatalError(env, buf);
}
}
return JNI_VERSION_1_2;
Copy link

@gerard-ziemski gerard-ziemski Feb 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This leaves an entire file with one trivial function implementation. Can we remove the file and implement DEF_JNI_OnLoad() in jni_util.h (or some other existing suitable file) ?

Loading

Copy link
Member Author

@iklam iklam Feb 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if jni_utils.c is the right file (it defines the JNU_XXX functions that are used by other shared libraries).

There are other .c files that have trivial DEF_JNI_OnLoad functions (e.g., java.base/share/native/libnio/nio_util.c).

@AlanBateman do you have any suggestions?

Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with the way it is, just thought we might want to consider cleaning up a bit more, since it's a cleanup task itself.

Loading

Copy link
Member Author

@iklam iklam Feb 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Gerard. The main purpose of this PR is to clean up the JVM side. I'll leave the refactoring of check_version.c to the core-lib team.

Loading

magicus
magicus approved these changes Feb 2, 2021
Copy link
Member

@magicus magicus left a comment

"Build" change looks good.

Loading

@iklam
Copy link
Member Author

@iklam iklam commented Feb 3, 2021

Thanks @gerard-ziemski @magicus @AlanBateman @lfoltan for the review.
/integrate

Loading

@openjdk openjdk bot closed this Feb 3, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Feb 3, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Feb 3, 2021

@iklam Since your change was applied there have been 26 commits pushed to the master branch:

  • 98a7692: 8076313: GraphicsEnvironment does not detect changes in count of monitors on Linux OS
  • a47befc: 8260878: com/sun/jdi/JdbOptions.java fails without jfr
  • d423d36: 8258508: Merge G1RedirtyCardsQueue into qset
  • bec6043: 8259570: (macos) tools/jpackage tests fails with 'hdiutil: couldn't eject "disk2" - Resource busy'
  • ffbcf1b: 8260471: Change SystemDictionary::X_klass calls to vmClasses::X_klass
  • 9af3339: 8261003: Bad Copyright header format after JDK-8183372
  • 6dc3c6d: 8183372: Refactor java/lang/Class shell tests to java
  • 105d3e8: 8260861: TrustStoreDescriptor log the same value
  • 69189f8: 8256421: Add 2 HARICA roots to cacerts truststore
  • f546fd0: 8260902: CDS mapping errors should not lead to unconditional output
  • ... and 16 more: https://git.openjdk.java.net/jdk/compare/df33595e9fb32267da9702863ab131d98ab71422...master

Your commit was automatically rebased without conflicts.

Pushed as commit b9d4211.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment