本文整理汇总了C++中LIR_Opr::is_valid方法的典型用法代码示例。如果您正苦于以下问题:C++ LIR_Opr::is_valid方法的具体用法?C++ LIR_Opr::is_valid怎么用?C++ LIR_Opr::is_valid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LIR_Opr
的用法示例。
在下文中一共展示了LIR_Opr::is_valid方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: move_op
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();
}
}
示例2: visit
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);
}
示例3: set_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);
}
}
示例4: strength_reduce_multiply
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;
}
示例5: push
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);
}
}
}
}
示例6: visit
virtual void visit(LIR_OpVisitState* visitor) {
if (_obj->is_valid()) visitor->do_input(_obj);
visitor->do_slow_case(_info);
}