src/share/vm/opto/escape.cpp

changeset 563
a76240c8b133
parent 559
b130b98db9cf
child 598
885ed790ecf0
     1.1 --- a/src/share/vm/opto/escape.cpp	Wed Apr 23 06:35:28 2008 -0400
     1.2 +++ b/src/share/vm/opto/escape.cpp	Mon Apr 28 08:08:12 2008 -0700
     1.3 @@ -215,6 +215,10 @@
     1.4    VectorSet visited(Thread::current()->resource_area());
     1.5    GrowableArray<uint>  worklist;
     1.6  
     1.7 +#ifdef ASSERT
     1.8 +  Node *orig_n = n;
     1.9 +#endif
    1.10 +
    1.11    n = n->uncast();
    1.12    PointsToNode  npt = _nodes->at_grow(n->_idx);
    1.13  
    1.14 @@ -223,8 +227,14 @@
    1.15      ptset.set(n->_idx);
    1.16      return;
    1.17    }
    1.18 -  assert(npt._node != NULL, "unregistered node");
    1.19 -
    1.20 +#ifdef ASSERT
    1.21 +  if (npt._node == NULL) {
    1.22 +    if (orig_n != n)
    1.23 +      orig_n->dump();
    1.24 +    n->dump();
    1.25 +    assert(npt._node != NULL, "unregistered node");
    1.26 +  }
    1.27 +#endif
    1.28    worklist.push(n->_idx);
    1.29    while(worklist.length() > 0) {
    1.30      int ni = worklist.pop();
    1.31 @@ -266,7 +276,7 @@
    1.32    PointsToNode *ptn = ptnode_adr(ni);
    1.33  
    1.34    // Mark current edges as visited and move deferred edges to separate array.
    1.35 -  for (; i < ptn->edge_count(); i++) {
    1.36 +  while (i < ptn->edge_count()) {
    1.37      uint t = ptn->edge_target(i);
    1.38  #ifdef ASSERT
    1.39      assert(!visited->test_set(t), "expecting no duplications");
    1.40 @@ -276,6 +286,8 @@
    1.41      if (ptn->edge_type(i) == PointsToNode::DeferredEdge) {
    1.42        ptn->remove_edge(t, PointsToNode::DeferredEdge);
    1.43        deferred_edges->append(t);
    1.44 +    } else {
    1.45 +      i++;
    1.46      }
    1.47    }
    1.48    for (int next = 0; next < deferred_edges->length(); ++next) {
    1.49 @@ -1716,6 +1728,8 @@
    1.50      }
    1.51      case Op_CastPP:
    1.52      case Op_CheckCastPP:
    1.53 +    case Op_EncodeP:
    1.54 +    case Op_DecodeN:
    1.55      {
    1.56        add_node(n, PointsToNode::LocalVar, PointsToNode::UnknownEscape, false);
    1.57        int ti = n->in(1)->_idx;
    1.58 @@ -1743,12 +1757,6 @@
    1.59        add_node(n, PointsToNode::JavaObject, es, true);
    1.60        break;
    1.61      }
    1.62 -    case Op_CreateEx:
    1.63 -    {
    1.64 -      // assume that all exception objects globally escape
    1.65 -      add_node(n, PointsToNode::JavaObject, PointsToNode::GlobalEscape, true);
    1.66 -      break;
    1.67 -    }
    1.68      case Op_ConN:
    1.69      {
    1.70        // assume all narrow oop constants globally escape except for null
    1.71 @@ -1761,6 +1769,12 @@
    1.72        add_node(n, PointsToNode::JavaObject, es, true);
    1.73        break;
    1.74      }
    1.75 +    case Op_CreateEx:
    1.76 +    {
    1.77 +      // assume that all exception objects globally escape
    1.78 +      add_node(n, PointsToNode::JavaObject, PointsToNode::GlobalEscape, true);
    1.79 +      break;
    1.80 +    }
    1.81      case Op_LoadKlass:
    1.82      {
    1.83        add_node(n, PointsToNode::JavaObject, PointsToNode::GlobalEscape, true);
    1.84 @@ -1976,10 +1990,11 @@
    1.85        break;
    1.86      }
    1.87      case Op_LoadP:
    1.88 +    case Op_LoadN:
    1.89      {
    1.90        const Type *t = phase->type(n);
    1.91  #ifdef ASSERT
    1.92 -      if (t->isa_ptr() == NULL)
    1.93 +      if (!t->isa_narrowoop() && t->isa_ptr() == NULL)
    1.94          assert(false, "Op_LoadP");
    1.95  #endif
    1.96  
    1.97 @@ -2060,11 +2075,16 @@
    1.98        break;
    1.99      }
   1.100      case Op_StoreP:
   1.101 +    case Op_StoreN:
   1.102      case Op_StorePConditional:
   1.103      case Op_CompareAndSwapP:
   1.104 +    case Op_CompareAndSwapN:
   1.105      {
   1.106        Node *adr = n->in(MemNode::Address);
   1.107        const Type *adr_type = phase->type(adr);
   1.108 +      if (adr_type->isa_narrowoop()) {
   1.109 +        adr_type = adr_type->is_narrowoop()->make_oopptr();
   1.110 +      }
   1.111  #ifdef ASSERT
   1.112        if (!adr_type->isa_oopptr())
   1.113          assert(phase->type(adr) == TypeRawPtr::NOTNULL, "Op_StoreP");

mercurial