提交 322c3026 编写于 作者: K kvn

6836054: java/util/Arrays/CopyMethods.java fails on solaris-sparc with IllegalArgumentException

Summary: Do not mark an allocation as scalar replaceable if its actual type in unknown statically.
Reviewed-by: never
上级 755c40f3
...@@ -905,15 +905,22 @@ void ConnectionGraph::split_unique_types(GrowableArray<Node *> &alloc_worklist) ...@@ -905,15 +905,22 @@ void ConnectionGraph::split_unique_types(GrowableArray<Node *> &alloc_worklist)
// see if it is unescaped. // see if it is unescaped.
if (es != PointsToNode::NoEscape || !ptn->_scalar_replaceable) if (es != PointsToNode::NoEscape || !ptn->_scalar_replaceable)
continue; continue;
if (alloc->is_Allocate()) {
// Set the scalar_replaceable flag before the next check. // Find CheckCastPP for the allocate or for the return value of a call
alloc->as_Allocate()->_is_scalar_replaceable = true;
}
// find CheckCastPP of call return value
n = alloc->result_cast(); n = alloc->result_cast();
if (n == NULL || // No uses accept Initialize or if (n == NULL) { // No uses except Initialize node
!n->is_CheckCastPP()) // not unique CheckCastPP. if (alloc->is_Allocate()) {
// Set the scalar_replaceable flag for allocation
// so it could be eliminated if it has no uses.
alloc->as_Allocate()->_is_scalar_replaceable = true;
}
continue;
}
if (!n->is_CheckCastPP()) { // not unique CheckCastPP.
assert(!alloc->is_Allocate(), "allocation should have unique type");
continue; continue;
}
// The inline code for Object.clone() casts the allocation result to // The inline code for Object.clone() casts the allocation result to
// java.lang.Object and then to the actual type of the allocated // java.lang.Object and then to the actual type of the allocated
// object. Detect this case and use the second cast. // object. Detect this case and use the second cast.
...@@ -934,9 +941,17 @@ void ConnectionGraph::split_unique_types(GrowableArray<Node *> &alloc_worklist) ...@@ -934,9 +941,17 @@ void ConnectionGraph::split_unique_types(GrowableArray<Node *> &alloc_worklist)
if (cast2 != NULL) { if (cast2 != NULL) {
n = cast2; n = cast2;
} else { } else {
// Non-scalar replaceable if the allocation type is unknown statically
// (reflection allocation), the object can't be restored during
// deoptimization without precise type.
continue; continue;
} }
} }
if (alloc->is_Allocate()) {
// Set the scalar_replaceable flag for allocation
// so it could be eliminated.
alloc->as_Allocate()->_is_scalar_replaceable = true;
}
set_escape_state(n->_idx, es); set_escape_state(n->_idx, es);
// in order for an object to be scalar-replaceable, it must be: // in order for an object to be scalar-replaceable, it must be:
// - a direct allocation (not a call returning an object) // - a direct allocation (not a call returning an object)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册