return mark_stack_ptr;
}
-// Return GC descriptor for interpreted class
-#ifdef INTERPRETER
-
+// Generate a GC marking descriptor for a class.
+//
// We assume that the gcj mark proc has index 0. This is a dubious assumption,
// since another one could be registered first. But the compiler also
// knows this, so in that case everything else will break, too.
/* FIXME: We should really look at the class and build the descriptor. */
return (void *)(GCJ_DEFAULT_DESCR);
}
-#endif
// Allocate some space that is known to be pointer-free.
void *
(void *)(2 * sizeof(void *)),
// descriptor; scan 2 words incl. vtable ptr.
// Least significant bits must be zero to
- // identify this as a lenght descriptor
+ // identify this as a length descriptor
{0} // First method
};
return GC_GCJ_MALLOC (size, &trace_one_vtable);
}
+// Ditto for two words.
+// the first field (beyond the fake vtable pointer) to be traced.
+// Eventually this should probably be generalized.
+
+static _Jv_VTable trace_two_vtable =
+{
+ 0, // class pointer
+ (void *)(3 * sizeof(void *)),
+ // descriptor; scan 3 words incl. vtable ptr.
+ {0} // First method
+};
+
+void *
+_Jv_AllocTraceTwo (jsize size /* includes vtable slot */)
+{
+ return GC_GCJ_MALLOC (size, &trace_two_vtable);
+}
+
#endif /* JV_HASH_SYNCHRONIZATION */
void
+_Jv_GCInitializeFinalizers (void (*notifier) (void))
+{
+ GC_finalize_on_demand = 1;
+ GC_finalizer_notifier = notifier;
+}
+
+void
_Jv_GCRegisterDisappearingLink (jobject *objp)
{
GC_general_register_disappearing_link ((GC_PTR *) objp, (GC_PTR) *objp);
}
jboolean
-_Jv_GCCanReclaimSoftReference (jobject obj)
+_Jv_GCCanReclaimSoftReference (jobject)
{
// For now, always reclaim soft references. FIXME.
return true;