src/cpu/sparc/vm/assembler_sparc.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 6961690 Sdiff src/cpu/sparc/vm

src/cpu/sparc/vm/assembler_sparc.cpp

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:


1410       or3(G0, hi, d);
1411     } else {
1412       Assembler::sethi(hi, d);   // hardware version zero-extends to upper 32
1413       if (low10(hi) != 0)
1414         or3(d, low10(hi), d);
1415     }
1416     sllx(d, 32, d);
1417   }
1418   else {
1419     Assembler::sethi(hi, tmp);
1420     Assembler::sethi(lo,   d); // macro assembler version sign-extends
1421     if (low10(hi) != 0)
1422       or3 (tmp, low10(hi), tmp);
1423     if (low10(lo) != 0)
1424       or3 (  d, low10(lo),   d);
1425     sllx(tmp, 32, tmp);
1426     or3 (d, tmp, d);
1427   }
1428 }
1429 







































1430 // compute size in bytes of sparc frame, given
1431 // number of extraWords
1432 int MacroAssembler::total_frame_size_in_bytes(int extraWords) {
1433 
1434   int nWords = frame::memory_parameter_word_sp_offset;
1435 
1436   nWords += extraWords;
1437 
1438   if (nWords & 1) ++nWords; // round up to double-word
1439 
1440   return nWords * BytesPerWord;
1441 }
1442 
1443 
1444 // save_frame: given number of "extra" words in frame,
1445 // issue approp. save instruction (p 200, v8 manual)
1446 
1447 void MacroAssembler::save_frame(int extraWords = 0) {
1448   int delta = -total_frame_size_in_bytes(extraWords);
1449   if (is_simm13(delta)) {




1410       or3(G0, hi, d);
1411     } else {
1412       Assembler::sethi(hi, d);   // hardware version zero-extends to upper 32
1413       if (low10(hi) != 0)
1414         or3(d, low10(hi), d);
1415     }
1416     sllx(d, 32, d);
1417   }
1418   else {
1419     Assembler::sethi(hi, tmp);
1420     Assembler::sethi(lo,   d); // macro assembler version sign-extends
1421     if (low10(hi) != 0)
1422       or3 (tmp, low10(hi), tmp);
1423     if (low10(lo) != 0)
1424       or3 (  d, low10(lo),   d);
1425     sllx(tmp, 32, tmp);
1426     or3 (d, tmp, d);
1427   }
1428 }
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 
1469 // compute size in bytes of sparc frame, given
1470 // number of extraWords
1471 int MacroAssembler::total_frame_size_in_bytes(int extraWords) {
1472 
1473   int nWords = frame::memory_parameter_word_sp_offset;
1474 
1475   nWords += extraWords;
1476 
1477   if (nWords & 1) ++nWords; // round up to double-word
1478 
1479   return nWords * BytesPerWord;
1480 }
1481 
1482 
1483 // save_frame: given number of "extra" words in frame,
1484 // issue approp. save instruction (p 200, v8 manual)
1485 
1486 void MacroAssembler::save_frame(int extraWords = 0) {
1487   int delta = -total_frame_size_in_bytes(extraWords);
1488   if (is_simm13(delta)) {


src/cpu/sparc/vm/assembler_sparc.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File