[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua and light threads
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 23 Oct 2000 13:49:42 -0200
> Well, tailcalls have been my worst case in making Lua stackless. 
If it is so bad, you can avoid this opcode. Just remove this code from
lcode.c:
    case OP_RETURN: {
      if (GET_OPCODE(i) == OP_CALL && GETARG_B(i) == MULT_RET) {
        SET_OPCODE(i, OP_TAILCALL);
        SETARG_B(i, arg1);
        optm = 1;
      }
      break;
    }
That way, the compiler will not do the optimization; it will keep an 
explicit OP_CALL followed by OP_RETURN in your code. 
-- Roberto