[vmkit-commits] [vmkit] r198130 - use j3meta.def to generate both the extractor and to retreive the runtime function

Gael Thomas gael.thomas at lip6.fr
Sat Dec 28 14:14:18 PST 2013


Author: gthomas
Date: Sat Dec 28 16:14:17 2013
New Revision: 198130

URL: http://llvm.org/viewvc/llvm-project?rev=198130&view=rev
Log:
use j3meta.def to generate both the extractor and to retreive the runtime function

Modified:
    vmkit/branches/mcjit/include/j3/j3codegen.h
    vmkit/branches/mcjit/include/j3/j3meta.def
    vmkit/branches/mcjit/lib/j3/vm/j3codegen.cc

Modified: vmkit/branches/mcjit/include/j3/j3codegen.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/mcjit/include/j3/j3codegen.h?rev=198130&r1=198129&r2=198130&view=diff
==============================================================================
--- vmkit/branches/mcjit/include/j3/j3codegen.h (original)
+++ vmkit/branches/mcjit/include/j3/j3codegen.h Sat Dec 28 16:14:17 2013
@@ -152,38 +152,16 @@ namespace j3 {
 		static void        echoDebugEnter(uint32_t isLeave, const char* msg, ...);
 		static void        echoDebugExecute(uint32_t level, const char* msg, ...);
 
-		llvm::Function*    funcJ3MethodIndex;
-		llvm::Function*    funcJ3TypeVT;
-		llvm::Function*    funcJ3TypeVTAndResolve;
-		llvm::Function*    funcJ3TypeInitialise;
-		llvm::Function*    funcJ3ObjectTypeJavaClass;
-		llvm::Function*    funcJ3ClassSize;
-		llvm::Function*    funcJ3ClassStaticInstance;
-		llvm::Function*    funcJ3ClassStringAt;
-		llvm::Function*    funcJ3ObjectAllocate;
-		llvm::Function*    funcJniEnv;
-		llvm::Function*    funcClassCastException;
-		llvm::Function*    funcNullPointerException;
-		llvm::Function*    funcThrowException;
-		llvm::Function*    funcIsAssignableTo;
-		llvm::Function*    funcFastIsAssignableToPrimaryChecker;
-		llvm::Function*    funcFastIsAssignableToNonPrimaryChecker;
-		llvm::Function*    funcJ3ThreadPushHandle;
-		llvm::Function*    funcJ3ThreadPush;
-		llvm::Function*    funcJ3ThreadTell;
-		llvm::Function*    funcJ3ThreadRestore;
-		llvm::Function*    funcEchoDebugExecute;
-		llvm::Function*    funcEchoDebugEnter;
-		llvm::Function*    funcCXABeginCatch;        /* __cxa_begin_catch */
-		llvm::Function*    funcCXAEndCatch;          /* __cxa_end_catch */
-		llvm::Function*    funcGXXPersonality;       /* __gxx_personality_v0 */
+#define _x(name, id)														\
+		llvm::Function* name;
+#include "j3/j3meta.def"
+#undef _x
+		llvm::GlobalValue* gvTypeInfo;            /* typename void* */
 		llvm::Function*    gcRoot;             
 		llvm::Function*    frameAddress;
 		llvm::Function*    stackMap;
 		llvm::Function*    patchPoint64;
 		llvm::Function*    patchPointVoid;
-		llvm::Function*    ziTry;
-		llvm::GlobalValue* gvTypeInfo;            /* typename void* */
 
 		J3CodeGen(vmkit::BumpAllocator* _allocator, J3Method* method, llvm::Function* _llvmFunction);
 		~J3CodeGen();

Modified: vmkit/branches/mcjit/include/j3/j3meta.def
URL: http://llvm.org/viewvc/llvm-project/vmkit/branches/mcjit/include/j3/j3meta.def?rev=198130&r1=198129&r2=198130&view=diff
==============================================================================
--- vmkit/branches/mcjit/include/j3/j3meta.def (original)
+++ vmkit/branches/mcjit/include/j3/j3meta.def Sat Dec 28 16:14:17 2013
@@ -23,5 +23,4 @@ _x(funcFastIsAssignableToNonPrimaryCheck
 _x(funcGXXPersonality,           "__gxx_personality_v0")
 _x(funcCXABeginCatch,            "__cxa_begin_catch")
 _x(funcCXAEndCatch,              "__cxa_end_catch")
-_x(gvTypeInfo,                   "typeinfo for void*")
 _x(funcFake,                     "j3::J3::forceSymbolDefinition()")
\ No newline at end of file

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=198130&r1=198129&r2=198130&view=diff
==============================================================================
--- vmkit/branches/mcjit/lib/j3/vm/j3codegen.cc (original)
+++ vmkit/branches/mcjit/lib/j3/vm/j3codegen.cc Sat Dec 28 16:14:17 2013
@@ -59,37 +59,10 @@ J3CodeGen::J3CodeGen(vmkit::BumpAllocato
 
 	builder = &_builder;
 
-	funcJ3MethodIndex            = vm->introspectFunction(module(), "j3::J3Method::index()");
-	funcJ3TypeVT                 = vm->introspectFunction(module(), "j3::J3Type::vt()");
-	funcJ3TypeVTAndResolve       = vm->introspectFunction(module(), "j3::J3Type::vtAndResolve()");
-	funcJ3TypeInitialise         = vm->introspectFunction(module(), "j3::J3Type::initialise()");
-	funcJ3ClassSize              = vm->introspectFunction(module(), "j3::J3Class::size()");
-	funcJ3ClassStaticInstance    = vm->introspectFunction(module(), "j3::J3Class::staticInstance()");
-	funcJ3ClassStringAt          = vm->introspectFunction(module(), "j3::J3Class::stringAt(unsigned short)");
-	funcJ3ObjectTypeJavaClass    = vm->introspectFunction(module(), "j3::J3ObjectType::javaClass()");
-	funcJniEnv                   = vm->introspectFunction(module(), "j3::J3::jniEnv()");
-	funcJ3ObjectAllocate         = vm->introspectFunction(module(), "j3::J3Object::allocate(j3::J3VirtualTable*, unsigned long)");
-	
-	funcThrowException           = vm->introspectFunction(module(), "vmkit::VMKit::throwException(void*)");
-	funcClassCastException       = vm->introspectFunction(module(), "j3::J3::classCastException()");
-	funcNullPointerException     = vm->introspectFunction(module(), "j3::J3::nullPointerException()");
-
-	funcJ3ThreadPushHandle       = vm->introspectFunction(module(), "j3::J3Thread::push(j3::J3ObjectHandle*)");
-	funcJ3ThreadPush             = vm->introspectFunction(module(), "j3::J3Thread::push(j3::J3Object*)");
-	funcJ3ThreadTell             = vm->introspectFunction(module(), "j3::J3Thread::tell()");
-	funcJ3ThreadRestore          = vm->introspectFunction(module(), "j3::J3Thread::restore(j3::J3ObjectHandle*)");
-	funcEchoDebugEnter           = vm->introspectFunction(module(), "j3::J3CodeGen::echoDebugEnter(unsigned int, char const*, ...)");
-	funcEchoDebugExecute         = vm->introspectFunction(module(), "j3::J3CodeGen::echoDebugExecute(unsigned int, char const*, ...)");
-
-	funcIsAssignableTo           = vm->introspectFunction(module(), "j3::J3VirtualTable::isAssignableTo(j3::J3VirtualTable*)");
-	funcFastIsAssignableToPrimaryChecker = 
-		vm->introspectFunction(module(), "j3::J3VirtualTable::fastIsAssignableToPrimaryChecker(j3::J3VirtualTable*, unsigned int)");
-	funcFastIsAssignableToNonPrimaryChecker = 
-		vm->introspectFunction(module(), "j3::J3VirtualTable::fastIsAssignableToNonPrimaryChecker(j3::J3VirtualTable*)");
-
-	funcGXXPersonality       = vm->introspectFunction(module(), "__gxx_personality_v0");
-	funcCXABeginCatch        = vm->introspectFunction(module(), "__cxa_begin_catch");
-	funcCXAEndCatch          = vm->introspectFunction(module(), "__cxa_end_catch");
+#define _x(name, id)														\
+	name = vm->introspectFunction(module(), id);
+#include "j3/j3meta.def"
+#undef _x
 
 	gvTypeInfo               = vm->introspectGlobalValue(module(),  "typeinfo for void*");
 
@@ -113,10 +86,6 @@ J3CodeGen::J3CodeGen(vmkit::BumpAllocato
 	}
 #endif
 
-	ziTry                    = 
-		(llvm::Function*)module()->getOrInsertFunction("vmkit.try", 
-																									 llvm::FunctionType::get(llvm::Type::getVoidTy(llvmFunction->getContext()), 0));
-
 	if(J3Cst::isNative(method->access()))
 		generateNative();
 	else





More information about the vmkit-commits mailing list