From: jzhou Date: Mon, 24 Jan 2011 22:14:25 +0000 (+0000) Subject: Some changes to enable SPECjbb for MGC version. Enable the compilation for 1. class... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=148bd0d53599dfafeae3d2b84bc30699f3dfd57f;p=IRC.git Some changes to enable SPECjbb for MGC version. Enable the compilation for 1. class type, 2. try-catch-finally, 3. transient modifier, 4. array-create-init statement. Now the compiler can parse code with these features but does not process them. Also add some interfaces for String, FileOutputStream classes. --- diff --git a/Robust/src/ClassLibrary/FileOutputStream.java b/Robust/src/ClassLibrary/FileOutputStream.java index 297cd482..07658f10 100644 --- a/Robust/src/ClassLibrary/FileOutputStream.java +++ b/Robust/src/ClassLibrary/FileOutputStream.java @@ -1,3 +1,5 @@ +import java.io.FileDescriptor; + public class FileOutputStream extends OutputStream { private int fd; @@ -26,6 +28,10 @@ public class FileOutputStream extends OutputStream { public FileOutputStreamOpen(String pathname) { fd = nativeOpen(pathname.getBytes()); } + + public FileOutputStream(FileDescriptor fdObj) { + fd = nativeOpen(fdObj.channel.getBytes()); + } private static native int nativeOpen(byte[] filename); private static native int nativeAppend(byte[] filename); diff --git a/Robust/src/ClassLibrary/String.java b/Robust/src/ClassLibrary/String.java index 52147045..e306e742 100644 --- a/Robust/src/ClassLibrary/String.java +++ b/Robust/src/ClassLibrary/String.java @@ -41,6 +41,29 @@ public class String { this.count=length; this.offset=0; } + + public String(byte str[], String encoding) { + int length = this.count; + if (length>(str.length)) + length=str.length; + char charstr[]=new char[length]; + for(int i=0; i(str.length-offset)) + length=str.length-offset; + char charstr[]=new char[length]; + for(int i=0; i count) || (srcBegin > srcEnd)) { + // FIXME + System.printString("Index error: "+srcBegin+" "+srcEnd+" "+count+"\n"+this); + System.exit(-1); + } + int len = srcEnd - srcBegin; + int j = dstBegin; + for(int i=srcBegin; i