4 ms·
It's definitely possible to optimize the bytecode. For example, I am working on another post right now that adds definite assignment analysis. It imagines an op
by tekknolagi 5y ago
It's definitely possible to optimize the bytecode. For example, I am working on another post right now that adds definite assignment analysis. It imagines an opcode LOAD_FAST_UNCHECKED that elides the runtime null check, and then replaces all definitely-assigned LOAD_FASTs with that.
Regarding inlining: if you have the right data structures, inlining is possible. For example, I add an inliner to our Python JIT here: https://github.com/facebookincubator/cinder/commit/f3c50b3938906149b32c9cd36c3a41f0e898b52d https://github.com/facebookincubator/cinder/commit/f3c50b393...
The SSA IR makes this reasonably straightforward. The harder part was runtime frame reflection and keeping stack traces consistent (pretending like nothing was inlined).
- hyperman1 5y agoI should have known, this is stack overflow after all. You're working on tech that successfully does exactly what I just declared undoable. Cinder looks very interesting. I have quite a lot of questions, but it looks like your readme answers a lot of them, so I'll spend the evening reading it first. My hat off to you.
- tekknolagi 5y agoLet me know what questions you have! We're working on this stuff in the open but it's not always easy to see the bigger picture of what's being worked on. Also, I think it's not necessarily required to have a JIT but I'll have to take a look at https://dl.acm.org/doi/10.1145/1534530.1534550 https://dl.acm.org/doi/10.1145/1534530.1534550 again to see if they handle a lot of the corner cases properly
- anamax 5y agoIt's not clear how that handles local functions that are redefined or that have multiple definition sites.
- rurban 5y agoWhy a these TODO(emacs)? Is there a special emacs ticket or tool?
- tekknolagi 5y agoHaha, that's my internal username at work. emacs is a nickname I got in college. EDIT: Actually, where are you seeing this? I don't see any in the blog post. Is it Skybison? EDIT 2: Oh, the Cinder commit. Yep.