diff options
author | Hans Boehm <boehm@acm.org> | 2000-09-05 11:37:52 +0000 |
---|---|---|
committer | Bryce McKinlay <bryce@gcc.gnu.org> | 2000-09-05 12:37:52 +0100 |
commit | 7c097ee994bfda54e6aed4c57562a1f346ef2575 (patch) | |
tree | 02336ca7e9e894a302632c3e3e905a326b2182e5 /gcc/java | |
parent | 820112852a897e77e04d5015e8718433630b1e33 (diff) | |
download | gcc-7c097ee994bfda54e6aed4c57562a1f346ef2575.zip gcc-7c097ee994bfda54e6aed4c57562a1f346ef2575.tar.gz gcc-7c097ee994bfda54e6aed4c57562a1f346ef2575.tar.bz2 |
boehm.c (mark_reference_fields): Set marking bits for all words in a multiple-word record.
2000-08-07 Hans Boehm <boehm@acm.org>
* boehm.c (mark_reference_fields): Set marking bits for all words in
a multiple-word record.
(get_boehm_type_descriptor): Use the procedure marking descriptor
for java.lang.Class.
From-SVN: r36159
Diffstat (limited to 'gcc/java')
-rw-r--r-- | gcc/java/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/java/boehm.c | 21 |
2 files changed, 25 insertions, 3 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 95c60f6..58d8a74 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,10 @@ +2000-08-07 Hans Boehm <boehm@acm.org> + + * boehm.c (mark_reference_fields): Set marking bits for all words in + a multiple-word record. + (get_boehm_type_descriptor): Use the procedure marking descriptor for + java.lang.Class. + 2000-08-31 Mike Stump <mrs@wrs.com> * Make-lang.in (jc1$(exeext), gcjh$(exeext), jv-scan$(exeext), diff --git a/gcc/java/boehm.c b/gcc/java/boehm.c index 63d6d7c..f758c9d 100644 --- a/gcc/java/boehm.c +++ b/gcc/java/boehm.c @@ -95,17 +95,21 @@ mark_reference_fields (field, low, high, ubit, for (; field != NULL_TREE; field = TREE_CHAIN (field)) { HOST_WIDE_INT offset; + HOST_WIDE_INT size_bytes; if (FIELD_STATIC (field)) continue; offset = int_byte_position (field); + size_bytes = int_size_in_bytes (TREE_TYPE (field)); if (JREFERENCE_TYPE_P (TREE_TYPE (field)) /* An `object' of type gnu.gcj.RawData is actually non-Java data. */ && TREE_TYPE (field) != rawdata_ptr_type_node) { unsigned int count; + unsigned int size_words; + unsigned int i; /* If this reference slot appears to overlay a slot we think we already covered, then we are doomed. */ @@ -113,11 +117,19 @@ mark_reference_fields (field, low, high, ubit, abort (); count = offset * BITS_PER_UNIT / POINTER_SIZE; + size_words = size_bytes * BITS_PER_UNIT / POINTER_SIZE; *last_set_index = count; - /* First word in object corresponds to most significant byte - of bitmap. */ - set_bit (low, high, ubit - count - 1); + + /* First word in object corresponds to most significant byte of + bitmap. + + In the case of a multiple-word record, we set pointer + bits for all words in the record. This is conservative, but the + size_words != 1 case is impossible in regular java code. */ + for (i = 0; i < size_words; ++i) + set_bit (low, high, ubit - count - i - 1); + if (count > ubit - 2) *pointer_after_end = 1; @@ -173,6 +185,9 @@ get_boehm_type_descriptor (tree type) /* Warning avoidance. */ ubit = (unsigned int) bit; + if (type == class_type_node) + return PROCEDURE_OBJECT_DESCRIPTOR; + field = TYPE_FIELDS (type); mark_reference_fields (field, &low, &high, ubit, &pointer_after_end, &all_bits_set, |