8256757: Incorrect MachCallRuntimeNode::ret_addr_offset() for CallLeafNoFP on x86_32

Reviewed-by: jiefu, kvn
This commit is contained in:
Aleksey Shipilev 2020-11-27 06:47:30 +00:00
parent 2215e5a47e
commit 9a468d8599
5 changed files with 9 additions and 2 deletions

View File

@ -308,7 +308,7 @@ static int sizeof_FFree_Float_Stack_All = -1;
int MachCallRuntimeNode::ret_addr_offset() {
assert(sizeof_FFree_Float_Stack_All != -1, "must have been emitted already");
return sizeof_FFree_Float_Stack_All + 5 + pre_call_resets_size();
return 5 + pre_call_resets_size() + (_leaf_no_fp ? 0 : sizeof_FFree_Float_Stack_All);
}
int MachCallNativeNode::ret_addr_offset() {

View File

@ -854,6 +854,7 @@ public:
const TypePtr* adr_type)
: CallLeafNode(tf, addr, name, adr_type)
{
init_class_id(Class_CallLeafNoFP);
}
virtual int Opcode() const;
};

View File

@ -994,6 +994,7 @@ class MachCallRuntimeNode : public MachCallNode {
virtual uint size_of() const; // Size is bigger
public:
const char *_name; // Printable name, if _method is NULL
bool _leaf_no_fp; // Is this CallLeafNoFP?
MachCallRuntimeNode() : MachCallNode() {
init_class_id(Class_MachCallRuntime);
}

View File

@ -1264,7 +1264,9 @@ MachNode *Matcher::match_sfpt( SafePointNode *sfpt ) {
call_java->as_CallDynamicJava()->_vtable_index;
}
else if( mcall->is_MachCallRuntime() ) {
mcall->as_MachCallRuntime()->_name = call->as_CallRuntime()->_name;
MachCallRuntimeNode* mach_call_rt = mcall->as_MachCallRuntime();
mach_call_rt->_name = call->as_CallRuntime()->_name;
mach_call_rt->_leaf_no_fp = call->is_CallLeafNoFP();
}
else if( mcall->is_MachCallNative() ) {
MachCallNativeNode* mach_call_native = mcall->as_MachCallNative();

View File

@ -49,6 +49,7 @@ class CMoveNode;
class CallDynamicJavaNode;
class CallJavaNode;
class CallLeafNode;
class CallLeafNoFPNode;
class CallNode;
class CallRuntimeNode;
class CallNativeNode;
@ -627,6 +628,7 @@ public:
DEFINE_CLASS_ID(CallDynamicJava, CallJava, 1)
DEFINE_CLASS_ID(CallRuntime, Call, 1)
DEFINE_CLASS_ID(CallLeaf, CallRuntime, 0)
DEFINE_CLASS_ID(CallLeafNoFP, CallLeaf, 0)
DEFINE_CLASS_ID(Allocate, Call, 2)
DEFINE_CLASS_ID(AllocateArray, Allocate, 0)
DEFINE_CLASS_ID(AbstractLock, Call, 3)
@ -821,6 +823,7 @@ public:
DEFINE_CLASS_QUERY(CallDynamicJava)
DEFINE_CLASS_QUERY(CallJava)
DEFINE_CLASS_QUERY(CallLeaf)
DEFINE_CLASS_QUERY(CallLeafNoFP)
DEFINE_CLASS_QUERY(CallRuntime)
DEFINE_CLASS_QUERY(CallStaticJava)
DEFINE_CLASS_QUERY(Catch)