RegisterString BB::compute_usedTwice() { fint len = duInfo.info->length(); RegisterString used = 0; RegisterString usedTwice = 0; fint i; for (i = 0; i < len; i++) { PReg* r = duInfo.info->nth(i)->reg; if (r->loc != UnAllocated && isAllocated(used, r->loc)) { // two PRegs have same preallocated reg - algorithm below can't handle // this usedTwice = allocateRegister(usedTwice, r->loc); } used = allocateRegister(used, r->loc); } return usedTwice; }
/** * Allocate a free integer register. * * @return the register that has been allocated */ int allocateIntegerRegister() { return allocateRegister(allocatedIntegerRegisters,NUM_INTEGER_REGISTERS); }