src/share/vm/opto/escape.cpp

changeset 670
9c2ecc2ffb12
parent 631
d1605aabd0a1
parent 658
1dd146f17531
child 680
4a4c365f777d
     1.1 --- a/src/share/vm/opto/escape.cpp	Thu Jul 03 11:01:32 2008 -0700
     1.2 +++ b/src/share/vm/opto/escape.cpp	Fri Jul 11 01:14:44 2008 -0700
     1.3 @@ -483,7 +483,7 @@
     1.4  //
     1.5  void ConnectionGraph::split_AddP(Node *addp, Node *base,  PhaseGVN  *igvn) {
     1.6    const TypeOopPtr *base_t = igvn->type(base)->isa_oopptr();
     1.7 -  assert(base_t != NULL && base_t->is_instance(), "expecting instance oopptr");
     1.8 +  assert(base_t != NULL && base_t->is_known_instance(), "expecting instance oopptr");
     1.9    const TypeOopPtr *t = igvn->type(addp)->isa_oopptr();
    1.10    if (t == NULL) {
    1.11      // We are computing a raw address for a store captured by an Initialize
    1.12 @@ -494,8 +494,8 @@
    1.13      assert(offs != Type::OffsetBot, "offset must be a constant");
    1.14      t = base_t->add_offset(offs)->is_oopptr();
    1.15    }
    1.16 -  uint inst_id =  base_t->instance_id();
    1.17 -  assert(!t->is_instance() || t->instance_id() == inst_id,
    1.18 +  int inst_id =  base_t->instance_id();
    1.19 +  assert(!t->is_known_instance() || t->instance_id() == inst_id,
    1.20                               "old type must be non-instance or match new type");
    1.21    const TypeOopPtr *tinst = base_t->add_offset(t->offset())->is_oopptr();
    1.22    // Do NOT remove the next call: ensure an new alias index is allocated
    1.23 @@ -509,7 +509,7 @@
    1.24    Node *adr = addp->in(AddPNode::Address);
    1.25    const TypeOopPtr  *atype = igvn->type(adr)->isa_oopptr();
    1.26    if (atype != NULL && atype->instance_id() != inst_id) {
    1.27 -    assert(!atype->is_instance(), "no conflicting instances");
    1.28 +    assert(!atype->is_known_instance(), "no conflicting instances");
    1.29      const TypeOopPtr *new_atype = base_t->add_offset(atype->offset())->isa_oopptr();
    1.30      Node *acast = new (_compile, 2) CastPPNode(adr, new_atype);
    1.31      acast->set_req(0, adr->in(0));
    1.32 @@ -663,7 +663,7 @@
    1.33      return orig_mem;
    1.34    Compile* C = phase->C;
    1.35    const TypeOopPtr *tinst = C->get_adr_type(alias_idx)->isa_oopptr();
    1.36 -  bool is_instance = (tinst != NULL) && tinst->is_instance();
    1.37 +  bool is_instance = (tinst != NULL) && tinst->is_known_instance();
    1.38    Node *prev = NULL;
    1.39    Node *result = orig_mem;
    1.40    while (prev != result) {
    1.41 @@ -693,7 +693,7 @@
    1.42          AllocateNode* alloc = proj_in->as_Initialize()->allocation();
    1.43          // Stop if this is the initialization for the object instance which
    1.44          // which contains this memory slice, otherwise skip over it.
    1.45 -        if (alloc == NULL || alloc->_idx != tinst->instance_id()) {
    1.46 +        if (alloc == NULL || alloc->_idx != (uint)tinst->instance_id()) {
    1.47            result = proj_in->in(TypeFunc::Memory);
    1.48          }
    1.49        } else if (proj_in->is_MemBar()) {
    1.50 @@ -887,7 +887,7 @@
    1.51        const TypeOopPtr *t = igvn->type(n)->isa_oopptr();
    1.52        if (t == NULL)
    1.53          continue;  // not a TypeInstPtr
    1.54 -      tinst = t->cast_to_instance(ni);
    1.55 +      tinst = t->cast_to_instance_id(ni);
    1.56        igvn->hash_delete(n);
    1.57        igvn->set_type(n,  tinst);
    1.58        n->raise_bottom_type(tinst);
    1.59 @@ -959,19 +959,19 @@
    1.60          Node *val = get_map(elem);   // CheckCastPP node
    1.61          TypeNode *tn = n->as_Type();
    1.62          tinst = igvn->type(val)->isa_oopptr();
    1.63 -        assert(tinst != NULL && tinst->is_instance() &&
    1.64 -               tinst->instance_id() == elem , "instance type expected.");
    1.65 +        assert(tinst != NULL && tinst->is_known_instance() &&
    1.66 +               (uint)tinst->instance_id() == elem , "instance type expected.");
    1.67  
    1.68 -        const TypeOopPtr *tn_t = NULL;
    1.69          const Type *tn_type = igvn->type(tn);
    1.70 +        const TypeOopPtr *tn_t;
    1.71          if (tn_type->isa_narrowoop()) {
    1.72 -          tn_t = tn_type->is_narrowoop()->make_oopptr()->isa_oopptr();
    1.73 +          tn_t = tn_type->make_ptr()->isa_oopptr();
    1.74          } else {
    1.75            tn_t = tn_type->isa_oopptr();
    1.76          }
    1.77  
    1.78          if (tn_t != NULL &&
    1.79 - tinst->cast_to_instance(TypeOopPtr::UNKNOWN_INSTANCE)->higher_equal(tn_t)) {
    1.80 +            tinst->cast_to_instance_id(TypeOopPtr::InstanceBot)->higher_equal(tn_t)) {
    1.81            if (tn_type->isa_narrowoop()) {
    1.82              tn_type = tinst->make_narrowoop();
    1.83            } else {
    1.84 @@ -1921,9 +1921,7 @@
    1.85      case Op_StoreN:
    1.86      {
    1.87        const Type *adr_type = phase->type(n->in(MemNode::Address));
    1.88 -      if (adr_type->isa_narrowoop()) {
    1.89 -        adr_type = adr_type->is_narrowoop()->make_oopptr();
    1.90 -      }
    1.91 +      adr_type = adr_type->make_ptr();
    1.92        if (adr_type->isa_oopptr()) {
    1.93          add_node(n, PointsToNode::UnknownType, PointsToNode::UnknownEscape, false);
    1.94        } else {
    1.95 @@ -1948,9 +1946,7 @@
    1.96      case Op_CompareAndSwapN:
    1.97      {
    1.98        const Type *adr_type = phase->type(n->in(MemNode::Address));
    1.99 -      if (adr_type->isa_narrowoop()) {
   1.100 -        adr_type = adr_type->is_narrowoop()->make_oopptr();
   1.101 -      }
   1.102 +      adr_type = adr_type->make_ptr();
   1.103        if (adr_type->isa_oopptr()) {
   1.104          add_node(n, PointsToNode::UnknownType, PointsToNode::UnknownEscape, false);
   1.105        } else {
   1.106 @@ -2131,10 +2127,7 @@
   1.107      case Op_CompareAndSwapN:
   1.108      {
   1.109        Node *adr = n->in(MemNode::Address);
   1.110 -      const Type *adr_type = phase->type(adr);
   1.111 -      if (adr_type->isa_narrowoop()) {
   1.112 -        adr_type = adr_type->is_narrowoop()->make_oopptr();
   1.113 -      }
   1.114 +      const Type *adr_type = phase->type(adr)->make_ptr();
   1.115  #ifdef ASSERT
   1.116        if (!adr_type->isa_oopptr())
   1.117          assert(phase->type(adr) == TypeRawPtr::NOTNULL, "Op_StoreP");

mercurial