mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 19:14:38 +02:00
7087727: JSR 292: C2 crash if ScavengeRootsInCode=2 when "static final" MethodHandle constants are in use
Reviewed-by: jrose, kvn, never
This commit is contained in:
parent
89ccd723ce
commit
423972a7d8
1 changed files with 3 additions and 3 deletions
|
@ -775,15 +775,15 @@ JVMState* PredictedDynamicCallGenerator::generate(JVMState* jvms) {
|
||||||
|
|
||||||
Node* bol = NULL;
|
Node* bol = NULL;
|
||||||
int bc = jvms->method()->java_code_at_bci(jvms->bci());
|
int bc = jvms->method()->java_code_at_bci(jvms->bci());
|
||||||
if (bc == Bytecodes::_invokespecial) {
|
if (bc != Bytecodes::_invokedynamic) {
|
||||||
// This is the selectAlternative idiom for guardWithTest
|
// This is the selectAlternative idiom for guardWithTest or
|
||||||
|
// similar idioms.
|
||||||
Node* receiver = kit.argument(0);
|
Node* receiver = kit.argument(0);
|
||||||
|
|
||||||
// Check if the MethodHandle is the expected one
|
// Check if the MethodHandle is the expected one
|
||||||
Node* cmp = gvn.transform(new(kit.C, 3) CmpPNode(receiver, predicted_mh));
|
Node* cmp = gvn.transform(new(kit.C, 3) CmpPNode(receiver, predicted_mh));
|
||||||
bol = gvn.transform(new(kit.C, 2) BoolNode(cmp, BoolTest::eq) );
|
bol = gvn.transform(new(kit.C, 2) BoolNode(cmp, BoolTest::eq) );
|
||||||
} else {
|
} else {
|
||||||
assert(bc == Bytecodes::_invokedynamic, "must be");
|
|
||||||
// Get the constant pool cache from the caller class.
|
// Get the constant pool cache from the caller class.
|
||||||
ciMethod* caller_method = jvms->method();
|
ciMethod* caller_method = jvms->method();
|
||||||
ciBytecodeStream str(caller_method);
|
ciBytecodeStream str(caller_method);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue