summaryrefslogtreecommitdiffstats
path: root/libjava/include/jvm.h
diff options
context:
space:
mode:
authorhboehm <hboehm@138bc75d-0d04-0410-961f-82ee72b054a4>2001-12-14 18:43:55 +0000
committerhboehm <hboehm@138bc75d-0d04-0410-961f-82ee72b054a4>2001-12-14 18:43:55 +0000
commit096c057426b1d823bea30f34d6d70504e63d74b5 (patch)
tree5f0133888c909558a79f8bc0aa5a45088a22f853 /libjava/include/jvm.h
parent56685c176771ca7cd558b6139655f9da1bf7a5b9 (diff)
downloadppe42-gcc-096c057426b1d823bea30f34d6d70504e63d74b5.tar.gz
ppe42-gcc-096c057426b1d823bea30f34d6d70504e63d74b5.zip
* libjava/prims.cc: Some old cleanups. The collector now
handles test for out of memory. * libjava/prims.cc, libjava/gcj/javaprims.h: (_Jv_AllocObjectNoInitNoFinalizer, _Jv_AllocObjectNoFinalizer): New functions for finalizer-free allocation. (jvmpi_notify_alloc): Became separate function. * libjava/java/lang/Object.h, libjava/include/jvm.h: Adjust for revised vtable layout on IA64. With TARGET_VTABLE_USES_DESCRIPTORS, there is only one extra descriptor. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@48002 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/include/jvm.h')
-rw-r--r--libjava/include/jvm.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/libjava/include/jvm.h b/libjava/include/jvm.h
index 1cba08cf675..57ba44fbfad 100644
--- a/libjava/include/jvm.h
+++ b/libjava/include/jvm.h
@@ -28,18 +28,12 @@ details. */
struct _Jv_VTable
{
#ifdef __ia64__
- jclass clas;
- unsigned long : 64;
- void *gc_descr;
- unsigned long : 64;
-
typedef struct { void *pc, *gp; } vtable_elt;
#else
- jclass clas;
- void *gc_descr;
-
typedef void *vtable_elt;
#endif
+ jclass clas;
+ void *gc_descr;
// This must be last, as derived classes "extend" this by
// adding new data members.
@@ -48,12 +42,20 @@ struct _Jv_VTable
#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 ((vtable_elt *)(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);
};
OpenPOWER on IntegriCloud