summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Allow to compile with --yjit-stats support but not the full RUBY_DEBUGJean Boussier2021-10-204-47/+75
| | | | | | | | | | | RUBY_DEBUG have a very significant performance overhead. Enough that YJIT with RUBY_DEBUG is noticeably slower than the interpreter without RUBY_DEBUG. This makes it hard to collect yjit-stats in production environments. By allowing to collect JIT statistics without the RUBy_DEBUG overhead, I hope to make such use cases smoother.
* Add toregexp to yjiteileencodes2021-10-203-0/+48
| | | | | | | | The FIXME is there so we remember to investigate why insns clears the temporary array. Is this necessary? If it's not we can remove it from both. Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
* Use cmov to handle Qundef case in getivar instead of side-exitMaxime Chevalier-Boisvert2021-10-202-5/+4
|
* Add ASM commentMaxime Chevalier-Boisvert2021-10-201-0/+1
|
* update README with correct repository URLMike Dalessio2021-10-201-3/+3
|
* Implement putspecialobjectJohn Hawthorn2021-10-202-1/+23
|
* Add opt_regexpmatch2John Hawthorn2021-10-202-0/+17
|
* Assign directly to C_ARG_REGS now when possibleJohn Hawthorn2021-10-201-20/+8
|
* Use callee-saved regs for REG_SP, REG_EP, REG_CFPJohn Hawthorn2021-10-203-109/+25
|
* Detach mapping to local in ctx_set_local_typeJohn Hawthorn2021-10-202-0/+22
| | | | | Similar to the previous fix to ctx_clear_local_types, we must detach mappings to a local if we are changing its value.
* Fix stack size check for ctx_get_opnd_typeJohn Hawthorn2021-10-201-3/+6
| | | | | | Previously all stack operands would become unknown once the stack grew beyond a certain size. This worked, but unnecessarily hid available information.
* Move yjit_type_of_value into yjit_core.cJohn Hawthorn2021-10-203-41/+43
|
* Implement verify_ctx for debuggingJohn Hawthorn2021-10-203-1/+118
|
* More detection of immediate constantsJohn Hawthorn2021-10-201-2/+10
|
* Don't generate entry point when PC != 0John Hawthorn2021-10-201-0/+6
| | | | | | 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.
* Implement tostring instruction for yjiteileencodes2021-10-202-0/+34
| | | | Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
* Simpler fix for -DUSE_EMBED_CI=0Alan Wu2021-10-201-2/+2
| | | | | Nobu pointed out that saving the old ci to a local is enough to keep it reachable.
* Revert "Fix use-after-free on USE_EMBED_CI=0"Alan Wu2021-10-201-12/+7
| | | | This reverts commit 1e0f2e4b09ca9443524acf4b50ffd50a80f330f3.
* Allow upgrading first N types when stack is largeJohn Hawthorn2021-10-201-6/+7
|
* Improve comments for mapping functionsJohn Hawthorn2021-10-201-1/+12
|
* Add regression test of invalid mapping mergeJohn Hawthorn2021-10-201-1/+14
| | | | This should have referenced MAX_TEMP_TYPES, not MAX_LOCAL_TYPES.
* Fix ctx_clear_local_typesJohn Hawthorn2021-10-201-1/+2
|
* Make ctx_diff aware of mappingsJohn Hawthorn2021-10-201-3/+16
|
* Introduce ctx_{get,set}_opnd_mappingJohn Hawthorn2021-10-203-51/+106
|
* Rename to ctx_upgrade_opnd_typeJohn Hawthorn2021-10-203-17/+25
|
* Return if fixnums impossibleJohn Hawthorn2021-10-201-0/+20
|
* Save PC and SP before accessing globalsAlan Wu2021-10-202-2/+43
| | | | | These instructions are marked as not leaf in insns.def, which indicate that they could raise exceptions and/or call Ruby methods.
* Add setglobal to yjiteileencodes2021-10-203-1/+36
| | | | | | | Adds yjit support for setting global variables. Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org> Co-authored-by: John Hawthorn <john@hawthorn.email>
* If codeblock is NULL because YJIT is disabled, YJIT.runtime_stats should ↵Noah Gibbs2021-10-201-0/+5
| | | | return Qnil
* Add getglobal to yjiteileencodes2021-10-203-0/+37
| | | | | | Adds getglobal to yjit and a test for it. Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
* Fix and uncomment getlocal testJohn Hawthorn2021-10-201-14/+13
| | | | | | 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.
* Add flag so we can easily tell if all stats avail. Comment out broken test.Maxime Chevalier-Boisvert2021-10-202-19/+23
|
* Fix use-after-free on USE_EMBED_CI=0Alan Wu2021-10-201-7/+11
| | | | | The old code didn't keep old_operands[0] reachable while allocating. You can crash it by requiring erb under GC stress mode.
* Add some YJIT runtime testsKevin Newton2021-10-201-2/+57
| | | | This is just for helping my own understanding, but could be useful for others as well.
* Clear JIT code when tracepoints get enabledAaron Patterson2021-10-202-0/+53
| | | | | 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.
* Make sure we can still compile with the JIT disabledAaron Patterson2021-10-203-3/+10
| | | | | | | 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.
* Remove the scraperAaron Patterson2021-10-2012-364/+5
| | | | | Now that we're using the jit function entry point, we don't need the scraper. Thank you for your service, scraper. ❤️
* Change register definitions to match the entry point calling conventionAaron Patterson2021-10-202-9/+2
| | | | | 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.
* Disable YJIT in MJIT testsAaron Patterson2021-10-201-0/+1
|
* make compiler happyAaron Patterson2021-10-201-2/+3
|
* Fix BOP invalidationAaron Patterson2021-10-201-11/+3
| | | | Instead of mutating the iseqs, just clear the JIT function.
* Add a guard that we start executing on the first PCAaron Patterson2021-10-205-3/+53
| | | | | | | 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
* fix alignmentAaron Patterson2021-10-203-9/+7
|
* Always use `ret` to return to the interpreterAaron Patterson2021-10-205-39/+43
| | | | | | | | | | | | | | | | | | | | | 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.
* YJIT stats should always include the inlined and outlined sizes, regardless ↵Noah Gibbs2021-10-201-12/+12
| | | | of RUBY_DEBUG and --yjit-stats/YJIT_STATS settings
* Allow asserts on results, rather than stdoutJohn Hawthorn2021-10-201-34/+40
|
* Add assert_no_exits aliasJohn Hawthorn2021-10-201-0/+4
|
* more testingJohn Hawthorn2021-10-201-2/+16
|
* Add test for recursionJohn Hawthorn2021-10-201-0/+11
|
* Add test of yjit compilationJohn Hawthorn2021-10-201-0/+228
|