OSDN Git Service

Allow SImode values to be assigned to the stack pointer.
[pf3gnuchains/gcc-fork.git] / libjava / boehm.cc
index 19b58ba..4dc60fc 100644 (file)
@@ -319,9 +319,8 @@ _Jv_MarkArray (void *addr, void *msp, void *msl, void * /*env*/)
   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.
@@ -332,7 +331,6 @@ _Jv_BuildGCDescr(jclass)
   /* 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 *
@@ -531,7 +529,7 @@ static _Jv_VTable trace_one_vtable = {
     (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
 };
 
@@ -541,16 +539,41 @@ _Jv_AllocTraceOne (jsize size /* includes vtable slot */)
   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;