changeset 10960:8aba11322f4e

use type.SIZE instead of constant
author twisti
date Sun, 04 Aug 2013 11:24:55 -0700
parents 109747b3b337
children d0c9278fe471
files graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeUtil.java
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeUtil.java	Sun Aug 04 11:17:49 2013 -0700
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeUtil.java	Sun Aug 04 11:24:55 2013 -0700
@@ -75,7 +75,7 @@
      */
     public static int log2(int val) {
         assert val > 0;
-        return 31 - Integer.numberOfLeadingZeros(val);
+        return (Integer.SIZE - 1) - Integer.numberOfLeadingZeros(val);
     }
 
     /**
@@ -87,7 +87,7 @@
      */
     public static int log2(long val) {
         assert val > 0;
-        return 63 - Long.numberOfLeadingZeros(val);
+        return (Long.SIZE - 1) - Long.numberOfLeadingZeros(val);
     }
 
     /**