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

Avoid generating MutableSeq in invokes #1302

Open
ice1000 opened this issue Feb 2, 2025 · 0 comments
Open

Avoid generating MutableSeq in invokes #1302

ice1000 opened this issue Feb 2, 2025 · 0 comments
Assignees

Comments

@ice1000
Copy link
Member

ice1000 commented Feb 2, 2025

In the JIT-compiled defs.

Right now we generate these MutableSeq to store some local variables of type Term:
https://gist.github.com/ice1000/70fd92ce92bd744c663e4f7e81d61192#file-_baka-java-L529

But they can be replaced with stack variables.

They were created to hack javac, who insist on "captured variables must be final or effectively final", while these local vars are re-assigned in the pattern matching code, so javac rejects them. But this is not a limitation of the JVM itself, and since we're generating bytecode directly, we should flatten these MutableSeq onto the stack.

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

2 participants