[llvm-commits] [vmkit] r51642 - /vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMRuntime.cpp
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Wed May 28 07:56:42 PDT 2008
Author: geoffray
Date: Wed May 28 09:56:42 2008
New Revision: 51642
URL: http://llvm.org/viewvc/llvm-project?rev=51642&view=rev
Log:
Create a hashed UTF8 to create the string object.
Modified:
vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMRuntime.cpp
Modified: vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMRuntime.cpp?rev=51642&r1=51641&r2=51642&view=diff
==============================================================================
--- vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMRuntime.cpp (original)
+++ vmkit/trunk/lib/JnJVM/Classpath/ClasspathVMRuntime.cpp Wed May 28 09:56:42 2008
@@ -43,12 +43,15 @@
sint32 lgLib = strLib->count;
sint32 lgPre = vm->prelib->size;
sint32 lgPost = vm->postlib->size;
+
+ uint32 size = (uint32)(lgPre + lgLib + lgPost);
+ uint16* elements = (uint16*)alloca(size * sizeof(uint16));
- UTF8* res = (UTF8*)UTF8::acons(lgPre + lgLib + lgPost, JavaArray::ofChar, vm);
-
- memmove(res->elements, vm->prelib->elements, lgPre * sizeof(uint16));
- memmove(&(res->elements[lgPre]), &(utf8Lib->elements[stLib]), lgLib * sizeof(uint16));
- memmove(&(res->elements[lgPre + lgLib]), vm->postlib->elements, lgPost * sizeof(uint16));
+ memmove(elements, vm->prelib->elements, lgPre * sizeof(uint16));
+ memmove(&(elements[lgPre]), &(utf8Lib->elements[stLib]), lgLib * sizeof(uint16));
+ memmove(&(elements[lgPre + lgLib]), vm->postlib->elements, lgPost * sizeof(uint16));
+
+ const UTF8* res = vm->readerConstructUTF8(elements, size);
return (jobject)(vm->UTF8ToStr(res));
More information about the llvm-commits
mailing list