From 651a25e73056ae61a3a80b74d8f7408b0553bc80 Mon Sep 17 00:00:00 2001 From: vlivanov Date: Mon, 29 Sep 2014 11:46:05 -0700 Subject: [PATCH] 8058825: EA: ConnectionGraph::split_unique_types does incorrect scalar replacement Reviewed-by: kvn --- src/share/vm/opto/escape.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/share/vm/opto/escape.cpp b/src/share/vm/opto/escape.cpp index 867e96953..25ffd3874 100644 --- a/src/share/vm/opto/escape.cpp +++ b/src/share/vm/opto/escape.cpp @@ -2839,6 +2839,13 @@ void ConnectionGraph::split_unique_types(GrowableArray &alloc_worklist) continue; } } + + const TypeOopPtr *t = igvn->type(n)->isa_oopptr(); + if (t == NULL) + continue; // not a TypeOopPtr + if (!t->klass_is_exact()) + continue; // not an unique type + if (alloc->is_Allocate()) { // Set the scalar_replaceable flag for allocation // so it could be eliminated. @@ -2857,10 +2864,7 @@ void ConnectionGraph::split_unique_types(GrowableArray &alloc_worklist) // - not determined to be ineligible by escape analysis set_map(alloc, n); set_map(n, alloc); - const TypeOopPtr *t = igvn->type(n)->isa_oopptr(); - if (t == NULL) - continue; // not a TypeOopPtr - const TypeOopPtr* tinst = t->cast_to_exactness(true)->is_oopptr()->cast_to_instance_id(ni); + const TypeOopPtr* tinst = t->cast_to_instance_id(ni); igvn->hash_delete(n); igvn->set_type(n, tinst); n->raise_bottom_type(tinst); -- GitLab