prims.cc (_Jv_AllocObject): Remove `size' argument.
libjava: 2004-04-15 Bryce McKinlay <mckinlay@redhat.com> * prims.cc (_Jv_AllocObject): Remove `size' argument. (_Jv_AllocObjectNoFinalizer): Likewise. (_Jv_AllocObjectNoInitNoFinalizer): Likewise. (_Jv_AllocPtrFreeObject): Likewise. (_Jv_AllocString): Moved from natString.cc. Call collector interface directly even in the JVMPI case. * gcj/cni.h (JvAllocObject): Remove `size' argument from _Jv_AllocObject calls. * gcj/javaprims.h: Update prototypes. * gnu/gcj/natCore.cc (_Jv_create_core): Use `new', not _Jv_AllocObject. * java/lang/Class.h: Update _Jv_AllocObject friend prototype. * java/lang/natString.cc (_Jv_AllocString): Move to prims.cc. gcc/cp: 2004-04-15 Bryce McKinlay <mckinlay@redhat.com> * init.c (build_new_1): Don't use type size argument for Java _Jv_AllocObject call. gcc/java: 2004-04-15 Bryce McKinlay <mckinlay@redhat.com> * expr.c (expand_java_NEW): Don't use size argument for _Jv_AllocObject calls. * parse.y (patch_invoke): Likewise. From-SVN: r80754
This commit is contained in:
parent
2f228199b9
commit
245c3c04af
12 changed files with 98 additions and 55 deletions
|
@ -286,7 +286,7 @@ private:
|
|||
friend jfieldID JvGetFirstStaticField (jclass);
|
||||
friend jint JvNumStaticFields (jclass);
|
||||
|
||||
friend jobject _Jv_AllocObject (jclass, jint);
|
||||
friend jobject _Jv_AllocObject (jclass);
|
||||
friend void *_Jv_AllocObj (jint, jclass);
|
||||
friend void *_Jv_AllocPtrFreeObj (jint, jclass);
|
||||
friend void *_Jv_AllocArray (jint, jclass);
|
||||
|
|
|
@ -401,30 +401,6 @@ java::lang::String::valueOf (jint num)
|
|||
return _Jv_NewString (buffer+11-i, i);
|
||||
}
|
||||
|
||||
jstring
|
||||
_Jv_AllocString(jsize len)
|
||||
{
|
||||
jsize sz = sizeof(java::lang::String) + len * sizeof(jchar);
|
||||
|
||||
// We assert that for strings allocated this way, the data field
|
||||
// will always point to the object itself. Thus there is no reason
|
||||
// for the garbage collector to scan any of it.
|
||||
// Furthermore, we're about to overwrite the string data, so
|
||||
// initialization of the object is not an issue.
|
||||
#ifdef ENABLE_JVMPI
|
||||
jstring obj = (jstring) _Jv_AllocPtrFreeObject(&StringClass, sz);
|
||||
#else
|
||||
// Class needs no initialization, and there is no finalizer, so
|
||||
// we can go directly to the collector's allocator interface.
|
||||
jstring obj = (jstring) _Jv_AllocPtrFreeObj(sz, &StringClass);
|
||||
#endif
|
||||
obj->data = obj;
|
||||
obj->boffset = sizeof(java::lang::String);
|
||||
obj->count = len;
|
||||
obj->cachedHashCode = 0;
|
||||
return obj;
|
||||
}
|
||||
|
||||
jstring
|
||||
_Jv_NewString(const jchar *chars, jsize len)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue