227
228
229 void LIRGenerator::increment_counter(LIR_Address* addr, int step) {
230 __ add((LIR_Opr)addr, LIR_OprFact::intConst(step), (LIR_Opr)addr);
231 }
232
233 void LIRGenerator::cmp_mem_int(LIR_Condition condition, LIR_Opr base, int disp, int c, CodeEmitInfo* info) {
234 __ cmp_mem_int(condition, base, disp, c, info);
235 }
236
237
238 void LIRGenerator::cmp_reg_mem(LIR_Condition condition, LIR_Opr reg, LIR_Opr base, int disp, BasicType type, CodeEmitInfo* info) {
239 __ cmp_reg_mem(condition, reg, new LIR_Address(base, disp, type), info);
240 }
241
242
243 bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, jint c, LIR_Opr result, LIR_Opr tmp) {
244 if (tmp->is_valid() && c > 0 && c < max_jint) {
245 if (is_power_of_2(c + 1)) {
246 __ move(left, tmp);
247 __ shift_left(left, log2_intptr(c + 1), left);
248 __ sub(left, tmp, result);
249 return true;
250 } else if (is_power_of_2(c - 1)) {
251 __ move(left, tmp);
252 __ shift_left(left, log2_intptr(c - 1), left);
253 __ add(left, tmp, result);
254 return true;
255 }
256 }
257 return false;
258 }
259
260
261 void LIRGenerator::store_stack_parameter (LIR_Opr item, ByteSize offset_from_sp) {
262 BasicType type = item->type();
263 __ store(item, new LIR_Address(FrameMap::rsp_opr, in_bytes(offset_from_sp), type));
264 }
265
266 void LIRGenerator::array_store_check(LIR_Opr value, LIR_Opr array, CodeEmitInfo* store_check_info, ciMethod* profiled_method, int profiled_bci) {
267 LIR_Opr tmp1 = new_register(objectType);
268 LIR_Opr tmp2 = new_register(objectType);
269 LIR_Opr tmp3 = new_register(objectType);
270 __ store_check(value, array, tmp1, tmp2, tmp3, store_check_info, profiled_method, profiled_bci);
271 }
272
|
227
228
229 void LIRGenerator::increment_counter(LIR_Address* addr, int step) {
230 __ add((LIR_Opr)addr, LIR_OprFact::intConst(step), (LIR_Opr)addr);
231 }
232
233 void LIRGenerator::cmp_mem_int(LIR_Condition condition, LIR_Opr base, int disp, int c, CodeEmitInfo* info) {
234 __ cmp_mem_int(condition, base, disp, c, info);
235 }
236
237
238 void LIRGenerator::cmp_reg_mem(LIR_Condition condition, LIR_Opr reg, LIR_Opr base, int disp, BasicType type, CodeEmitInfo* info) {
239 __ cmp_reg_mem(condition, reg, new LIR_Address(base, disp, type), info);
240 }
241
242
243 bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, jint c, LIR_Opr result, LIR_Opr tmp) {
244 if (tmp->is_valid() && c > 0 && c < max_jint) {
245 if (is_power_of_2(c + 1)) {
246 __ move(left, tmp);
247 __ shift_left(left, log2_jint(c + 1), left);
248 __ sub(left, tmp, result);
249 return true;
250 } else if (is_power_of_2(c - 1)) {
251 __ move(left, tmp);
252 __ shift_left(left, log2_jint(c - 1), left);
253 __ add(left, tmp, result);
254 return true;
255 }
256 }
257 return false;
258 }
259
260
261 void LIRGenerator::store_stack_parameter (LIR_Opr item, ByteSize offset_from_sp) {
262 BasicType type = item->type();
263 __ store(item, new LIR_Address(FrameMap::rsp_opr, in_bytes(offset_from_sp), type));
264 }
265
266 void LIRGenerator::array_store_check(LIR_Opr value, LIR_Opr array, CodeEmitInfo* store_check_info, ciMethod* profiled_method, int profiled_bci) {
267 LIR_Opr tmp1 = new_register(objectType);
268 LIR_Opr tmp2 = new_register(objectType);
269 LIR_Opr tmp3 = new_register(objectType);
270 __ store_check(value, array, tmp1, tmp2, tmp3, store_check_info, profiled_method, profiled_bci);
271 }
272
|