-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
JDK-8292561: Make "ReplayCompiles" a diagnostic product switch #9935
JDK-8292561: Make "ReplayCompiles" a diagnostic product switch #9935
Conversation
👋 Welcome back stuefe! A progress list of the required criteria for merging this PR into |
/label remove hotspot |
@tstuefe |
@tstuefe |
Webrevs
|
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.
Current ciReplay tests requires vm.debug == true
- that is why they can use debug flags.
I don't think we need to modify them. For new tests which you want to run in product VM we can use new NMT feature you are proposing.
src/hotspot/share/ci/ciEnv.hpp
Outdated
#ifndef PRODUCT | ||
if (ReplayCompiles && o->is_klass()) { | ||
Klass* k = (Klass*)o; | ||
if (k->is_instance_klass() && ciReplay::is_klass_unresolved((InstanceKlass*)k)) { | ||
// Klass was unresolved at replay dump time. Simulate this case. | ||
return ciEnv::_unloaded_ciinstance_klass; | ||
} | ||
} |
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.
May be make this part of code as ciReplay
method and place it into ciReplay.cpp to reduce code in .hpp file.
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.
@vnkozlov , I moved the code into ciObjectFactory::get_metadata()
since it seemed to fit there very well. Is that okay or do you really want it to live in ciReplay.cpp?
@@ -3871,9 +3871,12 @@ bool Arguments::handle_deprecated_print_gc_flags() { | |||
} | |||
|
|||
static void apply_debugger_ergo() { | |||
#ifdef ASSERT |
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.
Use #ifndef PRODUCT
as other UseDebuggerErgo*
code.
What I meant was I first attempted to remove the
Okay. |
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. I am not a reviewer.
I tried this feature and it works as expected.
I dump 4 replay files using this option -XX:CompileCommand=DumpReplay,java.util.HashMap::putVal
.
2 of them are c1 and 2 are c2. I see ReplayCompiles works in release build and it also accepts unresolved klasses. eg.
Warning: entry was unresolved in the replay data: jdk/internal/misc/VM
Warning: entry was unresolved in the replay data: jdk/internal/loader/ClassLoaders
Warning: entry was unresolved in the replay data: jdk/internal/misc/Unsafe
Warning: entry was unresolved in the replay data: java/lang/invoke/StringConcatFactory
Warning: entry was unresolved in the replay data: java/lang/ClassLoader
Warning: entry was unresolved in the replay data: java/lang/Thread
Warning: entry was unresolved in the replay data: jdk/internal/loader/ClassLoaders
Warning: entry was unresolved in the replay data: jdk/internal/loader/BootLoader
Warning: entry was unresolved in the replay data: jdk/internal/module/ServicesCatalog
Warning: entry was unresolved in the replay data: java/lang/module/ModuleDescriptor$Opens
Warning: entry was unresolved in the replay data: java/lang/System
Warning: entry was unresolved in the replay data: java/util/concurrent/ConcurrentHashMap$ForwardingNode
272 26 b 3 java.util.HashMap::putVal (300 bytes)
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. Looks good.
@tstuefe 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 35 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 |
Going to push as commit f9004fe.
Your commit was automatically rebased without conflicts. |
See discussion: https://mail.openjdk.org/pipermail/hotspot-compiler-dev/2022-August/057988.html
Making ReplayCompiles a (diagnostic) runtime switch can help when facing problems with shipped release VMs:
Making the option product increases libjvm.so text size by 54kb (Linux x64). No measurable runtime overhead.
Tests: Almost all tests in compiler/ciReplay generate replay files by inducing a crash with
-XX:CICrashAt
. That won't work in release builds. I added a simple test that checks that invalid replay files are correctly refused, and that test can also be done on a release VM. So we at least have a test for release that checks argument parsing.(Note: I have #9891 open, which could in the future serve as an alternative to CICrashAt by limiting the compiler arena).
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/9935/head:pull/9935
$ git checkout pull/9935
Update a local copy of the PR:
$ git checkout pull/9935
$ git pull https://git.openjdk.org/jdk pull/9935/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 9935
View PR using the GUI difftool:
$ git pr show -t 9935
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/9935.diff