* src/mm/cacao-gc/rootset.c (rootset_resize) Added.
* src/mm/cacao-gc/copy.c: Adapted to above changes.
* src/mm/cacao-gc/heap.c: Likewise.
* src/mm/cacao-gc/compact.c: Likewise.
* src/mm/cacao-gc/mark.c: Likewise.
--HG--
branch : exact-gc
for (i = 0; i < rs->refcount; i++) {
/* load the reference */
- refptr = rs->refs[i];
+ refptr = rs->refs[i].ref;
ref = *( refptr );
GC_LOG2( printf("\troot pointer to %p\n", (void *) ref); );
for (i = 0; i < rs->refcount; i++) {
/* load the root reference */
- ref = *( rs->refs[i] );
+ ref = *( rs->refs[i].ref );
/* forward the object */
- GC_FORWARD(ref, rs->refs[i], src->base, src->end);
+ GC_FORWARD(ref, rs->refs[i].ref, src->base, src->end);
}
for (i = 0; i < rs->refcount; i++) {
/* load the reference */
- refptr = rs->refs[i];
+ refptr = rs->refs[i].ref;
ref = *( refptr );
GC_LOG2( printf("\troot pointer to %p\n", (void *) ref); );
for (i = 0; i < rs->refcount; i++) {
/* is this a marking reference? */
- if (!rs->ref_marks[i])
+ if (!rs->refs[i].marks)
continue;
/* load the reference */
- ref = *( rs->refs[i] );
+ ref = *( rs->refs[i].ref );
/* check for outside or null pointers */
if (!POINTS_INTO(ref, start, end))
{
rootset_t *rs;
+ /* allocate memory for rootset */
rs = DNEW(rootset_t);
rs->next = NULL;
+ rs->capacity = ROOTSET_INITIAL_CAPACITY;
rs->refcount = 0;
return rs;
}
+rootset_t *rootset_resize(rootset_t *rs)
+{
+ s4 size_old;
+ s4 size_new;
+
+ /* double the capacity of this rootset */
+ size_old = sizeof(rootset_t) + (rs->capacity - ROOTSET_INITIAL_CAPACITY) * sizeof(rootset_entry_t);
+ rs->capacity *= 2;
+ size_new = sizeof(rootset_t) + (rs->capacity - ROOTSET_INITIAL_CAPACITY) * sizeof(rootset_entry_t);
+
+ GC_LOG2( printf("Resizing rootset to capacity %d (%d -> %d)\n", rs->capacity, size_old, size_new); );
+
+ /* reallocate memory for rootset */
+ /* XXX DMREALLOC(ptr,type,num1,num2) */
+ rs = DMREALLOC(rs, u1, size_old, size_new);
+
+ return rs;
+}
+
+
/* rootset_from_globals ********************************************************
Searches global variables to compile the global root set out of references
*******************************************************************************/
-#define ROOTSET_ADD(adr,marks,type) \
- GC_ASSERT(refcount < RS_REFS); /* TODO: UGLY!!! */ \
- rs->refs[refcount] = (adr); \
- rs->ref_marks[refcount] = (marks); \
- rs->ref_type[refcount] = (type); \
+#define ROOTSET_ADD(adr,mrk,tp) \
+ if (refcount >= rs->capacity) \
+ rs = rootset_resize(rs); \
+ rs->refs[refcount].ref = (adr); \
+ rs->refs[refcount].marks = (mrk); \
+ rs->refs[refcount].type = (tp); \
refcount++;
-void rootset_from_globals(rootset_t *rs)
+static rootset_t *rootset_from_globals(rootset_t *rs)
{
list_final_entry_t *fe;
list_gcref_entry_t *re;
/* remeber how many references there are inside this root set */
rs->refcount = refcount;
+ return rs;
}
-void rootset_from_classes(rootset_t *rs)
+static rootset_t *rootset_from_classes(rootset_t *rs)
{
classinfo *c;
fieldinfo *f;
/* remeber how many references there are inside this root set */
rs->refcount = refcount;
+ return rs;
}
*******************************************************************************/
-void rootset_from_thread(threadobject *thread, rootset_t *rs)
+static rootset_t *rootset_from_thread(threadobject *thread, rootset_t *rs)
{
executionstate_t *es;
sourcestate_t *ss;
/* remeber how many references there are inside this root set */
rs->refcount = refcount;
+ return rs;
}
/* find the global rootset ... */
rs_top = rootset_create();
- rootset_from_globals(rs_top);
- rootset_from_classes(rs_top);
+ rs_top = rootset_from_globals(rs_top);
+ rs_top = rootset_from_classes(rs_top);
/* ... and the rootsets for the threads */
rs = rs_top;
#if defined(ENABLE_THREADS)
for (thread = threads_list_first(); thread != NULL; thread = threads_list_next(thread)) {
rs->next = rootset_create();
- rs = rs->next;
+ rs->next = rootset_from_thread(thread, rs->next);
- rootset_from_thread(thread, rs);
+ rs = rs->next;
}
#else
thread = THREADOBJECT;
rs->next = rootset_create();
- rs = rs->next;
-
- rootset_from_thread(thread, rs);
+ rs->next = rootset_from_thread(thread, rs->next);
#endif
return rs_top;
/* Debugging ******************************************************************/
#if !defined(NDEBUG)
-const char* ref_type_names[] = {
+static const char* ref_type_names[] = {
"XXXXXX", "REGIST", "CLASSL",
"GLOBAL", "FINAL ", "LOCAL ",
"STACK ", "STATIC"
}
/* print the references in this rootset */
- printf("\tReferences (%d):\n", rs->refcount);
+ printf("\tReferences (%d / %d):\n", rs->refcount, rs->capacity);
for (i = 0; i < rs->refcount; i++) {
- o = *( rs->refs[i] );
+ o = *( rs->refs[i].ref );
/*printf("\t\tReference at %p points to ...\n", (void *) rs->refs[i]);*/
printf("\t\t");
- printf("%s ", ref_type_names[rs->ref_type[i]]);
- if (rs->ref_marks[i])
+ printf("%s ", ref_type_names[rs->refs[i].type]);
+ if (rs->refs[i].marks)
printf("MARK+UPDATE");
else
printf(" UPDATE");
/* Structures *****************************************************************/
#define ROOTSET_DUMMY_THREAD ((threadobject *) (ptrint) -1)
-#define RS_REFS 512 /* TODO: you see why we need to rethink this!!! */
+
+#define ROOTSET_INITIAL_CAPACITY 16
#define REFTYPE_THREADOBJECT 1
#define REFTYPE_REGISTERED 1
/* rootset is passed as array of pointers, which point to the location of
the reference */
+typedef struct rootset_entry_t {
+ java_objectheader **ref; /* a pointer to the actual reference */
+ bool marks; /* indicates if a reference marks */
+#if !defined(NDEBUG)
+ s4 type;
+#endif
+} rootset_entry_t;
+
+
struct rootset_t {
rootset_t *next; /* link to the next chain element */
threadobject *thread; /* thread this rootset belongs to */
sourcestate_t *ss; /* sourcestate of the thread */
executionstate_t *es; /* executionstate of the thread */
+ s4 capacity; /* the current capacity of this rs */
s4 refcount; /* number of references */
- java_objectheader **refs[RS_REFS]; /* list of references */
- bool ref_marks[RS_REFS]; /* indicates if a reference marks */
-#if !defined(NDEBUG)
- s4 ref_type[RS_REFS];
-#endif
+ rootset_entry_t refs[ROOTSET_INITIAL_CAPACITY]; /* list of references */
};
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: java_lang_reflect_Constructor.c 8026 2007-06-07 09:04:51Z twisti $
+ $Id: java_lang_reflect_Constructor.c 8027 2007-06-07 10:30:33Z michi $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: java_lang_reflect_Field.c 7976 2007-05-29 12:22:55Z twisti $
+ $Id: java_lang_reflect_Field.c 8027 2007-06-07 10:30:33Z michi $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: java_lang_reflect_Method.c 7976 2007-05-29 12:22:55Z twisti $
+ $Id: java_lang_reflect_Method.c 8027 2007-06-07 10:30:33Z michi $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: asmpart.h 7596 2007-03-28 21:05:53Z twisti $
+ $Id: asmpart.h 7601 2007-03-28 23:02:50Z michi $
*/
--- /dev/null
+/* src/vm/jit/m68k/disass.c - wrapper functions for GNU binutils disassembler
+
+ Copyright (C) 1996-2005, 2006, 2007 R. Grafl, A. Krall, C. Kruegel,
+ C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
+ E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
+ J. Wenninger, Institut f. Computersprachen - TU Wien
+
+ This file is part of CACAO.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2, or (at
+ your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
+
+ $Id: arch.h 5330 2006-09-05 18:43:12Z edwin $
+
+*/
+
+
+#include "config.h"
+
+#include <assert.h>
+#include <dis-asm.h>
+#include <stdarg.h>
+
+#include "vm/types.h"
+
+#include "vm/global.h"
+#include "vm/jit/disass.h"
+
+
+/* disassinstr *****************************************************************
+
+ Outputs a disassembler listing of one machine code instruction on
+ 'stdout'.
+
+ code: instructions machine code
+
+*******************************************************************************/
+
+u1 *disassinstr(u1 *code)
+{
+ s4 seqlen;
+ s4 i;
+
+ if (!disass_initialized) {
+ INIT_DISASSEMBLE_INFO(info, NULL, disass_printf);
+
+ /* setting the struct members must be done after
+ INIT_DISASSEMBLE_INFO */
+
+ info.mach = bfd_mach_mcf_isa_b_float_emac; /* this is optimistic */
+ info.read_memory_func = &disass_buffer_read_memory;
+
+ disass_initialized = 1;
+ }
+
+ /* must be reset */
+ disass_len = 0;
+
+ printf("0x%08x: ", (s4) code);
+
+ /* 0x51fc is tpf "trap false" but not recognized correctly by binutils, make output more readable by skipping it */
+ if (*((u2*)code) == 0x51fc) {
+ printf("%04x\n", *((u2*)code));
+ return (code+2);
+ }
+
+ seqlen = print_insn_m68k((bfd_vma) (ptrint) code, &info);
+
+ for (i = 0; i < seqlen; i+=2, code+=2) {
+ printf("%04x ", *((u2*)code));
+ }
+
+ for (; i < 6; i+=2) {
+ printf(" ");
+ }
+
+ printf(" %s\n", disass_buf);
+
+ return code;
+}
+
+
+/*
+ * These are local overrides for various environment variables in Emacs.
+ * Please do not remove this and leave it at the end of the file, where
+ * Emacs will automagically detect them.
+ * ---------------------------------------------------------------------
+ * Local variables:
+ * mode: c
+ * indent-tabs-mode: t
+ * c-basic-offset: 4
+ * tab-width: 4
+ * End:
+ */
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: asmpart.S 8011 2007-06-05 10:06:18Z twisti $
+ $Id: asmpart.S 8027 2007-06-07 10:30:33Z michi $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: md-abi.c 8013 2007-06-05 10:19:09Z twisti $
+ $Id: md-abi.c 8027 2007-06-07 10:30:33Z michi $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: codegen.c 7966 2007-05-25 12:41:03Z pm $
+ $Id: codegen.c 8027 2007-06-07 10:30:33Z michi $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: codegen.h 7966 2007-05-25 12:41:03Z pm $
+ $Id: codegen.h 8027 2007-06-07 10:30:33Z michi $
*/
Changes: Edwin Steiner
- $Id: md.c 7966 2007-05-25 12:41:03Z pm $
+ $Id: md.c 8027 2007-06-07 10:30:33Z michi $
*/
--- /dev/null
+antlr
+
+ * parses one or more grammar files and generates a parser and lexical analyzer for each.
+ * Tue May 1 18:49:29 CEST 2007: ===== DaCapo antlr PASSED in 37095 msec =====
+ * Wed May 9 23:58:51 CEST 2007: (ibm java) ===== DaCapo antlr PASSED in 269244 msec =====
+ * Thu May 10 00:05:50 CEST 2007: ===== DaCapo antlr PASSED in 70164 msec =====
+ * Thu May 10 08:54:54 CEST 2007: (ibm java intrp) ===== DaCapo antlr PASSED in 686373 msec =====
+
+
+bloat
+
+ * performs a number of optimizations and analysis on Java bytecode files
+ * Tue May 1 18:55:16 CEST 2007: ===== DaCapo bloat PASSED in 266735 msec =====
+
+chart
+
+ * uses JFreeChart to plot a number of complex line graphs and renders them as PDF
+ * Fri May 18 02:08:25 CEST 2007: ===== DaCapo chart PASSED in 549048 msec =====
+
+eclipse
+
+ * executes some of the (non-gui) jdt performance tests for the Eclipse IDE
+
+fop
+
+ * takes an XSL-FO file, parses it and formats it, generating a PDF file.
+ * Tue May 1 22:10:03 CEST 2007: ===== DaCapo fop PASSED in 83230 msec =====
+
+hsqldb
+
+ * executes a JDBCbench-like in-memory benchmark, executing a number of transactions against a model of a banking application
+ * Tue May 1 19:37:46 CEST 2007: ===== DaCapo hsqldb PASSED in 72187 msec =====
+
+jython
+
+ * inteprets a the pybench Python benchmark
+ * Tue May 1 19:23:18 CEST 2007: ===== DaCapo jython PASSED in 190386 msec =====
+
+luindex
+
+ * Uses lucene to indexes a set of documents; the works of Shakespeare and the King James Bible
+ * Sat May 12 20:27:43 CEST 2007: ===== DaCapo luindex PASSED in 92671 msec =====
+
+lusearch
+
+ * Uses lucene to do a text search of keywords over a corpus of data comprising the works of Shakespeare and the King James Bible
+
+pmd
+
+ * analyzes a set of Java classes for a range of source code problems
+ * Tue May 1 22:12:57 CEST 2007: ===== DaCapo pmd PASSED in 43427 msec =====
+
+xalan
+
+ * transforms XML documents into HTML
+ * Tue May 1 23:26:33 CEST 2007
+ LOG: [0x77dc66c0] Generating code: org.apache.xalan.processor.XSLTSchema.build()V
+ 32834 (0x8042) is not an signed 16 bit integer at /home/peter/cacao-dev/build-s390/../svn/src/vm/jit/s390/emit.c:258.
+ => branch to patcher overflow
+
+ * HANGUP !
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: asmpart.S 7678 2007-04-09 17:23:55Z twisti $
+ $Id: asmpart.S 7688 2007-04-12 09:05:12Z michi $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: md-abi.c 7713 2007-04-15 21:49:48Z twisti $
+ $Id: md-abi.c 7723 2007-04-16 18:03:08Z michi $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: resolve.c 7983 2007-05-30 20:04:42Z twisti $
+ $Id: resolve.c 8027 2007-06-07 10:30:33Z michi $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: string.c 7967 2007-05-25 15:03:46Z twisti $
+ $Id: string.c 8027 2007-06-07 10:30:33Z michi $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: descriptor.c 7486 2007-03-08 13:50:07Z twisti $
+ $Id: descriptor.c 7483 2007-03-08 13:17:40Z michi $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: descriptor.h 7596 2007-03-28 21:05:53Z twisti $
+ $Id: descriptor.h 7601 2007-03-28 23:02:50Z michi $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: method.c 7573 2007-03-25 18:55:02Z twisti $
+ $Id: method.c 7601 2007-03-28 23:02:50Z michi $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: method.h 7966 2007-05-25 12:41:03Z pm $
+ $Id: method.h 8027 2007-06-07 10:30:33Z michi $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: options.c 7966 2007-05-25 12:41:03Z pm $
+ $Id: options.c 8027 2007-06-07 10:30:33Z michi $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: options.h 7966 2007-05-25 12:41:03Z pm $
+ $Id: options.h 8027 2007-06-07 10:30:33Z michi $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: statistics.c 8006 2007-06-05 07:40:49Z twisti $
+ $Id: statistics.c 8027 2007-06-07 10:30:33Z michi $
*/
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
- $Id: statistics.h 8006 2007-06-05 07:40:49Z twisti $
+ $Id: statistics.h 8027 2007-06-07 10:30:33Z michi $
*/