summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-10-20Add opt_regexpmatch2John Hawthorn
2021-10-20Assign directly to C_ARG_REGS now when possibleJohn Hawthorn
2021-10-20Use callee-saved regs for REG_SP, REG_EP, REG_CFPJohn Hawthorn
2021-10-20Detach mapping to local in ctx_set_local_typeJohn Hawthorn
Similar to the previous fix to ctx_clear_local_types, we must detach mappings to a local if we are changing its value.
2021-10-20Fix stack size check for ctx_get_opnd_typeJohn Hawthorn
Previously all stack operands would become unknown once the stack grew beyond a certain size. This worked, but unnecessarily hid available information.
2021-10-20Move yjit_type_of_value into yjit_core.cJohn Hawthorn
2021-10-20Implement verify_ctx for debuggingJohn Hawthorn
2021-10-20More detection of immediate constantsJohn Hawthorn
2021-10-20Don't generate entry point when PC != 0John Hawthorn
If we hit this at PC > 0 (ie. with an optional argument) the provided types and context are likely incorrect and it is likely this block can't be used.
2021-10-20Implement tostring instruction for yjiteileencodes
Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2021-10-20Simpler fix for -DUSE_EMBED_CI=0Alan Wu
Nobu pointed out that saving the old ci to a local is enough to keep it reachable.
2021-10-20Revert "Fix use-after-free on USE_EMBED_CI=0"Alan Wu
This reverts commit 1e0f2e4b09ca9443524acf4b50ffd50a80f330f3.
2021-10-20Allow upgrading first N types when stack is largeJohn Hawthorn
2021-10-20Improve comments for mapping functionsJohn Hawthorn
2021-10-20Add regression test of invalid mapping mergeJohn Hawthorn
This should have referenced MAX_TEMP_TYPES, not MAX_LOCAL_TYPES.
2021-10-20Fix ctx_clear_local_typesJohn Hawthorn
2021-10-20Make ctx_diff aware of mappingsJohn Hawthorn
2021-10-20Introduce ctx_{get,set}_opnd_mappingJohn Hawthorn
2021-10-20Rename to ctx_upgrade_opnd_typeJohn Hawthorn
2021-10-20Return if fixnums impossibleJohn Hawthorn
2021-10-20Save PC and SP before accessing globalsAlan Wu
These instructions are marked as not leaf in insns.def, which indicate that they could raise exceptions and/or call Ruby methods.
2021-10-20Add setglobal to yjiteileencodes
Adds yjit support for setting global variables. Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org> Co-authored-by: John Hawthorn <john@hawthorn.email>
2021-10-20If codeblock is NULL because YJIT is disabled, YJIT.runtime_stats should ↵Noah Gibbs
return Qnil
2021-10-20Add getglobal to yjiteileencodes
Adds getglobal to yjit and a test for it. Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2021-10-20Fix and uncomment getlocal testJohn Hawthorn
Previously, under the scraper, this would side-exit because it was returning to a C method. Now that we use the jit_func entrypoint, this test no longer side-exits.
2021-10-20Add flag so we can easily tell if all stats avail. Comment out broken test.Maxime Chevalier-Boisvert
2021-10-20Fix use-after-free on USE_EMBED_CI=0Alan Wu
The old code didn't keep old_operands[0] reachable while allocating. You can crash it by requiring erb under GC stress mode.
2021-10-20Add some YJIT runtime testsKevin Newton
This is just for helping my own understanding, but could be useful for others as well.
2021-10-20Clear JIT code when tracepoints get enabledAaron Patterson
Clear out any JIT code on iseqs when tracepoints get enabled. We can't handle tracepoints right now, so we'll just try to recompile later.
2021-10-20Make sure we can still compile with the JIT disabledAaron Patterson
If `--disable-jit-support` is passed to configure, then `jit_func` is removed from the iseq body and we can't compile YJIT. This commit detects when the JIT function pointer is gone and disables YJIT in that case.
2021-10-20Remove the scraperAaron Patterson
Now that we're using the jit function entry point, we don't need the scraper. Thank you for your service, scraper. ❤️
2021-10-20Change register definitions to match the entry point calling conventionAaron Patterson
The JIT entry point passes the CFP as RSI and the EC as RDI. Lets match that so we don't have to shuffle registers around.
2021-10-20Disable YJIT in MJIT testsAaron Patterson
2021-10-20make compiler happyAaron Patterson
2021-10-20Fix BOP invalidationAaron Patterson
Instead of mutating the iseqs, just clear the JIT function.
2021-10-20Add a guard that we start executing on the first PCAaron Patterson
Methods with optional parameters don't always start executing at the first PC, but we compile all methods assuming that they do. This commit adds a guard to ensure that we're actually starting at the first PC for methods with optional params
2021-10-20fix alignmentAaron Patterson
2021-10-20Always use `ret` to return to the interpreterAaron Patterson
Always using `ret` to return to the interpreter means that we never have to check the VM_FRAME_FLAG_FINISH flag. In the case that we return `Qundef`, the interpreter will execute the cfp. We can take advantage of this by setting the PC to the instruction we can't handle, and let the interpreter pick up the ball from there. If we return a value other than Qundef, the interpreter will take that value as the "return value" from the JIT and push that to the SP of the caller The leave instruction puts the return value on the top of the calling frame's stack. YJIT does the same thing for leave instructions. However, when we're returning back to the interpreter, the leave instruction _should not_ put the return value on the top of the stack, but put it in RAX and use RET. This commit pops the last value from the stack pointer and puts it in RAX so that the interpreter is happy with SP.
2021-10-20YJIT stats should always include the inlined and outlined sizes, regardless ↵Noah Gibbs
of RUBY_DEBUG and --yjit-stats/YJIT_STATS settings
2021-10-20Allow asserts on results, rather than stdoutJohn Hawthorn
2021-10-20Add assert_no_exits aliasJohn Hawthorn
2021-10-20more testingJohn Hawthorn
2021-10-20Add test for recursionJohn Hawthorn
2021-10-20Add test of yjit compilationJohn Hawthorn
2021-10-20Add YJIT.enabled?John Hawthorn
2021-10-20Ensure we guard the value before we returnKevin Newton
Otherwise you can end up not implicitly calling `to_ary`, which if it has side-effects will result in different behavior.
2021-10-20Update yjit.rbMaxime Chevalier-Boisvert
2021-10-20Update yjit.rbMaxime Chevalier-Boisvert
Co-authored-by: Rafael França <rafael.franca@shopify.com>
2021-10-20Dup strings so we can mutate themAaron Patterson
I guess the strings are frozen, so we need to dup before mutating
2021-10-20It's RUN_OPTS, not RUNOPTS!!! via @tenderloveMaxime Chevalier-Boisvert