void LIR_OopMapGenerator::process_move(LIR_Op* op) {
  LIR_Op1* op1 = op->as_Op1();
  LIR_Opr src = op1->in_opr();
  LIR_Opr dst = op1->result_opr();
  
  assert(!src->is_stack() || !dst->is_stack(), "No memory-memory moves allowed");
  if ((src->is_stack() && frame_map()->is_spill_pos(src)) ||
      (dst->is_stack() && frame_map()->is_spill_pos(dst))) {
    // Oops in the spill area are handled by another mechanism (see
    // CodeEmitInfo::record_spilled_oops)
    return;
  }
  if (dst->is_oop()) {
    assert((src->is_oop() &&
            (src->is_stack() || src->is_register() || src->is_constant())
           ) ||
           src->is_address(), "Wrong tracking of oops/non-oops in LIR");
    assert(!src->is_stack() || is_marked(src->single_stack_ix()),
           "Error in tracking of oop stores to stack");
    if (dst->is_stack()) {
      mark(dst->single_stack_ix());
    } else if (dst->is_register()) {
      if (LIRCacheLocals) {
        if (local_mapping()->is_cache_reg(dst)) {
          mark(dst);
        }
      } else {
        assert(local_mapping() == NULL, "expected no local mapping");
      }
    }
  } else {
    // !dst->is_oop()
    // Note that dst may be an address
    assert(!src->is_single_stack() || !is_marked(src->single_stack_ix()), "Error in tracking of oop stores to stack");
    assert(!src->is_double_stack() || !is_marked(src->double_stack_ix()), "Error in tracking of oop stores to stack");
    assert(!src->is_double_stack() || !is_marked(1 + src->double_stack_ix()), "Error in tracking of oop stores to stack");
    if (dst->is_stack()) {
      if (dst->is_single_stack()) {
        clear_all(dst->single_stack_ix());
      } else {
        clear_all(dst->double_stack_ix());
        clear_all(1 + dst->double_stack_ix());
      }
    } else if (dst->is_register()) {
      if (LIRCacheLocals) {
        if (local_mapping()->is_cache_reg(dst)) {
          clear_all(dst);
        }
      } else {
        assert(local_mapping() == NULL, "expected no local mapping");
      }
    }
  }
}
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);
}
示例#3
0
VMReg FrameMap::regname(LIR_Opr opr) const {
  if (opr->is_single_cpu()) {
    assert(!opr->is_virtual(), "should not see virtual registers here");
    return opr->as_register()->as_VMReg();
  } else if (opr->is_single_stack()) {
    return sp_offset2vmreg(sp_offset_for_slot(opr->single_stack_ix()));
  } else if (opr->is_address()) {
    LIR_Address* addr = opr->as_address_ptr();
    assert(addr->base() == stack_pointer(), "sp based addressing only");
    return sp_offset2vmreg(in_ByteSize(addr->index()->as_jint()));
  }
  ShouldNotReachHere();
  return VMRegImpl::Bad();
}
LIR_Opr LocalMapping::get_cache_reg(LIR_Opr opr) const {
  RInfo reg;
  if (opr->is_single_stack()) {
    reg = get_cache_reg(opr->single_stack_ix());
  } else if (opr->is_double_stack() && CacheDoubleWord) {
    reg = get_cache_reg(opr->double_stack_ix());
  }
  if (reg.is_illegal()) {
    return LIR_OprFact::illegalOpr;
  }
  switch (opr->type()) {
  case T_INT:
  case T_OBJECT:
    if (!reg.is_word()) {
      return LIR_OprFact::illegalOpr;
    }
    break;
    
  case T_FLOAT:
    if (!reg.is_float()) {
      return LIR_OprFact::illegalOpr;
    }
    break;
    
  case T_DOUBLE:
    if (!reg.is_double()) {
      return LIR_OprFact::illegalOpr;
    }
    break;
    
  case T_LONG:
    if (!reg.is_long()) {
      return LIR_OprFact::illegalOpr;
    }
    break;
  }
  return LIR_OprFact::rinfo(reg, opr->type());
}