Commit 0e04bfb8 authored by Kunshan Wang's avatar Kunshan Wang

WIP: bootimg. Also increase JVM heap size in C API

parent 6ec604b7
......@@ -30,19 +30,21 @@ static void init_jvm() {
JavaVMInitArgs vm_args;
JavaVMOption options[1];
JavaVMOption options[2];
char *cpoptionstr = (char*)calloc(classpath_txt_len + 100, 1);
strcat(cpoptionstr, "-Djava.class.path=");
strncat(cpoptionstr, (const char*)classpath_txt, classpath_txt_len);
options[0].optionString = cpoptionstr;
options[1].optionString = "-Xmx4096M";
if (refimpl2_start_debug) {
printf("Classpath option: '%s'\n", cpoptionstr);
}
vm_args.version = JNI_VERSION_1_8;
vm_args.nOptions = 1;
vm_args.nOptions = 2;
vm_args.options = options;
vm_args.ignoreUnrecognized = JNI_FALSE;
......
......@@ -17,6 +17,7 @@ import uvm.refimpl.nat.NativeCallHelper
import uvm.refimpl.nat.NativeLibraryHolder
import uvm.staticanalysis.StaticAnalyzer
import uvm.utils.IDFactory
import uvm.refimpl.bootimg.BootImageBuilder
object MicroVM {
val DEFAULT_SOS_SIZE: Word = 2L * 1024L * 1024L; // 2MiB
......@@ -62,6 +63,8 @@ class MicroVM(vmConf: VMConf) {
val irReader = new UIRTextReader(idFactory, recordSourceInfo=vmConf.sourceInfo)
val hailScriptLoader = new HailScriptLoader(recordSourceInfo=vmConf.sourceInfo)
val staticAnalyzer = new StaticAnalyzer()
val bootImageBuilder = new BootImageBuilder()
{
// VOID, BYTE, BYTE_ARRAY: The micro VM allocates stacks on the heap in the large object space.
......@@ -143,7 +146,7 @@ class MicroVM(vmConf: VMConf) {
* Make boot image.
*/
def makeBootImage(whiteList: Seq[Int], outputFile: String): Unit = {
???
bootImageBuilder.makeBootImage(whiteList, outputFile)
}
/**
......
package uvm.refimpl.bootimg
import uvm.refimpl._
import scala.collection.mutable.HashSet
class TransitiveClosure(initialSet: Seq[Int]) {
val set = Set[Int](initialSet: _*)
}
class BootImageBuilder(implicit microVM: MicroVM) {
def makeBootImage(whiteList: Seq[Int], outputFile: String): Unit = {
implicit val tc = new TransitiveClosure(whiteList)
doTypeSigClosure()
}
def doTypeSigClosure()(implicit tc: TransitiveClosure): Unit = {
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment