@@ -616,8 +616,9 @@ class CallNode : public SafePointNode {
616
616
// For macro nodes, the JVMState gets modified during expansion. If calls
617
617
// use MachConstantBase, it gets modified during matching. So when cloning
618
618
// the node the JVMState must be cloned. Default is not to clone.
619
- virtual void clone_jvms (Compile* C) {
620
- if (C->needs_clone_jvms () && jvms () != NULL ) {
619
+ virtual bool needs_clone_jvms (Compile* C) { return C->needs_clone_jvms (); }
620
+ void clone_jvms (Compile* C) {
621
+ if ((jvms () != NULL ) && needs_clone_jvms (C)) {
621
622
set_jvms (jvms ()->clone_deep (C));
622
623
jvms ()->set_map_deep (this );
623
624
}
@@ -737,11 +738,8 @@ class CallStaticJavaNode : public CallJavaNode {
737
738
}
738
739
// Late inlining modifies the JVMState, so we need to clone it
739
740
// when the call node is cloned (because it is macro node).
740
- virtual void clone_jvms (Compile* C) {
741
- if ((jvms () != NULL ) && is_boxing_method ()) {
742
- set_jvms (jvms ()->clone_deep (C));
743
- jvms ()->set_map_deep (this );
744
- }
741
+ virtual bool needs_clone_jvms (Compile* C) {
742
+ return is_boxing_method () || CallNode::needs_clone_jvms (C);
745
743
}
746
744
747
745
virtual int Opcode () const ;
@@ -766,11 +764,8 @@ class CallDynamicJavaNode : public CallJavaNode {
766
764
767
765
// Late inlining modifies the JVMState, so we need to clone it
768
766
// when the call node is cloned.
769
- virtual void clone_jvms (Compile* C) {
770
- if ((jvms () != NULL ) && IncrementalInlineVirtual) {
771
- set_jvms (jvms ()->clone_deep (C));
772
- jvms ()->set_map_deep (this );
773
- }
767
+ virtual bool needs_clone_jvms (Compile* C) {
768
+ return IncrementalInlineVirtual || CallNode::needs_clone_jvms (C);
774
769
}
775
770
776
771
int _vtable_index;
@@ -923,12 +918,7 @@ class AllocateNode : public CallNode {
923
918
AllocateNode (Compile* C, const TypeFunc *atype, Node *ctrl, Node *mem, Node *abio,
924
919
Node *size, Node *klass_node, Node *initial_test);
925
920
// Expansion modifies the JVMState, so we need to clone it
926
- virtual void clone_jvms (Compile* C) {
927
- if (jvms () != NULL ) {
928
- set_jvms (jvms ()->clone_deep (C));
929
- jvms ()->set_map_deep (this );
930
- }
931
- }
921
+ virtual bool needs_clone_jvms (Compile* C) { return true ; }
932
922
virtual int Opcode () const ;
933
923
virtual uint ideal_reg () const { return Op_RegP; }
934
924
virtual bool guaranteed_safepoint () { return false ; }
@@ -1142,12 +1132,7 @@ class LockNode : public AbstractLockNode {
1142
1132
1143
1133
virtual Node *Ideal (PhaseGVN *phase, bool can_reshape);
1144
1134
// Expansion modifies the JVMState, so we need to clone it
1145
- virtual void clone_jvms (Compile* C) {
1146
- if (jvms () != NULL ) {
1147
- set_jvms (jvms ()->clone_deep (C));
1148
- jvms ()->set_map_deep (this );
1149
- }
1150
- }
1135
+ virtual bool needs_clone_jvms (Compile* C) { return true ; }
1151
1136
1152
1137
bool is_nested_lock_region (); // Is this Lock nested?
1153
1138
bool is_nested_lock_region (Compile * c); // Why isn't this Lock nested?
0 commit comments