This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: RFC: class-related structures and conservative scanning
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 07 Feb 2006 12:50:18 -0700
- Subject: Patch: RFC: class-related structures and conservative scanning
- Reply-to: tromey at redhat dot com
I'm not checking this in yet, I thought I'd get some comments first.
This patch changes the marking of Class objects so that only the
direct fields of Class are marked. Then it updates all the
Class-related structures to be allocated with _Jv_AllocRawObj, so that
they will be conservatively scanned.
This fixes a number of memory leaks and is also useful infrastructure
for eventually enabling incremental collection.
A refinement of this approach would be to move away from conservative
scanning for these objects and introduce new 'kind's which describe
them. Bitmap descriptors would work for some things (e.g. the
vtable); for others we would have to add new procedural markers. In
some cases it is hard to say exactly what we should do (the constant
pool comes to mind ... the mark procedure would need the tags in order
to be precise). I haven't done this yet since it isn't clear how big
the benefits would be, and because this patch doesn't make it any
harder to change to a more precise model in the future.
Historically we didn't rely on conservative scanning much, because we
were hoping that we'd end up with multiple GC implementations. At
this point it seems pretty clear that this is not going to happen
easily. And, changing things this way does not really prevent such a
move in the future -- we can just search for all the _Jv_AllocRawObj
calls and change them.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
PR libgcj/26063, PR libgcj/17978, PR libgcj/10598:
* defineclass.cc (parse): Use _Jv_AllocRawObj.
(read_constpool): Likewise.
(read_one_code_attribute): Use internal function name.
(handleConstantPool): Use _Jv_AllocRawObj.
(handleInterfacesBegin): Likewise.
(handleFieldsBegin): Likewise.
(handleMethodsBegin): Likewise.
(handleCodeAttribute): Likewise.
(handleMethodsEnd): Likewise.
* include/jvm.h (new_vtable): Use _Jv_AllocRawObj.
* interpret.cc (do_allocate_static_fields): Use _Jv_AllocRawObj.
* link.cc (prepare_constant_time_tables): Use _Jv_AllocRawObj.
(generate_itable): Likewise.
(find_iindex): Likewise.
(add_miranda_methods): Likewise.
(struct method_closure): New structure.
(create_error_method): Use struct method_closure; allocate with
_Jv_AllocBytes.
* boehm.cc (_Jv_MarkObj): Mark vtable. Only mark direct fields
of Class.
(_Jv_MarkArray): Mark vtable.
(_Jv_AllocRawObj): Don't allocate objects of size 0.
Index: link.cc
===================================================================
--- link.cc (revision 110591)
+++ link.cc (working copy)
@@ -1,6 +1,6 @@
// link.cc - Code for linking and resolving classes and pool entries.
-/* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation
This file is part of libgcj.
@@ -590,9 +590,8 @@
// depth. We do not include java.lang.Object in the table of ancestors,
// since it is redundant.
- // FIXME: _Jv_AllocBytes
- klass->ancestors = (jclass *) _Jv_Malloc (klass->depth
- * sizeof (jclass));
+ klass->ancestors = (jclass *) _Jv_AllocRawObj (klass->depth
+ * sizeof (jclass));
klass0 = klass;
for (int index = 0; index < klass->depth; index++)
{
@@ -611,9 +610,8 @@
return;
}
- // FIXME: _Jv_AllocBytes
klass->idt =
- (_Jv_IDispatchTable *) _Jv_Malloc (sizeof (_Jv_IDispatchTable));
+ (_Jv_IDispatchTable *) _Jv_AllocRawObj (sizeof (_Jv_IDispatchTable));
_Jv_ifaces ifaces;
ifaces.count = 0;
@@ -625,8 +623,7 @@
if (ifaces.count > 0)
{
klass->idt->cls.itable =
- // FIXME: _Jv_AllocBytes
- (void **) _Jv_Malloc (itable_size * sizeof (void *));
+ (void **) _Jv_AllocRawObj (itable_size * sizeof (void *));
klass->idt->cls.itable_length = itable_size;
jshort *itable_offsets =
@@ -725,14 +722,12 @@
/* Create interface dispatch table for iface */
if (iface->idt == NULL)
{
- // FIXME: _Jv_AllocBytes
iface->idt
- = (_Jv_IDispatchTable *) _Jv_Malloc (sizeof (_Jv_IDispatchTable));
+ = (_Jv_IDispatchTable *) _Jv_AllocRawObj (sizeof (_Jv_IDispatchTable));
// The first element of ioffsets is its length (itself included).
- // FIXME: _Jv_AllocBytes
- jshort *ioffsets = (jshort *) _Jv_Malloc (INITIAL_IOFFSETS_LEN
- * sizeof (jshort));
+ jshort *ioffsets = (jshort *) _Jv_AllocRawObj (INITIAL_IOFFSETS_LEN
+ * sizeof (jshort));
ioffsets[0] = INITIAL_IOFFSETS_LEN;
for (int i = 1; i < INITIAL_IOFFSETS_LEN; i++)
ioffsets[i] = -1;
@@ -934,9 +929,8 @@
if (i >= newlen)
newlen = i + 3;
jshort *old_ioffsets = ifaces[j]->idt->iface.ioffsets;
- // FIXME: _Jv_AllocBytes
- jshort *new_ioffsets = (jshort *) _Jv_Malloc (newlen
- * sizeof(jshort));
+ jshort *new_ioffsets = (jshort *) _Jv_AllocRawObj (newlen
+ * sizeof(jshort));
memcpy (&new_ioffsets[1], &old_ioffsets[1],
(len - 1) * sizeof (jshort));
new_ioffsets[0] = newlen;
@@ -954,42 +948,47 @@
return i;
}
+#ifdef USE_LIBFFI
+// We use a structure of this type to store the closure that
+// represents a missing method.
+struct method_closure
+{
+ // This field must come first, since the address of this field will
+ // be the same as the address of the overall structure. This is due
+ // to disabling interior pointers in the GC.
+ ffi_closure closure;
+ ffi_cif cif;
+ ffi_type *arg_types[1];
+};
+
+#endif // USE_LIBFFI
+
void *
_Jv_Linker::create_error_method (_Jv_Utf8Const *class_name)
{
#ifdef USE_LIBFFI
- // TODO: The following structs/objects are heap allocated are
- // unreachable by the garbage collector:
- // - cif, arg_types
+ method_closure *closure
+ = (method_closure *) _Jv_AllocBytes(sizeof (method_closure));
- ffi_closure *closure = (ffi_closure *) _Jv_Malloc( sizeof( ffi_closure ));
- ffi_cif *cif = (ffi_cif *) _Jv_Malloc( sizeof( ffi_cif ));
+ closure->arg_types[0] = &ffi_type_void;
- // Pretends that we want to call a void (*) (void) function via
- // ffi_call.
- ffi_type **arg_types = (ffi_type **) _Jv_Malloc( sizeof( ffi_type * ));
- arg_types[0] = &ffi_type_void;
-
- // Initializes the cif and the closure. If that worked the closure is
- // returned and can be used as a function pointer in a class' atable.
- if (ffi_prep_cif (
- cif, FFI_DEFAULT_ABI, 1, &ffi_type_void, arg_types) == FFI_OK
- && (ffi_prep_closure (
- closure, cif, _Jv_ThrowNoClassDefFoundErrorTrampoline,
- class_name) == FFI_OK))
+ // Initializes the cif and the closure. If that worked the closure
+ // is returned and can be used as a function pointer in a class'
+ // atable.
+ if (ffi_prep_cif (&closure->cif, FFI_DEFAULT_ABI, 1, &ffi_type_void,
+ closure->arg_types) == FFI_OK
+ && ffi_prep_closure (&closure->closure, &closure->cif,
+ _Jv_ThrowNoClassDefFoundErrorTrampoline,
+ class_name) == FFI_OK)
+ return &closure->closure;
+ else
{
- return closure;
- }
- else
- {
java::lang::StringBuffer *buffer = new java::lang::StringBuffer();
- buffer->append(
- JvNewStringLatin1("Error setting up FFI closure"
- " for static method of missing class: "));
-
+ buffer->append(JvNewStringLatin1("Error setting up FFI closure"
+ " for static method of"
+ " missing class: "));
buffer->append (_Jv_NewStringUtf8Const(class_name));
-
throw new java::lang::InternalError(buffer->toString());
}
#else
@@ -1696,8 +1695,8 @@
// found is really unique among all superinterfaces.
int new_count = base->method_count + 1;
_Jv_Method *new_m
- = (_Jv_Method *) _Jv_AllocBytes (sizeof (_Jv_Method)
- * new_count);
+ = (_Jv_Method *) _Jv_AllocRawObj (sizeof (_Jv_Method)
+ * new_count);
memcpy (new_m, base->methods,
sizeof (_Jv_Method) * base->method_count);
Index: interpret.cc
===================================================================
--- interpret.cc (revision 110591)
+++ interpret.cc (working copy)
@@ -3881,7 +3881,7 @@
{
_Jv_InterpClass *iclass = (_Jv_InterpClass *) klass->aux_info;
- char *static_data = (char *) _Jv_AllocBytes (static_size);
+ char *static_data = (char *) _Jv_AllocRawObj (static_size);
for (int i = 0; i < klass->field_count; i++)
{
Index: boehm.cc
===================================================================
--- boehm.cc (revision 110591)
+++ boehm.cc (working copy)
@@ -1,6 +1,6 @@
// boehm.cc - interface between libjava and Boehm GC.
-/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation
This file is part of libgcj.
@@ -85,6 +85,9 @@
jclass klass = dt->clas;
GC_PTR p;
+ p = (GC_PTR) dt;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, obj);
+
# ifndef JV_HASH_SYNCHRONIZATION
// Every object has a sync_info pointer.
p = (GC_PTR) obj->sync_info;
@@ -114,26 +117,11 @@
MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
p = (GC_PTR) c->superclass;
MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
- for (int i = 0; i < c->constants.size; ++i)
- {
- /* FIXME: We could make this more precise by using the tags -KKT */
- p = (GC_PTR) c->constants.data[i].p;
- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
- }
-#ifdef INTERPRETER
- if (_Jv_IsInterpretedClass (c))
- {
- p = (GC_PTR) c->constants.tags;
- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
- p = (GC_PTR) c->constants.data;
- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
- }
-#endif
-
- // The vtable might be allocated even for compiled code.
- p = (GC_PTR) c->vtable;
+ p = (GC_PTR) c->constants.tags;
MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
+ p = (GC_PTR) c->constants.data;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
// If the class is an array, then the methods field holds a
// pointer to the element class. If the class is primitive,
@@ -141,101 +129,24 @@
p = (GC_PTR) c->methods;
MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
- // The vtable might have been set, but the rest of the class
- // could still be uninitialized. If this is the case, then
- // c.isArray will SEGV. We check for this, and if it is the
- // case we just return.
- if (__builtin_expect (c->name == NULL, false))
- return mark_stack_ptr;
-
- if (! c->isArray() && ! c->isPrimitive())
- {
- // Scan each method in the cases where `methods' really
- // points to a methods structure.
- for (int i = 0; i < c->method_count; ++i)
- {
- p = (GC_PTR) c->methods[i].name;
- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
- p = (GC_PTR) c->methods[i].signature;
- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
-
- // Note that we don't have to mark each individual throw
- // separately, as these are stored in the constant pool.
- p = (GC_PTR) c->methods[i].throws;
- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
- }
- }
-
- // Mark all the fields.
p = (GC_PTR) c->fields;
MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
- for (int i = 0; i < c->field_count; ++i)
- {
- _Jv_Field* field = &c->fields[i];
- p = (GC_PTR) field->name;
- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
- p = (GC_PTR) field->type;
- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
-
- // For the interpreter, we also need to mark the memory
- // containing static members
- if ((field->flags & java::lang::reflect::Modifier::STATIC))
- {
- p = (GC_PTR) field->u.addr;
- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
-
- // also, if the static member is a reference,
- // mark also the value pointed to. We check for isResolved
- // since marking can happen before memory is allocated for
- // static members.
- // Note that field->u.addr may be null if the class c is
- // JV_STATE_LOADED but not JV_STATE_PREPARED (initialized).
- // Note also that field->type could be NULL in some
- // situations, for instance if the class has state
- // JV_STATE_ERROR.
- if (field->type && JvFieldIsRef (field)
- && p && field->isResolved())
- {
- jobject val = *(jobject*) p;
- p = (GC_PTR) val;
- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
- }
- }
- }
-
+ // The vtable might be allocated even for compiled code.
p = (GC_PTR) c->vtable;
MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
+
p = (GC_PTR) c->interfaces;
MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
- for (int i = 0; i < c->interface_count; ++i)
- {
- p = (GC_PTR) c->interfaces[i];
- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
- }
p = (GC_PTR) c->loader;
MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
// The dispatch tables can be allocated at runtime.
p = (GC_PTR) c->ancestors;
MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
- if (c->idt)
- {
- p = (GC_PTR) c->idt;
- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
- if (c->isInterface())
- {
- p = (GC_PTR) c->idt->iface.ioffsets;
- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c->idt);
- }
- else if (! c->isPrimitive())
- {
- // This field is only valid for ordinary classes.
- p = (GC_PTR) c->idt->cls.itable;
- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c->idt);
- }
- }
+ p = (GC_PTR) c->idt;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
p = (GC_PTR) c->arrayclass;
MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
@@ -245,73 +156,6 @@
MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
p = (GC_PTR) c->aux_info;
MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
-
-#ifdef INTERPRETER
- if (_Jv_IsInterpretedClass (c) && c->aux_info)
- {
- _Jv_InterpClass* ic = (_Jv_InterpClass*) c->aux_info;
-
- p = (GC_PTR) ic->interpreted_methods;
- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, ic);
-
- p = (GC_PTR) ic->source_file_name;
- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, ic);
-
- for (int i = 0; i < c->method_count; i++)
- {
- // The interpreter installs a heap-allocated trampoline
- // here, so we'll mark it.
- p = (GC_PTR) c->methods[i].ncode;
- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
-
- using namespace java::lang::reflect;
-
- // Mark the direct-threaded code. Note a subtlety here:
- // when we add Miranda methods to a class, we don't
- // resize its interpreted_methods array. If we try to
- // reference one of these methods, we may crash.
- // However, we know these are all abstract, and we know
- // that abstract methods have nothing useful in this
- // array. So, we skip all abstract methods to avoid the
- // problem. FIXME: this is pretty obscure, it may be
- // better to add a methods to the execution engine and
- // resize the array.
- if ((c->methods[i].accflags & Modifier::ABSTRACT) != 0)
- continue;
-
- p = (GC_PTR) ic->interpreted_methods[i];
- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, ic);
-
- if ((c->methods[i].accflags & Modifier::NATIVE) != 0)
- {
- _Jv_JNIMethod *jm
- = (_Jv_JNIMethod *) ic->interpreted_methods[i];
- if (jm)
- {
- p = (GC_PTR) jm->jni_arg_types;
- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, p);
- }
- }
- else
- {
- _Jv_InterpMethod *im
- = (_Jv_InterpMethod *) ic->interpreted_methods[i];
- if (im)
- {
- p = (GC_PTR) im->line_table;
- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, ic);
- p = (GC_PTR) im->prepared;
- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, ic);
- }
- }
- }
-
- p = (GC_PTR) ic->field_initializers;
- MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, ic);
-
- }
-#endif
-
}
else
{
@@ -367,6 +211,9 @@
jclass klass = dt->clas;
GC_PTR p;
+ p = (GC_PTR) dt;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, array);
+
# ifndef JV_HASH_SYNCHRONIZATION
// Every object has a sync_info pointer.
p = (GC_PTR) array->sync_info;
@@ -515,7 +362,7 @@
void *
_Jv_AllocRawObj (jsize size)
{
- return (void *) GC_MALLOC (size);
+ return (void *) GC_MALLOC (size ? size : 1);
}
static void
Index: include/jvm.h
===================================================================
--- include/jvm.h (revision 110591)
+++ include/jvm.h (working copy)
@@ -1,6 +1,6 @@
// jvm.h - Header file for private implementation information. -*- c++ -*-
-/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation
This file is part of libgcj.
@@ -72,6 +72,7 @@
{
return (2 * sizeof (void *)) + (index * vtable_elt_size ());
}
+
static _Jv_VTable *new_vtable (int count);
};
@@ -374,16 +375,12 @@
void _Jv_RunMain (struct _Jv_VMInitArgs *vm_args, jclass klass,
const char *name, int argc, const char **argv, bool is_jar);
-// Delayed until after _Jv_AllocBytes is declared.
-//
-// Note that we allocate this as unscanned memory -- the vtables
-// are handled specially by the GC.
-
+// Delayed until after _Jv_AllocRawObj is declared.
inline _Jv_VTable *
_Jv_VTable::new_vtable (int count)
{
size_t size = sizeof(_Jv_VTable) + (count - 1) * vtable_elt_size ();
- return (_Jv_VTable *) _Jv_AllocBytes (size);
+ return (_Jv_VTable *) _Jv_AllocRawObj (size);
}
// Determine if METH gets an entry in a VTable.
Index: defineclass.cc
===================================================================
--- defineclass.cc (revision 110591)
+++ defineclass.cc (working copy)
@@ -1,6 +1,6 @@
// defineclass.cc - defining a class from .class format.
-/* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation
This file is part of libgcj.
@@ -350,7 +350,7 @@
// Allocate our aux_info here, after the name is set, to fulfill our
// contract with the collector interface.
- def->aux_info = (void *) _Jv_AllocBytes (sizeof (_Jv_InterpClass));
+ def->aux_info = (void *) _Jv_AllocRawObj (sizeof (_Jv_InterpClass));
def_interp = (_Jv_InterpClass *) def->aux_info;
int interfaces_count = read2u ();
@@ -387,8 +387,7 @@
void _Jv_ClassReader::read_constpool ()
{
tags = (unsigned char*) _Jv_AllocBytes (pool_count);
- offsets = (unsigned int *) _Jv_AllocBytes (sizeof (int)
- * pool_count) ;
+ offsets = (unsigned int *) _Jv_AllocBytes (sizeof (int) * pool_count) ;
/** first, we scan the constant pool, collecting tags and offsets */
tags[0] = JV_CONSTANT_Undefined;
@@ -656,8 +655,8 @@
int table_len = read2u ();
_Jv_LineTableEntry* table
- = (_Jv_LineTableEntry *) JvAllocBytes (table_len
- * sizeof (_Jv_LineTableEntry));
+ = (_Jv_LineTableEntry *) _Jv_AllocBytes (table_len
+ * sizeof (_Jv_LineTableEntry));
for (int i = 0; i < table_len; i++)
{
table[i].bytecode_pc = read2u ();
@@ -702,11 +701,10 @@
{
/** now, we actually define the class' constant pool */
- // the pool is scanned explicitly by the collector
jbyte *pool_tags = (jbyte*) _Jv_AllocBytes (pool_count);
_Jv_word *pool_data
- = (_Jv_word*) _Jv_AllocBytes (pool_count * sizeof (_Jv_word));
-
+ = (_Jv_word*) _Jv_AllocRawObj (pool_count * sizeof (_Jv_word));
+
def->constants.tags = pool_tags;
def->constants.data = pool_data;
def->constants.size = pool_count;
@@ -1046,7 +1044,7 @@
void _Jv_ClassReader::handleInterfacesBegin (int count)
{
- def->interfaces = (jclass*) _Jv_AllocBytes (count*sizeof (jclass));
+ def->interfaces = (jclass*) _Jv_AllocRawObj (count*sizeof (jclass));
def->interface_count = count;
}
@@ -1112,11 +1110,10 @@
void _Jv_ClassReader::handleFieldsBegin (int count)
{
- def->fields = (_Jv_Field*)
- _Jv_AllocBytes (count * sizeof (_Jv_Field));
+ def->fields = (_Jv_Field*) _Jv_AllocRawObj (count * sizeof (_Jv_Field));
def->field_count = count;
- def_interp->field_initializers = (_Jv_ushort*)
- _Jv_AllocBytes (count * sizeof (_Jv_ushort));
+ def_interp->field_initializers
+ = (_Jv_ushort*) _Jv_AllocRawObj (count * sizeof (_Jv_ushort));
for (int i = 0; i < count; i++)
def_interp->field_initializers[i] = (_Jv_ushort) 0;
}
@@ -1256,11 +1253,11 @@
void
_Jv_ClassReader::handleMethodsBegin (int count)
{
- def->methods = (_Jv_Method *) _Jv_AllocBytes (sizeof (_Jv_Method) * count);
+ def->methods = (_Jv_Method *) _Jv_AllocRawObj (sizeof (_Jv_Method) * count);
def_interp->interpreted_methods
- = (_Jv_MethodBase **) _Jv_AllocBytes (sizeof (_Jv_MethodBase *)
- * count);
+ = (_Jv_MethodBase **) _Jv_AllocRawObj (sizeof (_Jv_MethodBase *)
+ * count);
for (int i = 0; i < count; i++)
{
@@ -1331,7 +1328,7 @@
{
int size = _Jv_InterpMethod::size (exc_table_length, code_length);
_Jv_InterpMethod *method =
- (_Jv_InterpMethod*) (_Jv_AllocBytes (size));
+ (_Jv_InterpMethod*) (_Jv_AllocRawObj (size));
method->max_stack = max_stack;
method->max_locals = max_locals;
@@ -1390,7 +1387,7 @@
else
{
_Jv_JNIMethod *m = (_Jv_JNIMethod *)
- _Jv_AllocBytes (sizeof (_Jv_JNIMethod));
+ _Jv_AllocRawObj (sizeof (_Jv_JNIMethod));
m->defining_class = def;
m->self = method;
m->function = NULL;