< prev index next >

src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp

Print this page




 213   __ move(LIR_OprFact::intptrConst(counter), pointer);
 214   LIR_Address* addr = new LIR_Address(pointer, type);
 215   increment_counter(addr, step);
 216 }
 217 
 218 
 219 void LIRGenerator::increment_counter(LIR_Address* addr, int step) {
 220   __ add((LIR_Opr)addr, LIR_OprFact::intConst(step), (LIR_Opr)addr);
 221 }
 222 
 223 void LIRGenerator::cmp_mem_int(LIR_Condition condition, LIR_Opr base, int disp, int c, CodeEmitInfo* info) {
 224   __ cmp_mem_int(condition, base, disp, c, info);
 225 }
 226 
 227 
 228 void LIRGenerator::cmp_reg_mem(LIR_Condition condition, LIR_Opr reg, LIR_Opr base, int disp, BasicType type, CodeEmitInfo* info) {
 229   __ cmp_reg_mem(condition, reg, new LIR_Address(base, disp, type), info);
 230 }
 231 
 232 
 233 void LIRGenerator::cmp_reg_mem(LIR_Condition condition, LIR_Opr reg, LIR_Opr base, LIR_Opr disp, BasicType type, CodeEmitInfo* info) {
 234   __ cmp_reg_mem(condition, reg, new LIR_Address(base, disp, type), info);
 235 }
 236 
 237 
 238 bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, jint c, LIR_Opr result, LIR_Opr tmp) {
 239   if (tmp->is_valid() && c > 0 && c < max_jint) {
 240     if (is_power_of_2(c + 1)) {
 241       __ move(left, tmp);
 242       __ shift_left(left, log2_intptr(c + 1), left);
 243       __ sub(left, tmp, result);
 244       return true;
 245     } else if (is_power_of_2(c - 1)) {
 246       __ move(left, tmp);
 247       __ shift_left(left, log2_intptr(c - 1), left);
 248       __ add(left, tmp, result);
 249       return true;
 250     }
 251   }
 252   return false;
 253 }
 254 
 255 
 256 void LIRGenerator::store_stack_parameter (LIR_Opr item, ByteSize offset_from_sp) {
 257   BasicType type = item->type();




 213   __ move(LIR_OprFact::intptrConst(counter), pointer);
 214   LIR_Address* addr = new LIR_Address(pointer, type);
 215   increment_counter(addr, step);
 216 }
 217 
 218 
 219 void LIRGenerator::increment_counter(LIR_Address* addr, int step) {
 220   __ add((LIR_Opr)addr, LIR_OprFact::intConst(step), (LIR_Opr)addr);
 221 }
 222 
 223 void LIRGenerator::cmp_mem_int(LIR_Condition condition, LIR_Opr base, int disp, int c, CodeEmitInfo* info) {
 224   __ cmp_mem_int(condition, base, disp, c, info);
 225 }
 226 
 227 
 228 void LIRGenerator::cmp_reg_mem(LIR_Condition condition, LIR_Opr reg, LIR_Opr base, int disp, BasicType type, CodeEmitInfo* info) {
 229   __ cmp_reg_mem(condition, reg, new LIR_Address(base, disp, type), info);
 230 }
 231 
 232 





 233 bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, jint c, LIR_Opr result, LIR_Opr tmp) {
 234   if (tmp->is_valid() && c > 0 && c < max_jint) {
 235     if (is_power_of_2(c + 1)) {
 236       __ move(left, tmp);
 237       __ shift_left(left, log2_intptr(c + 1), left);
 238       __ sub(left, tmp, result);
 239       return true;
 240     } else if (is_power_of_2(c - 1)) {
 241       __ move(left, tmp);
 242       __ shift_left(left, log2_intptr(c - 1), left);
 243       __ add(left, tmp, result);
 244       return true;
 245     }
 246   }
 247   return false;
 248 }
 249 
 250 
 251 void LIRGenerator::store_stack_parameter (LIR_Opr item, ByteSize offset_from_sp) {
 252   BasicType type = item->type();


< prev index next >