src/share/vm/opto/memnode.cpp

changeset 1018
5d75ab5f6698
parent 1005
dca06e7f503d
child 1040
98cb887364d3
     1.1 --- a/src/share/vm/opto/memnode.cpp	Tue Feb 17 14:30:24 2009 -0800
     1.2 +++ b/src/share/vm/opto/memnode.cpp	Wed Feb 18 13:53:42 2009 -0800
     1.3 @@ -1066,11 +1066,11 @@
     1.4          break;
     1.5        }
     1.6      }
     1.7 -    LoadNode* load = NULL;
     1.8 -    if (allocation != NULL && base->in(load_index)->is_Load()) {
     1.9 -      load = base->in(load_index)->as_Load();
    1.10 -    }
    1.11 -    if (load != NULL && in(Memory)->is_Phi() && in(Memory)->in(0) == base->in(0)) {
    1.12 +    bool has_load = ( allocation != NULL &&
    1.13 +                      (base->in(load_index)->is_Load() ||
    1.14 +                       base->in(load_index)->is_DecodeN() &&
    1.15 +                       base->in(load_index)->in(1)->is_Load()) );
    1.16 +    if (has_load && in(Memory)->is_Phi() && in(Memory)->in(0) == base->in(0)) {
    1.17        // Push the loads from the phi that comes from valueOf up
    1.18        // through it to allow elimination of the loads and the recovery
    1.19        // of the original value.
    1.20 @@ -1106,11 +1106,20 @@
    1.21        result->set_req(load_index, in2);
    1.22        return result;
    1.23      }
    1.24 -  } else if (base->is_Load()) {
    1.25 +  } else if (base->is_Load() ||
    1.26 +             base->is_DecodeN() && base->in(1)->is_Load()) {
    1.27 +    if (base->is_DecodeN()) {
    1.28 +      // Get LoadN node which loads cached Integer object
    1.29 +      base = base->in(1);
    1.30 +    }
    1.31      // Eliminate the load of Integer.value for integers from the cache
    1.32      // array by deriving the value from the index into the array.
    1.33      // Capture the offset of the load and then reverse the computation.
    1.34      Node* load_base = base->in(Address)->in(AddPNode::Base);
    1.35 +    if (load_base->is_DecodeN()) {
    1.36 +      // Get LoadN node which loads IntegerCache.cache field
    1.37 +      load_base = load_base->in(1);
    1.38 +    }
    1.39      if (load_base != NULL) {
    1.40        Compile::AliasType* atp = phase->C->alias_type(load_base->adr_type());
    1.41        intptr_t cache_offset;

mercurial