-
Notifications
You must be signed in to change notification settings - Fork 150
Part 1/2 #101 - implement partial compilation to native code #105
Conversation
Codecov Report
@@ Coverage Diff @@
## master #105 +/- ##
==========================================
- Coverage 68.9% 65.76% -3.15%
==========================================
Files 33 40 +7
Lines 3345 3867 +522
==========================================
+ Hits 2305 2543 +238
- Misses 783 1058 +275
- Partials 257 266 +9
Continue to review full report at Codecov.
|
…compile/native, track instruction metadata when emitting internal bytecode
On second thought, hold off on reviewing this. I need to think about a better way to structure this. |
@sbinet, can you look at this and give me your thoughts? I'm not done, but getting close. This PR is mostly boilerplate, but usefully implements AOT compilation for
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still digesting... (just a first pass.)
Ive addressed the comments, PTAL. |
Friendly ping @sbinet :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still digging through :)
Done :) PTAL. |
…, off-by-one in asm emitter in some conditions, add custom test case which can be fully compiled, written in rust.
Apologies for the additional commit - I was intending for that to be a different PR, but I found a few bugs that shouldn't be left out of this PR (off-by-one in the return instruction pointer, double-allocation/overrun for |
…+ relies on less implementation behaviour.
Friendly ping @sbinet :) |
Let me know if there's anything I can do to move this along. If you would like me to split some of this into separate PRs, (like the scanner in one and the execution in another) I can try. Let me know :) |
Apologies for the sluggish answers. (I am on the road to the dotGo conference...) If you can split some PRs off, then yes, by all means: smaller bites are great :) |
No worries at all :) I'm sorry for being pushy, just trying to get this in before my excitement shifts to other ideas. I'll go ahead and split this into 2-3 different PRs, and close this one. Thanks, and enjoy dotGo! Say hi to Dave for me 😄 |
This PR lays the boilerplate for supporting AOT & JIT compilation.
Use one of the unassigned opcodes to signal to the interpreter to execute a native code section. Modify the disassembler to throw an error if this opcode is used, so any collision years down the line is detected & can be trivially fixed.
Implement interfaces to abstract different stages, specifically:
sequenceScanner
)pageAllocator
)instructionBuilder
)When a sequence of opcodes is rewritten, the beginning is set to an internal opcode that signals the interpreter should run a section of native code at a specific
[]asmBlock
index. Any remaining opcodes are set toops.Unreachable
- as we dont plan to emit asm where there are inbound branches in the middle (yet), this should crash out in the event of any bugs that jump into the recompiled section.Tests for integration between the different interfaces & structures in
VM
/compiledFunction
.