本文整理汇总了C++中LIR_Opr::is_illegal方法的典型用法代码示例。如果您正苦于以下问题:C++ LIR_Opr::is_illegal方法的具体用法?C++ LIR_Opr::is_illegal怎么用?C++ LIR_Opr::is_illegal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LIR_Opr
的用法示例。
在下文中一共展示了LIR_Opr::is_illegal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: result
LIR_Opr result() {
assert(!_destroys_register || (!_result->is_register() || _result->is_virtual()),
"shouldn't use set_destroys_register with physical regsiters");
if (_destroys_register && _result->is_register()) {
if (_new_result->is_illegal()) {
_new_result = _gen->new_register(type());
gen()->lir()->move(_result, _new_result);
}
return _new_result;
} else {
return _result;
}
return _result;
}
示例2: assert
//.........这里部分代码省略.........
}
case lir_add:
case lir_sub:
case lir_mul:
case lir_div: {
assert(left->is_fpu_register(), "must be");
assert(res->is_fpu_register(), "must be");
assert(left->is_equal(res), "must be");
// either the left-hand or the right-hand side must be on top of stack
// (if right is not a register, left must be on top)
if (!right->is_fpu_register()) {
insert_exchange(left);
new_left = to_fpu_stack_top(left);
} else {
// no exchange necessary if right is alredy on top of stack
if (tos_offset(right) == 0) {
new_left = to_fpu_stack(left);
new_right = to_fpu_stack_top(right);
} else {
insert_exchange(left);
new_left = to_fpu_stack_top(left);
new_right = to_fpu_stack(right);
}
if (right->is_last_use()) {
op2->set_fpu_pop_count(1);
if (tos_offset(right) == 0) {
sim()->pop();
} else {
// if left is on top of stack, the result is placed in the stack
// slot of right, so a renaming from right to res is necessary
assert(tos_offset(left) == 0, "must be");
sim()->pop();
do_rename(right, res);
}
}
}
new_res = to_fpu_stack(res);
break;
}
case lir_rem: {
assert(left->is_fpu_register(), "must be");
assert(right->is_fpu_register(), "must be");
assert(res->is_fpu_register(), "must be");
assert(left->is_equal(res), "must be");
// Must bring both operands to top of stack with following operand ordering:
// * fpu stack before rem: ... right left
// * fpu stack after rem: ... left
if (tos_offset(right) != 1) {
insert_exchange(right);
insert_exchange(1);
}
insert_exchange(left);
assert(tos_offset(right) == 1, "check");
assert(tos_offset(left) == 0, "check");
new_left = to_fpu_stack_top(left);
new_right = to_fpu_stack(right);
op2->set_fpu_pop_count(1);
sim()->pop();
do_rename(right, res);
new_res = to_fpu_stack_top(res);
break;
}
case lir_abs:
case lir_sqrt: {
// Right argument appears to be unused
assert(right->is_illegal(), "must be");
assert(left->is_fpu_register(), "must be");
assert(res->is_fpu_register(), "must be");
assert(left->is_last_use(), "old value gets destroyed");
insert_free_if_dead(res, left);
insert_exchange(left);
do_rename(left, res);
new_left = to_fpu_stack_top(res);
new_res = new_left;
op2->set_fpu_stack_size(sim()->stack_size());
break;
}
default: {
assert(false, "missed a fpu-operation");
}
}
op2->set_in_opr1(new_left);
op2->set_in_opr2(new_right);
op2->set_result_opr(new_res);
}