Bug 587735 - redefine nRegisterAllocFromSet in terms of lsReg or msReg (r=edwsmith)
authorCédric VINCENT <cedric.vincent>
Fri, 10 Sep 2010 01:34:00 -0700
changeset 58058 f36e539c450b2a8805027fe11b5ba1092a58409c
parent 58057 cf37bdb2b7947d76fab7a87ca3450e4421427dfa
child 58059 307fa27df667b5b02b96b04707eea75d3d105e34
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersedwsmith
bugs587735
milestone2.0b8pre
Bug 587735 - redefine nRegisterAllocFromSet in terms of lsReg or msReg (r=edwsmith)
js/src/nanojit/NativeSH4.cpp
--- a/js/src/nanojit/NativeSH4.cpp
+++ b/js/src/nanojit/NativeSH4.cpp
@@ -3182,18 +3182,17 @@ namespace nanojit
         // Patch the constant.
         *((uint32_t *)(void *)branch) = (uint32_t) target;
     }
 
     Register Assembler::nRegisterAllocFromSet(RegisterMask set) {
         int reg = 0;
 
         // Find the first register in this set.
-        while (!(set & rmask((Register)reg)))
-            reg++;
+        reg = lsReg(set);
 
         _allocator.free &= ~rmask((Register)reg);
 
         // Sanity check.
         NanoAssert((rmask((Register)reg) & set) == rmask((Register)reg));
 
         return (Register)reg;
     }