Commit 652f2504 by Tom Tromey Committed by Tom Tromey

boehm.c (mark_reference_fields): Don't mark RawData fields.

	* boehm.c (mark_reference_fields): Don't mark RawData fields.
	Keep track of when we've seen a reference field after a
	non-reference field.
	(get_boehm_type_descriptor): Handle case where we see
	non-reference fields but no trailing reference field.
	* decl.c (rawdata_ptr_type_node): Define.
	(init_decl_processing): Initialize rawdata_ptr_type_node.
	* java-tree.h (rawdata_ptr_type_node): Declare.

From-SVN: r33701
parent 0db7ad3a
2000-05-04 Tom Tromey <tromey@cygnus.com>
* boehm.c (mark_reference_fields): Don't mark RawData fields.
Keep track of when we've seen a reference field after a
non-reference field.
(get_boehm_type_descriptor): Handle case where we see
non-reference fields but no trailing reference field.
* decl.c (rawdata_ptr_type_node): Define.
(init_decl_processing): Initialize rawdata_ptr_type_node.
* java-tree.h (rawdata_ptr_type_node): Declare.
2000-05-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2000-05-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* jcf-dump.c (SPECIAL_IINC): Ensure arguments match format * jcf-dump.c (SPECIAL_IINC): Ensure arguments match format
...@@ -14,11 +25,6 @@ ...@@ -14,11 +25,6 @@
* gjavah.c (decode_signature_piece): Don't treat `$' as namespace * gjavah.c (decode_signature_piece): Don't treat `$' as namespace
separator. separator.
2000-05-02 Tom Tromey <tromey@cygnus.com>
* expr.c (build_jni_stub): Cache the result of
_Jv_LookupJNIMethod.
2000-04-19 Tom Tromey <tromey@cygnus.com> 2000-04-19 Tom Tromey <tromey@cygnus.com>
* class.c (add_method_1): Set both DECL_EXTERNAL and METHOD_NATIVE * class.c (add_method_1): Set both DECL_EXTERNAL and METHOD_NATIVE
......
...@@ -100,7 +100,10 @@ mark_reference_fields (field, low, high, ubit, ...@@ -100,7 +100,10 @@ mark_reference_fields (field, low, high, ubit,
continue; continue;
offset = int_byte_position (field); offset = int_byte_position (field);
if (JREFERENCE_TYPE_P (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 count;
...@@ -117,8 +120,14 @@ mark_reference_fields (field, low, high, ubit, ...@@ -117,8 +120,14 @@ mark_reference_fields (field, low, high, ubit,
set_bit (low, high, ubit - count - 1); set_bit (low, high, ubit - count - 1);
if (count > ubit - 2) if (count > ubit - 2)
*pointer_after_end = 1; *pointer_after_end = 1;
/* If we saw a non-reference field earlier, then we can't
use the count representation. We keep track of that in
*ALL_BITS_SET. */
if (! *all_bits_set)
*all_bits_set = -1;
} }
else else if (*all_bits_set > 0)
*all_bits_set = 0; *all_bits_set = 0;
*last_view_index = offset; *last_view_index = offset;
...@@ -172,9 +181,13 @@ get_boehm_type_descriptor (tree type) ...@@ -172,9 +181,13 @@ get_boehm_type_descriptor (tree type)
/* If the object is all pointers, or if the part with pointers fits /* If the object is all pointers, or if the part with pointers fits
in our bitmap, then we are ok. Otherwise we have to allocate it in our bitmap, then we are ok. Otherwise we have to allocate it
a different way. */ a different way. */
if (all_bits_set) if (all_bits_set != -1)
{ {
/* In the GC the computation looks something like this: /* In this case the initial part of the object is all reference
fields, and the end of the object is all non-reference
fields. We represent the mark as a count of the fields,
shifted. In the GC the computation looks something like
this:
value = DS_LENGTH | WORDS_TO_BYTES (last_set_index + 1); value = DS_LENGTH | WORDS_TO_BYTES (last_set_index + 1);
DS_LENGTH is 0. DS_LENGTH is 0.
WORDS_TO_BYTES shifts by log2(bytes-per-pointer). */ WORDS_TO_BYTES shifts by log2(bytes-per-pointer). */
......
...@@ -295,6 +295,7 @@ tree string_ptr_type_node; ...@@ -295,6 +295,7 @@ tree string_ptr_type_node;
tree throwable_type_node; tree throwable_type_node;
tree runtime_exception_type_node; tree runtime_exception_type_node;
tree error_exception_type_node; tree error_exception_type_node;
tree rawdata_ptr_type_node;
tree *predef_filenames; tree *predef_filenames;
int predef_filenames_size; int predef_filenames_size;
...@@ -586,6 +587,8 @@ init_decl_processing () ...@@ -586,6 +587,8 @@ init_decl_processing ()
lookup_class (get_identifier ("java.lang.RuntimeException")); lookup_class (get_identifier ("java.lang.RuntimeException"));
error_exception_type_node = error_exception_type_node =
lookup_class (get_identifier ("java.lang.Error")); lookup_class (get_identifier ("java.lang.Error"));
rawdata_ptr_type_node
= promote_type (lookup_class (get_identifier ("gnu.gcj.RawData")));
/* This section has to be updated as items are added to the previous /* This section has to be updated as items are added to the previous
section. */ section. */
......
...@@ -225,6 +225,7 @@ extern tree string_ptr_type_node; ...@@ -225,6 +225,7 @@ extern tree string_ptr_type_node;
extern tree throwable_type_node; extern tree throwable_type_node;
extern tree runtime_exception_type_node; extern tree runtime_exception_type_node;
extern tree error_exception_type_node; extern tree error_exception_type_node;
extern tree rawdata_ptr_type_node;
extern tree *predef_filenames; extern tree *predef_filenames;
extern int predef_filenames_size; extern int predef_filenames_size;
......
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