src/cpu/x86/vm/c1_LIRAssembler_x86.cpp

Print this page




 762       ShouldNotReachHere();
 763   }
 764 }
 765 
 766 void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmitInfo* info ) {
 767   assert(src->is_constant(), "should not call otherwise");
 768   assert(dest->is_address(), "should not call otherwise");
 769   LIR_Const* c = src->as_constant_ptr();
 770   LIR_Address* addr = dest->as_address_ptr();
 771 
 772   int null_check_here = code_offset();
 773   switch (type) {
 774     case T_INT:    // fall through
 775     case T_FLOAT:
 776       __ movl(as_Address(addr), c->as_jint_bits());
 777       break;
 778 
 779     case T_OBJECT:  // fall through
 780     case T_ARRAY:
 781       if (c->as_jobject() == NULL) {
 782         __ movptr(as_Address(addr), (int32_t)NULL_WORD);
 783       } else {
 784         if (is_literal_address(addr)) {
 785           ShouldNotReachHere();
 786           __ movoop(as_Address(addr, noreg), c->as_jobject());
 787         } else {
 788           __ movoop(as_Address(addr), c->as_jobject());
 789         }
 790       }
 791       break;
 792 
 793     case T_LONG:    // fall through
 794     case T_DOUBLE:
 795 #ifdef _LP64
 796       if (is_literal_address(addr)) {
 797         ShouldNotReachHere();
 798         __ movptr(as_Address(addr, r15_thread), (intptr_t)c->as_jlong_bits());
 799       } else {
 800         __ movptr(r10, (intptr_t)c->as_jlong_bits());
 801         null_check_here = code_offset();
 802         __ movptr(as_Address_lo(addr), r10);




 762       ShouldNotReachHere();
 763   }
 764 }
 765 
 766 void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmitInfo* info ) {
 767   assert(src->is_constant(), "should not call otherwise");
 768   assert(dest->is_address(), "should not call otherwise");
 769   LIR_Const* c = src->as_constant_ptr();
 770   LIR_Address* addr = dest->as_address_ptr();
 771 
 772   int null_check_here = code_offset();
 773   switch (type) {
 774     case T_INT:    // fall through
 775     case T_FLOAT:
 776       __ movl(as_Address(addr), c->as_jint_bits());
 777       break;
 778 
 779     case T_OBJECT:  // fall through
 780     case T_ARRAY:
 781       if (c->as_jobject() == NULL) {
 782         __ movptr(as_Address(addr), NULL_WORD);
 783       } else {
 784         if (is_literal_address(addr)) {
 785           ShouldNotReachHere();
 786           __ movoop(as_Address(addr, noreg), c->as_jobject());
 787         } else {
 788           __ movoop(as_Address(addr), c->as_jobject());
 789         }
 790       }
 791       break;
 792 
 793     case T_LONG:    // fall through
 794     case T_DOUBLE:
 795 #ifdef _LP64
 796       if (is_literal_address(addr)) {
 797         ShouldNotReachHere();
 798         __ movptr(as_Address(addr, r15_thread), (intptr_t)c->as_jlong_bits());
 799       } else {
 800         __ movptr(r10, (intptr_t)c->as_jlong_bits());
 801         null_check_here = code_offset();
 802         __ movptr(as_Address_lo(addr), r10);