summaryrefslogtreecommitdiff
path: root/gcc/java/boehm.c
diff options
context:
space:
mode:
authorbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>2000-09-05 11:37:52 +0000
committerbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>2000-09-05 11:37:52 +0000
commit64aa5c152b00f67430dee24496d9d15915363b4e (patch)
tree02336ca7e9e894a302632c3e3e905a326b2182e5 /gcc/java/boehm.c
parent65c1684c1fc9896e8f2c846f0d3ac2e0988f54d7 (diff)
downloadgcc-64aa5c152b00f67430dee24496d9d15915363b4e.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36159 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/boehm.c')
-rw-r--r--gcc/java/boehm.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/gcc/java/boehm.c b/gcc/java/boehm.c
index 63d6d7c3dcf..f758c9d4fcb 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,