projects
/
nestedvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
new syscall stubs
[nestedvm.git]
/
src
/
org
/
ibex
/
nestedvm
/
Compiler.java
diff --git
a/src/org/ibex/nestedvm/Compiler.java
b/src/org/ibex/nestedvm/Compiler.java
index
de5a048
..
ebdf29d
100644
(file)
--- a/
src/org/ibex/nestedvm/Compiler.java
+++ b/
src/org/ibex/nestedvm/Compiler.java
@@
-7,6
+7,8
@@
import java.io.*;
import org.ibex.nestedvm.util.*;
import org.ibex.nestedvm.util.*;
+// FEATURE: -d option for classfilecompiler (just like javac's -d)
+
public abstract class Compiler implements Registers {
/** The ELF binary being read */
protected ELF elf;
public abstract class Compiler implements Registers {
/** The ELF binary being read */
protected ELF elf;
@@
-48,8
+50,6
@@
public abstract class Compiler implements Registers {
protected boolean assumeTailCalls = true;
protected boolean assumeTailCalls = true;
- protected boolean optimizedMemcpy = true;
-
// True to insert some code in the output to help diagnore compiler problems
protected boolean debugCompiler = false;
// True to insert some code in the output to help diagnore compiler problems
protected boolean debugCompiler = false;
@@
-77,20
+77,11
@@
public abstract class Compiler implements Registers {
protected boolean onePage;
protected void pageSizeInit() throws Exn {
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++;
}
while(pageSize>>>pageShift != 1) pageShift++;
}
- /** The address of the memcpy function in the binary (used for optimizedMemcpy) */
- protected int memcpy;
-
- /** The address of the memset function in the binary (used for optimizedMemcpy) */
- protected int memset;
-
/** A set of all addresses that can be jumped too (only available if pruneCases == true) */
protected Set jumpableAddresses;
/** A set of all addresses that can be jumped too (only available if pruneCases == true) */
protected Set jumpableAddresses;
@@
-214,13
+205,6
@@
public abstract class Compiler implements Registers {
if(symtab == null) throw new Exn("Binary has no symtab (did you strip it?)");
ELF.Symbol sym;
if(symtab == null) throw new Exn("Binary has no symtab (did you strip it?)");
ELF.Symbol sym;
- // Check for some functions we can override
- sym = symtab.getGlobalSymbol("memcpy");
- memcpy = sym == null ? -1 : sym.addr;
-
- sym = symtab.getGlobalSymbol("memset");
- memset = sym == null ? -1 : sym.addr;
-
userInfo = symtab.getGlobalSymbol("user_info");
gp = symtab.getGlobalSymbol("_gp");
if(gp == null) throw new Exn("no _gp symbol (did you strip the binary?)");
userInfo = symtab.getGlobalSymbol("user_info");
gp = symtab.getGlobalSymbol("_gp");
if(gp == null) throw new Exn("no _gp symbol (did you strip the binary?)");