[vmkit-commits] [vmkit] r198572 - Only explore a catch block if the associated try block is inspected. Close the first basic block is needed. And most import, select the initial exception node after having selected the initial javaPC (otherwise, the first instruction could be the one of an exception handler).

Gael Thomas gael.thomas at lip6.fr
Sun Jan 5 13:50:05 PST 2014


Author: gthomas
Date: Sun Jan  5 15:50:05 2014
New Revision: 198572

URL: http://llvm.org/viewvc/llvm-project?rev=198572&view=rev
Log:
Only explore a catch block if the associated try block is inspected. Close the first basic block is needed. And most import, select the initial exception node after having selected the initial javaPC (otherwise, the first instruction could be the one of an exception handler).

Modified:
    vmkit/branches/mcjit/lib/j3/openjdk/j3openjdk.cc
    vmkit/branches/mcjit/lib/j3/vm/j3codegen.cc
    vmkit/branches/mcjit/lib/j3/vm/j3codegenexception.cc
    vmkit/branches/mcjit/lib/j3/vm/j3options.cc

Modified: vmkit/branches/mcjit/lib/j3/openjdk/j3openjdk.cc
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/mcjit/lib/j3/openjdk/j3openjdk.cc?rev=198572&r1=198571&r2=198572&view=diff
==============================================================================
--- vmkit/branches/mcjit/lib/j3/openjdk/j3openjdk.cc (original)
+++ vmkit/branches/mcjit/lib/j3/openjdk/j3openjdk.cc Sun Jan  5 15:50:05 2014
@@ -98,7 +98,7 @@ void JNICALL JVM_ArrayCopy(JNIEnv* env,
 	J3Type* srcType0 = src->vt()->type();
 	J3Type* dstType0 = dst->vt()->type();
 
-	fprintf(stderr, " array copy from %s to %s\n", srcType0->name()->cStr(), dstType0->name()->cStr());
+	//fprintf(stderr, " array copy from %s to %s\n", srcType0->name()->cStr(), dstType0->name()->cStr());
 	if(!srcType0->isArrayClass() || !dstType0->isArrayClass())
 		J3::arrayStoreException();
 
@@ -116,10 +116,10 @@ void JNICALL JVM_ArrayCopy(JNIEnv* env,
 	else {
 		J3Type* srcEl = srcType0->asArrayClass()->component();
 		J3Type* dstEl = dstType0->asArrayClass()->component();
-
+		
 		if(!srcEl->isObjectType() || !dstEl->isObjectType())
 			J3::arrayStoreException();
-
+		
 		for(uint32_t i=0; i<length; i++) {
 			J3ObjectHandle* val = src->getObjectAt(src_pos + i);
 			if(!val->vt()->type()->isAssignableTo(dstEl))

Modified: vmkit/branches/mcjit/lib/j3/vm/j3codegen.cc
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/mcjit/lib/j3/vm/j3codegen.cc?rev=198572&r1=198571&r2=198572&view=diff
==============================================================================
--- vmkit/branches/mcjit/lib/j3/vm/j3codegen.cc (original)
+++ vmkit/branches/mcjit/lib/j3/vm/j3codegen.cc Sun Jan  5 15:50:05 2014
@@ -41,10 +41,11 @@ J3CodeGen::J3CodeGen(vmkit::BumpAllocato
 
 #if 0
 	/* usefull to debug a single function */
-	if(   cl->name() == vm->names()->get("java/nio/Bits") &&
-				method->name() == vm->names()->get("<clinit>") &&
-				method->signature()->name() == vm->names()->get("()V") )
-		vm->options()->debugTranslate = 3;
+	if(   cl->name() == vm->names()->get("sun/misc/Launcher") &&
+				method->name() == vm->names()->get("getFileURL") &&
+				method->signature()->name() == vm->names()->get("(Ljava/io/File;)Ljava/net/URL;") ) {
+		vm->options()->debugTranslate = 2;
+	}
 #endif
 
 	if(vm->options()->debugTranslate)
@@ -861,11 +862,12 @@ void J3CodeGen::translate() {
 	if(vm->options()->debugTranslate > 1)
 		exceptions.dump(vm->options()->debugTranslate-1);
 
-	selectExceptionNode(0);
-
 	stack.topStack = 0;
 	builder->SetInsertPoint(bb);
 	_onEndPoint();
+	closeBB = 1;
+
+	selectExceptionNode(0);
 
 	while(codeReader->remaining()) {
 		llvm::Value* val1;

Modified: vmkit/branches/mcjit/lib/j3/vm/j3codegenexception.cc
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/mcjit/lib/j3/vm/j3codegenexception.cc?rev=198572&r1=198571&r2=198572&view=diff
==============================================================================
--- vmkit/branches/mcjit/lib/j3/vm/j3codegenexception.cc (original)
+++ vmkit/branches/mcjit/lib/j3/vm/j3codegenexception.cc Sun Jan  5 15:50:05 2014
@@ -102,7 +102,7 @@ void J3ExceptionTable::read(J3Reader* re
 		entries[i].endPC = reader->readU2();
 		entries[i].handlerPC = reader->readU2();
 		entries[i].catchType = reader->readU2();
-		entries[i].bb = codeGen->forwardBranch("exception-handler", entries[i].handlerPC, 0, 1);
+		entries[i].bb = codeGen->forwardBranch("exception-handler", entries[i].handlerPC, 0, 0);
 		codeGen->opInfos[entries[i].handlerPC].topStack = -1;
 
 		J3ExceptionNode** cur = findPos(entries[i].startPC);

Modified: vmkit/branches/mcjit/lib/j3/vm/j3options.cc
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/mcjit/lib/j3/vm/j3options.cc?rev=198572&r1=198571&r2=198572&view=diff
==============================================================================
--- vmkit/branches/mcjit/lib/j3/vm/j3options.cc (original)
+++ vmkit/branches/mcjit/lib/j3/vm/j3options.cc Sun Jan  5 15:50:05 2014
@@ -21,7 +21,7 @@ J3Options::J3Options() {
 	debugLoad = 0;
 	debugResolve = 0;
 	debugIniting = 0;
-	debugTranslate = 1;
+	debugTranslate = 0;
 	debugLinking = 0;
 	debugLifeCycle = 1;
 





More information about the vmkit-commits mailing list