本文整理汇总了C++中LIR_Opr类的典型用法代码示例。如果您正苦于以下问题:C++ LIR_Opr类的具体用法?C++ LIR_Opr怎么用?C++ LIR_Opr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LIR_Opr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: is_simm13
// Returns if item is an int constant that can be represented by a simm13
static bool is_simm13(LIR_Opr item) {
if (item->is_constant() && item->type() == T_INT) {
return Assembler::is_simm13(item->as_constant_ptr()->as_jint());
} else {
return false;
}
}
示例2: G1PreBarrierStub
// Version that _does_ generate a load of the previous value from addr.
// addr (the address of the field to be read) must be a LIR_Address
// pre_val (a temporary register) must be a register;
G1PreBarrierStub(LIR_Opr addr, LIR_Opr pre_val, LIR_PatchCode patch_code, CodeEmitInfo* info) :
_addr(addr), _pre_val(pre_val), _do_load(true),
_patch_code(patch_code), _info(info)
{
assert(_pre_val->is_register(), "should be temporary register");
assert(_addr->is_address(), "should be the address of the field");
}
示例3: assert
FrameMap::FrameMap(ciMethod* method, int monitors, int reserved_argument_area_size) {
assert(_init_done, "should already be completed");
_framesize = -1;
_num_spills = -1;
assert(monitors >= 0, "not set");
_num_monitors = monitors;
assert(reserved_argument_area_size >= 0, "not set");
_reserved_argument_area_size = MAX2(4, reserved_argument_area_size) * BytesPerWord;
_argcount = method->arg_size();
_argument_locations = new intArray(_argcount, -1);
_incoming_arguments = java_calling_convention(signature_type_array_for(method), false);
_oop_map_arg_count = _incoming_arguments->reserved_stack_slots();
int java_index = 0;
for (int i = 0; i < _incoming_arguments->length(); i++) {
LIR_Opr opr = _incoming_arguments->at(i);
if (opr->is_address()) {
LIR_Address* address = opr->as_address_ptr();
_argument_locations->at_put(java_index, address->disp() - STACK_BIAS);
_incoming_arguments->args()->at_put(i, LIR_OprFact::stack(java_index, as_BasicType(as_ValueType(address->type()))));
}
java_index += type2size[opr->type()];
}
}
示例4: roundfp_op
void LIR_Assembler::roundfp_op(LIR_Opr src, LIR_Opr tmp, LIR_Opr dest, bool pop_fpu_stack) {
assert((src->is_single_fpu() && dest->is_single_stack()) ||
(src->is_double_fpu() && dest->is_double_stack()),
"round_fp: rounds register -> stack location");
reg2stack (src, dest, src->type(), pop_fpu_stack);
}
示例5: is_cache_reg
bool LocalMapping::is_cache_reg(LIR_Opr opr) const {
if (opr->is_register()) {
return is_cache_reg(opr->rinfo());
} else {
return false;
}
}
示例6: value
void LIRItem::load_nonconstant() {
LIR_Opr r = value()->operand();
if (r->is_constant()) {
_result = r;
} else {
load_item();
}
}
示例7: 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);
}
}
示例8: assert
void LIRGenerator::do_If(If* x) {
assert(x->number_of_sux() == 2, "inconsistency");
ValueTag tag = x->x()->type()->tag();
bool is_safepoint = x->is_safepoint();
If::Condition cond = x->cond();
LIRItem xitem(x->x(), this);
LIRItem yitem(x->y(), this);
LIRItem* xin = &xitem;
LIRItem* yin = &yitem;
if (tag == longTag) {
// for longs, only conditions "eql", "neq", "lss", "geq" are valid;
// mirror for other conditions
if (cond == If::gtr || cond == If::leq) {
cond = Instruction::mirror(cond);
xin = &yitem;
yin = &xitem;
}
xin->set_destroys_register();
}
xin->load_item();
if (tag == longTag && yin->is_constant() && yin->get_jlong_constant() == 0 && (cond == If::eql || cond == If::neq)) {
// inline long zero
yin->dont_load_item();
} else if (tag == longTag || tag == floatTag || tag == doubleTag) {
// longs cannot handle constants at right side
yin->load_item();
} else {
yin->dont_load_item();
}
// add safepoint before generating condition code so it can be recomputed
if (x->is_safepoint()) {
// increment backedge counter if needed
increment_backedge_counter(state_for(x, x->state_before()), x->profiled_bci());
__ safepoint(LIR_OprFact::illegalOpr, state_for(x, x->state_before()));
}
set_no_result(x);
LIR_Opr left = xin->result();
LIR_Opr right = yin->result();
__ cmp(lir_cond(cond), left, right);
// Generate branch profiling. Profiling code doesn't kill flags.
profile_branch(x, cond);
move_to_phi(x->state());
if (x->x()->type()->is_float_kind()) {
__ branch(lir_cond(cond), right->type(), x->tsux(), x->usux());
} else {
__ branch(lir_cond(cond), right->type(), x->tsux());
}
assert(x->default_sux() == x->fsux(), "wrong destination above");
__ jump(x->default_sux());
}
示例9: value
void LIRItem::load_nonconstant() {
LIR_Opr r = value()->operand();
if (_gen->can_inline_as_constant(value())) {
if (!r->is_constant()) {
r = LIR_OprFact::value_type(value()->type());
}
_result = r;
} else {
load_item();
}
}
示例10: result
LIR_Opr result() {
assert(_destroys_register==not_destroyed||(!_result->is_register()||_result->is_virtual()),
"shouldn't use set_destroys_register with physical regsiters");
if(_destroys_register==awaiting_copy&&_result->is_register()){
LIR_Opr new_result=_gen->new_register(type())->set_destroyed();
gen()->lir()->move(_result, new_result);
_destroys_register = destroyed;
_result=new_result;
}
return _result;
}
示例11: assert
LIR_Opr FpuStackAllocator::to_fpu_stack(LIR_Opr opr) {
assert(opr->is_fpu_register() && !opr->is_xmm_register(), "shouldn't call this otherwise");
int stack_offset = tos_offset(opr);
if (opr->is_single_fpu()) {
return LIR_OprFact::single_fpu(stack_offset)->make_fpu_stack_offset();
} else {
assert(opr->is_double_fpu(), "shouldn't call this otherwise");
return LIR_OprFact::double_fpu(stack_offset)->make_fpu_stack_offset();
}
}
示例12: rlock
// Handle fanout of fpu registers: return false if no fanout;
// If fanout than, we copy the value of float register into a new one,
// so that the new FPU register has ref-count 1
bool LIRGenerator::fpu_fanout_handled() {
if (result()->is_register() && (value()->type()->is_float_kind())) {
// The item is float or double register with a use_count > 1
LIR_Opr reg = rlock(value());
emit()->copy_fpu_item(reg->rinfo(), result());
set_result(value(), reg);
return true;
} else {
return false;
}
}
示例13: clear_fpu_stack
void FpuStackAllocator::clear_fpu_stack(LIR_Opr preserve) {
int result_stack_size = (preserve->is_fpu_register() && !preserve->is_xmm_register() ? 1 : 0);
while (sim()->stack_size() > result_stack_size) {
assert(!sim()->slot_is_empty(0), "not allowed");
if (result_stack_size == 0 || sim()->get_slot(0) != fpu_num(preserve)) {
insert_free(0);
} else {
// move "preserve" to bottom of stack so that all other stack slots can be popped
insert_exchange(sim()->stack_size() - 1);
}
}
}
示例14: switch
// for _ladd, _lmul, _lsub, _ldiv, _lrem
void LIRGenerator::do_ArithmeticOp_Long(ArithmeticOp* x) {
switch (x->op()) {
case Bytecodes::_lrem:
case Bytecodes::_lmul:
case Bytecodes::_ldiv: {
if (x->op() == Bytecodes::_ldiv || x->op() == Bytecodes::_lrem) {
LIRItem right(x->y(), this);
right.load_item();
CodeEmitInfo* info = state_for(x);
LIR_Opr item = right.result();
assert(item->is_register(), "must be");
__ cmp(lir_cond_equal, item, LIR_OprFact::longConst(0));
__ branch(lir_cond_equal, T_LONG, new DivByZeroStub(info));
}
address entry;
switch (x->op()) {
case Bytecodes::_lrem:
entry = CAST_FROM_FN_PTR(address, SharedRuntime::lrem);
break; // check if dividend is 0 is done elsewhere
case Bytecodes::_ldiv:
entry = CAST_FROM_FN_PTR(address, SharedRuntime::ldiv);
break; // check if dividend is 0 is done elsewhere
case Bytecodes::_lmul:
entry = CAST_FROM_FN_PTR(address, SharedRuntime::lmul);
break;
default:
ShouldNotReachHere();
}
// order of arguments to runtime call is reversed.
LIR_Opr result = call_runtime(x->y(), x->x(), entry, x->type(), NULL);
set_result(x, result);
break;
}
case Bytecodes::_ladd:
case Bytecodes::_lsub: {
LIRItem left(x->x(), this);
LIRItem right(x->y(), this);
left.load_item();
right.load_item();
rlock_result(x);
arithmetic_op_long(x->op(), x->operand(), left.result(), right.result(), NULL);
break;
}
default: ShouldNotReachHere();
}
}
示例15: load_item
// Item will be loaded into a byte register; Intel only
void LIRItem::load_byte_item() {
load_item();
LIR_Opr res = result();
if (!res->is_virtual() || !_gen->is_vreg_flag_set(res, LIRGenerator::byte_reg)) {
// make sure that it is a byte register
assert(!value()->type()->is_float() && !value()->type()->is_double(),
"can't load floats in byte register");
LIR_Opr reg = _gen->rlock_byte(T_BYTE);
__ move(res, reg);
_result = reg;
}
}