Quick Cmm question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Quick Cmm question

Jan Stolarek
I have a question about this piece of Cmm code:

  cJI:
      R1 = _sGG::P32;
      call (stg_gc_enter_1)(R1) args: 4, res: 0, upd: 4;
  cJK:
      ...

Does the call to stg_gc_enter_1 return to cJK: a) never; b) sometimes; c) always ? I'm looking at the implementation in rts/HeapStackCheck.cmm but I don't know the meaning of `jump stg_returnToSched [R1];` at the and of stg_gc_noregs. Any help will be appreciated.

Janek



Reply | Threaded
Open this post in threaded view
|

Quick Cmm question

Edward Z. Yang
IIUC, this code will never return to cJK. It will return to what-ever
address is in R1; jumping to 'returnToSched' with the value in R1
says, "Please run the scheduler, and jump back to R1 when you're
done and ready to run my thread again."

Edward

Excerpts from Jan Stolarek's message of Mon Aug 05 08:08:43 -0700 2013:

> I have a question about this piece of Cmm code:
>
>   cJI:
>       R1 = _sGG::P32;
>       call (stg_gc_enter_1)(R1) args: 4, res: 0, upd: 4;
>   cJK:
>       ...
>
> Does the call to stg_gc_enter_1 return to cJK: a) never; b) sometimes; c) always ? I'm looking at the implementation in rts/HeapStackCheck.cmm but I don't know the meaning of `jump stg_returnToSched [R1];` at the and of stg_gc_noregs. Any help will be appreciated.
>
> Janek
>



Reply | Threaded
Open this post in threaded view
|

Quick Cmm question

Jan Stolarek
Thank you Edward.

Janek

Dnia poniedzia?ek, 5 sierpnia 2013, Edward Z. Yang napisa?:

> IIUC, this code will never return to cJK. It will return to what-ever
> address is in R1; jumping to 'returnToSched' with the value in R1
> says, "Please run the scheduler, and jump back to R1 when you're
> done and ready to run my thread again."
>
> Edward
>
> Excerpts from Jan Stolarek's message of Mon Aug 05 08:08:43 -0700 2013:
> > I have a question about this piece of Cmm code:
> >
> >   cJI:
> >       R1 = _sGG::P32;
> >       call (stg_gc_enter_1)(R1) args: 4, res: 0, upd: 4;
> >   cJK:
> >       ...
> >
> > Does the call to stg_gc_enter_1 return to cJK: a) never; b) sometimes; c)
> > always ? I'm looking at the implementation in rts/HeapStackCheck.cmm but
> > I don't know the meaning of `jump stg_returnToSched [R1];` at the and of
> > stg_gc_noregs. Any help will be appreciated.
> >
> > Janek