提交 bbe54b4a 编写于 作者: T twisti

7087727: JSR 292: C2 crash if ScavengeRootsInCode=2 when "static final"...

7087727: JSR 292: C2 crash if ScavengeRootsInCode=2 when "static final" MethodHandle constants are in use
Reviewed-by: jrose, kvn, never
上级 4a396a58
......@@ -775,15 +775,15 @@ JVMState* PredictedDynamicCallGenerator::generate(JVMState* jvms) {
Node* bol = NULL;
int bc = jvms->method()->java_code_at_bci(jvms->bci());
if (bc == Bytecodes::_invokespecial) {
// This is the selectAlternative idiom for guardWithTest
if (bc != Bytecodes::_invokedynamic) {
// This is the selectAlternative idiom for guardWithTest or
// similar idioms.
Node* receiver = kit.argument(0);
// Check if the MethodHandle is the expected one
Node* cmp = gvn.transform(new(kit.C, 3) CmpPNode(receiver, predicted_mh));
bol = gvn.transform(new(kit.C, 2) BoolNode(cmp, BoolTest::eq) );
} else {
assert(bc == Bytecodes::_invokedynamic, "must be");
// Get the constant pool cache from the caller class.
ciMethod* caller_method = jvms->method();
ciBytecodeStream str(caller_method);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册