+ // Attempt to allocate a register - this function finds an unlocked
+ // register, locks it, and returns it. If none can be found, this
+ // returns -1 (InvalidGPRReg or InvalidFPRReg).
+ RegID tryAllocate()
+ {
+ VirtualRegister ignored = VirtualRegister();
+
+ for (uint32_t i = 0; i < NUM_REGS; ++i) {
+ if (!m_data[i].lockCount && !m_data[i].name.isValid())
+ return allocateInternal(i, ignored);
+ }
+
+ return (RegID)-1;
+ }
+