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

Remove Harmony and related code from OpenJ9 builds #529

Open
pdbain-ibm opened this issue Nov 7, 2017 · 6 comments
Open

Remove Harmony and related code from OpenJ9 builds #529

pdbain-ibm opened this issue Nov 7, 2017 · 6 comments

Comments

@pdbain-ibm
Copy link
Contributor

Harmony code is required for certain legacy builds, but not Java 9 or OpenJ9.
Request a configuration parameter, e.g. INCLUDE_HARMONY, which is false by default,
in the cmake build system.
@pshipton FYI
@dnakamura will our cmake build system handle different configurations depending on the Java spec version?

@pdbain-ibm
Copy link
Contributor Author

Prototype: https://github.com/pdbain-ibm/openj9/tree/remove_harmony
This uses the JAVA_SPEC_VERSION compiler command line setting.

@pdbain-ibm
Copy link
Contributor Author

@DanHeidinga FYI.
Notes so far:

  1. IBM Java 8 uses the Harmony JDWP and hence the Harmony port library shim.
    This is about 47 KB on Linux x86.

  2. The IBM Java 9 VM should support Java 8, so should load the Harmony shim when running in Java 8.

  3. The Java version is checked in jvm.c:JNI_CreateJavaVM(), but does so ~100 lines after calling preloadLibraries() (which loads J9_HARMONY_PORT_LIBRARY_SHIM_DLL_NAME).

  4. JVM initialization adds an argument to the VM arguments with a pointer to the Harmony port library.

  5. runtime/vm/vmifunc.c sets up the Harmony VMI functions. In doing so, it scans the VM arguments for the setting from 4).

  6. This branch: https://github.com/pdbain-ibm/openj9/tree/disable_harmony has code to disable 4) and 5). The change is fairly simple since the Java version is known. Avoiding loading the shim is a bigger job because the version isn't known at the time.

  7. The OpenJ9 Java 8 & 9 VMs do not need the Harmony code. There is currently no build flag to distinguish IBM from OpenJ9 builds, though.

@pdbain-ibm
Copy link
Contributor Author

See also #621

@pdbain-ibm
Copy link
Contributor Author

Comment from same:
dnakamura 14 days ago • edited Contributor
Alternatively the -D/-U options I added to UMA could come in handy here. It lets you override buildspec flag settings on the command line. This is done by passing -D or -U to set/unset the option respectively. ie -D opt_harmony
Edit: See #78 for details

pdbain-ibm added a commit to pdbain-ibm/openj9 that referenced this issue Dec 18, 2017
Issue eclipse-openj9#529 Remove Harmony code from OpenJ9 builds

Signed-off-by: Peter Bain <[email protected]>
pdbain-ibm added a commit to pdbain-ibm/openj9 that referenced this issue Dec 19, 2017
If required, opt_harmony can be forced on vi the command line UMA option.

Issue: eclipse-openj9#529

Signed-off-by: Peter Bain <[email protected]>
@pdbain-ibm pdbain-ibm changed the title Remove Harmony code from OpenJ9 builds Remove Harmony and related code from OpenJ9 builds Dec 20, 2017
@pdbain-ibm
Copy link
Contributor Author

Per discussion with @pshipton, removing Harmony also allows us to remove some port library socket code.

@pdbain-ibm
Copy link
Contributor Author

Picking this up again. The entire socket code is still required for Harmony in the proprietary builds
but only a subset is required for OpenJ9.
Two approaches to removing the socket code:

  1. split the socket library and move the functions needed by Harmony to an internal repo.
  2. ifdef out the functions required by Harmony.

@DanHeidinga FYI.

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

No branches or pull requests

2 participants