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
8263377: Store method handle linkers in the 'non-nmethods' heap #8760
Conversation
👋 Welcome back yftsai! A progress list of the required criteria for merging this PR into |
@yftsai this pull request can not be integrated into git checkout intrinsics
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 |
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.
Some initial comments. The codeBlob code looks mostly good to me. But, I don't have enough knowledge about the GC and IC changes to be able to say the same about that.
if (mhi != NULL) { | ||
debug_only(mhi->verify();) // might block | ||
} |
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 is debug only. Looking at CodeCache::allocate, it can only return NULL
if the allocation size is <= 0
, in which case an earlier assert will already fire. So, this null check doesn't seem needed?
if (mhi != NULL) { | |
debug_only(mhi->verify();) // might block | |
} | |
debug_only(mhi->verify();) // might block |
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 seems needed. CodeCache::allocate may return NULL
if the code cache is full.
assert(Arguments::is_interpreter_only() || (spe->method()->has_compiled_code() && | ||
spe->method()->code()->entry_point() == spe->method()->from_compiled_entry()), | ||
spe->method()->code()->code_begin() == spe->method()->from_compiled_entry()), |
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.
Not sure if this assert is still needed/useful, since we should only encounter MH linker blobs here, for which the from_compiled_entry
is always code_begin
.
I'd suggest just removing this assert.
static nmethod* compile_method(const methodHandle& method, | ||
static CodeBlob* compile_method(const methodHandle& method, | ||
int osr_bci, | ||
int comp_level, | ||
const methodHandle& hot_method, | ||
int hot_count, | ||
CompileTask::CompileReason compile_reason, | ||
TRAPS); | ||
|
||
static nmethod* compile_method(const methodHandle& method, | ||
static CodeBlob* compile_method(const methodHandle& method, |
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.
Not so sure about these changes. It seems to me that if a method is requested to be compiled, it should always result in an nmethod.
Alternatively, would it be possible to keep these functions returning an nmethod
but add an assert at the start to check that the passed method
is not a method handle intrinsic?
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.
The original implementation assumed that MH intrinsics are possible input. If that's not the cases, the newly added assertion simplifies some handling branches.
I don't think we need a new RuntimeBlob subclasses. Can't we use the existing AdapterBlob or MethodHandlesAdapterBlob? When changing from nmethod to CodeBlob, don't we need to replace COMPILED_METHOD_LOAD JVMTI events with DYNAMIC_CODE_GENERATED events? |
Looking at all the CompiledMethod --> CodeBlob changes, I wondering if it wouldn't be better to use a subclass of CompiledMethod, liked we did for AOT methods. However, there may be assumptions in the code that the only subclass of CompiledMethod is nmethod. |
/label hotspot-compiler |
@dean-long |
code->log_identity(log); | ||
CodeBlob* code = get_Method()->code(); | ||
if (code != NULL && code->is_compiled()) { | ||
code->as_compiled_method()->log_identity(log); |
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.
Doesn't this change the log output?
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, the output of MH intrinsic cases will become like the cases where codes are not set. The removed parts are compiled ID, compiler, and compile level. They are all constants for MH intrinsics, not providing much information.
remove unused argument of NativeJump::check_verified_entry_alignment remove unused argument of NativeJumip::patch_verified_entry remove dead codes in SharedRuntime::generate_method_handle_intrinsic_wrapper
The idea has been explored in this earlier commit. Overall, it is more complex in reimplementing many CompiledMethod interfaces to support nmethod life cycle and GC scans. These interfaces are logically irrelevant to MH intrinsics which never unload and contain no oops. |
An MH intrinsic is handled differently from them in SharedRuntime::continuation_for_implicit_exception and compiledIC. |
@yftsai This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
@yftsai This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the |
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/8760/head:pull/8760
$ git checkout pull/8760
Update a local copy of the PR:
$ git checkout pull/8760
$ git pull https://git.openjdk.org/jdk pull/8760/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 8760
View PR using the GUI difftool:
$ git pr show -t 8760
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/8760.diff