[llvm-commits] [vmkit] r51241 - in /vmkit/trunk/lib/JnJVM/VMCore: JavaUpcalls.cpp JnjvmModule.cpp JnjvmModule.h
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Mon May 19 03:01:04 PDT 2008
Author: geoffray
Date: Mon May 19 05:01:03 2008
New Revision: 51241
URL: http://llvm.org/viewvc/llvm-project?rev=51241&view=rev
Log:
Add a setMethod function to JnjvmModule to specify the runtime
method to use.
80-col corrections.
Modified:
vmkit/trunk/lib/JnJVM/VMCore/JavaUpcalls.cpp
vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp
vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.h
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaUpcalls.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaUpcalls.cpp?rev=51241&r1=51240&r2=51241&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaUpcalls.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaUpcalls.cpp Mon May 19 05:01:03 2008
@@ -112,34 +112,73 @@
Class* Classpath::vmStackWalker;
void ClasspathThread::initialise(Jnjvm* vm) {
- newThread = UPCALL_CLASS(vm, "java/lang/Thread");
- newVMThread = UPCALL_CLASS(vm, "java/lang/VMThread");
- assocThread = UPCALL_FIELD(vm, "java/lang/VMThread", "thread", "Ljava/lang/Thread;", ACC_VIRTUAL);
- vmdata = UPCALL_FIELD(vm, "java/lang/VMThread", "vmdata", "Ljava/lang/Object;", ACC_VIRTUAL);
- finaliseCreateInitialThread = UPCALL_METHOD(vm, "java/lang/InheritableThreadLocal", "newChildThread", "(Ljava/lang/Thread;)V", ACC_STATIC);
- initVMThread = UPCALL_METHOD(vm, "java/lang/VMThread", "<init>", "(Ljava/lang/Thread;)V", ACC_VIRTUAL);
- groupAddThread = UPCALL_METHOD(vm, "java/lang/ThreadGroup", "addThread", "(Ljava/lang/Thread;)V", ACC_VIRTUAL);
- name = UPCALL_FIELD(vm, "java/lang/Thread", "name", "Ljava/lang/String;", ACC_VIRTUAL);
- priority = UPCALL_FIELD(vm, "java/lang/Thread", "priority", "I", ACC_VIRTUAL);
- daemon = UPCALL_FIELD(vm, "java/lang/Thread", "daemon", "Z", ACC_VIRTUAL);
- group = UPCALL_FIELD(vm, "java/lang/Thread", "group", "Ljava/lang/ThreadGroup;", ACC_VIRTUAL);
- running = UPCALL_FIELD(vm, "java/lang/VMThread", "running", "Z", ACC_VIRTUAL);
- rootGroup = UPCALL_FIELD(vm, "java/lang/ThreadGroup", "root", "Ljava/lang/ThreadGroup;", ACC_STATIC);
- vmThread = UPCALL_FIELD(vm, "java/lang/Thread", "vmThread", "Ljava/lang/VMThread;", ACC_VIRTUAL);
- uncaughtException = UPCALL_METHOD(vm, "java/lang/ThreadGroup", "uncaughtException", "(Ljava/lang/Thread;Ljava/lang/Throwable;)V", ACC_VIRTUAL);
+ newThread =
+ UPCALL_CLASS(vm, "java/lang/Thread");
+
+ newVMThread =
+ UPCALL_CLASS(vm, "java/lang/VMThread");
+
+ assocThread =
+ UPCALL_FIELD(vm, "java/lang/VMThread", "thread", "Ljava/lang/Thread;",
+ ACC_VIRTUAL);
+
+ vmdata =
+ UPCALL_FIELD(vm, "java/lang/VMThread", "vmdata", "Ljava/lang/Object;",
+ ACC_VIRTUAL);
+
+ finaliseCreateInitialThread =
+ UPCALL_METHOD(vm, "java/lang/InheritableThreadLocal", "newChildThread",
+ "(Ljava/lang/Thread;)V", ACC_STATIC);
+
+ initVMThread =
+ UPCALL_METHOD(vm, "java/lang/VMThread", "<init>",
+ "(Ljava/lang/Thread;)V", ACC_VIRTUAL);
+
+ groupAddThread =
+ UPCALL_METHOD(vm, "java/lang/ThreadGroup", "addThread",
+ "(Ljava/lang/Thread;)V", ACC_VIRTUAL);
+
+ name =
+ UPCALL_FIELD(vm, "java/lang/Thread", "name", "Ljava/lang/String;",
+ ACC_VIRTUAL);
+
+ priority =
+ UPCALL_FIELD(vm, "java/lang/Thread", "priority", "I", ACC_VIRTUAL);
+
+ daemon =
+ UPCALL_FIELD(vm, "java/lang/Thread", "daemon", "Z", ACC_VIRTUAL);
+
+ group =
+ UPCALL_FIELD(vm, "java/lang/Thread", "group",
+ "Ljava/lang/ThreadGroup;", ACC_VIRTUAL);
+
+ running =
+ UPCALL_FIELD(vm, "java/lang/VMThread", "running", "Z", ACC_VIRTUAL);
+
+ rootGroup =
+ UPCALL_FIELD(vm, "java/lang/ThreadGroup", "root",
+ "Ljava/lang/ThreadGroup;", ACC_STATIC);
+
+ vmThread =
+ UPCALL_FIELD(vm, "java/lang/Thread", "vmThread",
+ "Ljava/lang/VMThread;", ACC_VIRTUAL);
+
+ uncaughtException =
+ UPCALL_METHOD(vm, "java/lang/ThreadGroup", "uncaughtException",
+ "(Ljava/lang/Thread;Ljava/lang/Throwable;)V", ACC_VIRTUAL);
}
void ClasspathThread::createInitialThread(Jnjvm* vm, JavaObject* th) {
JavaObject* vmth = (*newVMThread)(vm);
- (*th)(name, (JavaObject*)vm->asciizToStr("main"));
- (*th)(priority, (uint32)1);
- (*th)(daemon, (uint32)0);
- (*th)(vmThread, vmth);
- (*vmth)(assocThread, th);
- (*vmth)(running, (uint32)1);
- (*rootGroup)();
- (*th)(group, (JavaObject*)((*rootGroup)().PointerVal));
- groupAddThread->invokeIntSpecial(vm, (JavaObject*)((*rootGroup)().PointerVal), th);
+ name->setVirtualObjectField(th, (JavaObject*)vm->asciizToStr("main"));
+ priority->setVirtualInt32Field(th, (uint32)1);
+ daemon->setVirtualInt8Field(th, (uint32)0);
+ vmThread->setVirtualObjectField(th, vmth);
+ assocThread->setVirtualObjectField(vmth, th);
+ running->setVirtualInt8Field(vmth, (uint32)1);
+ JavaObject* RG = rootGroup->getStaticObjectField();
+ group->setVirtualObjectField(th, RG);
+ groupAddThread->invokeIntSpecial(vm, RG, th);
}
void ClasspathThread::mapInitialThread(Jnjvm* vm) {
@@ -147,90 +186,191 @@
createInitialThread(vm, th);
JavaThread* myth = JavaThread::get();
myth->javaThread = th;
- JavaObject* vmth = (JavaObject*)((*th)(vmThread).PointerVal);
- (*vmth)(vmdata, (JavaObject*)myth);
+ JavaObject* vmth = vmThread->getVirtualObjectField(th);
+ vmdata->setVirtualObjectField(vmth, (JavaObject*)myth);
finaliseCreateInitialThread->invokeIntStatic(vm, th);
}
void Classpath::initialiseClasspath(Jnjvm* vm) {
- getSystemClassLoader = UPCALL_METHOD(vm, "java/lang/ClassLoader", "getSystemClassLoader", "()Ljava/lang/ClassLoader;", ACC_STATIC);
- setContextClassLoader = UPCALL_METHOD(vm, "java/lang/Thread", "setContextClassLoader", "(Ljava/lang/ClassLoader;)V", ACC_VIRTUAL);
- newString = UPCALL_CLASS(vm, "java/lang/String");
- newClass = UPCALL_CLASS(vm, "java/lang/Class");
- newThrowable = UPCALL_CLASS(vm, "java/lang/Throwable");
- newException = UPCALL_CLASS(vm, "java/lang/Exception");
- initClass = UPCALL_METHOD(vm, "java/lang/Class", "<init>", "(Ljava/lang/Object;)V", ACC_VIRTUAL);
- initClassWithProtectionDomain = UPCALL_METHOD(vm, "java/lang/Class", "<init>", "(Ljava/lang/Object;Ljava/security/ProtectionDomain;)V", ACC_VIRTUAL);
- vmdataClass = UPCALL_FIELD(vm, "java/lang/Class", "vmdata", "Ljava/lang/Object;", ACC_VIRTUAL);
- setProperty = UPCALL_METHOD(vm, "java/util/Properties", "setProperty", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object;", ACC_VIRTUAL);
- initString = UPCALL_METHOD(vm, "java/lang/String", "<init>", "([CIIZ)V", ACC_VIRTUAL);
-
- initConstructor = UPCALL_METHOD(vm, "java/lang/reflect/Constructor", "<init>", "(Ljava/lang/Class;I)V", ACC_VIRTUAL);
- newConstructor = UPCALL_CLASS(vm, "java/lang/reflect/Constructor");
- constructorArrayClass = UPCALL_ARRAY_CLASS(vm, "java/lang/reflect/Constructor", 1);
- constructorSlot = UPCALL_FIELD(vm, "java/lang/reflect/Constructor", "slot", "I", ACC_VIRTUAL);
-
- initMethod = UPCALL_METHOD(vm, "java/lang/reflect/Method", "<init>", "(Ljava/lang/Class;Ljava/lang/String;I)V", ACC_VIRTUAL);
- newMethod = UPCALL_CLASS(vm, "java/lang/reflect/Method");
- methodArrayClass = UPCALL_ARRAY_CLASS(vm, "java/lang/reflect/Method", 1);
- methodSlot = UPCALL_FIELD(vm, "java/lang/reflect/Method", "slot", "I", ACC_VIRTUAL);
-
- initField = UPCALL_METHOD(vm, "java/lang/reflect/Field", "<init>", "(Ljava/lang/Class;Ljava/lang/String;I)V", ACC_VIRTUAL);
- newField = UPCALL_CLASS(vm, "java/lang/reflect/Field");
- fieldArrayClass = UPCALL_ARRAY_CLASS(vm, "java/lang/reflect/Field", 1);
- fieldSlot = UPCALL_FIELD(vm, "java/lang/reflect/Field", "slot", "I", ACC_VIRTUAL);
-
-
- classArrayClass = UPCALL_ARRAY_CLASS(vm, "java/lang/Class", 1);
- newVMThrowable = UPCALL_CLASS(vm, "java/lang/VMThrowable");
- initVMThrowable = UPCALL_METHOD(vm, "java/lang/VMThrowable", "<init>", "()V", ACC_VIRTUAL);
- vmDataVMThrowable = UPCALL_FIELD(vm, "java/lang/VMThrowable", "vmdata", "Ljava/lang/Object;", ACC_VIRTUAL);
- bufferAddress = UPCALL_FIELD(vm, "java/nio/Buffer", "address", "Lgnu/classpath/Pointer;", ACC_VIRTUAL);
- dataPointer32 = UPCALL_FIELD(vm, "gnu/classpath/Pointer32", "data", "I", ACC_VIRTUAL);
- vmdataClassLoader = UPCALL_FIELD(vm, "java/lang/ClassLoader", "vmdata", "Ljava/lang/Object;", ACC_VIRTUAL);
-
- newStackTraceElement = UPCALL_CLASS(vm, "java/lang/StackTraceElement");
- initStackTraceElement = UPCALL_METHOD(vm, "java/lang/StackTraceElement", "<init>", "(Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;Z)V", ACC_VIRTUAL);
-
-
- boolValue = UPCALL_FIELD(vm, "java/lang/Boolean", "value", "Z", ACC_VIRTUAL);
- byteValue = UPCALL_FIELD(vm, "java/lang/Byte", "value", "B", ACC_VIRTUAL);
- shortValue = UPCALL_FIELD(vm, "java/lang/Short", "value", "S", ACC_VIRTUAL);
- charValue = UPCALL_FIELD(vm, "java/lang/Character", "value", "C", ACC_VIRTUAL);
- intValue = UPCALL_FIELD(vm, "java/lang/Integer", "value", "I", ACC_VIRTUAL);
- longValue = UPCALL_FIELD(vm, "java/lang/Long", "value", "J", ACC_VIRTUAL);
- floatValue = UPCALL_FIELD(vm, "java/lang/Float", "value", "F", ACC_VIRTUAL);
- doubleValue = UPCALL_FIELD(vm, "java/lang/Double", "value", "D", ACC_VIRTUAL);
-
- Classpath::voidClass = UPCALL_CLASS(vm, "java/lang/Void");
- Classpath::boolClass = UPCALL_CLASS(vm, "java/lang/Boolean");
- Classpath::byteClass = UPCALL_CLASS(vm, "java/lang/Byte");
- Classpath::shortClass = UPCALL_CLASS(vm, "java/lang/Short");
- Classpath::charClass = UPCALL_CLASS(vm, "java/lang/Character");
- Classpath::intClass = UPCALL_CLASS(vm, "java/lang/Integer");
- Classpath::floatClass = UPCALL_CLASS(vm, "java/lang/Float");
- Classpath::doubleClass = UPCALL_CLASS(vm, "java/lang/Double");
- Classpath::longClass = UPCALL_CLASS(vm, "java/lang/Long");
-
- vmStackWalker = UPCALL_CLASS(vm, "gnu/classpath/VMStackWalker");
-
- loadInClassLoader = UPCALL_METHOD(vm, "java/lang/ClassLoader", "loadClass", "(Ljava/lang/String;Z)Ljava/lang/Class;", ACC_VIRTUAL);
-
- JavaMethod* internString = UPCALL_METHOD(vm, "java/lang/VMString", "intern", "(Ljava/lang/String;)Ljava/lang/String;", ACC_STATIC);
- // Create intern
- {
- llvm::Function* func = vm->module->getMethodInfo(internString)->getMethod();
- func->setName("internString");
- func->setLinkage(llvm::GlobalValue::ExternalLinkage);
- }
-
- JavaMethod* isArray = UPCALL_METHOD(vm, "java/lang/Class", "isArray", "()Z", ACC_VIRTUAL);
- // Create intern
- {
- llvm::Function* func = vm->module->getMethodInfo(isArray)->getMethod();
- func->setName("isArray");
- func->setLinkage(llvm::GlobalValue::ExternalLinkage);
- }
+ getSystemClassLoader =
+ UPCALL_METHOD(vm, "java/lang/ClassLoader", "getSystemClassLoader",
+ "()Ljava/lang/ClassLoader;", ACC_STATIC);
+
+ setContextClassLoader =
+ UPCALL_METHOD(vm, "java/lang/Thread", "setContextClassLoader",
+ "(Ljava/lang/ClassLoader;)V", ACC_VIRTUAL);
+
+ newString =
+ UPCALL_CLASS(vm, "java/lang/String");
+
+ newClass =
+ UPCALL_CLASS(vm, "java/lang/Class");
+
+ newThrowable =
+ UPCALL_CLASS(vm, "java/lang/Throwable");
+
+ newException =
+ UPCALL_CLASS(vm, "java/lang/Exception");
+
+ initClass =
+ UPCALL_METHOD(vm, "java/lang/Class", "<init>", "(Ljava/lang/Object;)V",
+ ACC_VIRTUAL);
+
+ initClassWithProtectionDomain =
+ UPCALL_METHOD(vm, "java/lang/Class", "<init>",
+ "(Ljava/lang/Object;Ljava/security/ProtectionDomain;)V",
+ ACC_VIRTUAL);
+
+ vmdataClass =
+ UPCALL_FIELD(vm, "java/lang/Class", "vmdata", "Ljava/lang/Object;",
+ ACC_VIRTUAL);
+
+ setProperty =
+ UPCALL_METHOD(vm, "java/util/Properties", "setProperty",
+ "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object;";
+ ACC_VIRTUAL);
+
+ initString =
+ UPCALL_METHOD(vm, "java/lang/String", "<init>", "([CIIZ)V", ACC_VIRTUAL);
+
+ initConstructor =
+ UPCALL_METHOD(vm, "java/lang/reflect/Constructor", "<init>",
+ "(Ljava/lang/Class;I)V", ACC_VIRTUAL);
+
+ newConstructor =
+ UPCALL_CLASS(vm, "java/lang/reflect/Constructor");
+
+ constructorArrayClass =
+ UPCALL_ARRAY_CLASS(vm, "java/lang/reflect/Constructor", 1);
+
+ constructorSlot =
+ UPCALL_FIELD(vm, "java/lang/reflect/Constructor", "slot", "I", ACC_VIRTUAL);
+
+ initMethod =
+ UPCALL_METHOD(vm, "java/lang/reflect/Method", "<init>",
+ "(Ljava/lang/Class;Ljava/lang/String;I)V", ACC_VIRTUAL);
+
+ newMethod =
+ UPCALL_CLASS(vm, "java/lang/reflect/Method");
+
+ methodArrayClass =
+ UPCALL_ARRAY_CLASS(vm, "java/lang/reflect/Method", 1);
+
+ methodSlot =
+ UPCALL_FIELD(vm, "java/lang/reflect/Method", "slot", "I", ACC_VIRTUAL);
+
+ initField =
+ UPCALL_METHOD(vm, "java/lang/reflect/Field", "<init>",
+ "(Ljava/lang/Class;Ljava/lang/String;I)V", ACC_VIRTUAL);
+
+ newField =
+ UPCALL_CLASS(vm, "java/lang/reflect/Field");
+
+ fieldArrayClass =
+ UPCALL_ARRAY_CLASS(vm, "java/lang/reflect/Field", 1);
+
+ fieldSlot =
+ UPCALL_FIELD(vm, "java/lang/reflect/Field", "slot", "I", ACC_VIRTUAL);
+
+
+ classArrayClass =
+ UPCALL_ARRAY_CLASS(vm, "java/lang/Class", 1);
+
+ newVMThrowable =
+ UPCALL_CLASS(vm, "java/lang/VMThrowable");
+
+ initVMThrowable =
+ UPCALL_METHOD(vm, "java/lang/VMThrowable", "<init>", "()V", ACC_VIRTUAL);
+
+ vmDataVMThrowable =
+ UPCALL_FIELD(vm, "java/lang/VMThrowable", "vmdata", "Ljava/lang/Object;",
+ ACC_VIRTUAL);
+
+ bufferAddress =
+ UPCALL_FIELD(vm, "java/nio/Buffer", "address", "Lgnu/classpath/Pointer;",
+ ACC_VIRTUAL);
+
+ dataPointer32 =
+ UPCALL_FIELD(vm, "gnu/classpath/Pointer32", "data", "I", ACC_VIRTUAL);
+
+ vmdataClassLoader =
+ UPCALL_FIELD(vm, "java/lang/ClassLoader", "vmdata", "Ljava/lang/Object;",
+ ACC_VIRTUAL);
+
+ newStackTraceElement =
+ UPCALL_CLASS(vm, "java/lang/StackTraceElement");
+
+ initStackTraceElement =
+ UPCALL_METHOD(vm, "java/lang/StackTraceElement", "<init>",
+ "(Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;Z)V",
+ ACC_VIRTUAL);
+
+ boolValue =
+ UPCALL_FIELD(vm, "java/lang/Boolean", "value", "Z", ACC_VIRTUAL);
+
+ byteValue =
+ UPCALL_FIELD(vm, "java/lang/Byte", "value", "B", ACC_VIRTUAL);
+
+ shortValue =
+ UPCALL_FIELD(vm, "java/lang/Short", "value", "S", ACC_VIRTUAL);
+
+ charValue =
+ UPCALL_FIELD(vm, "java/lang/Character", "value", "C", ACC_VIRTUAL);
+
+ intValue =
+ UPCALL_FIELD(vm, "java/lang/Integer", "value", "I", ACC_VIRTUAL);
+
+ longValue =
+ UPCALL_FIELD(vm, "java/lang/Long", "value", "J", ACC_VIRTUAL);
+
+ floatValue =
+ UPCALL_FIELD(vm, "java/lang/Float", "value", "F", ACC_VIRTUAL);
+
+ doubleValue =
+ UPCALL_FIELD(vm, "java/lang/Double", "value", "D", ACC_VIRTUAL);
+
+ Classpath::voidClass =
+ UPCALL_CLASS(vm, "java/lang/Void");
+
+ Classpath::boolClass =
+ UPCALL_CLASS(vm, "java/lang/Boolean");
+
+ Classpath::byteClass =
+ UPCALL_CLASS(vm, "java/lang/Byte");
+
+ Classpath::shortClass =
+ UPCALL_CLASS(vm, "java/lang/Short");
+
+ Classpath::charClass =
+ UPCALL_CLASS(vm, "java/lang/Character");
+
+ Classpath::intClass =
+ UPCALL_CLASS(vm, "java/lang/Integer");
+
+ Classpath::floatClass =
+ UPCALL_CLASS(vm, "java/lang/Float");
+
+ Classpath::doubleClass =
+ UPCALL_CLASS(vm, "java/lang/Double");
+
+ Classpath::longClass =
+ UPCALL_CLASS(vm, "java/lang/Long");
+
+ vmStackWalker =
+ UPCALL_CLASS(vm, "gnu/classpath/VMStackWalker");
+
+ loadInClassLoader =
+ UPCALL_METHOD(vm, "java/lang/ClassLoader", "loadClass",
+ "(Ljava/lang/String;Z)Ljava/lang/Class;", ACC_VIRTUAL);
+
+ JavaMethod* internString =
+ UPCALL_METHOD(vm, "java/lang/VMString", "intern",
+ "(Ljava/lang/String;)Ljava/lang/String;", ACC_STATIC);
+ vm->module->setMethod(internString, "internString");
+
+ JavaMethod* isArray =
+ UPCALL_METHOD(vm, "java/lang/Class", "isArray", "()Z", ACC_VIRTUAL);
+ vm->module->setMethod(isArray, "isArray");
ClasspathThread::initialise(vm);
@@ -244,26 +384,20 @@
true, false);
COMPILE_METHODS(object)
- JavaMethod* getCallingClass = UPCALL_METHOD(vm, "gnu/classpath/VMStackWalker", "getCallingClass", "()Ljava/lang/Class;", ACC_STATIC);
- {
- llvm::Function* func = vm->module->getMethodInfo(getCallingClass)->getMethod();
- func->setName("getCallingClass");
- func->setLinkage(llvm::GlobalValue::ExternalLinkage);
- }
-
- JavaMethod* getCallingClassLoader = UPCALL_METHOD(vm, "gnu/classpath/VMStackWalker", "getCallingClassLoader", "()Ljava/lang/ClassLoader;", ACC_STATIC);
- {
- llvm::Function* func = vm->module->getMethodInfo(getCallingClassLoader)->getMethod();
- func->setName("getCallingClassLoader");
- func->setLinkage(llvm::GlobalValue::ExternalLinkage);
- }
-
- JavaMethod* postProperties = UPCALL_METHOD(vm, "gnu/classpath/VMSystemProperties", "postInit", "(Ljava/util/Properties;)V", ACC_STATIC);
- {
- llvm::Function* func = vm->module->getMethodInfo(postProperties)->getMethod();
- func->setName("propertiesPostInit");
- func->setLinkage(llvm::GlobalValue::ExternalLinkage);
- }
+ JavaMethod* getCallingClass =
+ UPCALL_METHOD(vm, "gnu/classpath/VMStackWalker", "getCallingClass",
+ "()Ljava/lang/Class;", ACC_STATIC);
+ vm->module->setMethod(getCallingClass, "getCallingClass");
+
+ JavaMethod* getCallingClassLoader =
+ UPCALL_METHOD(vm, "gnu/classpath/VMStackWalker", "getCallingClassLoader",
+ "()Ljava/lang/ClassLoader;", ACC_STATIC);
+ vm->module->setMethod(getCallingClassLoader, "getCallingClassLoader");
+
+ JavaMethod* postProperties =
+ UPCALL_METHOD(vm, "gnu/classpath/VMSystemProperties", "postInit",
+ "(Ljava/util/Properties;)V", ACC_STATIC);
+ vm->module->setMethod(postProperties, "propertiesPostInit");
}
extern "C" JavaString* internString(JavaString* obj) {
@@ -274,7 +408,7 @@
extern "C" uint8 isArray(JavaObject* klass) {
CommonClass* cl =
- (CommonClass*)(((*Classpath::vmdataClass)((JavaObject*)klass)).PointerVal);
+ (CommonClass*)((Classpath::vmdataClass->getVirtualObjectField(klass)));
return (uint8)cl->isArray;
}
Modified: vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp?rev=51241&r1=51240&r2=51241&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.cpp Mon May 19 05:01:03 2008
@@ -120,7 +120,8 @@
if (jit->compilingClass->isolate->module == Jnjvm::bootstrapVM->module &&
isArray && classDef->isolate != Jnjvm::bootstrapVM) {
// We know the array class can belong to bootstrap
- varGV = Jnjvm::bootstrapVM->constructArray(this->name, 0)->llvmVar(compilingModule);
+ CommonClass* cl = Jnjvm::bootstrapVM->constructArray(this->name, 0);
+ return getVar(cl, jit);
}
#endif
@@ -580,7 +581,8 @@
ConstantInt* CI = mvm::jit::constantZero;
std::vector<Value*> Args;
- Function* res = Function::Create(virt ? getVirtualBufType() : getStaticBufType(),
+ Function* res = Function::Create(virt ? getVirtualBufType() :
+ getStaticBufType(),
GlobalValue::ExternalLinkage,
signature->printString(),
signature->isolate->module);
@@ -633,7 +635,8 @@
std::vector<Value*> Args;
- Function* res = Function::Create(virt ? getVirtualBufType() : getStaticBufType(),
+ Function* res = Function::Create(virt ? getVirtualBufType() :
+ getStaticBufType(),
GlobalValue::ExternalLinkage,
signature->printString(),
signature->isolate->module);
@@ -1020,3 +1023,8 @@
((float*)((uint64)obj + field->ptrOffset))[0] = val;
}
+void JnjvmModule::setMethod(JavaMethod* meth, const char* name) {
+ llvm::Function* func = getMethodInfo(meth)->getMethod();
+ func->setName(name);
+ func->setLinkage(llvm::GlobalValue::ExternalLinkage);
+}
Modified: vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.h?rev=51241&r1=51240&r2=51241&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.h (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JnjvmModule.h Mon May 19 05:01:03 2008
@@ -317,6 +317,7 @@
void resolveVirtualClass(Class* cl);
void resolveStaticClass(Class* cl);
+ void setMethod(JavaMethod* meth, const char* name);
LLVMSignatureInfo* getSignatureInfo(Signdef*);
LLVMCommonClassInfo* getClassInfo(CommonClass*);
More information about the llvm-commits
mailing list