[llvm-commits] [vmkit] r51639 - in /vmkit/trunk/lib/JnJVM/VMCore: JavaArray.cpp JavaArray.h JavaInitialise.cpp JavaIsolate.cpp LockedMap.h VirtualTables.cpp
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Wed May 28 02:42:31 PDT 2008
Author: geoffray
Date: Wed May 28 04:42:30 2008
New Revision: 51639
URL: http://llvm.org/viewvc/llvm-project?rev=51639&view=rev
Log:
Do not trace UTF8 objects.
Allocate UTF8 objects with malloc instead of GC.
Modified:
vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp
vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h
vmkit/trunk/lib/JnJVM/VMCore/JavaInitialise.cpp
vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp
vmkit/trunk/lib/JnJVM/VMCore/LockedMap.h
vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp?rev=51639&r1=51638&r2=51639&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaArray.cpp Wed May 28 04:42:30 2008
@@ -252,3 +252,15 @@
buf[size] = 0;
return buf;
}
+
+const UTF8* UTF8::acons(sint32 n, ClassArray* cl, Jnjvm* vm) {
+ if (n < 0)
+ negativeArraySizeException(n);
+ else if (n > JavaArray::MaxArraySize)
+ outOfMemoryError(n);
+ UTF8* res = (UTF8*) malloc(sizeof(UTF8) + n * sizeof(uint16));
+ ((void**)res)[0] = ArrayUInt16::VT;
+ res->initialise(cl);
+ res->size = n;
+ return (const UTF8*)res;
+}
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h?rev=51639&r1=51638&r2=51639&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaArray.h Wed May 28 04:42:30 2008
@@ -81,7 +81,8 @@
class UTF8 : public ArrayUInt16 {
public:
- static VirtualTable* VT;
+
+ static const UTF8* acons(sint32 n, ClassArray* cl, Jnjvm* vm);
const UTF8* internalToJava(Jnjvm *vm, unsigned int start,
unsigned int len) const;
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaInitialise.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaInitialise.cpp?rev=51639&r1=51638&r2=51639&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaInitialise.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaInitialise.cpp Wed May 28 04:42:30 2008
@@ -56,7 +56,6 @@
INIT(Reader);
INIT(ZipFile);
INIT(ZipArchive);
- INIT(UTF8Map);
INIT(ClassMap);
INIT(ZipFileMap);
INIT(StringMap);
@@ -84,7 +83,6 @@
INIT(ArrayFloat);
INIT(ArrayDouble);
INIT(ArrayObject);
- INIT(UTF8);
#undef INIT
}
Modified: vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp?rev=51639&r1=51638&r2=51639&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/JavaIsolate.cpp Wed May 28 04:42:30 2008
@@ -463,7 +463,7 @@
isolate->javavmEnv = &JNI_JavaVMTable;
// We copy so that bootstrap utf8 such as "<init>" are unique
- isolate->hashUTF8 = vm_new(isolate, UTF8Map)();
+ isolate->hashUTF8 = new UTF8Map();
bootstrapVM->hashUTF8->copy(isolate->hashUTF8);
isolate->hashStr = vm_new(isolate, StringMap)();
isolate->bootstrapClasses = callingVM->bootstrapClasses;
@@ -516,7 +516,7 @@
isolate->name = "bootstrapVM";
isolate->appClassLoader = 0;
- isolate->hashUTF8 = vm_new(isolate, UTF8Map)();
+ isolate->hashUTF8 = new UTF8Map();
isolate->hashStr = vm_new(isolate, StringMap)();
isolate->bootstrapClasses = vm_new(isolate, ClassMap)();
isolate->jniEnv = &JNI_JNIEnvTable;
Modified: vmkit/trunk/lib/JnJVM/VMCore/LockedMap.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/LockedMap.h?rev=51639&r1=51638&r2=51639&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/LockedMap.h (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/LockedMap.h Wed May 28 04:42:30 2008
@@ -101,25 +101,18 @@
};
-class UTF8Map : public mvm::Object {
+class UTF8Map {
public:
typedef std::multimap<const uint32, const UTF8*>::iterator iterator;
mvm::Lock* lock;
std::multimap<const uint32, const UTF8*, std::less<uint32>,
gc_allocator< std::pair<const uint32, const UTF8*> > > map;
- static VirtualTable* VT;
const UTF8* lookupOrCreateAsciiz(Jnjvm* vm, const char* asciiz);
const UTF8* lookupOrCreateReader(Jnjvm* vm, const uint16* buf, uint32 size);
const UTF8* lookupAsciiz(const char* asciiz);
const UTF8* lookupReader(const uint16* buf, uint32 size);
- virtual void TRACER;
-
- virtual void print(mvm::PrintBuffer* buf) {
- buf->write("UTF8 Hashtable<>");
- }
-
UTF8Map() {
lock = mvm::Lock::allocNormal();
}
Modified: vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp?rev=51639&r1=51638&r2=51639&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp (original)
+++ vmkit/trunk/lib/JnJVM/VMCore/VirtualTables.cpp Wed May 28 04:42:30 2008
@@ -41,7 +41,6 @@
INIT(ArrayFloat);
INIT(ArrayDouble);
INIT(ArrayObject);
- INIT(UTF8);
INIT(CommonClass);
INIT(Class);
INIT(ClassArray);
@@ -55,7 +54,6 @@
INIT(Reader);
INIT(ZipFile);
INIT(ZipArchive);
- INIT(UTF8Map);
INIT(ClassMap);
INIT(ZipFileMap);
INIT(StringMap);
@@ -185,7 +183,6 @@
void Jnjvm::TRACER {
appClassLoader->MARK_AND_TRACE;
- hashUTF8->MARK_AND_TRACE;
hashStr->MARK_AND_TRACE;
bootstrapClasses->MARK_AND_TRACE;
javaTypes->MARK_AND_TRACE;
@@ -216,12 +213,6 @@
void JavaString::TRACER {
}
-void UTF8Map::TRACER {
- for (iterator i = map.begin(), e = map.end(); i!= e; ++i) {
- i->second->MARK_AND_TRACE;
- }
-}
-
void ClassMap::TRACER {
for (iterator i = map.begin(), e = map.end(); i!= e; ++i) {
i->second->MARK_AND_TRACE;
More information about the llvm-commits
mailing list