diff -r 9e5a7340635e -r b130b98db9cf src/share/vm/opto/escape.cpp --- a/src/share/vm/opto/escape.cpp Thu Apr 17 07:16:03 2008 -0700 +++ b/src/share/vm/opto/escape.cpp Wed Apr 23 11:20:36 2008 -0700 @@ -215,6 +215,10 @@ VectorSet visited(Thread::current()->resource_area()); GrowableArray worklist; +#ifdef ASSERT + Node *orig_n = n; +#endif + n = n->uncast(); PointsToNode npt = _nodes->at_grow(n->_idx); @@ -223,8 +227,14 @@ ptset.set(n->_idx); return; } - assert(npt._node != NULL, "unregistered node"); - +#ifdef ASSERT + if (npt._node == NULL) { + if (orig_n != n) + orig_n->dump(); + n->dump(); + assert(npt._node != NULL, "unregistered node"); + } +#endif worklist.push(n->_idx); while(worklist.length() > 0) { int ni = worklist.pop(); @@ -266,7 +276,7 @@ PointsToNode *ptn = ptnode_adr(ni); // Mark current edges as visited and move deferred edges to separate array. - for (; i < ptn->edge_count(); i++) { + while (i < ptn->edge_count()) { uint t = ptn->edge_target(i); #ifdef ASSERT assert(!visited->test_set(t), "expecting no duplications"); @@ -276,6 +286,8 @@ if (ptn->edge_type(i) == PointsToNode::DeferredEdge) { ptn->remove_edge(t, PointsToNode::DeferredEdge); deferred_edges->append(t); + } else { + i++; } } for (int next = 0; next < deferred_edges->length(); ++next) { @@ -1716,6 +1728,8 @@ } case Op_CastPP: case Op_CheckCastPP: + case Op_EncodeP: + case Op_DecodeN: { add_node(n, PointsToNode::LocalVar, PointsToNode::UnknownEscape, false); int ti = n->in(1)->_idx; @@ -1743,12 +1757,6 @@ add_node(n, PointsToNode::JavaObject, es, true); break; } - case Op_CreateEx: - { - // assume that all exception objects globally escape - add_node(n, PointsToNode::JavaObject, PointsToNode::GlobalEscape, true); - break; - } case Op_ConN: { // assume all narrow oop constants globally escape except for null @@ -1761,6 +1769,12 @@ add_node(n, PointsToNode::JavaObject, es, true); break; } + case Op_CreateEx: + { + // assume that all exception objects globally escape + add_node(n, PointsToNode::JavaObject, PointsToNode::GlobalEscape, true); + break; + } case Op_LoadKlass: { add_node(n, PointsToNode::JavaObject, PointsToNode::GlobalEscape, true); @@ -1976,10 +1990,11 @@ break; } case Op_LoadP: + case Op_LoadN: { const Type *t = phase->type(n); #ifdef ASSERT - if (t->isa_ptr() == NULL) + if (!t->isa_narrowoop() && t->isa_ptr() == NULL) assert(false, "Op_LoadP"); #endif @@ -2060,11 +2075,16 @@ break; } case Op_StoreP: + case Op_StoreN: case Op_StorePConditional: case Op_CompareAndSwapP: + case Op_CompareAndSwapN: { Node *adr = n->in(MemNode::Address); const Type *adr_type = phase->type(adr); + if (adr_type->isa_narrowoop()) { + adr_type = adr_type->is_narrowoop()->make_oopptr(); + } #ifdef ASSERT if (!adr_type->isa_oopptr()) assert(phase->type(adr) == TypeRawPtr::NOTNULL, "Op_StoreP");