diff options
| author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-03-03 18:32:22 +0000 |
|---|---|---|
| committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-03-03 18:32:22 +0000 |
| commit | 28455cb2e5bfbb6ba8dd24086527bf38aabb155a (patch) | |
| tree | 52487c80f51b4a4bece252841cdfab7adad1fd42 | |
| parent | f62550405d2e7d7a6ade3cc6b4b179221d6ba38b (diff) | |
| download | ppe42-gcc-28455cb2e5bfbb6ba8dd24086527bf38aabb155a.tar.gz ppe42-gcc-28455cb2e5bfbb6ba8dd24086527bf38aabb155a.zip | |
* interpret.cc (do_allocate_static_fields): Added comment.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111683 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | libjava/ChangeLog | 4 | ||||
| -rw-r--r-- | libjava/interpret.cc | 12 |
2 files changed, 15 insertions, 1 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index f3bdb61e87e..87b0ef6dbde 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -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: diff --git a/libjava/interpret.cc b/libjava/interpret.cc index ddb469788f0..0e6fbc847cf 100644 --- a/libjava/interpret.cc +++ b/libjava/interpret.cc @@ -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); |

