aboutsummaryrefslogtreecommitdiffstats
path: root/yjit/src/utils.rs
Commit message (Collapse)AuthorAgeFilesLines
* YJIT: Return Option from asm.compile() for has_dropped_bytes()Alan Wu2023-10-191-2/+2
| | | | | | | | | So that we get a reminder to check CodeBlock::has_dropped_bytes(). Internally, asm.compile() already checks it, and this patch just propagates it out to the caller with a `#[must_use]`. Code GC logic moved out one level in entry_stub_hit(), so the body can freely use `?`
* YJIT: Add --yjit-perf (#8697)Takashi Kokubun2023-10-181-1/+1
| | | Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>
* [DOC] Removed redundant `the`Hiroshi SHIBATA2023-07-131-1/+1
|
* YJIT: Introduce Target::SideExit (#7712)Takashi Kokubun2023-04-141-2/+2
| | | | | | | * YJIT: Introduce Target::SideExit * YJIT: Obviate Insn::SideExitContext * YJIT: Avoid cloning a Context for each insn
* YJIT: Let Assembler own Context (#7691)Takashi Kokubun2023-04-121-11/+10
| | | | | | | | | | | * YJIT: Let Assembler own Context * Update a comment Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com> --------- Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
* YJIT: Stack temp register allocation for arm64 (#7659)Takashi Kokubun2023-04-061-10/+11
| | | | | | | | | | | | | | | | | * YJIT: Stack temp register allocation for arm64 * Update a comment Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com> * Update comments about assertion * Update a comment Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com> --------- Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
* YJIT: use u16 for insn_idx instead of u32 (#7534)Maxime Chevalier-Boisvert2023-03-151-1/+1
|
* YJIT: Make iseq_get_location consistent with iseq.c (#7074)Takashi Kokubun2023-01-061-7/+10
| | | | | | | | | * YJIT: Make iseq_get_location consistent with iseq.c * YJIT: Call it "YJIT entry point" Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com> Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
* YJIT: Interleave inline and outlined code blocks (#6460)Takashi Kokubun2022-10-171-5/+4
| | | | Co-authored-by: Alan Wu <alansi.xingwu@shopify.com> Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
* fixes more clippy warnings (#6543)Jimmy Miller2022-10-131-2/+10
| | | | | * fixes more clippy warnings * Fix x86 c_callable to have doc_strings
* Minor cleanups (https://github.com/Shopify/ruby/pull/345)Alan Wu2022-08-291-4/+2
| | | | | | | | | | | | | | | | | | | * Move allocation into Assembler::pos_marker We wanted to do this to begin with but didn't because we were confused about the lifetime parameter. It's actually talking about the lifetime of the references that the closure captures. Since all of our usages capture no references (they use `move`), it's fine to put a `+ 'static` here. * Use optional token syntax for calling convention macro * Explicitly request C ABI on ARM It looks like the Rust calling convention for functions are the same as the C ABI for now and it's unlikely to change, but it's easy for us to be explicit here. I also tried saying `extern "aapcs"` but that unfortunately doesn't work.
* Port print_int to the new backend (https://github.com/Shopify/ruby/pull/321)Kevin Newton2022-08-291-47/+63
| | | | | | * Port print_int to the new backend * Tests for print_int and print_str
* Port print_str to new backend (https://github.com/Shopify/ruby/pull/318)Kevin Newton2022-08-291-65/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | * ADR and ADRP for AArch64 * Implement Op::Jbe on X86 * Lera instruction * Op::BakeString * LeaPC -> LeaLabel * Port print_str to the new backend * Port print_value to the new backend * Port print_ptr to the new backend * Write null-terminators in Op::BakeString * Fix up rebase issues on print-str port * Add back in panic for X86 backend for unsupported instructions being lowered * Fix target architecture
* Fix compile errors on arm on the CI (https://github.com/Shopify/ruby/pull/313)Maxime Chevalier-Boisvert2022-08-291-11/+32
| | | | | | * Fix compile errors on arm on the CI * Fix typo
* add --yjit-dump-iseqs param (https://github.com/Shopify/ruby/pull/332)Noah Gibbs2022-08-241-0/+35
|
* YJIT: Enable default rustc lints (warnings) (#5864)Alan Wu2022-04-291-1/+34
| | | | | | | | | | | | | | `rustc` performs in depth dead code analysis and issues warning even for things like unused struct fields and unconstructed enum variants. This was annoying for us during the port but hopefully they are less of an issue now. This patch enables all the unused warnings we disabled and address all the warnings we previously ignored. Generally, the approach I've taken is to use `cfg!` instead of using the `cfg` attribute and to delete code where it makes sense. I've put `#[allow(unused)]` on things we intentionally keep around for printf style debugging and on items that are too annoying to keep warning-free in all build configs.
* Rust YJITAlan Wu2022-04-271-0/+205
In December 2021, we opened an [issue] to solicit feedback regarding the porting of the YJIT codebase from C99 to Rust. There were some reservations, but this project was given the go ahead by Ruby core developers and Matz. Since then, we have successfully completed the port of YJIT to Rust. The new Rust version of YJIT has reached parity with the C version, in that it passes all the CRuby tests, is able to run all of the YJIT benchmarks, and performs similarly to the C version (because it works the same way and largely generates the same machine code). We've even incorporated some design improvements, such as a more fine-grained constant invalidation mechanism which we expect will make a big difference in Ruby on Rails applications. Because we want to be careful, YJIT is guarded behind a configure option: ```shell ./configure --enable-yjit # Build YJIT in release mode ./configure --enable-yjit=dev # Build YJIT in dev/debug mode ``` By default, YJIT does not get compiled and cargo/rustc is not required. If YJIT is built in dev mode, then `cargo` is used to fetch development dependencies, but when building in release, `cargo` is not required, only `rustc`. At the moment YJIT requires Rust 1.60.0 or newer. The YJIT command-line options remain mostly unchanged, and more details about the build process are documented in `doc/yjit/yjit.md`. The CI tests have been updated and do not take any more resources than before. The development history of the Rust port is available at the following commit for interested parties: https://github.com/Shopify/ruby/commit/1fd9573d8b4b65219f1c2407f30a0a60e537f8be Our hope is that Rust YJIT will be compiled and included as a part of system packages and compiled binaries of the Ruby 3.2 release. We do not anticipate any major problems as Rust is well supported on every platform which YJIT supports, but to make sure that this process works smoothly, we would like to reach out to those who take care of building systems packages before the 3.2 release is shipped and resolve any issues that may come up. [issue]: https://bugs.ruby-lang.org/issues/18481 Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com> Co-authored-by: Noah Gibbs <the.codefolio.guy@gmail.com> Co-authored-by: Kevin Newton <kddnewton@gmail.com>