8019247: SIGSEGV in compiled method c8e.e.t_.getArray(Ljava/lang/Class;)[Ljava/lang/Object

Undo recent changes (and add more comments) in Ideal_allocation().

Reviewed-by: roland
This commit is contained in:
Vladimir Kozlov 2013-07-02 10:30:49 -07:00
parent 7936ee54bf
commit fc1302ea95

View file

@ -3332,9 +3332,14 @@ AllocateNode* AllocateNode::Ideal_allocation(Node* ptr, PhaseTransform* phase) {
if (ptr == NULL) { // reduce dumb test in callers if (ptr == NULL) { // reduce dumb test in callers
return NULL; return NULL;
} }
ptr = ptr->uncast(); // strip a raw-to-oop cast if (ptr->is_CheckCastPP()) { // strip only one raw-to-oop cast
ptr = ptr->in(1);
if (ptr == NULL) return NULL; if (ptr == NULL) return NULL;
}
// Return NULL for allocations with several casts:
// j.l.reflect.Array.newInstance(jobject, jint)
// Object.clone()
// to keep more precise type from last cast.
if (ptr->is_Proj()) { if (ptr->is_Proj()) {
Node* allo = ptr->in(0); Node* allo = ptr->in(0);
if (allo != NULL && allo->is_Allocate()) { if (allo != NULL && allo->is_Allocate()) {