Print this page
rev 1838 : 6961690: load oops from constant table on SPARC
Summary: oops should be loaded from the constant table of an nmethod instead of materializing them with a long code sequence.
Reviewed-by:

Split Close
Expand all
Collapse all
          --- old/src/share/vm/opto/postaloc.cpp
          +++ new/src/share/vm/opto/postaloc.cpp
↓ open down ↓ 190 lines elided ↑ open up ↑
 191  191  
 192  192    // Loop backedges won't have a value-mapping yet
 193  193    if( &value == NULL ) return blk_adjust;
 194  194  
 195  195    // Skip through all copies to the _value_ being used.  Do not change from
 196  196    // int to pointer.  This attempts to jump through a chain of copies, where
 197  197    // intermediate copies might be illegal, i.e., value is stored down to stack
 198  198    // then reloaded BUT survives in a register the whole way.
 199  199    Node *val = skip_copies(n->in(k));
 200  200  
      201 +  if (val == x && nk_idx != 0 &&
      202 +      regnd[nk_reg] != NULL && regnd[nk_reg] != x &&
      203 +      n2lidx(x) == n2lidx(regnd[nk_reg])) {
      204 +    // When rematerialzing nodes and stretching lifetimes, the
      205 +    // allocator will reuse the original def for multidef LRG instead
      206 +    // of the current reaching def because it can't know it's safe to
      207 +    // do so.  After allocation completes if they are in the same LRG
      208 +    // then it should use the current reaching def instead.
      209 +    n->set_req(k, regnd[nk_reg]);
      210 +    blk_adjust += yank_if_dead(val, current_block, &value, &regnd);
      211 +    val = skip_copies(n->in(k));
      212 +  }
      213 +
 201  214    if( val == x ) return blk_adjust; // No progress?
 202  215  
 203  216    bool single = is_single_register(val->ideal_reg());
 204  217    uint val_idx = n2lidx(val);
 205  218    OptoReg::Name val_reg = lrgs(val_idx).reg();
 206  219  
 207  220    // See if it happens to already be in the correct register!
 208  221    // (either Phi's direct register, or the common case of the name
 209  222    // never-clobbered original-def register)
 210  223    if( value[val_reg] == val &&
↓ open down ↓ 396 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX