src/cpu/x86/vm/c1_LIRGenerator_x86.cpp

Print this page




 158                            offset_in_bytes + index_opr->as_jint() * elem_size, type);
 159   } else {
 160 #ifdef _LP64
 161     if (index_opr->type() == T_INT) {
 162       LIR_Opr tmp = new_register(T_LONG);
 163       __ convert(Bytecodes::_i2l, index_opr, tmp);
 164       index_opr = tmp;
 165     }
 166 #endif // _LP64
 167     addr =  new LIR_Address(array_opr,
 168                             index_opr,
 169                             LIR_Address::scale(type),
 170                             offset_in_bytes, type);
 171   }
 172   if (needs_card_mark) {
 173     // This store will need a precise card mark, so go ahead and
 174     // compute the full adddres instead of computing once for the
 175     // store and again for the card mark.
 176     LIR_Opr tmp = new_pointer_register();
 177     __ leal(LIR_OprFact::address(addr), tmp);
 178     return new LIR_Address(tmp, 0, type);
 179   } else {
 180     return addr;
 181   }
 182 }
 183 
 184 
 185 void LIRGenerator::increment_counter(address counter, int step) {
 186   LIR_Opr pointer = new_pointer_register();
 187   __ move(LIR_OprFact::intptrConst(counter), pointer);
 188   LIR_Address* addr = new LIR_Address(pointer, 0, T_INT);
 189   increment_counter(addr, step);
 190 }
 191 
 192 
 193 void LIRGenerator::increment_counter(LIR_Address* addr, int step) {
 194   __ add((LIR_Opr)addr, LIR_OprFact::intConst(step), (LIR_Opr)addr);
 195 }
 196 
 197 
 198 void LIRGenerator::cmp_mem_int(LIR_Condition condition, LIR_Opr base, int disp, int c, CodeEmitInfo* info) {
 199   __ cmp_mem_int(condition, base, disp, c, info);
 200 }
 201 
 202 
 203 void LIRGenerator::cmp_reg_mem(LIR_Condition condition, LIR_Opr reg, LIR_Opr base, int disp, BasicType type, CodeEmitInfo* info) {
 204   __ cmp_reg_mem(condition, reg, new LIR_Address(base, disp, type), info);
 205 }
 206 
 207 
 208 void LIRGenerator::cmp_reg_mem(LIR_Condition condition, LIR_Opr reg, LIR_Opr base, LIR_Opr disp, BasicType type, CodeEmitInfo* info) {




 158                            offset_in_bytes + index_opr->as_jint() * elem_size, type);
 159   } else {
 160 #ifdef _LP64
 161     if (index_opr->type() == T_INT) {
 162       LIR_Opr tmp = new_register(T_LONG);
 163       __ convert(Bytecodes::_i2l, index_opr, tmp);
 164       index_opr = tmp;
 165     }
 166 #endif // _LP64
 167     addr =  new LIR_Address(array_opr,
 168                             index_opr,
 169                             LIR_Address::scale(type),
 170                             offset_in_bytes, type);
 171   }
 172   if (needs_card_mark) {
 173     // This store will need a precise card mark, so go ahead and
 174     // compute the full adddres instead of computing once for the
 175     // store and again for the card mark.
 176     LIR_Opr tmp = new_pointer_register();
 177     __ leal(LIR_OprFact::address(addr), tmp);
 178     return new LIR_Address(tmp, (intx)0, type);
 179   } else {
 180     return addr;
 181   }
 182 }
 183 
 184 
 185 void LIRGenerator::increment_counter(address counter, int step) {
 186   LIR_Opr pointer = new_pointer_register();
 187   __ move(LIR_OprFact::intptrConst(counter), pointer);
 188   LIR_Address* addr = new LIR_Address(pointer, (intx)0, T_INT);
 189   increment_counter(addr, step);
 190 }
 191 
 192 
 193 void LIRGenerator::increment_counter(LIR_Address* addr, int step) {
 194   __ add((LIR_Opr)addr, LIR_OprFact::intConst(step), (LIR_Opr)addr);
 195 }
 196 
 197 
 198 void LIRGenerator::cmp_mem_int(LIR_Condition condition, LIR_Opr base, int disp, int c, CodeEmitInfo* info) {
 199   __ cmp_mem_int(condition, base, disp, c, info);
 200 }
 201 
 202 
 203 void LIRGenerator::cmp_reg_mem(LIR_Condition condition, LIR_Opr reg, LIR_Opr base, int disp, BasicType type, CodeEmitInfo* info) {
 204   __ cmp_reg_mem(condition, reg, new LIR_Address(base, disp, type), info);
 205 }
 206 
 207 
 208 void LIRGenerator::cmp_reg_mem(LIR_Condition condition, LIR_Opr reg, LIR_Opr base, LIR_Opr disp, BasicType type, CodeEmitInfo* info) {