diff options
author | Hans Boehm <Hans_Boehm@hp.com> | 2001-12-14 18:43:55 +0000 |
---|---|---|
committer | Hans Boehm <hboehm@gcc.gnu.org> | 2001-12-14 18:43:55 +0000 |
commit | 938f37772eae24bf9fd62530ed5f0bf0e43598ec (patch) | |
tree | 5f0133888c909558a79f8bc0aa5a45088a22f853 /libjava/include | |
parent | b6bfa8766be24c7e4064a386aa61caca54446f40 (diff) | |
download | gcc-938f37772eae24bf9fd62530ed5f0bf0e43598ec.zip gcc-938f37772eae24bf9fd62530ed5f0bf0e43598ec.tar.gz gcc-938f37772eae24bf9fd62530ed5f0bf0e43598ec.tar.bz2 |
prims.cc: Some old cleanups.
* 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.
From-SVN: r48002
Diffstat (limited to 'libjava/include')
-rw-r--r-- | libjava/include/jvm.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/libjava/include/jvm.h b/libjava/include/jvm.h index 1cba08c..57ba44f 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); }; |