Example #1
0
int InlinedScope::allocateFloatTemporaries(int firstFloatIndex) {
  assert(firstFloatIndex >= 0, "illegal firstFloatIndex");
  _firstFloatIndex = firstFloatIndex;				// start index for first float of this scope
  int nofFloatTemps = hasFloatTemporaries() ? nofFloatTemporaries() : 0;
  // convert floatLocs into stackLocs
  for (int k = 0; k < nofFloatTemps; k++) {
    PReg* preg = floatTemporary(k)->preg();
    Location loc = preg->loc;
    assert(loc.scopeNo() == scopeID() && loc.floatNo() == k, "inconsistency");
    preg->loc = Mapping::floatTemporary(scopeID(), k);
    assert(preg->loc.isStackLocation(), "must be a stack location");
  }
  int startFloatIndex = firstFloatIndex + nofFloatTemps;	// start index for first float in subscopes
  int totalNofFloatsInSubscopes = 0;
  // allocate float temporaries of subscopes
  int len = _subScopes->length();
  for (int i = 0; i < len; i++) {
    InlinedScope* scope = _subScopes->at(i);
    totalNofFloatsInSubscopes = max(totalNofFloatsInSubscopes, scope->allocateFloatTemporaries(startFloatIndex));
  }
  return nofFloatTemps + totalNofFloatsInSubscopes;
}