Inlined functions still have protos present in bytecode without references as values #519
EpixScripts
started this conversation in
General
Replies: 1 comment 2 replies
-
Yeah this is a known limitation of the bytecode compiler. We plan to lift it eventually, but it's not trivial right now due to how the compiler is structured. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was toying around with bytecode and seeing how the inlining mechanism works, but then I noticed when I have a function that is inlined and is only used by calling it, the proto is still present in the bytecode and a NEWCLOSURE/DUPCLOSURE instruction is created. However, the closure is not used. For example, if I input the script:
When compiled with optimization level 2 and debug level 1, disassembly reads:
A closure is created and loaded into register 0, but never used.
Is there a specific reason for this, or would this be considered a bug?
Beta Was this translation helpful? Give feedback.
All reactions