210 } 211 212 void LIRGenerator::increment_counter(LIR_Address* addr, int step) { 213 __ add((LIR_Opr)addr, LIR_OprFact::intConst(step), (LIR_Opr)addr); 214 } 215 216 void LIRGenerator::cmp_mem_int(LIR_Condition condition, LIR_Opr base, int disp, int c, CodeEmitInfo* info) { 217 LIR_Opr scratch = FrameMap::Z_R1_opr; 218 __ load(new LIR_Address(base, disp, T_INT), scratch, info); 219 __ cmp(condition, scratch, c); 220 } 221 222 void LIRGenerator::cmp_reg_mem(LIR_Condition condition, LIR_Opr reg, LIR_Opr base, int disp, BasicType type, CodeEmitInfo* info) { 223 __ cmp_reg_mem(condition, reg, new LIR_Address(base, disp, type), info); 224 } 225 226 bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, int c, LIR_Opr result, LIR_Opr tmp) { 227 if (tmp->is_valid()) { 228 if (is_power_of_2(c + 1)) { 229 __ move(left, tmp); 230 __ shift_left(left, log2_intptr(c + 1), left); 231 __ sub(left, tmp, result); 232 return true; 233 } else if (is_power_of_2(c - 1)) { 234 __ move(left, tmp); 235 __ shift_left(left, log2_intptr(c - 1), left); 236 __ add(left, tmp, result); 237 return true; 238 } 239 } 240 return false; 241 } 242 243 void LIRGenerator::store_stack_parameter (LIR_Opr item, ByteSize offset_from_sp) { 244 BasicType type = item->type(); 245 __ store(item, new LIR_Address(FrameMap::Z_SP_opr, in_bytes(offset_from_sp), type)); 246 } 247 248 //---------------------------------------------------------------------- 249 // visitor functions 250 //---------------------------------------------------------------------- 251 252 void LIRGenerator::array_store_check(LIR_Opr value, LIR_Opr array, CodeEmitInfo* store_check_info, ciMethod* profiled_method, int profiled_bci) { 253 LIR_Opr tmp1 = new_register(objectType); 254 LIR_Opr tmp2 = new_register(objectType); 255 LIR_Opr tmp3 = LIR_OprFact::illegalOpr; | 210 } 211 212 void LIRGenerator::increment_counter(LIR_Address* addr, int step) { 213 __ add((LIR_Opr)addr, LIR_OprFact::intConst(step), (LIR_Opr)addr); 214 } 215 216 void LIRGenerator::cmp_mem_int(LIR_Condition condition, LIR_Opr base, int disp, int c, CodeEmitInfo* info) { 217 LIR_Opr scratch = FrameMap::Z_R1_opr; 218 __ load(new LIR_Address(base, disp, T_INT), scratch, info); 219 __ cmp(condition, scratch, c); 220 } 221 222 void LIRGenerator::cmp_reg_mem(LIR_Condition condition, LIR_Opr reg, LIR_Opr base, int disp, BasicType type, CodeEmitInfo* info) { 223 __ cmp_reg_mem(condition, reg, new LIR_Address(base, disp, type), info); 224 } 225 226 bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, int c, LIR_Opr result, LIR_Opr tmp) { 227 if (tmp->is_valid()) { 228 if (is_power_of_2(c + 1)) { 229 __ move(left, tmp); 230 __ shift_left(left, log2_int(c + 1), left); 231 __ sub(left, tmp, result); 232 return true; 233 } else if (is_power_of_2(c - 1)) { 234 __ move(left, tmp); 235 __ shift_left(left, log2_int(c - 1), left); 236 __ add(left, tmp, result); 237 return true; 238 } 239 } 240 return false; 241 } 242 243 void LIRGenerator::store_stack_parameter (LIR_Opr item, ByteSize offset_from_sp) { 244 BasicType type = item->type(); 245 __ store(item, new LIR_Address(FrameMap::Z_SP_opr, in_bytes(offset_from_sp), type)); 246 } 247 248 //---------------------------------------------------------------------- 249 // visitor functions 250 //---------------------------------------------------------------------- 251 252 void LIRGenerator::array_store_check(LIR_Opr value, LIR_Opr array, CodeEmitInfo* store_check_info, ciMethod* profiled_method, int profiled_bci) { 253 LIR_Opr tmp1 = new_register(objectType); 254 LIR_Opr tmp2 = new_register(objectType); 255 LIR_Opr tmp3 = LIR_OprFact::illegalOpr; |