mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 03:24:38 +02:00
8205714: Initial class initialization
Ensure class is fully initialized before caching a resolved invokestatic, or patching the callsite Reviewed-by: acorn, coleenp, kvn, vlivanov
This commit is contained in:
parent
43b3a6a6bb
commit
4a157daf01
2 changed files with 20 additions and 2 deletions
|
@ -1376,6 +1376,14 @@ methodHandle SharedRuntime::resolve_sub_helper(JavaThread *thread,
|
|||
}
|
||||
#endif
|
||||
|
||||
// Do not patch call site for static call when the class is not
|
||||
// fully initialized.
|
||||
if (invoke_code == Bytecodes::_invokestatic &&
|
||||
!callee_method->method_holder()->is_initialized()) {
|
||||
assert(callee_method->method_holder()->is_linked(), "must be");
|
||||
return callee_method;
|
||||
}
|
||||
|
||||
// JSR 292 key invariant:
|
||||
// If the resolved method is a MethodHandle invoke target, the call
|
||||
// site must be a MethodHandle call site, because the lambda form might tail-call
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue