[llvm-commits] [vmkit] r50226 - in /vmkit/trunk/lib/JnJVM: Classpath/ClasspathVMClass.cpp VMCore/JavaTypes.cpp VMCore/JavaTypes.h
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Thu Apr 24 12:24:03 PDT 2008
Author: geoffray
Date: Thu Apr 24 14:24:02 2008
New Revision: 50226
URL: http://llvm.org/viewvc/llvm-project?rev=50226&view=rev
Log:
Primitive classes have a special name, the AssessorDesc contains the real name.
Modified:
vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMClass.cpp
vmkit/trunk/lib/JnJVM/VMCore/JavaTypes.cpp
vmkit/trunk/lib/JnJVM/VMCore/JavaTypes.h
Modified: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMClass.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMClass.cpp?rev=50226&r1=50225&r2=50226&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMClass.cpp (original)
+++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMClass.cpp Thu Apr 24 14:24:02 2008
@@ -179,7 +179,7 @@
AssessorDesc* ass = AssessorDesc::bogusClassToPrimitive(cl);
const UTF8* res = 0;
if (ass) {
- res = cl->name;
+ res = ass->UTF8Name;
} else {
const UTF8* iname = cl->name;
res = iname->internalToJava(vm, 0, iname->size);
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaTypes.cpp?rev=50226&r1=50225&r2=50226&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaTypes.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaTypes.cpp Thu Apr 24 14:24:02 2008
@@ -57,8 +57,8 @@
AssessorDesc* AssessorDesc::dRef = 0;
AssessorDesc* AssessorDesc::allocate(bool dt, char bid, uint32 nb, uint32 nw,
- const char* name, Jnjvm* vm,
- const llvm::Type* t,
+ const char* name, const char* className,
+ Jnjvm* vm, const llvm::Type* t,
const char* assocName, arrayCtor_t ctor) {
AssessorDesc* res = vm_new(vm, AssessorDesc)();
res->doTrace = dt;
@@ -66,6 +66,7 @@
res->nbb = nb;
res->nbw = nw;
res->asciizName = name;
+ res->UTF8Name = vm->asciizConstructUTF8(name);
res->llvmType = t;
if (t && t != llvm::Type::VoidTy) {
res->llvmTypePtr = llvm::PointerType::getUnqual(t);
@@ -78,7 +79,7 @@
res->assocClassName = 0;
if (bid != I_PARG && bid != I_PARD && bid != I_REF && bid != I_TAB) {
- res->classType = vm->constructClass(vm->asciizConstructUTF8(name),
+ res->classType = vm->constructClass(vm->asciizConstructUTF8(className),
CommonClass::jnjvmClassLoader);
res->classType->status = ready;
res->classType->access = ACC_ABSTRACT | ACC_FINAL | ACC_PUBLIC;
@@ -90,38 +91,42 @@
void AssessorDesc::initialise(Jnjvm* vm) {
- dParg = AssessorDesc::allocate(false, I_PARG, 0, 0, "(", vm, 0, 0, 0);
- dPard = AssessorDesc::allocate(false, I_PARD, 0, 0, ")", vm, 0, 0, 0);
- dVoid = AssessorDesc::allocate(false, I_VOID, 0, 0, "void", vm,
- llvm::Type::VoidTy, "java/lang/Void", 0);
- dBool = AssessorDesc::allocate(false, I_BOOL, 1, 1, "boolean", vm,
+ dParg = AssessorDesc::allocate(false, I_PARG, 0, 0, "(", "(", vm, 0, 0, 0);
+ dPard = AssessorDesc::allocate(false, I_PARD, 0, 0, ")", ")", vm, 0, 0, 0);
+ dVoid = AssessorDesc::allocate(false, I_VOID, 0, 0, "void", "*** void ***",
+ vm, llvm::Type::VoidTy, "java/lang/Void", 0);
+ dBool = AssessorDesc::allocate(false, I_BOOL, 1, 1, "boolean",
+ "*** boolean ***", vm,
llvm::Type::Int8Ty, "java/lang/Boolean",
(arrayCtor_t)ArrayUInt8::acons);
- dByte = AssessorDesc::allocate(false, I_BYTE, 1, 1, "byte", vm,
- llvm::Type::Int8Ty, "java/lang/Byte",
+ dByte = AssessorDesc::allocate(false, I_BYTE, 1, 1, "byte", "*** byte ***",
+ vm, llvm::Type::Int8Ty, "java/lang/Byte",
(arrayCtor_t)ArraySInt8::acons);
- dChar = AssessorDesc::allocate(false, I_CHAR, 2, 1, "char", vm,
- llvm::Type::Int16Ty, "java/lang/Character",
+ dChar = AssessorDesc::allocate(false, I_CHAR, 2, 1, "char", "*** char ***",
+ vm, llvm::Type::Int16Ty, "java/lang/Character",
(arrayCtor_t)ArrayUInt16::acons);
- dShort = AssessorDesc::allocate(false, I_SHORT, 2, 1, "short", vm,
- llvm::Type::Int16Ty, "java/lang/Short",
+ dShort = AssessorDesc::allocate(false, I_SHORT, 2, 1, "short",
+ "*** short ***", vm, llvm::Type::Int16Ty,
+ "java/lang/Short",
(arrayCtor_t)ArraySInt16::acons);
- dInt = AssessorDesc::allocate(false, I_INT, 4, 1, "int", vm,
+ dInt = AssessorDesc::allocate(false, I_INT, 4, 1, "int", "*** int ***", vm,
llvm::Type::Int32Ty, "java/lang/Integer",
(arrayCtor_t)ArraySInt32::acons);
- dFloat = AssessorDesc::allocate(false, I_FLOAT, 4, 1, "float", vm,
+ dFloat = AssessorDesc::allocate(false, I_FLOAT, 4, 1, "float",
+ "*** float ***", vm,
llvm::Type::FloatTy, "java/lang/Float",
(arrayCtor_t)ArrayFloat::acons);
- dLong = AssessorDesc::allocate(false, I_LONG, 8, 2, "long", vm,
- llvm::Type::Int64Ty, "java/lang/Long",
+ dLong = AssessorDesc::allocate(false, I_LONG, 8, 2, "long", "*** long ***",
+ vm, llvm::Type::Int64Ty, "java/lang/Long",
(arrayCtor_t)ArrayLong::acons);
- dDouble = AssessorDesc::allocate(false, I_DOUBLE, 8, 2, "double", vm,
+ dDouble = AssessorDesc::allocate(false, I_DOUBLE, 8, 2, "double",
+ "*** double ***", vm,
llvm::Type::DoubleTy, "java/lang/Double",
(arrayCtor_t)ArrayDouble::acons);
- dTab = AssessorDesc::allocate(true, I_TAB, 4, 1, "array", vm,
+ dTab = AssessorDesc::allocate(true, I_TAB, 4, 1, "array", "array", vm,
JavaObject::llvmType, 0,
(arrayCtor_t)ArrayObject::acons);
- dRef = AssessorDesc::allocate(true, I_REF, 4, 1, "reference", vm,
+ dRef = AssessorDesc::allocate(true, I_REF, 4, 1, "reference", "reference", vm,
JavaObject::llvmType, 0,
(arrayCtor_t)ArrayObject::acons);
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaTypes.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaTypes.h?rev=50226&r1=50225&r2=50226&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaTypes.h (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaTypes.h Thu Apr 24 14:24:02 2008
@@ -57,6 +57,7 @@
const llvm::Type* llvmTypePtr;
llvm::Constant* llvmNullConstant;
const UTF8* assocClassName;
+ const UTF8* UTF8Name;
arrayCtor_t arrayCtor;
static AssessorDesc* dParg;
@@ -74,9 +75,9 @@
static AssessorDesc* dRef;
static AssessorDesc* allocate(bool dt, char bid, uint32 nb, uint32 nw,
- const char* name, Jnjvm* vm,
- const llvm::Type* type, const char* assocName,
- arrayCtor_t ctor);
+ const char* name, const char* className,
+ Jnjvm* vm, const llvm::Type* type,
+ const char* assocName, arrayCtor_t ctor);
static void initialise(Jnjvm* vm);
More information about the llvm-commits
mailing list