Hi Fan,

I think you are asking about safe instruction pointer addresses in
JITed code where the JIT is able to enumerate all live references.  If
this is the case, it turns out there are lots of subtle interactions
between all the pieces of the system.  In otherwords, I can't do
justice to the topic in an email.  But I will point you in the right
direction.

The JIT can insert  polling code at points where it knows it can find
all live references on a thread's stack.  When the GC wants a thread
to suspend and report its live references, it can set a flag in the
thread-local context.  When the JITed code sees the flag set, it will
suspend the thread and report the live references. As far as I know
the DRLVM JIT you are looking at does not quite do this yet.

An incomplete but useful for bringup approach is to let the targetted
thread continue executing until it tries to allocate an object.
Assuming there is no space available, the thread is vectored into the
garbage collector itself.  By design, object allocation sites are
places where the JIT can enumerate all live references on the stack.

There are other schemes, such as suspending and resuming the targetted
thread until the JIT reports it can enumerate.  I won't bore you with
the details here.  Let me know if this helps.


On 8/27/06, Fan Bin <[EMAIL PROTECTED]> wrote:
Hi, I have a question about jit compiler in drlvm. I want to suspend the thread 
manually on a particular point. I know that the thread can only be suspended at 
safe point. I guess the safe point is inserted by jit compiler when it compile 
the method, but I can't prove it from the source code. So my question is 
whether it's true that it is the jit compiler which insert the safe point. If 
it is true, how does it do this?
Thank you for your help.



--
Weldon Washburn
Intel Middleware Products Division

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to