[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Lightning] Code patching, context switching

From: Sandro Magi
Subject: Re: [Lightning] Code patching, context switching
Date: Thu, 21 Feb 2008 18:44:31 -0500

On Wed, Feb 20, 2008 at 11:55 AM, Paolo Bonzini <address@hidden> wrote:
>  Yes.  r3-r9, which the ABI uses for argument passing, are not accessible
>  at all.  In the prolog, they are moved to other, callee-save registers,
>  which are also not accessible with JIT_{R,V} but only with jit_getarg.

Actually, it occurs to me that I don't need access to caller-save
registers to implement context switching. My context switch function
will simply be a function that I call using prolog, and all
caller-save registers will thus already be saved on the stack and
restored on return after switching stacks. I then simply need to save
the registers accessible Lightning's JIT_V/FRP. Am I missing anything

One potential pitfall is expensive floating-point state. Is there a
way to determine whether the floating point registers have been used
since the last context switch? I'd rather not have to save them if it
can be avoided. I'm currently reading the fenv.h header [1] which
discusses the portable C interface. By the way, Boost.Coroutine has
done an impressive analysis of the issues involved.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]