LGTM, just a few comments.

http://gwt-code-reviews.appspot.com/572801/diff/9001/10005
File dev/core/super/com/google/gwt/lang/LongLibBase.java (right):

http://gwt-code-reviews.appspot.com/572801/diff/9001/10005#newcode55
dev/core/super/com/google/gwt/lang/LongLibBase.java:55: protected static
boolean RUN_IN_JVM = false;
This should be documented -- if it does what I think it does, which is
to allow you to debug this in the JVM during development, then this
should be final.

http://gwt-code-reviews.appspot.com/572801/diff/9001/10005#newcode414
dev/core/super/com/google/gwt/lang/LongLibBase.java:414: private static
int nlz(int x) {
Replace calls to this method with a call to
Integer.numberOfLeadingZeros(x).

If this algorithm is faster, the method in Integer should be updated.

http://gwt-code-reviews.appspot.com/572801/diff/9001/10005#newcode459
dev/core/super/com/google/gwt/lang/LongLibBase.java:459: private static
int powerOfTwo(int x) {
Is this guaranteed to be called with a power of 2?

x & -x will give you the lowest bit set -- not sure if there are any
edge cases or if this is faster, but you might consider:

// if not a power of two, return (check for 0 if not non-zero)
if (x != x & -x) {
  return -1;
}
return Integer.numberOfTrailingZeros(x);

Again, if numberOfTrailingZeros isn't fast enough, update it with a
better algorithm.

http://gwt-code-reviews.appspot.com/572801/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to