diff --git a/js/src/jit/RegisterSets.h b/js/src/jit/RegisterSets.h index b19d422c3fc..251fac45f80 100644 --- a/js/src/jit/RegisterSets.h +++ b/js/src/jit/RegisterSets.h @@ -400,8 +400,12 @@ class TypedRegisterSet #endif } T getAny() const { - JS_ASSERT(!empty()); - return T::FromCode(mozilla::FloorLog2(bits_)); + // The choice of first or last here is mostly arbitrary, as they are + // about the same speed on popular architectures. We choose first, as + // it has the advantage of using the "lower" registers more often. These + // registers are sometimes more efficient (e.g. optimized encodings for + // EAX on x86). + return getFirst(); } T getFirst() const { JS_ASSERT(!empty());