harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fan Bin" <fanbi...@gmail.com>
Subject Re: [drlvm] how does drlvm insert the safe point into a method
Date Mon, 28 Aug 2006 12:13:20 GMT
Thank you very much for your answer and your bearing my awful english:). and thanks to Egor
and Mikhail. Yes, my question is about the safe point in JITed code. Your answer are really
helps. 

I want to suspend a thread from another thead, not for the reason of GC, but for some other
reasons. From your answer, I know that it is JIT who insert the polling code. So I think what
should I do is modifying the JIT, insert the polling code at the point I want the suspendee
to stop. I'll look for bbp in the source to see some details first. I'll ask if I meet some
questions.

I still have a question to Wedlon: What do you mean that "As far as I know the DRLVM JIT you
are looking at does not quite do this yet". Does it mean that the drlvm JIT(Jitrino.JET and
OPT) I'm looking at can't insert the polling code, or just JET can't do this?

Many thanks, 
fanbin

----- Original Message ----- 
From: "Weldon Washburn" <weldonwjw@gmail.com>
To: <harmony-dev@incubator.apache.org>
Sent: Monday, August 28, 2006 12:38 PM
Subject: Re: [drlvm] how does drlvm insert the safe point into a method


> 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 <fanbin23@gmail.com> 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: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
Mime
View raw message