< prev index next >

src/hotspot/share/opto/output.cpp

Print this page
rev 59189 : imported patch hotspot


 787     // is written to the lower memory address.  This may seem like
 788     // a machine dependency, but it is not--it is a requirement on
 789     // the author of the <arch>.ad file to ensure that, for every
 790     // even/odd double-register pair to which a double may be allocated,
 791     // the word in the even single-register is stored to the first
 792     // memory word.  (Note that register numbers are completely
 793     // arbitrary, and are not tied to any machine-level encodings.)
 794 #ifdef _LP64
 795     if( t->base() == Type::DoubleBot || t->base() == Type::DoubleCon ) {
 796       array->append(new ConstantIntValue((jint)0));
 797       array->append(new_loc_value( C->regalloc(), regnum, Location::dbl ));
 798     } else if ( t->base() == Type::Long ) {
 799       array->append(new ConstantIntValue((jint)0));
 800       array->append(new_loc_value( C->regalloc(), regnum, Location::lng ));
 801     } else if ( t->base() == Type::RawPtr ) {
 802       // jsr/ret return address which must be restored into a the full
 803       // width 64-bit stack slot.
 804       array->append(new_loc_value( C->regalloc(), regnum, Location::lng ));
 805     }
 806 #else //_LP64
 807 #ifdef SPARC
 808     if (t->base() == Type::Long && OptoReg::is_reg(regnum)) {
 809       // For SPARC we have to swap high and low words for
 810       // long values stored in a single-register (g0-g7).
 811       array->append(new_loc_value( C->regalloc(),              regnum   , Location::normal ));
 812       array->append(new_loc_value( C->regalloc(), OptoReg::add(regnum,1), Location::normal ));
 813     } else
 814 #endif //SPARC
 815     if( t->base() == Type::DoubleBot || t->base() == Type::DoubleCon || t->base() == Type::Long ) {
 816       // Repack the double/long as two jints.
 817       // The convention the interpreter uses is that the second local
 818       // holds the first raw word of the native double representation.
 819       // This is actually reasonable, since locals and stack arrays
 820       // grow downwards in all implementations.
 821       // (If, on some machine, the interpreter's Java locals or stack
 822       // were to grow upwards, the embedded doubles would be word-swapped.)
 823       array->append(new_loc_value( C->regalloc(), OptoReg::add(regnum,1), Location::normal ));
 824       array->append(new_loc_value( C->regalloc(),              regnum   , Location::normal ));
 825     }
 826 #endif //_LP64
 827     else if( (t->base() == Type::FloatBot || t->base() == Type::FloatCon) &&
 828              OptoReg::is_reg(regnum) ) {
 829       array->append(new_loc_value( C->regalloc(), regnum, Matcher::float_in_double()
 830                                                       ? Location::float_in_dbl : Location::normal ));
 831     } else if( t->base() == Type::Int && OptoReg::is_reg(regnum) ) {
 832       array->append(new_loc_value( C->regalloc(), regnum, Matcher::int_in_long
 833                                                       ? Location::int_in_long : Location::normal ));
 834     } else if( t->base() == Type::NarrowOop ) {




 787     // is written to the lower memory address.  This may seem like
 788     // a machine dependency, but it is not--it is a requirement on
 789     // the author of the <arch>.ad file to ensure that, for every
 790     // even/odd double-register pair to which a double may be allocated,
 791     // the word in the even single-register is stored to the first
 792     // memory word.  (Note that register numbers are completely
 793     // arbitrary, and are not tied to any machine-level encodings.)
 794 #ifdef _LP64
 795     if( t->base() == Type::DoubleBot || t->base() == Type::DoubleCon ) {
 796       array->append(new ConstantIntValue((jint)0));
 797       array->append(new_loc_value( C->regalloc(), regnum, Location::dbl ));
 798     } else if ( t->base() == Type::Long ) {
 799       array->append(new ConstantIntValue((jint)0));
 800       array->append(new_loc_value( C->regalloc(), regnum, Location::lng ));
 801     } else if ( t->base() == Type::RawPtr ) {
 802       // jsr/ret return address which must be restored into a the full
 803       // width 64-bit stack slot.
 804       array->append(new_loc_value( C->regalloc(), regnum, Location::lng ));
 805     }
 806 #else //_LP64








 807     if( t->base() == Type::DoubleBot || t->base() == Type::DoubleCon || t->base() == Type::Long ) {
 808       // Repack the double/long as two jints.
 809       // The convention the interpreter uses is that the second local
 810       // holds the first raw word of the native double representation.
 811       // This is actually reasonable, since locals and stack arrays
 812       // grow downwards in all implementations.
 813       // (If, on some machine, the interpreter's Java locals or stack
 814       // were to grow upwards, the embedded doubles would be word-swapped.)
 815       array->append(new_loc_value( C->regalloc(), OptoReg::add(regnum,1), Location::normal ));
 816       array->append(new_loc_value( C->regalloc(),              regnum   , Location::normal ));
 817     }
 818 #endif //_LP64
 819     else if( (t->base() == Type::FloatBot || t->base() == Type::FloatCon) &&
 820              OptoReg::is_reg(regnum) ) {
 821       array->append(new_loc_value( C->regalloc(), regnum, Matcher::float_in_double()
 822                                                       ? Location::float_in_dbl : Location::normal ));
 823     } else if( t->base() == Type::Int && OptoReg::is_reg(regnum) ) {
 824       array->append(new_loc_value( C->regalloc(), regnum, Matcher::int_in_long
 825                                                       ? Location::int_in_long : Location::normal ));
 826     } else if( t->base() == Type::NarrowOop ) {


< prev index next >