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

8264805: Remove the experimental Ahead-of-Time Compiler #3398

Closed
wants to merge 6 commits into from

Conversation

@vnkozlov
Copy link
Contributor

@vnkozlov vnkozlov commented Apr 8, 2021

As part of JEP 410 remove code related to Ahead-of-Time Compiler from JDK:

  • jdk.aot module — the jaotc tool
  • src/hotspot/share/aot — loads AoT compiled code into VM for execution
  • related HotSpot code guarded by #if INCLUDE_AOT

Additionally, remove tests as well as code in makefiles related to AoT compilation.

Tested hs-tier1-4


Progress

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

Issue

  • JDK-8264805: Remove the experimental Ahead-of-Time Compiler

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/3398/head:pull/3398
$ git checkout pull/3398

Update a local copy of the PR:
$ git checkout pull/3398
$ git pull https://git.openjdk.java.net/jdk pull/3398/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 3398

View PR using the GUI difftool:
$ git pr show -t 3398

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/3398.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Apr 8, 2021

👋 Welcome back kvn! 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.

@openjdk
Copy link

@openjdk openjdk bot commented Apr 8, 2021

@vnkozlov this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout JDK-8264805
git fetch https://git.openjdk.java.net/jdk master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push
@openjdk
Copy link

@openjdk openjdk bot commented Apr 8, 2021

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

  • build
  • core-libs
  • hotspot
  • serviceability
  • shenandoah

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.

@mlbridge
Copy link

@mlbridge mlbridge bot commented Apr 8, 2021

Webrevs

@vnkozlov
Copy link
Contributor Author

@vnkozlov vnkozlov commented Apr 8, 2021

/label remove merge-conflict

@coleenp
Copy link

@coleenp coleenp commented Apr 8, 2021

