src/share/vm/opto/memnode.cpp

changeset 656
1e026f8da827
parent 628
44a553b2809d
child 658
1dd146f17531
     1.1 --- a/src/share/vm/opto/memnode.cpp	Mon Jun 23 18:21:18 2008 -0700
     1.2 +++ b/src/share/vm/opto/memnode.cpp	Tue Jun 24 10:43:29 2008 -0700
     1.3 @@ -769,15 +769,8 @@
     1.4    case T_OBJECT:
     1.5  #ifdef _LP64
     1.6      if (adr->bottom_type()->is_ptr_to_narrowoop()) {
     1.7 -      const TypeNarrowOop* narrowtype;
     1.8 -      if (rt->isa_narrowoop()) {
     1.9 -        narrowtype = rt->is_narrowoop();
    1.10 -      } else {
    1.11 -        narrowtype = rt->is_oopptr()->make_narrowoop();
    1.12 -      }
    1.13 -      Node* load  = gvn.transform(new (C, 3) LoadNNode(ctl, mem, adr, adr_type, narrowtype));
    1.14 -
    1.15 -      return DecodeNNode::decode(&gvn, load);
    1.16 +      Node* load  = gvn.transform(new (C, 3) LoadNNode(ctl, mem, adr, adr_type, rt->make_narrowoop()));
    1.17 +      return new (C, 2) DecodeNNode(load, load->bottom_type()->make_ptr());
    1.18      } else
    1.19  #endif
    1.20      {
    1.21 @@ -1631,9 +1624,8 @@
    1.22    assert(adr_type != NULL, "expecting TypeOopPtr");
    1.23  #ifdef _LP64
    1.24    if (adr_type->is_ptr_to_narrowoop()) {
    1.25 -    const TypeNarrowOop* narrowtype = tk->is_oopptr()->make_narrowoop();
    1.26 -    Node* load_klass = gvn.transform(new (C, 3) LoadNKlassNode(ctl, mem, adr, at, narrowtype));
    1.27 -    return DecodeNNode::decode(&gvn, load_klass);
    1.28 +    Node* load_klass = gvn.transform(new (C, 3) LoadNKlassNode(ctl, mem, adr, at, tk->make_narrowoop()));
    1.29 +    return new (C, 2) DecodeNNode(load_klass, load_klass->bottom_type()->make_ptr());
    1.30    }
    1.31  #endif
    1.32    assert(!adr_type->is_ptr_to_narrowoop(), "should have got back a narrow oop");
    1.33 @@ -1843,15 +1835,10 @@
    1.34  //------------------------------Value------------------------------------------
    1.35  const Type *LoadNKlassNode::Value( PhaseTransform *phase ) const {
    1.36    const Type *t = klass_value_common(phase);
    1.37 -
    1.38 -  if (t == TypePtr::NULL_PTR) {
    1.39 -    return TypeNarrowOop::NULL_PTR;
    1.40 -  }
    1.41 -  if (t != Type::TOP && !t->isa_narrowoop()) {
    1.42 -    assert(t->is_oopptr(), "sanity");
    1.43 -    t = t->is_oopptr()->make_narrowoop();
    1.44 -  }
    1.45 -  return t;
    1.46 +  if (t == Type::TOP)
    1.47 +    return t;
    1.48 +
    1.49 +  return t->make_narrowoop();
    1.50  }
    1.51  
    1.52  //------------------------------Identity---------------------------------------
    1.53 @@ -1864,7 +1851,7 @@
    1.54    if( t == Type::TOP ) return x;
    1.55    if( t->isa_narrowoop()) return x;
    1.56  
    1.57 -  return EncodePNode::encode(phase, x);
    1.58 +  return phase->transform(new (phase->C, 2) EncodePNode(x, t->make_narrowoop()));
    1.59  }
    1.60  
    1.61  //------------------------------Value-----------------------------------------
    1.62 @@ -1930,14 +1917,13 @@
    1.63      if (adr->bottom_type()->is_ptr_to_narrowoop() ||
    1.64          (UseCompressedOops && val->bottom_type()->isa_klassptr() &&
    1.65           adr->bottom_type()->isa_rawptr())) {
    1.66 -      const TypePtr* type = val->bottom_type()->is_ptr();
    1.67 -      Node* cp = EncodePNode::encode(&gvn, val);
    1.68 -      return new (C, 4) StoreNNode(ctl, mem, adr, adr_type, cp);
    1.69 +      val = gvn.transform(new (C, 2) EncodePNode(val, val->bottom_type()->make_narrowoop()));
    1.70 +      return new (C, 4) StoreNNode(ctl, mem, adr, adr_type, val);
    1.71      } else
    1.72  #endif
    1.73 -      {
    1.74 -        return new (C, 4) StorePNode(ctl, mem, adr, adr_type, val);
    1.75 -      }
    1.76 +    {
    1.77 +      return new (C, 4) StorePNode(ctl, mem, adr, adr_type, val);
    1.78 +    }
    1.79    }
    1.80    ShouldNotReachHere();
    1.81    return (StoreNode*)NULL;

mercurial