Exec support and cleanup
[nestedvm.git] / src / org / ibex / nestedvm / Compiler.java
index c68e5cf..68d2dee 100644 (file)
@@ -79,11 +79,8 @@ public abstract class Compiler implements Registers {
     protected boolean onePage;
     
     protected void pageSizeInit() throws Exn {
-        try {
-            Runtime.checkPageSize(pageSize,totalPages);
-        } catch(IllegalArgumentException e) {
-            throw new Exn(e.getMessage());
-        }
+        if((pageSize&(pageSize-1)) != 0) throw new Exn("pageSize not a multiple of two");
+        if((totalPages&(totalPages-1)) != 0) throw new Exn("totalPages not a multiple of two");
         while(pageSize>>>pageShift != 1) pageShift++;
     }