This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: Remove JvAllocObject and add fields to Class for interpreter/JITdata


Tom Tromey wrote:

Bryce>  extern inline jobject
Bryce>  JvAllocObject (jclass cls, jsize sz)
Bryce>  {
Bryce> -  return _Jv_AllocObject (cls, sz);
Bryce> +  return _Jv_AllocObject (cls);
Bryce>  }

Does this function even make sense any more?
I think we should remove it and update gcj.texi.



My naive attempt to get rid of these turned into a major patch when I noticed that defineClass.cc actually does call JvAllocObject with a size argument that is not equal to the size_in_bytes of the class it is creating. The problem is that the interpreter actually overrides java.lang.Class to store additional, interpreter specific fields. Since the goal is pluggable JITs, I decided it would make more sense to add fields to java.lang.Class where JIT-specific data can be stored.


Please comment on the following patch, particularly the names and nature of the new fields in Class.h

Thanks

Bryce.


2004-04-16  Bryce McKinlay  <mckinlay@redhat.com>
 
	* gcj/cni.h (JvAllocObject): Remove these obsolete, 
	undocumented CNI calls.
	* include/java-interp.h (_Jv_InterpClass): No longer
	extends java.lang.Class.
	* java/lang/Class.h (Class): Add new fields `aux_id' and 
	`aux_info'.
	* boehm.cc (_Jv_MarkObj): Update java.lang.Class marking.
	* defineclass.cc: Remove Class<->_Jv_InterpClass casts.
	Use Class->aux_info instead.
	* jni.cc (_Jv_JNI_AllocObject): Use _Jv_AllocObject.
	* resolve.cc: Remove Class<->_Jv_InterpClass casts.
	Use Class->aux_info instead.
	* java/io/natObjectInputStream.cc (allocateObject): Use
	_Jv_AllocObject.
	* java/lang/natClass.cc (newInstance): Likewise.
	* java/lang/natClassLoader.cc (_Jv_NewClass): Likewise.
	* java/lang/natObject.cc (clone): Likewise.
	* java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Likewise.
	* java/lang/natVMClassLoader.cc (defineClass): Don't use
	JvAllocObject. Allocate klass->aux_info here for interpreted
	class.

Index: gcj/cni.h
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gcj/cni.h,v
retrieving revision 1.11
diff -u -r1.11 cni.h
--- gcj/cni.h	16 Apr 2004 16:27:18 -0000	1.11
+++ gcj/cni.h	17 Apr 2004 00:16:57 -0000
@@ -20,18 +20,6 @@
 
 #include <string.h>
 
-extern inline jobject
-JvAllocObject (jclass cls)
-{
-  return _Jv_AllocObject (cls);
-}
-
-extern inline jobject
-JvAllocObject (jclass cls, jsize sz)
-{
-  return _Jv_AllocObject (cls);
-}
-
 extern "C" jstring _Jv_NewStringUTF (const char *bytes);
 extern "C" void _Jv_InitClass (jclass);
 
 
Index: boehm.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/boehm.cc,v
retrieving revision 1.42
diff -u -r1.42 boehm.cc
--- boehm.cc	4 Dec 2003 13:07:07 -0000	1.42
+++ boehm.cc	17 Apr 2004 00:41:54 -0000
@@ -208,11 +208,15 @@
       MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, cPlabel);
       p = (ptr_t) c->hack_signers;
       MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, cSlabel);
+      p = (ptr_t) c->aux_id;
+      MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, ic, cTlabel);
+      p = (ptr_t) c->aux_info;
+      MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, ic, cUlabel);
 
 #ifdef INTERPRETER
       if (_Jv_IsInterpretedClass (c))
 	{
-	  _Jv_InterpClass* ic = (_Jv_InterpClass*) c;
+	  _Jv_InterpClass* ic = (_Jv_InterpClass*) c->aux_info;
 
 	  p = (ptr_t) ic->interpreted_methods;
 	  MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, ic, cElabel);
	  
	  
Index: defineclass.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/defineclass.cc,v
retrieving revision 1.35
diff -u -r1.35 defineclass.cc
--- defineclass.cc	24 Oct 2003 09:29:41 -0000	1.35
+++ defineclass.cc	17 Apr 2004 00:16:55 -0000
@@ -96,7 +96,10 @@
   unsigned int      *offsets;
 
   // the class to define (see java-interp.h)