void CodeCache::mark_for_evol_deoptimization(InstanceKlass* dependee) {
This function, its caller and the function in jvmtiRedefineClasses.cpp that calls it can be deleted also, but you can file a separate RFE for that if you want.

@coleenp
coleenp approved these changes Apr 8, 2021
Copy link

@coleenp coleenp left a comment

I looked at the changes in oops, runtime, classfile and code directories.

@erikj79
erikj79 approved these changes Apr 8, 2021
Copy link
Member

@erikj79 erikj79 left a comment

Build changes look good.

@stefank
stefank approved these changes Apr 8, 2021
Copy link
Member

@stefank stefank left a comment

GC changes look good.

@vnkozlov
Copy link
Contributor Author

@vnkozlov vnkozlov commented Apr 8, 2021

void CodeCache::mark_for_evol_deoptimization(InstanceKlass* dependee) {
This function, its caller and the function in jvmtiRedefineClasses.cpp that calls it can be deleted also, but you can file a separate RFE for that if you want.

Thank you, Coleen, for review. I will wait other comments and will remove this code.

@vnkozlov
Copy link
Contributor Author

@vnkozlov vnkozlov commented Apr 8, 2021

Thank you, Erik and Stefan.

Copy link
Member

@iignatev iignatev left a comment

Test changes look good to me.

@coleenp
Copy link

@coleenp coleenp commented Apr 8, 2021

There's a comment above
void VM_RedefineClasses::mark_dependent_code(InstanceKlass* ik) {
that should be rewritten, so I think we should just file an RFE to remove it afterwards.

@openjdk
Copy link

@openjdk openjdk bot commented Apr 8, 2021

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

8264805: Remove the experimental Ahead-of-Time Compiler

Reviewed-by: coleenp, erikj, stefank, iignatyev, dholmes, aph, shade, iklam, mchung, iveresov

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

  • 1d37b98: 8265972: Remove declarations with no implementations in javaClasses.hpp
  • cb29b19: 8184134: HeapRegion::LogOfHRGrainWords is unused
  • 41daa88: 8265899: Use pattern matching for instanceof at module jdk.compiler(part 1)
  • a6f2863: 8266003: ProblemList sanity/client/SwingSet/src/ButtonDemoScreenshotTest.java on macosx-all
  • 852a41d: 8258625: [JVMCI] refactor and unify JVMCI readFieldValue path
  • b5c6351: 8264663: Update test SuspendWithCurrentThread.java to verify that suspend doesn't exit until resumed

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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.

@openjdk openjdk bot added ready and removed merge-conflict labels Apr 8, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Apr 8, 2021

@vnkozlov The label merge-conflict is not a valid label. These labels are valid:

  • serviceability
  • hotspot
  • sound
  • hotspot-compiler
  • kulla
  • i18n
  • shenandoah
  • jdk
  • javadoc
  • 2d
  • security
  • swing
  • hotspot-runtime
  • jmx
  • build
  • nio
  • beans
  • core-libs
  • compiler
  • net
  • hotspot-gc
  • hotspot-jfr
  • awt
@vnkozlov
Copy link
Contributor Author

@vnkozlov vnkozlov commented Apr 8, 2021

There's a comment above
void VM_RedefineClasses::mark_dependent_code(InstanceKlass* ik) {
that should be rewritten, so I think we should just file an RFE to remove it afterwards.

https://bugs.openjdk.java.net/browse/JDK-8264941

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Hi Vladimir,

This looks good to me - I went through all the files.

It was nice to see how nicely compartmentalized the AOT feature was - that made checking the changes quite simple. The one exception was the fingerprinting code, which for some reason was AOT-only but not marked that way, so I'm not sure what the story is there. ??

I was also surprised to see some of the flags were not marked experimental, so there will need to a CSR request to remove those without going through the normal deprecation process.

Thanks,
David

@@ -193,11 +131,11 @@ void CompiledDirectStaticCall::verify() {

#ifdef ASSERT
CodeBlob *cb = CodeCache::find_blob_unsafe((address) _call);
assert(cb && !cb->is_aot(), "CompiledDirectStaticCall cannot be used on AOTCompiledMethod");
assert(cb, "sanity");

This comment has been minimized.

@dholmes-ora

dholmes-ora Apr 9, 2021
Member

Nit: implied boolean - use "cb != NULL"

This comment has been minimized.

@vnkozlov

vnkozlov Apr 9, 2021
Author Contributor

done

// of the actual code an AOTCompiledMethod object is pointing to in order to locate it.
// Notice that for an ordinary CodeBlob with code size zero, code_begin() may point beyond the object!
const void* start = AOT_ONLY( (code_blob_type() == CodeBlobType::AOT) ? blob->code_begin() : ) (void*)blob;
const void* start = (void*)blob;

This comment has been minimized.

@dholmes-ora

dholmes-ora Apr 9, 2021
Member

start seems redundant now

This comment has been minimized.

@vnkozlov

vnkozlov Apr 9, 2021
Author Contributor

Done:

   bool contains_blob(const CodeBlob* blob) const {
-    const void* start = (void*)blob;
-    return contains(start);
+    return contains((void*)blob);
   }
@openjdk openjdk bot added the csr label Apr 9, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Apr 9, 2021

@dholmes-ora has indicated that a compatibility and specification (CSR) request is needed for this pull request.
@vnkozlov please create a CSR request and add link to it in JDK-8264805. This pull request cannot be integrated until the CSR request is approved.

@openjdk openjdk bot removed the ready label Apr 9, 2021
Copy link
Contributor

@theRealAph theRealAph left a comment

AArch64 looks fine.

Copy link
Contributor

@shipilev shipilev left a comment

Shenandoah parts look good. I have a few minor comments after reading the rest.

@@ -70,7 +70,7 @@ const bool CCallingConventionRequiresIntsAsLongs = false;
#endif

#if INCLUDE_JVMCI
#define COMPRESSED_CLASS_POINTERS_DEPENDS_ON_COMPRESSED_OOPS (EnableJVMCI || UseAOT)
#define COMPRESSED_CLASS_POINTERS_DEPENDS_ON_COMPRESSED_OOPS (EnableJVMCI)

This comment has been minimized.

@shipilev

shipilev Apr 9, 2021
Contributor

Minor nit: can probably drop parentheses here.

This comment has been minimized.

@vnkozlov

vnkozlov Apr 9, 2021
Author Contributor

done

} else {
tty->print("unknown");
Comment on lines 714 to 715

This comment has been minimized.

@shipilev

shipilev Apr 9, 2021
Contributor

We can probably split this cleanup into the minor issue, your call. The benefit of separate issue: backportability.

This comment has been minimized.

@@ -255,8 +254,7 @@ class InstanceKlass: public Klass {
_misc_has_nonstatic_concrete_methods = 1 << 5, // class/superclass/implemented interfaces has non-static, concrete methods
_misc_declares_nonstatic_concrete_methods = 1 << 6, // directly declares non-static, concrete methods
_misc_has_been_redefined = 1 << 7, // class has been redefined
_misc_has_passed_fingerprint_check = 1 << 8, // when this class was loaded, the fingerprint computed from its
// code source was found to be matching the value recorded by AOT.
_unused = 1 << 8, //

This comment has been minimized.

@veresov

veresov Apr 9, 2021
Contributor

Any particular reason we don't want to remove this gap?

This comment has been minimized.

@vnkozlov

vnkozlov Apr 9, 2021
Author Contributor

Less changes. We don't get any benefits from removing it. It is opposite - if we need a new value we will use it without changing following values again.

@@ -1331,12 +1184,6 @@ void CodeInstaller::site_DataPatch(CodeBuffer& buffer, jint pc_offset, JVMCIObje
if (!_immutable_pic_compilation) {

This comment has been minimized.

@veresov

veresov Apr 9, 2021
Contributor

All _immutable_pic_compilation mentions can be removed as well. It is true only for AOT compiles produced by Graal. It's never going to be used without AOT.

This comment has been minimized.

@vnkozlov

vnkozlov Apr 9, 2021
Author Contributor

Done. I removed _immutable_pic_compilation in JVMCI in Hotspot.

@iklam
iklam approved these changes Apr 9, 2021
Copy link
Member

@iklam iklam left a comment

LGTM. Just a small nit.

@@ -79,9 +76,6 @@ void MethodCounters::clear_counters() {

void MethodCounters::metaspace_pointers_do(MetaspaceClosure* it) {

This comment has been minimized.

@iklam

iklam Apr 9, 2021
Member

MethodCounters::metaspace_pointers_do can be removed altogether (also need to remove the declaration in methodCounter.hpp).

This comment has been minimized.

@vnkozlov

vnkozlov Apr 9, 2021
Author Contributor

Done.

@vnkozlov
Copy link
Contributor Author

@vnkozlov vnkozlov commented Apr 9, 2021

/label add hotspot-compiler

@openjdk
Copy link

@openjdk openjdk bot commented Apr 9, 2021

@vnkozlov
The hotspot-compiler label was successfully added.

@vnkozlov
Copy link
Contributor Author

@vnkozlov vnkozlov commented Apr 9, 2021

Hi Vladimir,

This looks good to me - I went through all the files.

It was nice to see how nicely compartmentalized the AOT feature was - that made checking the changes quite simple. The one exception was the fingerprinting code, which for some reason was AOT-only but not marked that way, so I'm not sure what the story is there. ??

I was also surprised to see some of the flags were not marked experimental, so there will need to a CSR request to remove those without going through the normal deprecation process.

Thanks,
David

Thank you, David.
We thought that we could use fingerprint code for other cases that is why we did not put it under #if INCLUDE_AOT.
I filed CSR for AOT product flags removal: https://bugs.openjdk.java.net/browse/JDK-8265000

@openjdk openjdk bot mentioned this pull request Apr 9, 2021
3 tasks done
@vnkozlov
Copy link
Contributor Author

@vnkozlov vnkozlov commented Apr 9, 2021

Thank you, Igor Ignatyev, Igor Veresov, Ioi, Aleksey and Andrew for reviews.
I will update changes based on your comments.

@mlchung
mlchung approved these changes Apr 9, 2021
Copy link
Member

@mlchung mlchung left a comment

I reviewed the module-loader-map and non-hotspot non-AOT tests.

@veresov
veresov approved these changes Apr 9, 2021
@dean-long
Copy link
Member

@dean-long dean-long commented Apr 10, 2021

@iklam
I thought the fingerprint code was also used by CDS.

@iklam
Copy link
Member

@iklam iklam commented Apr 10, 2021

@iklam
I thought the fingerprint code was also used by CDS.

CDS actually uses a different mechanism (CRC of the classfile bytes) to validate that a class has not changed between archive dumping time and runtime. See

int clsfile_crc32 = ClassLoader::crc32(0, (const char*)cfs->buffer(), cfs->length());
if (!record->matches(clsfile_size, clsfile_crc32)) {
return NULL;
}

@openjdk openjdk bot added merge-conflict and removed csr labels Apr 14, 2021
@openjdk openjdk bot added ready and removed merge-conflict labels Apr 26, 2021
@vnkozlov
Copy link
Contributor Author

@vnkozlov vnkozlov commented Apr 27, 2021

/integrate

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

@openjdk openjdk bot commented Apr 27, 2021

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

  • 15d4787: 8265496: improve null check in DeflaterOutputStream/InflaterInputStream
  • 1d37b98: 8265972: Remove declarations with no implementations in javaClasses.hpp
  • cb29b19: 8184134: HeapRegion::LogOfHRGrainWords is unused
  • 41daa88: 8265899: Use pattern matching for instanceof at module jdk.compiler(part 1)
  • a6f2863: 8266003: ProblemList sanity/client/SwingSet/src/ButtonDemoScreenshotTest.java on macosx-all
  • 852a41d: 8258625: [JVMCI] refactor and unify JVMCI readFieldValue path
  • b5c6351: 8264663: Update test SuspendWithCurrentThread.java to verify that suspend doesn't exit until resumed

Your commit was automatically rebased without conflicts.

Pushed as commit 694aced.

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

@vnkozlov vnkozlov deleted the vnkozlov:JDK-8264805 branch Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment