]> gcc.gnu.org Git - gcc.git/commitdiff
* interpret.cc (do_allocate_static_fields): Added comment.
authorTom Tromey <tromey@redhat.com>
Fri, 3 Mar 2006 18:32:22 +0000 (18:32 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Fri, 3 Mar 2006 18:32:22 +0000 (18:32 +0000)
From-SVN: r111683

libjava/ChangeLog
libjava/interpret.cc

index f3bdb61e87e84bc27cd28fc4a0c8b78d9953bf13..87b0ef6dbdeb8666c10c2a9b4bcc1d8a864f2059 100644 (file)
@@ -1,3 +1,7 @@
+2006-03-03  Tom Tromey  <tromey@redhat.com>
+
+       * interpret.cc (do_allocate_static_fields): Added comment.
+
 2006-03-01  Tom Tromey  <tromey@redhat.com>
 
        PR java/24321:
index ddb469788f0c116051c9064c34bbce409dec8121..0e6fbc847cfc0e34140ce867f5ca1710fe5ad9ae 100644 (file)
@@ -3882,7 +3882,17 @@ _Jv_InterpreterEngine::do_allocate_static_fields (jclass klass,
   _Jv_InterpClass *iclass = (_Jv_InterpClass *) klass->aux_info;
 
   // Splitting the allocations here lets us scan reference fields and
-  // avoid scanning non-reference fields.
+  // avoid scanning non-reference fields.  How reference fields are
+  // scanned is a bit tricky: we allocate using _Jv_AllocRawObj, which
+  // means that this memory will be scanned conservatively (same
+  // difference, since we know all the contents here are pointers).
+  // Then we put pointers into this memory into the 'fields'
+  // structure.  Most of these are interior pointers, which is ok (but
+  // even so the pointer to the first reference field will be used and
+  // that is not an interior pointer).  The 'fields' array is also
+  // allocated with _Jv_AllocRawObj (see defineclass.cc), so it will
+  // be scanned.  A pointer to this array is held by Class and thus
+  // seen by the collector.
   char *reference_fields = (char *) _Jv_AllocRawObj (pointer_size);
   char *non_reference_fields = (char *) _Jv_AllocBytes (other_size);
 
This page took 0.068008 seconds and 5 git commands to generate.