Commit 4824d1bb by Bryce McKinlay Committed by Bryce McKinlay

boehm.cc: (_Jv_MarkObj...

2000-04-19  Bryce McKinlay  <bryce@albatross.co.nz>

	* boehm.cc: (_Jv_MarkObj, _Jv_MarkArray): Cast pointers for
	MAYBE_MARK to ptr_t, for compatibility with new GC version.

From-SVN: r33252
parent 93002327
2000-04-19 Bryce McKinlay <bryce@albatross.co.nz>
* boehm.cc: (_Jv_MarkObj, _Jv_MarkArray): Cast pointers for
MAYBE_MARK to ptr_t, for compatibility with new GC version.
2000-04-16 Bryce McKinlay <bryce@albatross.co.nz> 2000-04-16 Bryce McKinlay <bryce@albatross.co.nz>
* java/io/natFileDescriptorPosix.cc (open): Use mode 0666. Fix for PR * java/io/natFileDescriptorPosix.cc (open): Use mode 0666. Fix for PR
......
...@@ -92,11 +92,11 @@ _Jv_MarkObj (void *addr, void *msp, void *msl, void * /*env*/) ...@@ -92,11 +92,11 @@ _Jv_MarkObj (void *addr, void *msp, void *msl, void * /*env*/)
jclass klass = dt->clas; jclass klass = dt->clas;
// Every object has a sync_info pointer. // Every object has a sync_info pointer.
word w = (word) obj->sync_info; ptr_t p = (ptr_t) obj->sync_info;
MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, obj, o1label); MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, obj, o1label);
// Mark the object's class. // Mark the object's class.
w = (word) klass; p = (ptr_t) klass;
MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, obj, o2label); MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, obj, o2label);
if (klass == &ClassClass) if (klass == &ClassClass)
{ {
...@@ -106,36 +106,36 @@ _Jv_MarkObj (void *addr, void *msp, void *msl, void * /*env*/) ...@@ -106,36 +106,36 @@ _Jv_MarkObj (void *addr, void *msp, void *msl, void * /*env*/)
// The next field should probably not be marked, since this is // The next field should probably not be marked, since this is
// only used in the class hash table. Marking this field // only used in the class hash table. Marking this field
// basically prohibits class unloading. --Kresten // basically prohibits class unloading. --Kresten
w = (word) c->next; p = (ptr_t) c->next;
MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c2label); MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, c2label);
#endif #endif
w = (word) c->name; p = (ptr_t) c->name;
MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c3label); MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, c3label);
w = (word) c->superclass; p = (ptr_t) c->superclass;
MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c4label); MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, c4label);
for (int i = 0; i < c->constants.size; ++i) for (int i = 0; i < c->constants.size; ++i)
{ {
/* FIXME: We could make this more precise by using the tags -KKT */ /* FIXME: We could make this more precise by using the tags -KKT */
w = (word) c->constants.data[i].p; p = (ptr_t) c->constants.data[i].p;
MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c5label); MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, c5label);
} }
#ifdef INTERPRETER #ifdef INTERPRETER
if (_Jv_IsInterpretedClass (c)) if (_Jv_IsInterpretedClass (c))
{ {
w = (word) c->constants.tags; p = (ptr_t) c->constants.tags;
MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c5alabel); MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, c5alabel);
w = (word) c->constants.data; p = (ptr_t) c->constants.data;
MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c5blabel); MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, c5blabel);
} }
#endif #endif
// If the class is an array, then the methods field holds a // If the class is an array, then the methods field holds a
// pointer to the element class. If the class is primitive, // pointer to the element class. If the class is primitive,
// then the methods field holds a pointer to the array class. // then the methods field holds a pointer to the array class.
w = (word) c->methods; p = (ptr_t) c->methods;
MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c6label); MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, c6label);
if (! c->isArray() && ! c->isPrimitive()) if (! c->isArray() && ! c->isPrimitive())
...@@ -144,11 +144,11 @@ _Jv_MarkObj (void *addr, void *msp, void *msl, void * /*env*/) ...@@ -144,11 +144,11 @@ _Jv_MarkObj (void *addr, void *msp, void *msl, void * /*env*/)
// points to a methods structure. // points to a methods structure.
for (int i = 0; i < c->method_count; ++i) for (int i = 0; i < c->method_count; ++i)
{ {
w = (word) c->methods[i].name; p = (ptr_t) c->methods[i].name;
MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c,
cm1label); cm1label);
w = (word) c->methods[i].signature; p = (ptr_t) c->methods[i].signature;
MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c,
cm2label); cm2label);
// FIXME: `ncode' entry? // FIXME: `ncode' entry?
...@@ -158,8 +158,8 @@ _Jv_MarkObj (void *addr, void *msp, void *msl, void * /*env*/) ...@@ -158,8 +158,8 @@ _Jv_MarkObj (void *addr, void *msp, void *msl, void * /*env*/)
// trampoline here, so we'll mark it. // trampoline here, so we'll mark it.
if (_Jv_IsInterpretedClass (c)) if (_Jv_IsInterpretedClass (c))
{ {
w = (word) c->methods[i].ncode; p = (ptr_t) c->methods[i].ncode;
MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c,
cm3label); cm3label);
} }
#endif #endif
...@@ -167,25 +167,25 @@ _Jv_MarkObj (void *addr, void *msp, void *msl, void * /*env*/) ...@@ -167,25 +167,25 @@ _Jv_MarkObj (void *addr, void *msp, void *msl, void * /*env*/)
} }
// Mark all the fields. // Mark all the fields.
w = (word) c->fields; p = (ptr_t) c->fields;
MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c8label); MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, c8label);
for (int i = 0; i < c->field_count; ++i) for (int i = 0; i < c->field_count; ++i)
{ {
_Jv_Field* field = &c->fields[i]; _Jv_Field* field = &c->fields[i];
#ifndef COMPACT_FIELDS #ifndef COMPACT_FIELDS
w = (word) field->name; p = (ptr_t) field->name;
MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c8alabel); MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, c8alabel);
#endif #endif
w = (word) field->type; p = (ptr_t) field->type;
MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c8blabel); MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, c8blabel);
// For the interpreter, we also need to mark the memory // For the interpreter, we also need to mark the memory
// containing static members // containing static members
if (field->flags & 0x0008) if (field->flags & 0x0008)
{ {
w = (word) field->u.addr; p = (ptr_t) field->u.addr;
MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c8clabel); MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, c8clabel);
// also, if the static member is a reference, // also, if the static member is a reference,
// mark also the value pointed to. We check for isResolved // mark also the value pointed to. We check for isResolved
...@@ -194,42 +194,42 @@ _Jv_MarkObj (void *addr, void *msp, void *msl, void * /*env*/) ...@@ -194,42 +194,42 @@ _Jv_MarkObj (void *addr, void *msp, void *msl, void * /*env*/)
if (JvFieldIsRef (field) && field->isResolved()) if (JvFieldIsRef (field) && field->isResolved())
{ {
jobject val = *(jobject*) field->u.addr; jobject val = *(jobject*) field->u.addr;
w = (word) val; p = (ptr_t) val;
MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit,
c, c8elabel); c, c8elabel);
} }
} }
} }
w = (word) c->vtable; p = (ptr_t) c->vtable;
MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c9label); MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, c9label);
w = (word) c->interfaces; p = (ptr_t) c->interfaces;
MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, cAlabel); MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, cAlabel);
for (int i = 0; i < c->interface_count; ++i) for (int i = 0; i < c->interface_count; ++i)
{ {
w = (word) c->interfaces[i]; p = (ptr_t) c->interfaces[i];
MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, cClabel); MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, cClabel);
} }
w = (word) c->loader; p = (ptr_t) c->loader;
MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, cBlabel); MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, cBlabel);
#ifdef INTERPRETER #ifdef INTERPRETER
if (_Jv_IsInterpretedClass (c)) if (_Jv_IsInterpretedClass (c))
{ {
_Jv_InterpClass* ic = (_Jv_InterpClass*)c; _Jv_InterpClass* ic = (_Jv_InterpClass*)c;
w = (word) ic->interpreted_methods; p = (ptr_t) ic->interpreted_methods;
MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, ic, cElabel); MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, ic, cElabel);
for (int i = 0; i < c->method_count; i++) for (int i = 0; i < c->method_count; i++)
{ {
w = (word) ic->interpreted_methods[i]; p = (ptr_t) ic->interpreted_methods[i];
MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, ic, \ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, ic, \
cFlabel); cFlabel);
} }
w = (word) ic->field_initializers; p = (ptr_t) ic->field_initializers;
MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, ic, cGlabel); MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, ic, cGlabel);
} }
#endif #endif
...@@ -255,8 +255,8 @@ _Jv_MarkObj (void *addr, void *msp, void *msl, void * /*env*/) ...@@ -255,8 +255,8 @@ _Jv_MarkObj (void *addr, void *msp, void *msl, void * /*env*/)
if (JvFieldIsRef (field)) if (JvFieldIsRef (field))
{ {
jobject val = JvGetObjectField (obj, field); jobject val = JvGetObjectField (obj, field);
w = (word) val; p = (ptr_t) val;
MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit,
obj, elabel); obj, elabel);
} }
field = field->getNextField (); field = field->getNextField ();
...@@ -286,17 +286,17 @@ _Jv_MarkArray (void *addr, void *msp, void *msl, void * /*env*/) ...@@ -286,17 +286,17 @@ _Jv_MarkArray (void *addr, void *msp, void *msl, void * /*env*/)
jclass klass = dt->clas; jclass klass = dt->clas;
// Every object has a sync_info pointer. // Every object has a sync_info pointer.
word w = (word) array->sync_info; ptr_t p = (ptr_t) array->sync_info;
MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, array, e1label); MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, array, e1label);
// Mark the object's class. // Mark the object's class.
w = (word) klass; p = (ptr_t) klass;
MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, obj, o2label); MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, obj, o2label);
for (int i = 0; i < JvGetArrayLength (array); ++i) for (int i = 0; i < JvGetArrayLength (array); ++i)
{ {
jobject obj = elements (array)[i]; jobject obj = elements (array)[i];
w = (word) obj; p = (ptr_t) obj;
MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, array, e2label); MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, array, e2label);
} }
return mark_stack_ptr; return mark_stack_ptr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment