# HG changeset patch # User vlivanov # Date 1412016365 25200 # Node ID 87f199a9c1b1817d056f70e07ac57dc237300d03 # Parent 1d6eb209432a359c72fc05dec350d8dcc441a4f8 8058825: EA: ConnectionGraph::split_unique_types does incorrect scalar replacement Reviewed-by: kvn diff -r 1d6eb209432a -r 87f199a9c1b1 src/share/vm/opto/escape.cpp --- a/src/share/vm/opto/escape.cpp Mon Oct 20 10:18:17 2014 +0200 +++ b/src/share/vm/opto/escape.cpp Mon Sep 29 11:46:05 2014 -0700 @@ -2839,6 +2839,13 @@ 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 @@ // - 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);