[vmkit-commits] [vmkit] r83711 - in /vmkit/trunk/lib/N3: Mono/MonoString.h PNetLib/PNetLib.cpp VMCore/Assembly.cpp VMCore/Assembly.h VMCore/CLIRuntimeJIT.cpp VMCore/CLISignature.cpp VMCore/CLIString.h VMCore/LinkN3Runtime.h VMCore/LockedMap.h VMCore/N3.cpp VMCore/N3.h VMCore/N3Initialise.cpp VMCore/UTF8.cpp VMCore/UTF8.h VMCore/VMCache.h VMCore/VMClass.cpp VMCore/VMClass.h VMCore/VMObject.h VMCore/VirtualTables.cpp
Gael Thomas
gael.thomas at lip6.fr
Sat Oct 10 05:12:51 PDT 2009
Author: gthomas
Date: Sat Oct 10 07:12:50 2009
New Revision: 83711
URL: http://llvm.org/viewvc/llvm-project?rev=83711&view=rev
Log:
n3::UTF8 is now a mvm::UTF8 and not more a gc object
Modified:
vmkit/trunk/lib/N3/Mono/MonoString.h
vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp
vmkit/trunk/lib/N3/VMCore/Assembly.cpp
vmkit/trunk/lib/N3/VMCore/Assembly.h
vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp
vmkit/trunk/lib/N3/VMCore/CLISignature.cpp
vmkit/trunk/lib/N3/VMCore/CLIString.h
vmkit/trunk/lib/N3/VMCore/LinkN3Runtime.h
vmkit/trunk/lib/N3/VMCore/LockedMap.h
vmkit/trunk/lib/N3/VMCore/N3.cpp
vmkit/trunk/lib/N3/VMCore/N3.h
vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp
vmkit/trunk/lib/N3/VMCore/UTF8.cpp
vmkit/trunk/lib/N3/VMCore/UTF8.h
vmkit/trunk/lib/N3/VMCore/VMCache.h
vmkit/trunk/lib/N3/VMCore/VMClass.cpp
vmkit/trunk/lib/N3/VMCore/VMClass.h
vmkit/trunk/lib/N3/VMCore/VMObject.h
vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp
Modified: vmkit/trunk/lib/N3/Mono/MonoString.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/Mono/MonoString.h?rev=83711&r1=83710&r2=83711&view=diff
==============================================================================
--- vmkit/trunk/lib/N3/Mono/MonoString.h (original)
+++ vmkit/trunk/lib/N3/Mono/MonoString.h Sat Oct 10 07:12:50 2009
@@ -19,8 +19,6 @@
namespace n3 {
-class UTF8;
-
class MonoString : public CLIString {
public:
Modified: vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp?rev=83711&r1=83710&r2=83711&view=diff
==============================================================================
--- vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp (original)
+++ vmkit/trunk/lib/N3/PNetLib/PNetLib.cpp Sat Oct 10 07:12:50 2009
@@ -694,7 +694,8 @@
if (item->getVirtualTable() == Property::VT) {
Property* prop = (Property*)item;
if (attributes == METHOD_SEMANTIC_ATTRIBUTES_GETTER) {
- const char* asciiz = utf8ToAsciiz(prop->name);
+ mvm::PrintBuffer _asciiz(prop->name);
+ const char* asciiz = _asciiz.cString();
char* buf = (char*)alloca(strlen(asciiz) + 5);
sprintf(buf, "get_%s", asciiz);
N3* vm = VMThread::get()->vm;
Modified: vmkit/trunk/lib/N3/VMCore/Assembly.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Assembly.cpp?rev=83711&r1=83710&r2=83711&view=diff
==============================================================================
--- vmkit/trunk/lib/N3/VMCore/Assembly.cpp (original)
+++ vmkit/trunk/lib/N3/VMCore/Assembly.cpp Sat Oct 10 07:12:50 2009
@@ -373,7 +373,7 @@
buf[i++] = ',';
}
buf[i] = '>';
- const UTF8* genName = UTF8::readerConstruct(VMThread::get()->vm, buf, size);
+ const UTF8* genName = VMThread::get()->vm->bufToUTF8(buf, size);
//printf("%s\n", mvm::PrintBuffer(genName).cString());
ClassNameCmp CC(genName, nameSpace);
@@ -751,7 +751,7 @@
++n;
}
- const UTF8* utf8 = UTF8::readerConstruct(vm, buf, n);
+ const UTF8* utf8 = vm->bufToUTF8(buf, n);
return utf8;
}
Modified: vmkit/trunk/lib/N3/VMCore/Assembly.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/Assembly.h?rev=83711&r1=83710&r2=83711&view=diff
==============================================================================
--- vmkit/trunk/lib/N3/VMCore/Assembly.h (original)
+++ vmkit/trunk/lib/N3/VMCore/Assembly.h Sat Oct 10 07:12:50 2009
@@ -26,8 +26,16 @@
class GenericValue;
}
+namespace mvm {
+ class UTF8;
+ class UTF8Map;
+}
+
namespace n3 {
+using mvm::UTF8;
+using mvm::UTF8Map;
+
class ArrayUInt16;
class ArrayUInt8;
class ArrayObject;
@@ -40,7 +48,6 @@
class Param;
class Property;
class Reader;
-class UTF8;
class VMClass;
class VMGenericClass;
class VMClassArray;
Modified: vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp?rev=83711&r1=83710&r2=83711&view=diff
==============================================================================
--- vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp (original)
+++ vmkit/trunk/lib/N3/VMCore/CLIRuntimeJIT.cpp Sat Oct 10 07:12:50 2009
@@ -138,9 +138,12 @@
orig->parameters,
false, true);
if (dmeth == 0) {
- const char* methAsciiz = utf8ToAsciiz(orig->name);
- const char* nameAsciiz = utf8ToAsciiz(orig->classDef->name);
- const char* nameSpaceAsciiz = utf8ToAsciiz(orig->classDef->nameSpace);
+ mvm::PrintBuffer _methAsciiz(orig->name);
+ mvm::PrintBuffer _nameAsciiz(orig->classDef->name);
+ mvm::PrintBuffer _nameSpaceAsciiz(orig->classDef->nameSpace);
+ const char* methAsciiz = _methAsciiz.cString();
+ const char* nameAsciiz = _nameAsciiz.cString();
+ const char* nameSpaceAsciiz = _nameSpaceAsciiz.cString();
char *buf = (char*)alloca(3 + strlen(methAsciiz) +
strlen(nameAsciiz) +
Modified: vmkit/trunk/lib/N3/VMCore/CLISignature.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLISignature.cpp?rev=83711&r1=83710&r2=83711&view=diff
==============================================================================
--- vmkit/trunk/lib/N3/VMCore/CLISignature.cpp (original)
+++ vmkit/trunk/lib/N3/VMCore/CLISignature.cpp Sat Oct 10 07:12:50 2009
@@ -308,7 +308,7 @@
cl->nameSpace = ass->name;
char *tmp = (char *) alloca(100);
snprintf(tmp, 100, "!!%d", number);
- cl->name = UTF8::asciizConstruct(VMThread::get()->vm, tmp);
+ cl->name = VMThread::get()->vm->asciizToUTF8(tmp);
return cl;
} else {
return currGenericMethod->genericParams[number];
Modified: vmkit/trunk/lib/N3/VMCore/CLIString.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/CLIString.h?rev=83711&r1=83710&r2=83711&view=diff
==============================================================================
--- vmkit/trunk/lib/N3/VMCore/CLIString.h (original)
+++ vmkit/trunk/lib/N3/VMCore/CLIString.h Sat Oct 10 07:12:50 2009
@@ -19,7 +19,6 @@
namespace n3 {
-class UTF8;
class N3;
class ArrayUInt16;
Modified: vmkit/trunk/lib/N3/VMCore/LinkN3Runtime.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/LinkN3Runtime.h?rev=83711&r1=83710&r2=83711&view=diff
==============================================================================
--- vmkit/trunk/lib/N3/VMCore/LinkN3Runtime.h (original)
+++ vmkit/trunk/lib/N3/VMCore/LinkN3Runtime.h Sat Oct 10 07:12:50 2009
@@ -11,10 +11,13 @@
#ifndef JNJVM_LINK_N3_RUNTIME_H
#define JNJVM_LINK_N3_RUNTIME_H
+namespace mvm {
+ class UTF8;
+}
namespace n3 {
+ using mvm::UTF8;
class CacheNode;
- class UTF8;
class VMClass;
class VMClassArray;
class VMCommonClass;
Modified: vmkit/trunk/lib/N3/VMCore/LockedMap.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/LockedMap.h?rev=83711&r1=83710&r2=83711&view=diff
==============================================================================
--- vmkit/trunk/lib/N3/VMCore/LockedMap.h (original)
+++ vmkit/trunk/lib/N3/VMCore/LockedMap.h Sat Oct 10 07:12:50 2009
@@ -36,7 +36,6 @@
class VMObject;
class VMMethod;
class VMField;
-class UTF8;
template<class Key, class Container, class Compare, class Upcall>
class LockedMap : public mvm::PermanentObject {
Modified: vmkit/trunk/lib/N3/VMCore/N3.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.cpp?rev=83711&r1=83710&r2=83711&view=diff
==============================================================================
--- vmkit/trunk/lib/N3/VMCore/N3.cpp (original)
+++ vmkit/trunk/lib/N3/VMCore/N3.cpp Sat Oct 10 07:12:50 2009
@@ -210,7 +210,7 @@
mvm::BumpPtrAllocator *a = new mvm::BumpPtrAllocator();
N3 *vm= new(*a, "VM") N3(*a, "bootstrapN3");
- vm->hashUTF8 = new(vm->allocator, "UTF8Map") UTF8Map();
+ vm->hashUTF8 = new(vm->allocator, "UTF8Map") UTF8Map(vm->allocator);
CLIJit::initialiseBootstrapVM(vm);
@@ -236,7 +236,8 @@
}
ArrayUInt8* N3::openAssembly(const UTF8* name, const char* ext) {
- const char* asciiz = utf8ToAsciiz(name);
+ mvm::PrintBuffer _asciiz = mvm::PrintBuffer(name);
+ const char* asciiz = _asciiz.cString();
uint32 alen = strlen(asciiz);
ArrayUInt8* res = 0;
Modified: vmkit/trunk/lib/N3/VMCore/N3.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3.h?rev=83711&r1=83710&r2=83711&view=diff
==============================================================================
--- vmkit/trunk/lib/N3/VMCore/N3.h (original)
+++ vmkit/trunk/lib/N3/VMCore/N3.h Sat Oct 10 07:12:50 2009
@@ -25,8 +25,14 @@
#include "types.h"
-namespace n3 {
+namespace mvm {
+ class UTF8;
+ class UTF8Map;
+}
+namespace n3 {
+using mvm::UTF8;
+using mvm::UTF8Map;
class ArrayObject;
class ArrayUInt8;
class Assembly;
@@ -34,8 +40,6 @@
class N3;
class N3ModuleProvider;
class StringMap;
-class UTF8;
-class UTF8Map;
class VMClass;
class VMClassArray;
class VMCommonClass;
@@ -43,8 +47,6 @@
class VMMethod;
class FunctionMap;
class N3ModuleProvider;
-class UTF8;
-class UTF8Map;
class VMMethod;
class VMObject;
class VMThread;
Modified: vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp?rev=83711&r1=83710&r2=83711&view=diff
==============================================================================
--- vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp (original)
+++ vmkit/trunk/lib/N3/VMCore/N3Initialise.cpp Sat Oct 10 07:12:50 2009
@@ -185,15 +185,6 @@
INIT(ArrayFloat);
INIT(ArrayDouble);
INIT(ArrayObject);
-
- {
- UTF8 fake(0);
- UTF8::VT = ((VirtualTable**)(void*)(&fake))[0];
-#if !defined(WITHOUT_FINALIZER)
- ((void**)UTF8::VT)[0] = 0;
-#endif
- }
-
INIT(VMCond);
INIT(LockObj);
INIT(VMObject);
@@ -236,9 +227,6 @@
const UTF8* utf8OfChar = vm->asciizToUTF8("Char");
MSCorlib::arrayChar = ass->constructArray(utf8OfChar, System, 1);
- ((UTF8*)System)->classOf = MSCorlib::arrayChar;
- ((UTF8*)utf8OfChar)->classOf = MSCorlib::arrayChar;
- ((UTF8*)mscorlib)->classOf = MSCorlib::arrayChar;
#define INIT(var, nameSpace, name, type, prim) {\
var = (VMClass*)vm->coreAssembly->loadTypeFromName( \
Modified: vmkit/trunk/lib/N3/VMCore/UTF8.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/UTF8.cpp?rev=83711&r1=83710&r2=83711&view=diff
==============================================================================
--- vmkit/trunk/lib/N3/VMCore/UTF8.cpp (original)
+++ vmkit/trunk/lib/N3/VMCore/UTF8.cpp Sat Oct 10 07:12:50 2009
@@ -1,126 +0,0 @@
-#include "UTF8.h"
-#include "VMThread.h"
-#include "VMClass.h"
-#include "VMArray.h"
-#include "N3.h"
-#include "MSCorlib.h"
-
-using namespace n3;
-
-void UTF8::print(mvm::PrintBuffer* buf) const {
- for (int i = 0; i < size; i++)
- buf->writeChar((char)elements[i]);
-}
-
-const UTF8* UTF8::extract(UTF8Map *map, uint32 start, uint32 end) const {
- uint32 len = end - start;
- uint16* buf = (uint16*)alloca(sizeof(uint16) * len);
-
- for (uint32 i = 0; i < len; i++) {
- buf[i] = elements[i + start];
- }
-
- return map->lookupOrCreateReader(buf, len);
-}
-
-const UTF8* UTF8::asciizConstruct(N3* vm, const char* asciiz) {
- return vm->asciizToUTF8(asciiz);
-}
-
-const UTF8* UTF8::readerConstruct(N3* vm, uint16* buf, uint32 n) {
- return vm->bufToUTF8(buf, n);
-}
-
-static uint32 asciizHasher(const char* asciiz, sint32 size) {
- uint32 r0 = 0, r1 = 0;
- for (sint32 i = 0; i < size; i++) {
- char c = asciiz[i];
- r0 += c;
- r1 ^= c;
- }
- return (r1 & 255) + ((r0 & 255) << 8);
-}
-
-static uint32 readerHasher(const uint16* buf, sint32 size) {
- uint32 r0 = 0, r1 = 0;
- for (sint32 i = 0; i < size; i++) {
- uint16 c = buf[i];
- r0 += c;
- r1 ^= c;
- }
- return (r1 & 255) + ((r0 & 255) << 8);
-}
-
-static bool asciizEqual(const UTF8* val, const char* asciiz, sint32 size) {
- sint32 len = val->size;
- if (len != size) return false;
- else {
- for (sint32 i = 0; i < len; i++) {
- if (asciiz[i] != val->elements[i]) return false;
- }
- return true;
- }
-}
-
-static bool readerEqual(const UTF8* val, const uint16* buf, sint32 size) {
- sint32 len = val->size;
- if (len != size) return false;
- else return !(memcmp(val->elements, buf, len * sizeof(uint16)));
-}
-
-
-const UTF8* UTF8Map::lookupOrCreateAsciiz(const char* asciiz) {
- sint32 size = strlen(asciiz);
- uint32 key = asciizHasher(asciiz, size);
- const UTF8* res = 0;
- lock->lock();
-
- std::pair<UTF8Map::iterator, UTF8Map::iterator> p = map.equal_range(key);
-
- for (UTF8Map::iterator i = p.first; i != p.second; i++) {
- if (asciizEqual(i->second, asciiz, size)) {
- res = i->second;
- break;
- }
- }
-
- if (res == 0) {
- UTF8* tmp = (UTF8 *)new(size) UTF8(size);
- for (sint32 i = 0; i < size; i++) {
- tmp->elements[i] = asciiz[i];
- }
- res = (const UTF8*)tmp;
- map.insert(std::make_pair(key, res));
- }
-
- lock->unlock();
- return res;
-}
-
-const UTF8* UTF8Map::lookupOrCreateReader(const uint16* buf, uint32 len) {
- sint32 size = (sint32)len;
- uint32 key = readerHasher(buf, size);
- const UTF8* res = 0;
- lock->lock();
-
- std::pair<UTF8Map::iterator, UTF8Map::iterator> p = map.equal_range(key);
-
- for (UTF8Map::iterator i = p.first; i != p.second; i++) {
- if (readerEqual(i->second, buf, size)) {
- res = i->second;
- break;
- }
- }
-
- if (res == 0) {
- UTF8* tmp = new(size) UTF8(size);
- memcpy(tmp->elements, buf, len * sizeof(uint16));
- res = (const UTF8*)tmp;
- map.insert(std::make_pair(key, res));
- }
-
- lock->unlock();
- return res;
-}
-
-
Modified: vmkit/trunk/lib/N3/VMCore/UTF8.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/UTF8.h?rev=83711&r1=83710&r2=83711&view=diff
==============================================================================
--- vmkit/trunk/lib/N3/VMCore/UTF8.h (original)
+++ vmkit/trunk/lib/N3/VMCore/UTF8.h Sat Oct 10 07:12:50 2009
@@ -1,167 +1,11 @@
#ifndef _N3_UTF8_
#define _N3_UTF8_
-#include "VMObject.h"
-#include "mvm/PrintBuffer.h"
-
-namespace mvm {
- class VirtualTable;
-}
+#include "mvm/UTF8.h"
namespace n3 {
- class VMClassArray;
- class UTF8Map;
- class N3;
-
-class UTF8 : public VMObject {
-public:
- static VirtualTable* VT;
- sint32 size;
- uint16 elements[1];
-
- /// operator new - Redefines the new operator of this class to allocate
- /// its objects in permanent memory, not with the garbage collector.
- void* operator new(size_t sz, sint32 n) {
- return gc::operator new(sizeof(VMObject) + sizeof(sint32) + n * sizeof(uint16), UTF8::VT);
- }
-
- UTF8(sint32 n) {
- size = n;
- }
-
- virtual void print(mvm::PrintBuffer* buf) const;
-
- static const UTF8* asciizConstruct(N3 *vm, const char* asciiz);
- static const UTF8* readerConstruct(N3 *vm, uint16* buf, uint32 n);
-
- const UTF8* extract(UTF8Map *vm, uint32 start, uint32 len) const;
-};
-
-class UTF8Map : public mvm::PermanentObject {
-public:
- typedef std::multimap<const uint32, const UTF8*>::iterator iterator;
-
- mvm::Lock* lock;
- std::multimap<uint32, const UTF8*, std::less<uint32>,
- gc_allocator<std::pair<const uint32, const UTF8*> > > map;
-
- const UTF8* lookupOrCreateAsciiz(const char* asciiz);
- const UTF8* lookupOrCreateReader(const uint16* buf, uint32 size);
-
- UTF8Map() {
- lock = new mvm::LockNormal();
- }
-
- virtual void TRACER {
- //lock->MARK_AND_TRACE;
- for (iterator i = map.begin(), e = map.end(); i!= e; ++i) {
- i->second->MARK_AND_TRACE;
- }
- }
-
- virtual void print(mvm::PrintBuffer* buf) const {
- buf->write("UTF8 Hashtable<>");
- }
-};
-
-
-class UTF8Builder {
- uint16 *buf;
- uint32 cur;
- uint32 size;
-
-public:
- UTF8Builder(size_t size) {
- size = (size < 4) ? 4 : size;
- this->buf = new uint16[size];
- this->size = size;
- }
-
- UTF8Builder *append(const UTF8 *utf8, uint32 start=0, uint32 length=0xffffffff) {
- length = length == 0xffffffff ? utf8->size : length;
- uint32 req = cur + length;
-
- if(req > size) {
- uint32 newSize = size<<1;
- while(req < newSize)
- newSize <<= 1;
- uint16 *newBuf = new uint16[newSize];
- memcpy(newBuf, buf, cur<<1);
- delete []buf;
- buf = newBuf;
- size = newSize;
- }
-
- memcpy(buf + cur, &utf8->elements + start, length<<1);
- cur = req;
-
- return this;
- }
-
- const UTF8 *toUTF8(UTF8Map *map) {
- return map->lookupOrCreateReader(buf, size);
- }
-
- ~UTF8Builder() {
- delete [] buf;
- }
-};
-
-
-/// UTF8Buffer - Helper class to create char* buffers suitable for
-/// printf.
-///
-class UTF8Buffer {
-
- /// buffer - The buffer that holds a string representation.
- ///
- char* buffer;
-public:
-
- /// UTF8Buffer - Create a buffer with the following UTF8.
- ///
- UTF8Buffer(const UTF8* val) {
- buffer = new char[val->size + 1];
- for (sint32 i = 0; i < val->size; ++i)
- buffer[i] = val->elements[i];
- buffer[val->size] = 0;
- printf("buffer: %s (%d)\n", buffer, val->size);
- }
-
- /// ~UTF8Buffer - Delete the buffer, as well as all dynamically
- /// allocated memory.
- ///
- ~UTF8Buffer() {
- printf("Destructor :(\n");
- delete[] buffer;
- }
-
- /// replaceWith - replace the content of the buffer and free the old buffer
- ///
- void replaceWith(char *buffer) {
- delete[] this->buffer;
- this->buffer = buffer;
- }
-
-
- /// cString - Return a C string representation of the buffer, suitable
- /// for printf.
- ///
- const char* cString() {
- printf("cString: %s\n", buffer);
- return buffer;
- }
-};
-
-inline char *_utf8ToAsciiz(const UTF8 *val, char *buffer) {
- for (sint32 i = 0; i < val->size; ++i)
- buffer[i] = val->elements[i];
- buffer[val->size] = 0;
- return buffer;
-}
-
-#define utf8ToAsciiz(utf8) _utf8ToAsciiz(utf8, (char*)alloca(utf8->size + 1))
-
+ using mvm::UTF8;
+ using mvm::UTF8Map;
}
#endif
Modified: vmkit/trunk/lib/N3/VMCore/VMCache.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMCache.h?rev=83711&r1=83710&r2=83711&view=diff
==============================================================================
--- vmkit/trunk/lib/N3/VMCore/VMCache.h (original)
+++ vmkit/trunk/lib/N3/VMCore/VMCache.h Sat Oct 10 07:12:50 2009
@@ -22,7 +22,6 @@
class Assembly;
class Enveloppe;
-class UTF8;
class VMClass;
class CacheNode : public mvm::Object {
Modified: vmkit/trunk/lib/N3/VMCore/VMClass.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMClass.cpp?rev=83711&r1=83710&r2=83711&view=diff
==============================================================================
--- vmkit/trunk/lib/N3/VMCore/VMClass.cpp (original)
+++ vmkit/trunk/lib/N3/VMCore/VMClass.cpp Sat Oct 10 07:12:50 2009
@@ -172,7 +172,8 @@
}
const UTF8* VMClassArray::constructArrayName(const UTF8* name, uint32 dims) {
- const char* asciiz = utf8ToAsciiz(name);
+ mvm::PrintBuffer _asciiz(name);
+ const char* asciiz = _asciiz.cString();
char* res = (char*)alloca(strlen(asciiz) + (dims * 2) + 1);
sprintf(res, asciiz);
@@ -184,7 +185,8 @@
}
const UTF8* VMClassPointer::constructPointerName(const UTF8* name, uint32 dims) {
- const char* asciiz = utf8ToAsciiz(name);
+ mvm::PrintBuffer _asciiz(name);
+ const char* asciiz = _asciiz.cString();
char* res = (char*)alloca(strlen(asciiz) + (dims * 2) + 1);
sprintf(res, asciiz);
Modified: vmkit/trunk/lib/N3/VMCore/VMClass.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMClass.h?rev=83711&r1=83710&r2=83711&view=diff
==============================================================================
--- vmkit/trunk/lib/N3/VMCore/VMClass.h (original)
+++ vmkit/trunk/lib/N3/VMCore/VMClass.h Sat Oct 10 07:12:50 2009
@@ -23,14 +23,18 @@
#include <cstdarg>
+namespace mvm {
+ class UTF8;
+}
+
namespace n3 {
+using mvm::UTF8;
class ArraySInt32;
class Assembly;
class Enveloppe;
class Param;
class Property;
-class UTF8;
class VMClass;
class VMField;
class VMMethod;
Modified: vmkit/trunk/lib/N3/VMCore/VMObject.h
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VMObject.h?rev=83711&r1=83710&r2=83711&view=diff
==============================================================================
--- vmkit/trunk/lib/N3/VMCore/VMObject.h (original)
+++ vmkit/trunk/lib/N3/VMCore/VMObject.h Sat Oct 10 07:12:50 2009
@@ -27,7 +27,6 @@
class VMField;
class VMObject;
class VMThread;
-class UTF8;
class VMCond : public mvm::Object {
public:
Modified: vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp?rev=83711&r1=83710&r2=83711&view=diff
==============================================================================
--- vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp (original)
+++ vmkit/trunk/lib/N3/VMCore/VirtualTables.cpp Sat Oct 10 07:12:50 2009
@@ -36,7 +36,6 @@
INIT(ArrayFloat);
INIT(ArrayDouble);
INIT(ArrayObject);
- INIT(UTF8);
INIT(VMCond);
INIT(LockObj);
INIT(VMObject);
@@ -124,8 +123,6 @@
void VMCommonClass::TRACER {
- name->MARK_AND_TRACE;
- nameSpace->MARK_AND_TRACE;
super->CALL_TRACER;
CALL_TRACER_VECTOR(VMClass*, interfaces, std::allocator);
//lockVar->MARK_AND_TRACE;
@@ -174,7 +171,6 @@
classDef->CALL_TRACER;
CALL_TRACER_VECTOR(Param*, params, gc_allocator);
TRACE_VECTOR(Enveloppe*, caches, gc_allocator);
- name->MARK_AND_TRACE;
}
void VMGenericMethod::TRACER {
@@ -185,7 +181,6 @@
void VMField::TRACER {
signature->CALL_TRACER;
classDef->CALL_TRACER;
- name->MARK_AND_TRACE;
}
void VMCond::TRACER {
@@ -215,13 +210,11 @@
void Param::TRACER {
method->CALL_TRACER;
- name->MARK_AND_TRACE;
}
void Property::TRACER {
type->CALL_TRACER;
//signature->MARK_AND_TRACE;
- name->MARK_AND_TRACE;
delegatee->MARK_AND_TRACE;
}
@@ -232,7 +225,6 @@
loadedTokenFields->CALL_TRACER;
//lockVar->MARK_AND_TRACE;
//condVar->MARK_AND_TRACE;
- name->MARK_AND_TRACE;
bytes->MARK_AND_TRACE;
textSection->CALL_TRACER;
rsrcSection->CALL_TRACER;
@@ -245,7 +237,6 @@
void N3::TRACER {
threadSystem->MARK_AND_TRACE;
- hashUTF8->CALL_TRACER;
functions->CALL_TRACER;
if (bootstrapThread) {
bootstrapThread->CALL_TRACER;
@@ -253,7 +244,6 @@
th != bootstrapThread; th = (VMThread*)th->next())
th->CALL_TRACER;
}
- hashUTF8->CALL_TRACER;
hashStr->CALL_TRACER;
loadedAssemblies->CALL_TRACER;
}
@@ -268,7 +258,6 @@
}
void Header::TRACER {
- versionName->MARK_AND_TRACE;
tildStream->CALL_TRACER;
stringStream->CALL_TRACER;
usStream->CALL_TRACER;
More information about the vmkit-commits
mailing list