-  _Jv_InterpClass   *def;
+  jclass	   def;
+  
+  // the classes associated interpreter data.
+  _Jv_InterpClass  *def_interp;
 
   /* check that the given number of input bytes are available */
   inline void check (int num)
@@ -221,7 +224,8 @@
     bytes  = (unsigned char*) (elements (data)+offset);
     len    = length;
     pos    = 0;
-    def    = (_Jv_InterpClass*) klass;
+    def    = klass;
+    def_interp = (_Jv_InterpClass *) def->aux_info;
   }
 
   /** and here goes the parser members defined out-of-line */
@@ -1047,10 +1051,10 @@
   def->fields = (_Jv_Field*) 
     _Jv_AllocBytes (count * sizeof (_Jv_Field));
   def->field_count = count;
-  def->field_initializers = (_Jv_ushort*)
+  def_interp->field_initializers = (_Jv_ushort*)
     _Jv_AllocBytes (count * sizeof (_Jv_ushort));
   for (int i = 0; i < count; i++)
-    def->field_initializers[i] = (_Jv_ushort) 0;
+    def_interp->field_initializers[i] = (_Jv_ushort) 0;
 }
 
 void _Jv_ClassReader::handleField (int field_no,
@@ -1133,7 +1137,7 @@
     throw_class_format_error ("field has multiple ConstantValue attributes");
 
   field->flags |= _Jv_FIELD_CONSTANT_VALUE;
-  def->field_initializers[field_index] = value;
+  def_interp->field_initializers[field_index] = value;
 
   /* type check the initializer */
   
@@ -1153,7 +1157,7 @@
   int low            = 0;
   int high           = def->field_count-1;
   _Jv_Field  *fields = def->fields;
-  _Jv_ushort *inits  = def->field_initializers;
+  _Jv_ushort *inits  = def_interp->field_initializers;
 
   // this is kind of a raw version of quicksort.
   while (low < high)
@@ -1195,13 +1199,13 @@
 {
   def->methods = (_Jv_Method *) _Jv_AllocBytes (sizeof (_Jv_Method) * count);
 
-  def->interpreted_methods
+  def_interp->interpreted_methods
     = (_Jv_MethodBase **) _Jv_AllocBytes (sizeof (_Jv_MethodBase *)
 					  * count);
 
   for (int i = 0; i < count; i++)
     {
-      def->interpreted_methods[i] = 0;
+      def_interp->interpreted_methods[i] = 0;
       def->methods[i].index = (_Jv_ushort) -1;
     }
 
@@ -1284,7 +1288,7 @@
 	  (void*) (bytes+code_start),
 	  code_length);
 
-  def->interpreted_methods[method_index] = method;
+  def_interp->interpreted_methods[method_index] = method;
 
   if ((method->self->accflags & java::lang::reflect::Modifier::STATIC))
     {
@@ -1301,7 +1305,7 @@
    int start_pc, int end_pc, int handler_pc, int catch_type)
 {
   _Jv_InterpMethod *method = reinterpret_cast<_Jv_InterpMethod *>
-    (def->interpreted_methods[method_index]);
+    (def_interp->interpreted_methods[method_index]);
   _Jv_InterpException *exc = method->exceptions ();
 
   exc[exc_index].start_pc.i     = start_pc;
@@ -1319,7 +1323,7 @@
       _Jv_Method *method = &def->methods[i];
       if ((method->accflags & Modifier::NATIVE) != 0)
 	{
-	  if (def->interpreted_methods[i] != 0)
+	  if (def_interp->interpreted_methods[i] != 0)
 	    throw_class_format_error ("code provided for native method");
 	  else
 	    {
@@ -1328,7 +1332,7 @@
 	      m->defining_class = def;
 	      m->self = method;
 	      m->function = NULL;
-	      def->interpreted_methods[i] = m;
+	      def_interp->interpreted_methods[i] = m;
 	      m->deferred = NULL;
 
 	      if ((method->accflags & Modifier::STATIC))
@@ -1344,12 +1348,12 @@
 	}
       else if ((method->accflags & Modifier::ABSTRACT) != 0)
 	{
-	  if (def->interpreted_methods[i] != 0)
+	  if (def_interp->interpreted_methods[i] != 0)
 	    throw_class_format_error ("code provided for abstract method");
 	}
       else
 	{
-	  if (def->interpreted_methods[i] == 0)
+	  if (def_interp->interpreted_methods[i] == 0)
 	    throw_class_format_error ("method with no code");
 	}
     }

Index: jni.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/jni.cc,v
retrieving revision 1.81
diff -u -r1.81 jni.cc
--- jni.cc	1 Feb 2004 20:05:02 -0000	1.81
+++ jni.cc	17 Apr 2004 00:16:56 -0000
@@ -633,7 +633,7 @@
       if (clazz->isInterface() || Modifier::isAbstract(clazz->getModifiers()))
 	env->ex = new java::lang::InstantiationException ();
       else
-	obj = JvAllocObject (clazz);
+	obj = _Jv_AllocObject (clazz);
     }
   catch (jthrowable t)
     {
Index: resolve.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/resolve.cc,v
retrieving revision 1.44
diff -u -r1.44 resolve.cc
--- resolve.cc	1 Apr 2004 17:07:03 -0000	1.44
+++ resolve.cc	17 Apr 2004 00:16:57 -0000
@@ -367,9 +367,9 @@
 // A helper for _Jv_PrepareClass.  This adds missing `Miranda methods'
 // to a class.
 void
-_Jv_PrepareMissingMethods (jclass base2, jclass iface_class)
+_Jv_PrepareMissingMethods (jclass base, jclass iface_class)
 {
-  _Jv_InterpClass *base = reinterpret_cast<_Jv_InterpClass *> (base2);
+  _Jv_InterpClass *interp_base = (_Jv_InterpClass *) base->aux_info;
   for (int i = 0; i < iface_class->interface_count; ++i)
     {
       for (int j = 0; j < iface_class->interfaces[i]->method_count; ++j)
@@ -403,11 +403,11 @@
 	      _Jv_MethodBase **new_im
 		= (_Jv_MethodBase **) _Jv_AllocBytes (sizeof (_Jv_MethodBase *)
 						      * new_count);
-	      memcpy (new_im, base->interpreted_methods,
+	      memcpy (new_im, interp_base->interpreted_methods,
 		      sizeof (_Jv_MethodBase *) * base->method_count);
 
 	      base->methods = new_m;
-	      base->interpreted_methods = new_im;
+	      interp_base->interpreted_methods = new_im;
 	      base->method_count = new_count;
 	    }
 	}
@@ -454,7 +454,7 @@
   if (klass->superclass)
     java::lang::VMClassLoader::resolveClass (klass->superclass);
 
-  _Jv_InterpClass *clz = (_Jv_InterpClass*)klass;
+  _Jv_InterpClass *iclass = (_Jv_InterpClass*)klass->aux_info;
 
   /************ PART ONE: OBJECT LAYOUT ***************/
 
@@ -462,7 +462,7 @@
   // superclasses and finding the maximum required alignment.  We
   // could consider caching this in the Class.
   int max_align = __alignof__ (java::lang::Object);
-  jclass super = clz->superclass;
+  jclass super = klass->superclass;
   while (super != NULL)
     {
       int num = JvNumInstanceFields (super);
@@ -484,23 +484,23 @@
   // Although java.lang.Object is never interpreted, an interface can
   // have a null superclass.  Note that we have to lay out an
   // interface because it might have static fields.
-  if (clz->superclass)
-    instance_size = clz->superclass->size();
+  if (klass->superclass)
+    instance_size = klass->superclass->size();
   else
     instance_size = java::lang::Object::class$.size();
 
-  for (int i = 0; i < clz->field_count; i++)
+  for (int i = 0; i < klass->field_count; i++)
     {
       int field_size;
       int field_align;
 
-      _Jv_Field *field = &clz->fields[i];
+      _Jv_Field *field = &klass->fields[i];
 
       if (! field->isRef ())
 	{
 	  // it's safe to resolve the field here, since it's 
 	  // a primitive class, which does not cause loading to happen.
-	  _Jv_ResolveField (field, clz->loader);
+	  _Jv_ResolveField (field, klass->loader);
 
 	  field_size = field->type->size ();
 	  field_align = get_alignment_from_class (field->type);
@@ -538,7 +538,7 @@
   // to the alignment required for this object; this keeps us in sync
   // with our current ABI.
   instance_size = ROUND (instance_size, max_align);
-  clz->size_in_bytes = instance_size;
+  klass->size_in_bytes = instance_size;
 
   // allocate static memory
   if (static_size != 0)
@@ -547,18 +547,18 @@
 
       memset (static_data, 0, static_size);
 
-      for (int i = 0; i < clz->field_count; i++)
+      for (int i = 0; i < klass->field_count; i++)
 	{
-	  _Jv_Field *field = &clz->fields[i];
+	  _Jv_Field *field = &klass->fields[i];
 
 	  if ((field->flags & Modifier::STATIC) != 0)
 	    {
 	      field->u.addr  = static_data + field->u.boffset;
-			    
-	      if (clz->field_initializers[i] != 0)
+	      
+	      if (iclass->field_initializers[i] != 0)
 		{
-		  _Jv_ResolveField (field, clz->loader);
-		  _Jv_InitField (0, clz, i);
+		  _Jv_ResolveField (field, klass->loader);
+		  _Jv_InitField (0, klass, i);
 		}
 	    }
 	}
@@ -566,31 +566,31 @@
       // now we don't need the field_initializers anymore, so let the
       // collector get rid of it!
 
-      clz->field_initializers = 0;
+      iclass->field_initializers = 0;
     }
 
   /************ PART TWO: VTABLE LAYOUT ***************/
 
   /* preparation: build the vtable stubs (even interfaces can)
      have code -- for static constructors. */
-  for (int i = 0; i < clz->method_count; i++)
+  for (int i = 0; i < klass->method_count; i++)
     {
-      _Jv_MethodBase *imeth = clz->interpreted_methods[i];
+      _Jv_MethodBase *imeth = iclass->interpreted_methods[i];
 
-      if ((clz->methods[i].accflags & Modifier::NATIVE) != 0)
+      if ((klass->methods[i].accflags & Modifier::NATIVE) != 0)
 	{
 	  // You might think we could use a virtual `ncode' method in
 	  // the _Jv_MethodBase and unify the native and non-native
 	  // cases.  Well, we can't, because we don't allocate these
 	  // objects using `new', and thus they don't get a vtable.
 	  _Jv_JNIMethod *jnim = reinterpret_cast<_Jv_JNIMethod *> (imeth);
-	  clz->methods[i].ncode = jnim->ncode ();
+	  klass->methods[i].ncode = jnim->ncode ();
 	}
       else if (imeth != 0)		// it could be abstract
 	{
 	  _Jv_InterpMethod *im = reinterpret_cast<_Jv_InterpMethod *> (imeth);
 	  _Jv_VerifyMethod (im);
-	  clz->methods[i].ncode = im->ncode ();
+	  klass->methods[i].ncode = im->ncode ();
 
 	  // Resolve ctable entries pointing to this method.  See
 	  // _Jv_Defer_Resolution.
@@ -598,16 +598,16 @@
 	  while (code)
 	    {
 	      void **target = (void **)*code;
-	      *code = clz->methods[i].ncode;
+	      *code = klass->methods[i].ncode;
 	      code = target;
 	    }
 	}
     }
 
-  if ((clz->accflags & Modifier::INTERFACE))
+  if ((klass->accflags & Modifier::INTERFACE))
     {
-      clz->state = JV_STATE_PREPARED;
-      clz->notifyAll ();
+      klass->state = JV_STATE_PREPARED;
+      klass->notifyAll ();
       return;
     }
 
@@ -619,15 +619,15 @@
   // this here by searching for such methods and constructing new
   // internal declarations for them.  We only need to do this for
   // abstract classes.
-  if ((clz->accflags & Modifier::ABSTRACT))
-    _Jv_PrepareMissingMethods (clz, clz);
+  if ((klass->accflags & Modifier::ABSTRACT))
+    _Jv_PrepareMissingMethods (klass, klass);
 
-  clz->vtable_method_count = -1;
-  _Jv_MakeVTable (clz);
+  klass->vtable_method_count = -1;
+  _Jv_MakeVTable (klass);
 
   /* wooha! we're done. */
-  clz->state = JV_STATE_PREPARED;
-  clz->notifyAll ();
+  klass->state = JV_STATE_PREPARED;
+  klass->notifyAll ();
 }
 
 /** Do static initialization for fields with a constant initializer */
@@ -642,18 +642,18 @@
   if (!_Jv_IsInterpretedClass (klass))
     return;
 
-  _Jv_InterpClass *clz = (_Jv_InterpClass*)klass;
+  _Jv_InterpClass *iclass = (_Jv_InterpClass*)klass->aux_info;
 
-  _Jv_Field * field = (&clz->fields[0]) + index;
+  _Jv_Field * field = (&klass->fields[0]) + index;
 
-  if (index > clz->field_count)
+  if (index > klass->field_count)
     throw_internal_error ("field out of range");
 
-  int init = clz->field_initializers[index];
+  int init = iclass->field_initializers[index];
   if (init == 0)
     return;
 
-  _Jv_Constants *pool = &clz->constants;
+  _Jv_Constants *pool = &klass->constants;
   int tag = pool->tags[init];
 
   if (! field->isResolved ())
@@ -673,12 +673,12 @@
     {
     case JV_CONSTANT_String:
       {
-	_Jv_MonitorEnter (clz);
+	_Jv_MonitorEnter (klass);
 	jstring str;
 	str = _Jv_NewStringUtf8Const (pool->data[init].utf8);
 	pool->data[init].string = str;
 	pool->tags[init] = JV_CONSTANT_ResolvedString;
-	_Jv_MonitorExit (clz);
+	_Jv_MonitorExit (klass);
       }
       /* fall through */
 
Index: include/java-interp.h
===================================================================
RCS file: /cvs/gcc/gcc/libjava/include/java-interp.h,v
retrieving revision 1.23
diff -u -r1.23 java-interp.h
--- include/java-interp.h	24 Oct 2003 09:29:42 -0000	1.23
+++ include/java-interp.h	17 Apr 2004 00:16:57 -0000
@@ -80,7 +79,7 @@
 {
 protected:
   // The class which defined this method.
-  _Jv_InterpClass *defining_class;
+  jclass defining_class;
 
   // The method description.
   _Jv_Method *self;
@@ -158,7 +156,7 @@
 #endif
 };
 
-class _Jv_InterpClass : public java::lang::Class
+class _Jv_InterpClass
 {
   _Jv_MethodBase **interpreted_methods;
   _Jv_ushort        *field_initializers;
@@ -185,13 +183,15 @@
 _Jv_Defer_Resolution (void *cl, _Jv_Method *meth, void **address)
 {
   int i;
-  _Jv_InterpClass *self = (_Jv_InterpClass *)cl;
+  jclass self = (jclass) cl;
+  _Jv_InterpClass *interp_cl = (_Jv_InterpClass*) self->aux_info;
+
   for (i = 0; i < self->method_count; i++)
     {
       _Jv_Method *m = &self->methods[i];
       if (m == meth)
 	{
-	  _Jv_MethodBase *imeth = self->interpreted_methods[i];
+	  _Jv_MethodBase *imeth = interp_cl->interpreted_methods[i];
 	  *address = imeth->deferred;
 	  imeth->deferred = address;
 	  return;

Index: java/lang/Class.h
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/Class.h,v
retrieving revision 1.64
diff -u -r1.64 Class.h
--- java/lang/Class.h	16 Apr 2004 16:27:19 -0000	1.64
+++ java/lang/Class.h	17 Apr 2004 00:16:58 -0000
@@ -449,6 +450,10 @@
   JArray<jobject> *hack_signers;
   // Used by Jv_PopClass and _Jv_PushClass to communicate with StackTrace.
   jclass chain;
+  // Identifier used to determine which JIT, interpreter, etc generated this class.
+  void *aux_id;
+  // Additional data, specific to the generator (JIT, native, interpreter) of this class.
+  void *aux_info;
 };
 
 #endif /* __JAVA_LANG_CLASS_H__ */

Index: java/lang/natClass.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/natClass.cc,v
retrieving revision 1.75
diff -u -r1.75 natClass.cc
--- java/lang/natClass.cc	23 Mar 2004 19:24:07 -0000	1.75
+++ java/lang/natClass.cc	17 Apr 2004 00:16:58 -0000
@@ -691,7 +691,7 @@
   if (! meth)
     throw new java::lang::InstantiationException (getName());
 
-  jobject r = JvAllocObject (this);
+  jobject r = _Jv_AllocObject (this);
   ((void (*) (jobject)) meth->ncode) (r);
   return r;
 }
@@ -1901,7 +1901,7 @@
       || (klass->accflags & Modifier::ABSTRACT))
     return;
 
-  //  out before we can create a vtable. 
+  // Class must be laid out before we can create a vtable. 
   if (klass->vtable_method_count == -1)
     _Jv_LayoutVTableMethods (klass);
 
Index: java/lang/natClassLoader.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/natClassLoader.cc,v
retrieving revision 1.64
diff -u -r1.64 natClassLoader.cc
--- java/lang/natClassLoader.cc	16 Jan 2004 23:54:22 -0000	1.64
+++ java/lang/natClassLoader.cc	17 Apr 2004 00:16:58 -0000
@@ -419,7 +419,7 @@
 _Jv_NewClass (_Jv_Utf8Const *name, jclass superclass,
 	      java::lang::ClassLoader *loader)
 {
-  jclass ret = (jclass) JvAllocObject (&java::lang::Class::class$);
+  jclass ret = (jclass) _Jv_AllocObject (&java::lang::Class::class$);
   ret->name = name;
   ret->superclass = superclass;
   ret->loader = loader;

Index: java/lang/natObject.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/natObject.cc,v
retrieving revision 1.29
diff -u -r1.29 natObject.cc
--- java/lang/natObject.cc	23 Oct 2003 21:48:36 -0000	1.29
+++ java/lang/natObject.cc	17 Apr 2004 00:16:59 -0000
@@ -98,7 +98,7 @@
 	throw new CloneNotSupportedException;
 
       size = klass->size();
-      r = JvAllocObject (klass, size);
+      r = _Jv_AllocObject (klass);
     }
 
   memcpy ((void *) r, (void *) this, size);

Index: java/lang/reflect/natMethod.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/reflect/natMethod.cc,v
retrieving revision 1.38
diff -u -r1.38 natMethod.cc
--- java/lang/reflect/natMethod.cc	14 Apr 2004 17:45:19 -0000	1.38
+++ java/lang/reflect/natMethod.cc	17 Apr 2004 00:16:59 -0000
@@ -379,7 +379,7 @@
   // the JDK 1.2 docs specify that the new object must be allocated
   // before argument conversions are done.
   if (is_constructor)
-    obj = JvAllocObject (return_type);
+    obj = _Jv_AllocObject (return_type);
 
   const int size_per_arg = sizeof(jvalue);
   ffi_cif cif;

Index: java/io/natObjectInputStream.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/io/natObjectInputStream.cc,v
retrieving revision 1.6
diff -u -r1.6 natObjectInputStream.cc
--- java/io/natObjectInputStream.cc	28 Feb 2003 11:38:56 -0000	1.6
+++ java/io/natObjectInputStream.cc	17 Apr 2004 00:24:10 -0000
@@ -38,7 +38,7 @@
 	obj = NULL;	
       else
 	{
-	  obj = JvAllocObject (klass);
+	  obj = _Jv_AllocObject (klass);
 	}
     }
   catch (jthrowable t)

Index: java/lang/natVMClassLoader.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/natVMClassLoader.cc,v
retrieving revision 1.1
diff -u -r1.1 natVMClassLoader.cc
--- java/lang/natVMClassLoader.cc	16 Jan 2004 23:54:22 -0000	1.1
+++ java/lang/natVMClassLoader.cc	17 Apr 2004 00:26:32 -0000
@@ -39,8 +39,8 @@
 {
 #ifdef INTERPRETER
   jclass klass;
-  klass = (jclass) JvAllocObject (&java::lang::Class::class$,
-				  sizeof (_Jv_InterpClass));
+  klass = new java::lang::Class ();
+  klass->aux_info = (void *) _Jv_AllocBytes (sizeof (_Jv_InterpClass));
 
   // Synchronize on the class, so that it is not attempted initialized
   // until we're done loading.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]