-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8363837: Make StubRoutines::crc_table_adr() into platform-specific method #26434
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 kvn! A progress list of the required criteria for merging this PR into |
@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:
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 38 new commits pushed to the
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 |
@adinn please look |
Webrevs
|
and I can NOT move updateBytesCRC32 stub declaration. |
@TheRealMDoerr @offamitkumar @RealFYang please test these changes on your platforms. |
@vnkozlov I'll note straight off that the situation here is complicated by the fact that I'm not sure we need to care too much about their pseudo-entry status. More importantly, I dislike your solution of moving the initialization into You are right that we cannot add these addresses to the external addresses list under
Both of these seem to me to be simpler and cleaner ways to deal with the address publication problem. What do you think? |
Thank you, @adinn for you suggestions.
I considered 2. when I worked on this but there is assumption that we have all external addresses recorded when we look for matching address in An other solution would be to have separate What do you think? |
Yes, I think it would be much better if we removed the entry declarations for We don't need a generated field in class StubRoutines nor any way to track the value as we do for real generated addresses. So, using the declaration mechanism was the wrong way to do this. |
Here is new version of fix as we discussed. |
Thanks for the ping. I performed tier1 test and I see the result is clean with the latest version on linux-riscv64. |
@@ -37,7 +37,7 @@ | |||
do_arch_blob, \ | |||
do_arch_entry, \ | |||
do_arch_entry_init) \ | |||
do_arch_blob(initial, 0) \ | |||
do_arch_blob(initial, 32) \ |
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.
Do we need this any more?
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.
Yes, to call generate_initial_stubs()
where _call_stub_entry
is set.
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.
Ah, yes, how annoying.
@@ -304,6 +304,9 @@ class StubRoutines: AllStatic { | |||
return dest_uninitialized ? _arrayof_oop_disjoint_arraycopy_uninit : _arrayof_oop_disjoint_arraycopy; | |||
} | |||
|
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.
Could we have a comment here to note that 1) this method is implemented in architecture-specific code 2) any table that is returned must be allocated once-only in foreign memory rather generated in the code cache.
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.
Done!
@@ -417,8 +417,6 @@ | |||
static_field(StubRoutines, _dilithiumMontMulByConstant, address) \ | |||
static_field(StubRoutines, _dilithiumDecomposePoly, address) \ | |||
static_field(StubRoutines, _updateBytesCRC32, address) \ | |||
static_field(StubRoutines, _crc_table_addr, 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.
Could you please export via CompilerToVM::Data
?
diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVM.hpp b/src/hotspot/share/jvmci/jvmciCompilerToVM.hpp
index 41531b083fc..71331b578a5 100644
--- a/src/hotspot/share/jvmci/jvmciCompilerToVM.hpp
+++ b/src/hotspot/share/jvmci/jvmciCompilerToVM.hpp
@@ -131,6 +131,8 @@ class CompilerToVM {
static address dlog10;
static address dpow;
+ static address crc_table_addr;
+
static address symbol_init;
static address symbol_clinit;
diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp b/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp
index b6d919fdfe9..8a1a02d62b3 100644
--- a/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp
+++ b/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp
@@ -151,6 +151,8 @@ address CompilerToVM::Data::dlog;
address CompilerToVM::Data::dlog10;
address CompilerToVM::Data::dpow;
+address CompilerToVM::Data::crc_table_addr;
+
address CompilerToVM::Data::symbol_init;
address CompilerToVM::Data::symbol_clinit;
@@ -289,6 +291,7 @@ void CompilerToVM::Data::initialize(JVMCI_TRAPS) {
SET_TRIGFUNC_OR_NULL(dtanh);
SET_TRIGFUNC_OR_NULL(dcbrt);
+ SET_TRIGFUNC_OR_NULL(crc_table_addr);
#undef SET_TRIGFUNC_OR_NULL
diff --git a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp
index 1408cb09b0a..88d098468e9 100644
--- a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp
+++ b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp
@@ -147,6 +147,7 @@
static_field(CompilerToVM::Data, dlog, address) \
static_field(CompilerToVM::Data, dlog10, address) \
static_field(CompilerToVM::Data, dpow, address) \
+ static_field(CompilerToVM::Data, crc_table_addr, address) \
\
static_field(CompilerToVM::Data, symbol_init, address) \
static_field(CompilerToVM::Data, symbol_clinit, 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.
@mur47x111 sure. But do you need also crc32c_table_addr
? And I don't see initialization. Can you prepare full patch for JVMCI which I can integrate?
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.
Initialization is done by SET_TRIGFUNC_OR_NULL()
. I see.
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.
Okay, I will add crc32c_table_addr myself then.
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.
I see that crc32c_table_addr() failed on Aarch64 because we should not call it.
I will go with your patch @mur47x111 then and let you solve crc32c.
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.
Done
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.
Thanks! I also ran across the ShouldNotCallThis
on aarch64 and decided to drop that because anyway we don't use crc32c_table_addr
. I think crc32c_table_addr
is only used internally in HotSpot but not via intrinsification call. Let's only export crc_table_addr
for now. I will examine the crc32c_table_addr
later
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.
Thank you, @mur47x111
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.
Looks ok to me.
@RealFYang thank you for testing. |
I updated title to reflect current implementation. |
Thank you @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.
LGTM
Thank you all for reviews. |
/integrate |
Going to push as commit 89fe586.
Your commit was automatically rebased without conflicts. |
StubRoutines::_crc_table_adr
and_crc32c_table_addr
are used by initial stubs. In Leyden these addresses should be recorded inAOTCodeAddressTable
to be used by AOTed stubs. But recording inAOTCodeAddressTable
is done inAOTCodeCache::init2()
which is called before initial stubs are generated and_crc*_table_addr
are set.We need to move
_crc_table_addr
and_crc32c_table_addr
initialization topreuniverse
blob to be available inAOTCodeCache::init2()
.I also renamed
_crc_table_adr
to_crc_table_addr
to match other names.During testing I found that
-Xlog:stubs
affects empty blobs generation. There was typo there:return nullptr;
was in wrong place.I have to specify sizes of
preuniverse
blobs so they are called after I fixed typo.32
bytes is cache line size on most CPUs. Note, there will be no assembler code generation for this case:_crc*_table_addr
are initialized by address of C tables.I did not move
_crc*_table_addr
declaration instubDeclarations.hpp
frominit
topreuniverse
blob. I tried but there is issue: they require to specify stub name and I can moveupdateBytesCRC32
stub declaration. I tries add fake stub but it did not work. I would prefer if I could usenullptr
instead of stub in such case. But it will complicate other code. I think it is finedo_entry()
macro only creates field and accessor function.Tested: tier1-4,tier10-rt,xcomp,stress
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26434/head:pull/26434
$ git checkout pull/26434
Update a local copy of the PR:
$ git checkout pull/26434
$ git pull https://git.openjdk.org/jdk.git pull/26434/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 26434
View PR using the GUI difftool:
$ git pr show -t 26434
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26434.diff
Using Webrev
Link to Webrev Comment