eclipse-openj9 / openj9

Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput. Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.
Other
3.26k stars 717 forks source link

Consolidate j9vm files to single C++ file #19441

Open ThanHenderson opened 3 months ago

ThanHenderson commented 3 months ago

Description

In runtime/j9vm there are vmi.c, j7vmi.c, j8vmi.c, java11vmi.c, and javanextvmi.cpp files.

Each of these contain implementations of the public JVM interface (the JVM_ functions). The initial reason for distinction seemed to be adding new functionality for Java releases, and having a separate file that adds the new functionality. This convention seems to have been abandoned with the introduction of javanextvmi.cpp, moreover, each file contain conditional compilation #if-directives dependent on JAVA_SPEC_VERSION and contain functionality for multiple Java versions regardless of the file distinction.

Proposal

Consolidate the vmi.c, j7vmi.c, j8vmi.c, java11vmi.c, and javanextvmi.cpp files into a single C++ file. Most LOC are git blamed to Initial OpenJ9 contribution, so by rewriting we won't be sacrificing much in the way of commit history. This opportunity also allows us to continue the migration to C++, continue to move toward adopting more modern C++ conventions/features, simplify the code, and write better documentation.

pshipton commented 3 months ago

It's fine with me. @tajila @keithc-ca

keithc-ca commented 3 months ago

This seems reasonable.

tajila commented 3 months ago

I'm fine with it.