This is the mail archive of the
java-patches@sourceware.cygnus.com
mailing list for the Java project.
Patch: Imported boehm-gc 5.0alpha6
- To: java-patches at sourceware dot cygnus dot com
- Subject: Patch: Imported boehm-gc 5.0alpha6
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: Wed, 19 Apr 2000 22:23:26 +1200
I have imported gc 5.0alpha6 into libgcj. The new version obsoletes many
of our libgcj-local hacks (for example, it should now know to look at
data_start on linux systems). Rather than post the entire patch, I have
posted the remaining diffs against the stock gc distribution. The
changes in dyn_load.c are some minor typo fixes that I have sent back to
Hans.
Here's the list of changes from the gc's README file:
- GC_malloc_explicitly_typed and friends sometimes failed to
initialize first word.
- Added allocation routines and support in the marker for mark
descriptors
in a type structure referenced by the first word of an object. This
was
introduced to support gcj, but hopefully in a way that makes it
generically useful.
- Added GC_requested_heapsize, and inhibited collections in
nonincremental
mode if the actual used heap size is less than what was explicitly
requested.
- The Solaris pthreads version of GC_pthread_create didn't handle a
NULL
attribute pointer. Solaris thread support used the wrong default
thread
stack size. (Thanks to Melissa O'Neill for the patch.)
- Changed PUSH_CONTENTS macro to no longer modify first parameter.
This usually doesn't matter, but it was certainly an accident waiting
to happen ...
- Added GC_register_finalizer_no_order and friends to gc.h. They're
needed by Java implementations.
- Integrated a fix for a win32 deadlock resulting from clock() calling
malloc. (Thanks to Chris Dodd.)
- Integrated Hiroshi Kawashima's port to Linux/MIPS. This was designed
for a handheld platform, and may or may not be sufficient for other
machines.
- Fixed a va_arg problem with the %c specifier in cordprnt.c. It
appears
that this was always broken, but recent versions of gcc are the first
to
report the (statically detectable) bug.
- Added an attempt at a more general solution to dlopen
races/deadlocks.
GC_dlopen now temporarily disables collection. Still not ideal, but
...
- Added -DUSE_I686_PREFETCH, -DUSE_3DNOW_PREFETCH, and support for IA64
prefetch instructions. May improve performance measurably, but I'm
not
sure the code will run correctly on processors that don't support the
instruction. Won't build except with very recent gcc.
- Added caching for header lookups in the marker. This seems to result
in a barely measurable performance gain. Added support for
interleaved
lookups of two pointers, but unconfigured that since the performance
gain is currently near zero, and it adds to code size.
- Changed Linux DATA_START definition to check both data_start and
__data_start, since nothing else seems to be portable.
- Added -DUSE_LD_WRAP to optionally take advantage of the GNU ld
function
wrapping mechanism. Probably currently useful only on Linux.
- Moved some variables for the scratch allocator into GC_arrays, on
Martin Hirzel's suggestion.
- Fixed a win32 threads bug that caused the collector to not look for
interior pointers from one of the thread stacks without
ALL_INTERIOR_POINTERS. (Thanks to Jeff Sturm.)
- Added Mingw32 support. (Thanks again to Jeff Sturm for the patch.)
- Changed the alpha port to use the generic register scanning code
instead
of alpha_mach_dep.s. Alpha_mach_dep.s doesn't look for pointers in
fp
registers, but gcc sometimes spills pointers there. (Thanks to
Manuel Serrano
for helping me debug this by email.) Changed the IA64 code to do
something
similar for similar reasons.
2000-04-19 Bryce McKinlay <bryce@albatross.co.nz>
Imported version version 5.0alpha6.
* acinclude.m4: Bump version to 5.0a6.
* configure.in: Don't use alpha_mach_dep.s.
* include/private/config.h, irix_threads.c gc_watcom.asm: Delete
obsolete files.
Index: README
===================================================================
RCS file: /cvs/java/libgcj/boehm-gc/README,v
retrieving revision 1.1.1.4
diff -u -r1.1.1.4 README
--- README 2000/04/19 02:29:15 1.1.1.4
+++ README 2000/04/19 09:47:35
@@ -3,6 +3,9 @@
Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved.
Copyright (c) 1999 by Hewlett-Packard Company. All rights reserved.
+ [ This version of the collector modified by Cygnus Solutions.
+ See the file ChangeLog for details ]
+
THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
Index: alloc.c
===================================================================
RCS file: /cvs/java/libgcj/boehm-gc/alloc.c,v
retrieving revision 1.1.1.4
diff -u -r1.1.1.4 alloc.c
--- alloc.c 2000/04/19 02:29:14 1.1.1.4
+++ alloc.c 2000/04/19 09:47:36
@@ -112,6 +112,7 @@
unsigned long time_diff;
if ((count++ & 3) != 0) return(0);
+#ifndef NO_CLOCK
GET_TIME(current_time);
time_diff = MS_TIME_DIFF(current_time,GC_start_time);
if (time_diff >= TIME_LIMIT) {
@@ -122,6 +123,7 @@
# endif
return(1);
}
+#endif
return(0);
}
#endif /* !SMALL_CONFIG */
@@ -262,7 +264,9 @@
/* We try to mark with the world stopped. */
/* If we run out of time, this turns into */
/* incremental marking. */
+#ifndef NO_CLOCK
GET_TIME(GC_start_time);
+#endif
if (GC_stopped_mark(GC_timeout_stop_func)) {
# ifdef SAVE_CALL_CHAIN
GC_save_callers(GC_last_stack);
Index: dbg_mlc.c
===================================================================
RCS file: /cvs/java/libgcj/boehm-gc/dbg_mlc.c,v
retrieving revision 1.1.1.4
diff -u -r1.1.1.4 dbg_mlc.c
--- dbg_mlc.c 2000/04/19 02:29:14 1.1.1.4
+++ dbg_mlc.c 2000/04/19 09:47:36
@@ -333,6 +333,35 @@
return (GC_store_debug_info(result, (word)lb, s, (word)i));
}
+# ifdef __STDC__
+ GC_PTR GC_debug_generic_malloc(size_t lb, int k, GC_EXTRA_PARAMS)
+# else
+ GC_PTR GC_debug_malloc(lb, k, s, i)
+ size_t lb;
+ int k;
+ char * s;
+ int i;
+# ifdef GC_ADD_CALLER
+ --> GC_ADD_CALLER not implemented for K&R C
+# endif
+# endif
+{
+ GC_PTR result = GC_generic_malloc(lb + DEBUG_BYTES, k);
+
+ if (result == 0) {
+ GC_err_printf1("GC_debug_malloc(%ld) returning NIL (",
+ (unsigned long) lb);
+ GC_err_puts(s);
+ GC_err_printf1(":%ld)\n", (unsigned long)i);
+ return(0);
+ }
+ if (!GC_debugging_started) {
+ GC_start_debugging();
+ }
+ ADD_CALL_CHAIN(result, ra);
+ return (GC_store_debug_info(result, (word)lb, s, (word)i));
+}
+
#ifdef STUBBORN_ALLOC
# ifdef __STDC__
GC_PTR GC_debug_malloc_stubborn(size_t lb, GC_EXTRA_PARAMS)
Index: dyn_load.c
===================================================================
RCS file: /cvs/java/libgcj/boehm-gc/dyn_load.c,v
retrieving revision 1.1.1.4
diff -u -r1.1.1.4 dyn_load.c
--- dyn_load.c 2000/04/19 02:29:14 1.1.1.4
+++ dyn_load.c 2000/04/19 09:47:37
@@ -161,14 +161,6 @@
#endif /* SUNOS4 ... */
-# if defined(SUNOS4) || defined(SUNOS5DL)
-/* Add dynamic library data sections to the root set. */
-# if !defined(PCR) && !defined(SOLARIS_THREADS) && defined(THREADS)
-# ifndef SRC_M3
- --> fix mutual exclusion with dlopen
-# endif /* We assume M3 programs don't call dlopen for now */
-# endif
-
# if defined(LINUX_THREADS) || defined(SOLARIS_THREADS) \
|| defined(HPUX_THREADS) || defined(IRIX_THREADS)
/* Make sure we're not in the middle of a collection, and make */
@@ -187,7 +179,7 @@
GC_bool result;
LOCK();
result = GC_dont_gc;
- while (GC_incremental && GC_collection_inProgress()) {
+ while (GC_incremental && GC_collection_in_progress()) {
GC_collect_a_little_inner(1000);
}
GC_dont_gc = TRUE;
@@ -195,7 +187,6 @@
return(result);
}
-
/* Redefine dlopen to guarantee mutual exclusion with */
/* GC_register_dynamic_libraries. */
/* Should probably happen for other operating systems, too. */
@@ -231,6 +222,14 @@
/* BTL: added to fix circular dlopen definition if SOLARIS_THREADS defined */
# if defined(GC_must_restore_redefined_dlopen)
# define dlopen GC_dlopen
+# endif
+
+# if defined(SUNOS4) || defined(SUNOS5DL)
+/* Add dynamic library data sections to the root set. */
+# if !defined(PCR) && !defined(SOLARIS_THREADS) && defined(THREADS)
+# ifndef SRC_M3
+ --> fix mutual exclusion with dlopen
+# endif /* We assume M3 programs don't call dlopen for now */
# endif
# ifndef USE_PROC_FOR_LIBRARIES
Index: gc_priv.h
===================================================================
RCS file: /cvs/java/libgcj/boehm-gc/gc_priv.h,v
retrieving revision 1.1.1.4
diff -u -r1.1.1.4 gc_priv.h
--- gc_priv.h 2000/04/19 02:29:15 1.1.1.4
+++ gc_priv.h 2000/04/19 09:47:37
@@ -1762,6 +1762,10 @@
/* P points to somewhere inside an object with */
/* debugging info. Print a human readable */
/* description of the object to stderr. */
+ptr_t GC_debug_object_start(/* ptr_t p */);
+ /* P points to the start of an object that may */
+ /* have debug info at its head. Return the */
+ /* start of the real data. */
extern void (*GC_check_heap)();
/* Check that all objects in the heap with */
/* debugging info are intact. Print */
Index: gcconfig.h
===================================================================
RCS file: /cvs/java/libgcj/boehm-gc/gcconfig.h,v
retrieving revision 1.1.1.3
diff -u -r1.1.1.3 gcconfig.h
--- gcconfig.h 2000/04/19 02:29:15 1.1.1.3
+++ gcconfig.h 2000/04/19 09:47:37
@@ -735,7 +735,9 @@
/* address space limit, and hence initial SP to 0x80000000. */
# endif
# if !defined(LINUX_THREADS) || !defined(REDIRECT_MALLOC)
-# define MPROTECT_VDB
+ /* libgcj: Linux threads don't interact well with the read() wrapper.
+ Not defining MPROTECT_VDB fixes this. */
+/* # define MPROTECT_VDB */
# else
/* We seem to get random errors in incremental mode, */
/* possibly because Linux threads is itself a malloc client */
@@ -897,7 +899,13 @@
# endif
# ifdef MIPS
+# ifndef ECOS
# define MACH_TYPE "MIPS"
+ /* LIBGCJ LOCAL: respect predefined DATASTART_IS_ETEXT. */
+# ifdef DATASTART_IS_ETEXT
+ extern int _etext;
+# define DATASTART ((ptr_t)(&_etext))
+# else
/* # define STACKBOTTOM ((ptr_t)0x7fff8000) sometimes also works. */
# ifdef LINUX
/* This was developed for a linuxce style platform. Probably */
@@ -954,6 +962,19 @@
# endif
# define DYNAMIC_LOADING
# endif
+# endif /* DATASTART_IS_ETEXT */
+# endif /* ECOS */
+# ifdef ECOS
+ extern char __ram_data_start;
+ extern char __ram_data_end;
+# define MACH_TYPE "MIPS"
+# define DATASTART (ptr_t)(&__ram_data_start)
+# define DATAEND (ptr_t)(&__ram_data_end)
+
+# define HEURISTIC2
+# define ALIGNMENT 4
+# define ALIGN_DOUBLE
+# endif /* ECOS */
# endif
# ifdef RS6000
@@ -1037,7 +1058,7 @@
# endif
extern int _end;
# define DATAEND (&_end)
-# define MPROTECT_VDB
+# undef MPROTECT_VDB
/* Has only been superficially tested. May not */
/* work on all versions. */
# endif
Index: linux_threads.c
===================================================================
RCS file: /cvs/java/libgcj/boehm-gc/linux_threads.c,v
retrieving revision 1.1.1.4
diff -u -r1.1.1.4 linux_threads.c
--- linux_threads.c 2000/04/19 02:29:15 1.1.1.4
+++ linux_threads.c 2000/04/19 09:47:38
@@ -196,6 +196,7 @@
# ifdef NO_SIGNALS
if (sigdelset(&mask, SIGINT) != 0) ABORT("sigdelset() failed");
if (sigdelset(&mask, SIGQUIT) != 0) ABORT("sigdelset() failed");
+ if (sigdelset(&mask, SIGTERM) != 0) ABORT("sigdelset() failed");
# endif
do {
me->signal = 0;
@@ -474,9 +475,11 @@
if (sigfillset(&act.sa_mask) != 0) {
ABORT("sigfillset() failed");
}
+
# ifdef NO_SIGNALS
if (sigdelset(&act.sa_mask, SIGINT) != 0
- || sigdelset(&act.sa_mask, SIGQUIT != 0)) {
+ || sigdelset(&act.sa_mask, SIGQUIT != 0)
+ || sigdelset(&act.sa_mask, SIGTERM != 0)) {
ABORT("sigdelset() failed");
}
# endif
Index: mark.c
===================================================================
RCS file: /cvs/java/libgcj/boehm-gc/mark.c,v
retrieving revision 1.1.1.4
diff -u -r1.1.1.4 mark.c
--- mark.c 2000/04/19 02:29:14 1.1.1.4
+++ mark.c 2000/04/19 09:47:38
@@ -504,6 +504,9 @@
case DS_PROC:
GC_mark_stack_top_reg--;
credit -= PROC_BYTES;
+#ifdef GC_DEBUG
+ current_p = GC_debug_object_start(current_p);
+#endif
GC_mark_stack_top_reg =
(*PROC(descr))
(current_p, GC_mark_stack_top_reg,
Index: mips_sgi_mach_dep.s
===================================================================
RCS file: /cvs/java/libgcj/boehm-gc/mips_sgi_mach_dep.s,v
retrieving revision 1.1.1.1
retrieving revision 1.3
diff -u -r1.1.1.1 -r1.3
--- mips_sgi_mach_dep.s 1999/04/07 14:56:06 1.1.1.1
+++ mips_sgi_mach_dep.s 1999/07/31 23:50:05 1.3
@@ -3,6 +3,7 @@
# define call_push(x) move $4,x; jal GC_push_one
+ .option pic2
.text
/* Mark from machine registers that are saved by C compiler */
# define FRAMESZ 32
Index: misc.c
===================================================================
RCS file: /cvs/java/libgcj/boehm-gc/misc.c,v
retrieving revision 1.1.1.4
diff -u -r1.1.1.4 misc.c
--- misc.c 2000/04/19 02:29:14 1.1.1.4
+++ misc.c 2000/04/19 09:47:38
@@ -59,6 +59,10 @@
# endif
# endif
+#ifdef ECOS
+#undef STACKBASE
+#endif
+
GC_FAR struct _GC_arrays GC_arrays /* = { 0 } */;
@@ -670,7 +674,7 @@
# endif
#endif
-#if !defined(MSWIN32) && !defined(OS2) && !defined(MACOS)
+#if !defined(MSWIN32) && !defined(OS2) && !defined(MACOS) && !defined(ECOS)
int GC_write(fd, buf, len)
int fd;
char *buf;
@@ -692,6 +696,15 @@
return(bytes_written);
}
#endif /* UN*X */
+
+#if defined(ECOS)
+int GC_write(fd, buf, len)
+{
+ _Jv_diag_write (buf, len);
+ return len;
+}
+#endif
+
#ifdef MSWIN32
# define WRITE(f, buf, len) (GC_set_files(), \
Index: os_dep.c
===================================================================
RCS file: /cvs/java/libgcj/boehm-gc/os_dep.c,v
retrieving revision 1.1.1.4
diff -u -r1.1.1.4 os_dep.c
--- os_dep.c 2000/04/19 02:29:14 1.1.1.4
+++ os_dep.c 2000/04/19 09:47:38
@@ -161,6 +161,39 @@
}
#endif
+# ifdef ECOS
+
+# ifndef ECOS_GC_MEMORY_SIZE
+# define ECOS_GC_MEMORY_SIZE (448 * 1024)
+# endif /* ECOS_GC_MEMORY_SIZE */
+
+// setjmp() function, as described in ANSI para 7.6.1.1
+#define setjmp( __env__ ) hal_setjmp( __env__ )
+
+// FIXME: This is a simple way of allocating memory which is
+// compatible with ECOS early releases. Later releases use a more
+// sophisticated means of allocating memory than this simple static
+// allocator, but this method is at least bound to work.
+static char memory[ECOS_GC_MEMORY_SIZE];
+static char *brk = memory;
+
+static void *tiny_sbrk(ptrdiff_t increment)
+{
+ void *p = brk;
+
+ brk += increment;
+
+ if (brk > memory + sizeof memory)
+ {
+ brk -= increment;
+ return NULL;
+ }
+
+ return p;
+}
+#define sbrk tiny_sbrk
+# endif /* ECOS */
+
# ifdef OS2
# include <stddef.h>
@@ -265,7 +298,8 @@
# else
# if !defined(PCR) && !defined(AMIGA) && !defined(MSWIN32) \
- && !defined(MACOS) && !defined(DJGPP) && !defined(DOS4GW)
+ && !defined(MACOS) && !defined(DJGPP) && !defined(DOS4GW) \
+ && !defined(NO_SIGSET)
# if defined(sigmask) && !defined(UTS4)
/* Use the traditional BSD interface */
@@ -340,7 +374,7 @@
# endif /*!OS/2 */
/* Ivan Demakov: simplest way (to me) */
-#ifdef DOS4GW
+#if defined (DOS4GW) || defined (NO_SIGSET)
void GC_disable_signals() { }
void GC_enable_signals() { }
#endif
@@ -511,6 +545,7 @@
void GC_setup_temporary_fault_handler()
{
+# ifndef ECOS
# if defined(SUNOS5SIGS) || defined(IRIX5) || defined(OSF1)
struct sigaction act;
@@ -544,10 +579,12 @@
old_bus_handler = signal(SIGBUS, GC_fault_handler);
# endif
# endif
+# endif /* ECOS */
}
void GC_reset_fault_handler()
{
+# ifndef ECOS
# if defined(SUNOS5SIGS) || defined(IRIX5) || defined(OSF1)
(void) sigaction(SIGSEGV, &old_segv_act, 0);
# if defined(IRIX5) && defined(_sigargs) /* Irix 5.x, not 6.x */ \
@@ -560,6 +597,7 @@
(void) signal(SIGBUS, old_bus_handler);
# endif
# endif
+# endif /* ECOS */
}
/* Return the first nonaddressible location > p (up) or */
@@ -568,6 +606,7 @@
ptr_t p;
GC_bool up;
{
+# ifndef ECOS
static VOLATILE ptr_t result;
/* Needs to be static, since otherwise it may not be */
/* preserved across the longjmp. Can safely be */
@@ -593,9 +632,14 @@
result += MIN_PAGE_SIZE;
}
return(result);
+# else /* ECOS */
+ abort();
+# endif /* ECOS */
}
# endif
+# ifndef ECOS
+
#ifdef LINUX_STACKBOTTOM
# define STAT_SKIP 27 /* Number of fields preceding startstack */
@@ -636,6 +680,10 @@
# define STACKBOTTOM_ALIGNMENT_M1 ((word)STACK_GRAN - 1)
+# if defined(STACKBASE)
+ extern ptr_t STACKBASE;
+ return(STACKBASE);
+# else
# ifdef STACKBOTTOM
return(STACKBOTTOM);
# else
@@ -677,7 +725,9 @@
# endif
return(result);
# endif /* STACKBOTTOM */
+# endif /* STACKBASE */
}
+# endif /* ECOS */
# endif /* ! AMIGA */
# endif /* ! OS2 */
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.
Index: boehm.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/boehm.cc,v
retrieving revision 1.16
diff -u -r1.16 boehm.cc
--- boehm.cc 2000/04/02 15:34:17 1.16
+++ boehm.cc 2000/04/19 09:59:40
@@ -92,11 +92,11 @@
jclass klass = dt->clas;
// Every object has a sync_info pointer.
- word w = (word) obj->sync_info;
- MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, obj, o1label);
+ ptr_t p = (ptr_t) obj->sync_info;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, obj, o1label);
// Mark the object's class.
- w = (word) klass;
- MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, obj, o2label);
+ p = (ptr_t) klass;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, obj, o2label);
if (klass == &ClassClass)
{
@@ -106,36 +106,36 @@
// The next field should probably not be marked, since this is
// only used in the class hash table. Marking this field
// basically prohibits class unloading. --Kresten
- w = (word) c->next;
- MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c2label);
+ p = (ptr_t) c->next;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, c2label);
#endif
- w = (word) c->name;
- MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c3label);
- w = (word) c->superclass;
- MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c4label);
+ p = (ptr_t) c->name;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, c3label);
+ p = (ptr_t) c->superclass;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, c4label);
for (int i = 0; i < c->constants.size; ++i)
{
/* FIXME: We could make this more precise by using the tags -KKT */
- w = (word) c->constants.data[i].p;
- MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c5label);
+ p = (ptr_t) c->constants.data[i].p;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, c5label);
}
#ifdef INTERPRETER
if (_Jv_IsInterpretedClass (c))
{
- w = (word) c->constants.tags;
- MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c5alabel);
- w = (word) c->constants.data;
- MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c5blabel);
+ p = (ptr_t) c->constants.tags;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, c5alabel);
+ p = (ptr_t) c->constants.data;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, c5blabel);
}
#endif
// If the class is an array, then the methods field holds a
// pointer to the element class. If the class is primitive,
// then the methods field holds a pointer to the array class.
- w = (word) c->methods;
- MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c6label);
+ p = (ptr_t) c->methods;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, c6label);
if (! c->isArray() && ! c->isPrimitive())
@@ -144,11 +144,11 @@
// points to a methods structure.
for (int i = 0; i < c->method_count; ++i)
{
- w = (word) c->methods[i].name;
- MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c,
+ p = (ptr_t) c->methods[i].name;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c,
cm1label);
- w = (word) c->methods[i].signature;
- MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c,
+ p = (ptr_t) c->methods[i].signature;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c,
cm2label);
// FIXME: `ncode' entry?
@@ -158,8 +158,8 @@
// trampoline here, so we'll mark it.
if (_Jv_IsInterpretedClass (c))
{
- w = (word) c->methods[i].ncode;
- MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c,
+ p = (ptr_t) c->methods[i].ncode;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c,
cm3label);
}
#endif
@@ -167,25 +167,25 @@
}
// Mark all the fields.
- w = (word) c->fields;
- MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c8label);
+ p = (ptr_t) c->fields;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, c8label);
for (int i = 0; i < c->field_count; ++i)
{
_Jv_Field* field = &c->fields[i];
#ifndef COMPACT_FIELDS
- w = (word) field->name;
- MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c8alabel);
+ p = (ptr_t) field->name;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, c8alabel);
#endif
- w = (word) field->type;
- MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c8blabel);
+ p = (ptr_t) field->type;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, c8blabel);
// For the interpreter, we also need to mark the memory
// containing static members
if (field->flags & 0x0008)
{
- w = (word) field->u.addr;
- MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c8clabel);
+ p = (ptr_t) field->u.addr;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, c8clabel);
// also, if the static member is a reference,
// mark also the value pointed to. We check for isResolved
@@ -194,42 +194,42 @@
if (JvFieldIsRef (field) && field->isResolved())
{
jobject val = *(jobject*) field->u.addr;
- w = (word) val;
- MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit,
+ p = (ptr_t) val;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit,
c, c8elabel);
}
}
}
- w = (word) c->vtable;
- MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c9label);
- w = (word) c->interfaces;
- MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, cAlabel);
+ p = (ptr_t) c->vtable;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, c9label);
+ p = (ptr_t) c->interfaces;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, cAlabel);
for (int i = 0; i < c->interface_count; ++i)
{
- w = (word) c->interfaces[i];
- MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, cClabel);
+ p = (ptr_t) c->interfaces[i];
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, cClabel);
}
- w = (word) c->loader;
- MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, cBlabel);
+ p = (ptr_t) c->loader;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, cBlabel);
#ifdef INTERPRETER
if (_Jv_IsInterpretedClass (c))
{
_Jv_InterpClass* ic = (_Jv_InterpClass*)c;
- w = (word) ic->interpreted_methods;
- MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, ic, cElabel);
+ p = (ptr_t) ic->interpreted_methods;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, ic, cElabel);
for (int i = 0; i < c->method_count; i++)
{
- w = (word) ic->interpreted_methods[i];
- MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, ic, \
+ p = (ptr_t) ic->interpreted_methods[i];
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, ic, \
cFlabel);
}
- w = (word) ic->field_initializers;
- MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, ic, cGlabel);
+ p = (ptr_t) ic->field_initializers;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, ic, cGlabel);
}
#endif
@@ -255,8 +255,8 @@
if (JvFieldIsRef (field))
{
jobject val = JvGetObjectField (obj, field);
- w = (word) val;
- MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit,
+ p = (ptr_t) val;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit,
obj, elabel);
}
field = field->getNextField ();
@@ -286,17 +286,17 @@
jclass klass = dt->clas;
// Every object has a sync_info pointer.
- word w = (word) array->sync_info;
- MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, array, e1label);
+ ptr_t p = (ptr_t) array->sync_info;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, array, e1label);
// Mark the object's class.
- w = (word) klass;
- MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, obj, o2label);
+ p = (ptr_t) klass;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, obj, o2label);
for (int i = 0; i < JvGetArrayLength (array); ++i)
{
jobject obj = elements (array)[i];
- w = (word) obj;
- MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, array, e2label);
+ p = (ptr_t) obj;
+ MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, array, e2label);
}
return mark_stack_ptr;