Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
While we already generated machine code for performing the actual call to the C function, we perform all deconting and unboxing of arguments in high level code. This is so that spesh can optimize this code to what's actually necessary for a given call site. For JIT compilation of the specialized code, we compile the call to the C function again, but this time instead of tailoring it to getting the return type from the runloop, we use can access information gathered by spesh for determining the register holding the return type. The generated JIT graph is seamlessly included in the wrapper function body's graph. A function call with a single argument thus results in JIT compiled code for: <sp_getarg_o>, <set>, <decont_i>, invokish control guard, <set>, <PHI>, <PHI>, <wval>, <wval>, MVM_gc_mark_thread_blocked, the actual call, MVM_gc_mark_thread_unblocked, call to box the return value, <return_o> Since at this stage the code calling the nativeinvoke_o op cannot change anymore, we can access the WORK registers directly, saving the copying of those to tc->cur_frame->args.
- Loading branch information
Showing
5 changed files
with
67 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters