Print this page
rev 1839 : 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/cpu/sparc/vm/assembler_sparc.cpp
          +++ new/src/cpu/sparc/vm/assembler_sparc.cpp
↓ open down ↓ 1419 lines elided ↑ open up ↑
1420 1420      Assembler::sethi(lo,   d); // macro assembler version sign-extends
1421 1421      if (low10(hi) != 0)
1422 1422        or3 (tmp, low10(hi), tmp);
1423 1423      if (low10(lo) != 0)
1424 1424        or3 (  d, low10(lo),   d);
1425 1425      sllx(tmp, 32, tmp);
1426 1426      or3 (d, tmp, d);
1427 1427    }
1428 1428  }
1429 1429  
     1430 +int MacroAssembler::size_of_set64(jlong value) {
     1431 +  v9_dep();
     1432 +
     1433 +  int hi = (int)(value >> 32);
     1434 +  int lo = (int)(value & ~0);
     1435 +  int count = 0;
     1436 +
     1437 +  // (Matcher::isSimpleConstant64 knows about the following optimizations.)
     1438 +  if (Assembler::is_simm13(lo) && value == lo) {
     1439 +    count++;
     1440 +  } else if (hi == 0) {
     1441 +    count++;
     1442 +    if (low10(lo) != 0)
     1443 +      count++;
     1444 +  }
     1445 +  else if (hi == -1) {
     1446 +    count += 2;
     1447 +  }
     1448 +  else if (lo == 0) {
     1449 +    if (Assembler::is_simm13(hi)) {
     1450 +      count++;
     1451 +    } else {
     1452 +      count++;
     1453 +      if (low10(hi) != 0)
     1454 +        count++;
     1455 +    }
     1456 +    count++;
     1457 +  }
     1458 +  else {
     1459 +    count += 2;
     1460 +    if (low10(hi) != 0)
     1461 +      count++;
     1462 +    if (low10(lo) != 0)
     1463 +      count++;
     1464 +    count += 2;
     1465 +  }
     1466 +  return count;
     1467 +}
     1468 +
1430 1469  // compute size in bytes of sparc frame, given
1431 1470  // number of extraWords
1432 1471  int MacroAssembler::total_frame_size_in_bytes(int extraWords) {
1433 1472  
1434 1473    int nWords = frame::memory_parameter_word_sp_offset;
1435 1474  
1436 1475    nWords += extraWords;
1437 1476  
1438 1477    if (nWords & 1) ++nWords; // round up to double-word
1439 1478  
↓ open down ↓ 3393 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX