void LIR_Assembler::move_op(LIR_Opr src, LIR_Opr dest, LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, BasicType type, LIR_PatchCode patch_code, CodeEmitInfo* info, bool unaligned) { if (src->is_register()) { if (dest->is_register()) { assert(patch_code == lir_patch_none && info == NULL, "no patching and info allowed here"); assert(!tmp1->is_valid() && !tmp2->is_valid(), "unnecessary definition of temp operands"); reg2reg(src, dest); } else if (dest->is_stack()) { assert(patch_code == lir_patch_none && info == NULL, "no patching and info allowed here"); assert(!tmp1->is_valid() && !tmp2->is_valid(), "unnecessary definition of temp operands"); reg2stack(src,dest,type); } else if (dest->is_address()) { reg2mem(src,dest,tmp1,tmp2,tmp3,type,patch_code,info,unaligned); } else { ShouldNotReachHere(); } } else if (src->is_stack()) { assert(patch_code == lir_patch_none && info == NULL, "no patching and info allowed here"); if (dest->is_register()) { assert(!tmp1->is_valid() && !tmp2->is_valid(), "unnecessary definition of temp operands"); stack2reg(src, dest, type); } else if (dest->is_stack()) { assert(!tmp2->is_valid(),"unnecessary definition of temp operands"); stack2stack(src, dest, tmp1, type); } else { ShouldNotReachHere(); } } else if (src->is_constant()) { if (dest->is_register()) { assert(!tmp3->is_valid(),"unnecessary definition of temp operands"); const2reg(src, dest, patch_code, info, tmp1, tmp2); // patching is possible } else if (dest->is_stack()) { assert(patch_code == lir_patch_none && info == NULL, "no patching and info allowed here"); assert(!tmp3->is_valid(),"unnecessary definition of temp operands"); const2stack(src, dest, tmp1, tmp2); } else if (dest->is_address()) { assert(patch_code == lir_patch_none, "no patching allowed here"); const2mem(src, dest, tmp1, tmp2, tmp3, type, info); } else { ShouldNotReachHere(); } } else if (src->is_address()) { assert(!tmp2->is_valid(),"unnecessary definition of temp operand"); mem2reg(src, dest, tmp1, type, patch_code, info, unaligned); } else { ShouldNotReachHere(); } }
virtual void visit(LIR_OpVisitState* visitor) { visitor->do_slow_case(_info); visitor->do_input(_klass_reg); visitor->do_input(_length); assert(_result->is_valid(), "must be valid"); visitor->do_output(_result); }
void set_result(Value x, LIR_Opr opr) { assert(opr->is_valid(), "must set to valid value"); assert(x->operand()->is_illegal(), "operand should never change"); assert(!opr->is_register() || opr->is_virtual(), "should never set result to a physical register"); x->set_operand(opr); assert(opr == x->operand(), "must be"); if (opr->is_virtual()) { _instruction_for_operand.at_put_grow(opr->vreg_number(), x, NULL); } }
bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, int c, LIR_Opr result, LIR_Opr tmp) { if (tmp->is_valid()) { if (is_power_of_2(c + 1)) { __ move(left, tmp); __ shift_left(left, log2_intptr(c + 1), left); __ sub(left, tmp, result); return true; } else if (is_power_of_2(c - 1)) { __ move(left, tmp); __ shift_left(left, log2_intptr(c - 1), left); __ add(left, tmp, result); return true; } } return false; }
void C1_MacroAssembler::build_frame(FrameMap* frame_map) { // offset from the expected fixed sp within the method int sp_offset = in_bytes(frame_map->framesize_in_bytes()) - 8; // call pushed the return IP if( frame_map->num_callee_saves() > 0 ) { int callee_save_num = frame_map->num_callee_saves()-1; int callee_saves = frame_map->callee_saves(); // bitmap for (int i=LinearScan::nof_cpu_regs-1; i>=0; i--) { if ((callee_saves & 1<<i) != 0) { int wanted_sp_offset = frame_map->address_for_callee_save(callee_save_num)._disp; assert0( sp_offset-8 == wanted_sp_offset ); push((Register)i); sp_offset -= 8; callee_save_num--; assert0( callee_save_num >= -1 ); } } #ifdef ASSERT for(int i=0;i<LinearScan::nof_xmm_regs;i++){ int reg = LinearScan::nof_cpu_regs+i; assert ((callee_saves & 1<<reg) == 0, "Unexpected callee save XMM register"); } #endif } if (sp_offset != 0) { // make sp equal expected sp for method if (sp_offset == 8) push (RCX); // push reg as smaller encoding than sub8i else sub8i (RSP, sp_offset ); } if( should_verify_oop(MacroAssembler::OopVerify_IncomingArgument) ) { int args_len = frame_map->incoming_arguments()->length(); for(int i=0; i < args_len; i++) { LIR_Opr arg = frame_map->incoming_arguments()->at(i); if (arg->is_valid() && arg->is_oop()) { VOopReg::VR oop = frame_map->oopregname(arg); verify_oop(oop, MacroAssembler::OopVerify_IncomingArgument); } } } }
virtual void visit(LIR_OpVisitState* visitor) { if (_obj->is_valid()) visitor->do_input(_obj); visitor->do_slow_case(_info); }