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]

Re: PATCH: Reduce allocation overhead, fix IA64 GC descriptors


>>>>> "Hans" == Boehm, Hans <hans_boehm@hp.com> writes:

Tom> Another choice would be to add a third allocation entry point:
Tom> allocate when we know a finalizer is required.

Hans> That could be done.  I'm not sure it's worth optimizing this
Hans> case.

Ok.

Hans> [ ChangeLog entry ]
Hans> How's this:

That's better, thanks.  I'll fix up the formatting stuff.

Hans> To clarify (at the risk of reciting the obvious): On IA64, a
Hans> function descriptor is a struct containing the pc (the address
Hans> of the first instruction), and gp (the required global offset
Hans> table pointer when running the function, set up by the caller).
Hans> Function pointers are pointers to such a struct.

Ok, thanks.  I wasn't aware of this.  My knowledge of low-level IA-64
stuff is nonexistent.

Hans> I don't think there's any need to compare gp values to check
Hans> function equality; a given instruction sequence will need a
Hans> fixed global offset table pointer.

Ok.

Hans> I think you really want to check the (first word of) the
Hans> finalizer entry in the vtable, not the class pointer.

Ok.

I'd prefer to have the ia64-specific vtable code isolated in
_Jv_VTable as much as possible.

How does the appended look?

As I understand it the different parts of your patch are separable.
Let's get the parts that don't require compiler changes in separately.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* include/jvm.h (_Jv_VTable::get_finalizer): Now conditional on
	__ia64__.

Index: include/jvm.h
===================================================================
RCS file: /cvs/gcc/gcc/libjava/include/jvm.h,v
retrieving revision 1.45
diff -u -r1.45 jvm.h
--- include/jvm.h 2001/10/23 05:42:03 1.45
+++ include/jvm.h 2001/11/22 20:42:33
@@ -48,12 +48,20 @@
 #ifdef __ia64__
   void *get_method(int i) { return &method[i]; }
   void set_method(int i, void *fptr) { method[i] = *(vtable_elt *)fptr; }
+  void *get_finalizer()
+  {
+    // We know that get_finalizer is only used for checking whether
+    // this object needs to have a finalizer registered.  So it is
+    // safe to simply return just the PC component of the vtable
+    // slot.
+    return get_method(0)->pc;
+  }
 #else
   void *get_method(int i) { return method[i]; }
   void set_method(int i, void *fptr) { method[i] = fptr; }
+  void *get_finalizer() { return get_method(0); }
 #endif
 
-  void *get_finalizer() { return get_method(0); }
   static size_t vtable_elt_size() { return sizeof(vtable_elt); }
   static _Jv_VTable *new_vtable (int count);
 };


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