Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.
/ jdk16u Public archive

Commit

Permalink
8263587: C2: JVMS not cloned when needs_clone_jvms() is true
Browse files Browse the repository at this point in the history
Backport-of: 9c50b8e66a87eb3f27a0cbb573b22a9d9a73a114
  • Loading branch information
TheRealMDoerr committed Mar 22, 2021
1 parent 62adf83 commit 75ed034
Showing 1 changed file with 9 additions and 24 deletions.
33 changes: 9 additions & 24 deletions src/hotspot/share/opto/callnode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -615,8 +615,9 @@ class CallNode : public SafePointNode {
// For macro nodes, the JVMState gets modified during expansion. If calls
// use MachConstantBase, it gets modified during matching. So when cloning
// the node the JVMState must be cloned. Default is not to clone.
virtual void clone_jvms(Compile* C) {
if (C->needs_clone_jvms() && jvms() != NULL) {
virtual bool needs_clone_jvms(Compile* C) { return C->needs_clone_jvms(); }
void clone_jvms(Compile* C) {
if ((jvms() != NULL) && needs_clone_jvms(C)) {
set_jvms(jvms()->clone_deep(C));
jvms()->set_map_deep(this);
}
Expand Down Expand Up @@ -738,11 +739,8 @@ class CallStaticJavaNode : public CallJavaNode {
}
// Late inlining modifies the JVMState, so we need to clone it
// when the call node is cloned (because it is macro node).
virtual void clone_jvms(Compile* C) {
if ((jvms() != NULL) && is_boxing_method()) {
set_jvms(jvms()->clone_deep(C));
jvms()->set_map_deep(this);
}
virtual bool needs_clone_jvms(Compile* C) {
return is_boxing_method() || CallNode::needs_clone_jvms(C);
}

virtual int Opcode() const;
Expand All @@ -766,11 +764,8 @@ class CallDynamicJavaNode : public CallJavaNode {

// Late inlining modifies the JVMState, so we need to clone it
// when the call node is cloned.
virtual void clone_jvms(Compile* C) {
if ((jvms() != NULL) && IncrementalInlineVirtual) {
set_jvms(jvms()->clone_deep(C));
jvms()->set_map_deep(this);
}
virtual bool needs_clone_jvms(Compile* C) {
return IncrementalInlineVirtual || CallNode::needs_clone_jvms(C);
}

int _vtable_index;
Expand Down Expand Up @@ -923,12 +918,7 @@ class AllocateNode : public CallNode {
AllocateNode(Compile* C, const TypeFunc *atype, Node *ctrl, Node *mem, Node *abio,
Node *size, Node *klass_node, Node *initial_test);
// Expansion modifies the JVMState, so we need to clone it
virtual void clone_jvms(Compile* C) {
if (jvms() != NULL) {
set_jvms(jvms()->clone_deep(C));
jvms()->set_map_deep(this);
}
}
virtual bool needs_clone_jvms(Compile* C) { return true; }
virtual int Opcode() const;
virtual uint ideal_reg() const { return Op_RegP; }
virtual bool guaranteed_safepoint() { return false; }
Expand Down Expand Up @@ -1142,12 +1132,7 @@ class LockNode : public AbstractLockNode {

virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
// Expansion modifies the JVMState, so we need to clone it
virtual void clone_jvms(Compile* C) {
if (jvms() != NULL) {
set_jvms(jvms()->clone_deep(C));
jvms()->set_map_deep(this);
}
}
virtual bool needs_clone_jvms(Compile* C) { return true; }

bool is_nested_lock_region(); // Is this Lock nested?
bool is_nested_lock_region(Compile * c); // Why isn't this Lock nested?
Expand Down

1 comment on commit 75ed034

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.