Skip to content

Remove the called function from the stack #50

Description

@p7g

To avoid needing to add/remove 1 in multiple places at runtime (for example when loading locals), it would be nice to store the called function in the cb_frame instead of on the stack. To do so means that the function should be at the top of the stack when evaluating OP_CALL, which requires reordering the code emitted by the compiler. The way to do this that comes to mind is buffering the bytecode from nud and appending it after compiling the arguments.

See the branch function-last for a WIP implementation.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions