[DGD] some questions about interpret.cpp

Carter Cheng cartercheng at gmail.com
Wed Dec 30 18:31:12 CET 2015


Thanks Felix.

On Tue, Dec 29, 2015 at 3:08 AM, Felix A. Croes <felix at dworkin.nl> wrote:

> Carter Cheng <cartercheng at gmail.com> wrote:
>
> > Also concerning kfuns why would they want to modify the program counter?
> > Shouldn't the kfun return to the subsequent instruction after the kfun
> call
> > in most cases?
>
> A kfun can modify the program counter when it executes the store value
> instructions that follow the kfun call.  This is how things work for
> the VM version 2.1; there is no more lvalue type, which means that
> there is no more where-to-store-what information on the value stack.
> Instead, a call to sscanf() is followed by store instructions, which
> are then executed through i_lvalues() in a special modus, allowing
> the kfun to save to variables from an array of values that is put
> on the stack.
>
> Storing values without going through an lvalue type is a big speed boost
> for LPC.  VM code is about 30% faster (measured for Hydra, DGD may be a
> little less optimized).  For JIT code, the impact will be even larger;
> it does however mean that for sscanf calls from JIT-compiled code, you
> have to pass a function pointer to i_lvalue(), which will then be called
> to perform the stores.
>
> Regards,
> Felix Croes
> ____________________________________________
> https://mail.dworkin.nl/mailman/listinfo/dgd
>



More information about the DGD mailing list