[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Question regarding handling of OP_CALL
- From: Dibyendu Majumdar <mobile@...>
- Date: Mon, 9 Mar 2015 18:20:40 +0000
On 9 March 2015 at 15:23, Roberto Ierusalimschy <email@example.com> wrote:
>> In lvm.c if the target of OP_CALL is a Lua function then it is handled
>> by the same invocation of luaV_execute(). When I compile a Lua
>> function I cannot do this so I need to recursively invoke
>> luaV_execute() on the called function. I was wondering if I should
>> directly call luaV_execute() or call luaD_call() - what would be the
>> correct approach?
> Probably luaD_call, but depends on your code. luaD_call handles C
> functions, controls the stack depth, and controls yields. Probably
> you want all of them.
Thanks. I haven't even started thinking about yields and how to
support them. Just realized what "savedpc" might be for!
How does a function yield? Is it a longjmp?