-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8337987: Relocate jfr and throw_exception stubs from StubGenerator to SharedRuntime #20566
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
Conversation
|
👋 Welcome back adinn! A progress list of the required criteria for merging this PR into |
|
@adinn 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 3 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
|
/label runtime |
|
@adinn
|
|
/label hotspot-runtime |
|
@adinn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, add description to PR
| // Build this early so it's available for the interpreter | ||
| StubRoutines::_throw_StackOverflowError_entry = generate_throw_exception("StackOverflowError throw_exception", | ||
| CAST_FROM_FN_PTR(address, SharedRuntime::throw_StackOverflowError)); | ||
| StubRoutines::_throw_delayed_StackOverflowError_entry = generate_throw_exception("delayed StackOverflowError throw_exception", | ||
| CAST_FROM_FN_PTR(address, SharedRuntime::throw_delayed_StackOverflowError)); | ||
| CAST_FROM_FN_PTR(address, SharedRuntime::throw_delayed_StackOverflowError)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not seems correct. And I see linux-x86 (32 bits) corresponding build failure in GHA.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, that was an accidental paste while editing the code. Should be fixed now.
|
Hi Andrew, I find that we need following add-on change for riscv: |
|
Hi @RealFYang
Thanks for checking. Should be fixed by the latest push. |
| \ | ||
| static_field(StubRoutines, _verify_oop_count, jint) \ | ||
| \ | ||
| static_field(StubRoutines, _throw_delayed_StackOverflowError_entry, address) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the following symbol exporting
diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVM.hpp b/src/hotspot/share/jvmci/jvmciCompilerToVM.hpp
index 8fdb96a3038..0e96cea6596 100644
--- a/src/hotspot/share/jvmci/jvmciCompilerToVM.hpp
+++ b/src/hotspot/share/jvmci/jvmciCompilerToVM.hpp
@@ -50,6 +50,7 @@ class CompilerToVM {
static address SharedRuntime_deopt_blob_unpack_with_exception_in_tls;
static address SharedRuntime_deopt_blob_uncommon_trap;
static address SharedRuntime_polling_page_return_handler;
+ static address SharedRuntime_throw_delayed_StackOverflowError_blob;
static address nmethod_entry_barrier;
static int thread_disarmed_guard_value_offset;
diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp b/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp
index 2116133e56e..27031bf55fe 100644
--- a/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp
+++ b/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp
@@ -68,6 +68,7 @@ address CompilerToVM::Data::SharedRuntime_deopt_blob_unpack;
address CompilerToVM::Data::SharedRuntime_deopt_blob_unpack_with_exception_in_tls;
address CompilerToVM::Data::SharedRuntime_deopt_blob_uncommon_trap;
address CompilerToVM::Data::SharedRuntime_polling_page_return_handler;
+address CompilerToVM::Data::SharedRuntime_throw_delayed_StackOverflowError_blob;
address CompilerToVM::Data::nmethod_entry_barrier;
int CompilerToVM::Data::thread_disarmed_guard_value_offset;
@@ -158,6 +159,7 @@ void CompilerToVM::Data::initialize(JVMCI_TRAPS) {
SharedRuntime_deopt_blob_unpack_with_exception_in_tls = SharedRuntime::deopt_blob()->unpack_with_exception_in_tls();
SharedRuntime_deopt_blob_uncommon_trap = SharedRuntime::deopt_blob()->uncommon_trap();
SharedRuntime_polling_page_return_handler = SharedRuntime::polling_page_return_handler_blob()->entry_point();
+ SharedRuntime_throw_delayed_StackOverflowError_blob = SharedRuntime::throw_delayed_StackOverflowError_entry();
BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod();
if (bs_nm != nullptr) {
diff --git a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp
index 130f1032e65..e0c56ccabee 100644
--- a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp
+++ b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp
@@ -68,6 +68,8 @@
static_field(CompilerToVM::Data, SharedRuntime_deopt_blob_uncommon_trap, address) \
static_field(CompilerToVM::Data, SharedRuntime_polling_page_return_handler, \
address) \
+ static_field(CompilerToVM::Data, SharedRuntime_throw_delayed_StackOverflowError_blob, \
+ address) \
\
static_field(CompilerToVM::Data, nmethod_entry_barrier, address) \
static_field(CompilerToVM::Data, thread_disarmed_guard_value_offset, int) \
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @mur47x111. Thanks for looking at this PR.
I deleted the static field declaration from vmStructs_jvmci.cpp because I found no other mention of throw_delayed_StackOverflowError_entry under src/hotspot/share/jvmci. So, I assumed it was not being used by any JVMCI clients.
I am happy to push a patch with your proposed changes. However, I just wanted to check whether you are sure you want to use the name SharedRuntime_throw_delayed_StackOverflowError_blob in the new declarations of the CompilerToVM field.
I am asking because I when I moved the exception stubs from StubGenerator to SharedRuntime I also made a change in the way the stubs are named, stored and accessed.
The original field StubGenerator::SharedRuntime_throw_delayed_StackOverflowError_entry stored the entry point for the throw routine and was of type address. The getter method that returns the entry address simply returns the field value.
The relocated field SharedRuntime::_throw_delayed_StackOverflowError_blob stores a pointer to a RuntimeBlob, the one that contains the throw routine. That is why the field name ends with _blob not _entry. The entry address is not stored directly in class SharedRuntime. In the new code the getter method computes the address by calling the blob's entry_point() method.
So, your patch is seems to be mixing up things by using the name SharedRuntime_throw_delayed_StackOverflowError_blob for the CompilerToVM field but declaring it with type address. Would it make more sense to use the name SharedRuntime_throw_delayed_StackOverflowError_entry for this field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, SharedRuntime_throw_delayed_StackOverflowError_entry is better. Thanks for the explanation!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I pushed a version of your patch modified to use that name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update is good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JVMCI changes look good to me. Thanks!
|
@vnkozlov @RealFYang @mur47x111 |
|
@vnkozlov @RealFYang Could one of you please re-review. I had to merge with master to allow for a one-line include file change in sharedRuntime.cpp. |
|
@RealFYang Thanks! |
|
/integrate |
|
Going to push as commit f0374a0.
Your commit was automatically rebased without conflicts. |
|
Hi @adinn , I encountered Client build failure on AArch64 after this commit. Could you help take a look at it when you have spare time? Thanks. Here shows the configuration And here shows the error msg: |
|
@shqking Thanks for reporting this problem. I reproduced the same failure on aarch64 and have noticed that the problem also arises on arm. File I raised JDK-8340793 and will push a patch to fix it. |
Store the throw_exception and jfr stub code as blobs in class SharedRuntime, move the generation code to the the arch-specific generator classes and update client code to access them from their new location.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/20566/head:pull/20566$ git checkout pull/20566Update a local copy of the PR:
$ git checkout pull/20566$ git pull https://git.openjdk.org/jdk.git pull/20566/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 20566View PR using the GUI difftool:
$ git pr show -t 20566Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/20566.diff
Webrev
Link to Webrev Comment