Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to implement a Go like defer statement #163

Open
dibyendumajumdar opened this issue Jul 16, 2019 · 0 comments
Open

Try to implement a Go like defer statement #163

dibyendumajumdar opened this issue Jul 16, 2019 · 0 comments

Comments

@dibyendumajumdar
Copy link
Owner

dibyendumajumdar commented Jul 16, 2019

Recently Roberto has been working on toclose variables in Lua 5.4. Lots of debate on the list around this.

I would like to try out something similar but slightly different.

Main idea is to use the luaF_close() way of handling upvalue closure but actually have a separate list of deferred functions. Provide an API to add a function to the list of deferred functions.

Might need a new opcode because we need to reserve stack slots at compile time.

dibyendumajumdar added a commit that referenced this issue Oct 6, 2019
…ack due to invocation of deferred functions
dibyendumajumdar added a commit that referenced this issue Oct 12, 2019
dibyendumajumdar added a commit that referenced this issue Oct 20, 2019
…ack due to invocation of deferred functions
dibyendumajumdar added a commit that referenced this issue Oct 20, 2019
dibyendumajumdar added a commit that referenced this issue Dec 11, 2019
…ack due to invocation of deferred functions
dibyendumajumdar added a commit that referenced this issue Dec 11, 2019
dibyendumajumdar added a commit that referenced this issue Dec 13, 2019
dibyendumajumdar added a commit that referenced this issue Jan 1, 2020
dibyendumajumdar added a commit that referenced this issue Mar 29, 2020
…MENT macro. This allows testing of performance with and without the 'defer' statement
dibyendumajumdar added a commit that referenced this issue Apr 5, 2020
dibyendumajumdar added a commit that referenced this issue Jul 4, 2020
…e need to reload RA after call to luaF_close() as stack may been reallocated
dibyendumajumdar added a commit that referenced this issue Jul 5, 2020
dibyendumajumdar added a commit that referenced this issue Jul 5, 2020
dibyendumajumdar added a commit that referenced this issue Jul 5, 2020
…, plus some changes in ldo.c back-ported from Lua 5.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant