Example #1
0
void printRegister(Location r) {
  if (is_StackLocation(r)) {
    lprintf("T%ld", long(index_for_StackLocation(r)));
  } else if (r >= ArgStackLocations) {
    lprintf("A%ld", long(r - ArgStackLocations));
  } else if (r >= IArgStackLocations) {
    lprintf("I%ld", long(r - IArgStackLocations));
  } else {
    lprintf("%s", RegisterNames[r]);
  }
}
Example #2
0
void RegisterState::allocate(Location r) {
  if (isRegister(r)) {
    ::allocateRegister(allocated, r);
  } 
  else if (is_StackLocation(r)) {
    assert(!isSet(stackAllocs[whichMask(r)], whichBit(r)),
           "already allocated");
    setNth(stackAllocs[whichMask(r)], whichBit(r));
    fint tempNo = index_for_StackLocation(r) + 1;
    if (tempNo >= stackDepth) 
      stackDepth = tempNo;
    curDepth++;
    assert(curDepth <= stackDepth, "curDepth too big");
  } 
}
Example #3
0
void reg_disp_type_of_loc(Location* basep, int32* offsetp, OperandType* tp, Location loc) {
  Location b = IllegalLocation;  int32 d = 0;  OperandType t = NumberOperand;
  
       if (isRegister(loc))  b = loc, d = 0, t = RegisterOperand;
       
  else if (loc == IReceiverReg  || is_IArgLocation(loc))  b = ebp,  d =  index_for_IArgLocation(loc) + 1 +     ircvr_offset;
  else if (loc == LReceiverReg  || is_LArgLocation(loc))  b = esp,  d =  index_for_LArgLocation(loc) + 1 + leaf_rcvr_offset;
  else if (loc ==  ReceiverReg  ||  is_ArgLocation(loc))  b = esp,  d =  index_for_ArgLocation(loc)  + 1 +   rcvr_offset;
  else if (                       is_StackLocation(loc))  b = ebp,  d = -index_for_StackLocation(loc) + first_local_offset;
  else fatal1("don't know how to do %s\n", locationName(loc));

  if (basep) *basep = b;
  if (offsetp) *offsetp = d * oopSize;
  if (tp) *tp = t;
}
Example #4
0
void RegisterState::allocate(Location r) {
  if (isRegister(r)) {
    ::allocateRegister(allocated, r);
    // allocate nonvols down from R31, must save/restore them, so track depth
    _number_of_saved_nonvolatile_registers = max(_number_of_saved_nonvolatile_registers, 32 - r);
  } 
  else if (is_StackLocation(r)) {
    assert(!isSet(stackAllocs[whichMask(r)], whichBit(r)),
           "already allocated");
    setNth(stackAllocs[whichMask(r)], whichBit(r));
    fint tempNo = index_for_StackLocation(r) + 1;
    if (tempNo >= stackDepth) 
      stackDepth = tempNo;
    curDepth++;
    assert(curDepth <= stackDepth, "curDepth too big");
  } 
}
Example #5
0
 inline fint tempToIndex(Location temp) { return index_for_StackLocation(temp) + 32; }