Re: [rvm-research] Regarding GC
Eliot Moss <[email protected]>
| Newsgroups | gmane.comp.java.jikes.rvm.devel |
|---|---|
| Message-ID | <[email protected]> |
On 8/27/2014 2:46 PM, Hari Krishnan wrote:
> Hi Mike,
> Thank you for the reply. I just don't want to assume anything. So just want to know that before I
> make progress in my work.
Allow me to point out a subtlety, not exactly contradicting, but
perhaps going beyond Mike's response.
Suppose your code was something like this:
Node n6 = n1.next.next.next.next.next;
(The key property is that it is not in a loop and involves
no calls or branching at the bytecode level.)
Then there might be a GCMap for a location before this statement,
and another one for some location after this statement. There
would not be a GCMap for each step within this code. This is
because things are arranged so that a GC is possible only at
certain points in a code. Only those points need a GCMap.
Now suppose the code looked like this:
Node n = ...;
for (int i = 5; --i >= 0; ) {
n = n.next;
}
Because there is branching involved in the loop, the compiler
may (probably will) insert a GCMap at the end of the for-loop
body. In this case a ref to each pointer might be a stack root
temporarily.
Of course in the earlier case the same thing is true in a sense,
it's just that, because GC will not happen at the intermediate
points, *GC* will never see a reference to the intermediate
nodes.
Does this all make sense? Perhaps if you tell us more about
what you are studying or trying to accomplish we can be of more
assistance. (It is not unusual to see highly specific questions
here that are, in the end, somewhat barking up the wrong tree.
We can be most helpful if we can lead you to the right tree :-) ).
Best wishes -- Eliot
------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/