src/share/vm/opto/memnode.cpp

changeset 1005
dca06e7f503d
parent 979
82a980778b92
parent 993
3b5ac9e7e6ea
child 1014
0fbdb4381b99
child 1018
5d75ab5f6698
     1.1 --- a/src/share/vm/opto/memnode.cpp	Tue Feb 10 18:39:09 2009 +0300
     1.2 +++ b/src/share/vm/opto/memnode.cpp	Tue Feb 17 14:30:24 2009 -0800
     1.3 @@ -779,14 +779,14 @@
     1.4           "use LoadRangeNode instead");
     1.5    switch (bt) {
     1.6    case T_BOOLEAN:
     1.7 -  case T_BYTE:    return new (C, 3) LoadBNode(ctl, mem, adr, adr_type, rt->is_int()    );
     1.8 -  case T_INT:     return new (C, 3) LoadINode(ctl, mem, adr, adr_type, rt->is_int()    );
     1.9 -  case T_CHAR:    return new (C, 3) LoadCNode(ctl, mem, adr, adr_type, rt->is_int()    );
    1.10 -  case T_SHORT:   return new (C, 3) LoadSNode(ctl, mem, adr, adr_type, rt->is_int()    );
    1.11 -  case T_LONG:    return new (C, 3) LoadLNode(ctl, mem, adr, adr_type, rt->is_long()   );
    1.12 -  case T_FLOAT:   return new (C, 3) LoadFNode(ctl, mem, adr, adr_type, rt              );
    1.13 -  case T_DOUBLE:  return new (C, 3) LoadDNode(ctl, mem, adr, adr_type, rt              );
    1.14 -  case T_ADDRESS: return new (C, 3) LoadPNode(ctl, mem, adr, adr_type, rt->is_ptr()    );
    1.15 +  case T_BYTE:    return new (C, 3) LoadBNode (ctl, mem, adr, adr_type, rt->is_int()    );
    1.16 +  case T_INT:     return new (C, 3) LoadINode (ctl, mem, adr, adr_type, rt->is_int()    );
    1.17 +  case T_CHAR:    return new (C, 3) LoadUSNode(ctl, mem, adr, adr_type, rt->is_int()    );
    1.18 +  case T_SHORT:   return new (C, 3) LoadSNode (ctl, mem, adr, adr_type, rt->is_int()    );
    1.19 +  case T_LONG:    return new (C, 3) LoadLNode (ctl, mem, adr, adr_type, rt->is_long()   );
    1.20 +  case T_FLOAT:   return new (C, 3) LoadFNode (ctl, mem, adr, adr_type, rt              );
    1.21 +  case T_DOUBLE:  return new (C, 3) LoadDNode (ctl, mem, adr, adr_type, rt              );
    1.22 +  case T_ADDRESS: return new (C, 3) LoadPNode (ctl, mem, adr, adr_type, rt->is_ptr()    );
    1.23    case T_OBJECT:
    1.24  #ifdef _LP64
    1.25      if (adr->bottom_type()->is_ptr_to_narrowoop()) {
    1.26 @@ -1076,13 +1076,14 @@
    1.27        // of the original value.
    1.28        Node* mem_phi = in(Memory);
    1.29        Node* offset = in(Address)->in(AddPNode::Offset);
    1.30 +      Node* region = base->in(0);
    1.31  
    1.32        Node* in1 = clone();
    1.33        Node* in1_addr = in1->in(Address)->clone();
    1.34        in1_addr->set_req(AddPNode::Base, base->in(allocation_index));
    1.35        in1_addr->set_req(AddPNode::Address, base->in(allocation_index));
    1.36        in1_addr->set_req(AddPNode::Offset, offset);
    1.37 -      in1->set_req(0, base->in(allocation_index));
    1.38 +      in1->set_req(0, region->in(allocation_index));
    1.39        in1->set_req(Address, in1_addr);
    1.40        in1->set_req(Memory, mem_phi->in(allocation_index));
    1.41  
    1.42 @@ -1091,7 +1092,7 @@
    1.43        in2_addr->set_req(AddPNode::Base, base->in(load_index));
    1.44        in2_addr->set_req(AddPNode::Address, base->in(load_index));
    1.45        in2_addr->set_req(AddPNode::Offset, offset);
    1.46 -      in2->set_req(0, base->in(load_index));
    1.47 +      in2->set_req(0, region->in(load_index));
    1.48        in2->set_req(Address, in2_addr);
    1.49        in2->set_req(Memory, mem_phi->in(load_index));
    1.50  
    1.51 @@ -1100,7 +1101,7 @@
    1.52        in2_addr = phase->transform(in2_addr);
    1.53        in2 =      phase->transform(in2);
    1.54  
    1.55 -      PhiNode* result = PhiNode::make_blank(base->in(0), this);
    1.56 +      PhiNode* result = PhiNode::make_blank(region, this);
    1.57        result->set_req(allocation_index, in1);
    1.58        result->set_req(load_index, in2);
    1.59        return result;
    1.60 @@ -1357,7 +1358,7 @@
    1.61    // Steps (a), (b):  Walk past independent stores to find an exact match.
    1.62    if (prev_mem != NULL && prev_mem != in(MemNode::Memory)) {
    1.63      // (c) See if we can fold up on the spot, but don't fold up here.
    1.64 -    // Fold-up might require truncation (for LoadB/LoadS/LoadC) or
    1.65 +    // Fold-up might require truncation (for LoadB/LoadS/LoadUS) or
    1.66      // just return a prior value, which is done by Identity calls.
    1.67      if (can_see_stored_value(prev_mem, phase)) {
    1.68        // Make ready for step (d):
    1.69 @@ -1606,14 +1607,14 @@
    1.70    return LoadNode::Ideal(phase, can_reshape);
    1.71  }
    1.72  
    1.73 -//--------------------------LoadCNode::Ideal--------------------------------------
    1.74 +//--------------------------LoadUSNode::Ideal-------------------------------------
    1.75  //
    1.76  //  If the previous store is to the same address as this load,
    1.77  //  and the value stored was larger than a char, replace this load
    1.78  //  with the value stored truncated to a char.  If no truncation is
    1.79  //  needed, the replacement is done in LoadNode::Identity().
    1.80  //
    1.81 -Node *LoadCNode::Ideal(PhaseGVN *phase, bool can_reshape) {
    1.82 +Node *LoadUSNode::Ideal(PhaseGVN *phase, bool can_reshape) {
    1.83    Node* mem = in(MemNode::Memory);
    1.84    Node* value = can_see_stored_value(mem,phase);
    1.85    if( value && !phase->type(value)->higher_equal( _type ) )

mercurial