summaryrefslogtreecommitdiff
path: root/yjit/src
AgeCommit message (Collapse)Author
2023-04-19YJIT: Tweak asm comments (#7743)Takashi Kokubun
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-04-19YJIT: Remove Insn::RegTemps (#7741)Takashi Kokubun
* YJIT: Remove Insn::RegTemps * Update a comment Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com> --------- Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com> Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2023-04-18Implement opt_newarray_send in YJITAaron Patterson
This commit implements opt_newarray_send along with min / max / hash for stack allocated arrays Notes: Merged: https://github.com/ruby/ruby/pull/6090
2023-04-18updating bindgenAaron Patterson
Notes: Merged: https://github.com/ruby/ruby/pull/6090
2023-04-18YJIT: Fix raw sample stack lengths in exit traces (#7728)John Hawthorn
yjit-trace-exits appends a synthetic sample for the instruction being exited, but we didn't increment the size of the stack. Fixing this count correctly lets us successfully generate a flamegraph from the exits. I also replaced the line number for instructions with 0, as I don't think the previous value had meaning. Co-authored-by: Adam Hess <HParker@github.com> Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-04-17YJIT: Fixes failure reported by rails for opt+splat+rest (#7727)Jimmy Miller
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-04-17YJIT: Spill a caller stack as late as possible (#7726)Takashi Kokubun
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-04-14YJIT: Add a counter to all side exits (#7720)Takashi Kokubun
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-04-14YJIT: Remove duplicate `asm.spill_temps()` Alan Wu
`jit_prepare_routine_call()` calls it, and there is another call above on line 2302. Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com> Notes: Merged: https://github.com/ruby/ruby/pull/7718
2023-04-14YJIT: Fix false object collection when setting ivarAlan Wu
Previously, setinstancevariable could generate code that calls `rb_ensure_iv_list_size()` without first updating `cfp->sp`. This means in the event that a GC start from within said routine the top few objects would not be marked, causing them to be falsly collected. Call `jit_prepare_routine_call()` first. [Bug #19601] Notes: Merged: https://github.com/ruby/ruby/pull/7718
2023-04-14YJIT: Introduce Target::SideExit (#7712)Takashi Kokubun
* YJIT: Introduce Target::SideExit * YJIT: Obviate Insn::SideExitContext * YJIT: Avoid cloning a Context for each insn Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-04-14YJIT: Change to Option<CodegenStatus> (#7717)Jimmy Miller
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-04-13YJIT: Add support for rest with option and splat args (#7698)Jimmy Miller
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2023-04-13YJIT: Use an enum to represent counters (#7701)Takashi Kokubun
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-04-13YJIT: Move stack_opnd from Context to Assembler (#7700)Takashi Kokubun
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-04-13YJIT: Add a sampling option to exit tracing (#7693)Adam Hess
Add a sampling option to trace exits Running YJIT with trace exits enabled can make very large metrics files. This allows us to configure a sample rate to make tracing exits possible on larger tests. This also updates the documented YJIT options. Co-authored-by: Alan Wu <XrXr@users.noreply.github.com> Co-authored-by: John Hawthorn <john@hawthorn.email> Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com> Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-04-12YJIT: Fix missing argc check in known cfuncsJohn Hawthorn
Previously we were missing a compile-time check that the known cfuncs receive the correct number of arguments. We noticied this because in particular when using ARGS_SPLAT, which also wasn't checked, YJIT would crash on code which was otherwise correct (didn't raise exceptions in the VM). This still supports vararg (argc == -1) cfuncs. I added an additional assertion that when we use the specialized codegen for one of these known functions that the argc are popped off the stack correctly, which should help ensure they're implemented correctly (previously the crash was usually observed on a future `leave` insn). [Bug #19595] Notes: Merged: https://github.com/ruby/ruby/pull/7697
2023-04-12YJIT: Let Assembler own Context (#7691)Takashi Kokubun
* 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> Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2023-04-11YJIT: Fix build on A64Alan Wu
Typo fix for the last commit (1432b37)
2023-04-11YJIT: Fix a compilation warning in x86_64Takashi Kokubun
This is used only for arm64's cb.jmp_ptr_bytes().
2023-04-11YJIT: Reduce paddings if --yjit-exec-mem-size <= 128 on arm64 (#7671)Takashi Kokubun
* YJIT: Reduce paddings if --yjit-exec-mem-size <= 128 on arm64 * YJIT: Define jmp_ptr_bytes on CodeBlock Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-04-10YJIT: Avoid using a register for unspecified_bits (#7685)Takashi Kokubun
Fix [Bug #19586] Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2023-04-06YJIT: Stack temp register allocation for arm64 (#7659)Takashi Kokubun
* 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> Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-04-06Update VPATH for socket, & dependenciesMatt Valentine-House
The socket extensions rubysocket.h pulls in the "private" include/gc.h, which now depends on vm_core.h. vm_core.h pulls in id.h when tool/update-deps generates the dependencies for the makefiles, it generates the line for id.h to be based on VPATH, which is configured in the extconf.rb for each of the extensions. By default VPATH does not include the actual source directory of the current Ruby so the dependency fails to resolve and linking fails. We need to append the topdir and top_srcdir to VPATH to have the dependancy picked up correctly (and I believe we need both of these to cope with in-tree and out-of-tree builds). I copied this from the approach taken in https://github.com/ruby/ruby/blob/master/ext/objspace/extconf.rb#L3 Notes: Merged: https://github.com/ruby/ruby/pull/7393
2023-04-05YJIT: Add codegen for Integer methods (#7665)Takashi Kokubun
* YJIT: Add codegen for Integer methods * YJIT: Update dependencies * YJIT: Fix Integer#[] for argc=2 Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2023-04-05YJIT: Count the number of actually written bytes (#7658)Takashi Kokubun
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-04-05YJIT: Eanble `unsafe_op_in_unsafe_fn` on crate::coreAlan Wu
Encourages commenting about soundness of `unsafe` usages. Notes: Merged: https://github.com/ruby/ruby/pull/7657
2023-04-05Revert "YJIT: Suppress unnecessary `unsafe` block (GH-7634)"Alan Wu
This reverts commit 9e678cdbd054f78576a8f21b3f97cccc395ade22. Without the `unsafe` annotations, the SAFETY comments make less sense. I want to keep the SAFETY comments. Notes: Merged: https://github.com/ruby/ruby/pull/7657
2023-04-04YJIT: add stats for ratio of versions per block (#7653)Maxime Chevalier-Boisvert
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-04-04Remove an unused counterTakashi Kokubun
I ended up not using it.
2023-04-04YJIT: Stack temp register allocation (#7651)Takashi Kokubun
Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com> Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2023-04-03YJIT: Add codegen for Array#<< (#7645)Takashi Kokubun
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2023-04-01Remove an unneeded function copyTakashi Kokubun
2023-04-01Remove unused VM_CALL_BLOCKISEQ flagTakashi Kokubun
2023-03-31YJIT: Remove unused variable [ci skip]Alan Wu
2023-03-31YJIT: Suppress unnecessary `unsafe` block (#7634)Nobuyoshi Nakada
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-03-30YJIT: Test more kw and rest cases and change exit nameJimmy Miller
Notes: Merged: https://github.com/ruby/ruby/pull/7628
2023-03-30YJIT: Generate side exits as late as possible (#7612)Takashi Kokubun
* YJIT: Generate side exits late as possible * YJIT: s/for_stack_size/with_stack_size/ * YJIT: s/get_counter/exit_counter/ Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2023-03-29YJIT: Leave cfp->pc uninitialized for VM_FRAME_MAGIC_CFUNCAlan Wu
C function frames don't need to use the VM-specific pc field to run properly. When pushing a control frame from output code, save one instruction by leaving the field uninitialized. Fix-up rb_vm_svar_lep(), which is used while setting local variables via Regexp#=~. Use cfp->iseq as a secondary signal so it can stop assuming that all CFUNC frames always have zero pc's. Notes: Merged: https://github.com/ruby/ruby/pull/7620 Merged-By: XrXr
2023-03-29YJIT: code_gc(): Assert self is inline to avoid other_cb()Alan Wu
The derived `&mut` from `other_cb()` overlapped with the parameter `ocb`. Use `cfg!()` instead of `#[cfg...]` to avoid unused warnings. Notes: Merged: https://github.com/ruby/ruby/pull/7611
2023-03-29YJIT: Take VM lock in RubyVM::YJIT.code_gcAlan Wu
Code GC needs synchronization. Notes: Merged: https://github.com/ruby/ruby/pull/7611
2023-03-29YJIT: Fix overlapping &mut in Assembler::code_gc()Alan Wu
Making overlapping `&mut`s triggers Undefined Bahavior. This function previously had them through `cb` and `ocb` aliasing with `self` or live references in the caller. To fix the overlap, take `ocb` as a parameter and don't use `get_inline_cb()` in the body of the function. Notes: Merged: https://github.com/ruby/ruby/pull/7611
2023-03-29YJIT: Rest and keyword (non-supplying) (#7608)Jimmy Miller
* YJIT: Rest and keyword (non-supplying) * Update yjit/src/codegen.rs --------- Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com> Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-03-28YJIT: Add `--yjit-pause` and `RubyVM::YJIT.resume` (#7609)Maxime Chevalier-Boisvert
* YJIT: Add --yjit-pause and RubyVM::YJIT.resume This allows booting YJIT in a suspended state. We chose to add a new command line option as opposed to simply allowing YJIT.resume to work without any command line option because it allows for combining with YJIT tuning command line options. It also simpifies implementation. Paired with Kokubun and Maxime. * Update yjit.rb Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com> --------- Co-authored-by: Alan Wu <XrXr@users.noreply.github.com> Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com> Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-03-28YJIT: Stop using the starting_context pattern (#7610)Takashi Kokubun
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2023-03-24YJIT: Rest and block_arg support (#7584)Jimmy Miller
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-03-24YJIT: Constify EC to avoid an `as` pointer cast (#7591)Alan Wu
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-03-23YJIT: Save PC on rb_str_concat (#7586)Takashi Kokubun
[Bug #19483] Co-authored-by: Alan Wu <alansi.xingwu@shopify.com> Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2023-03-23YJIT: Use starting context for status === CantCompile (#7583)Jimmy Miller
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-03-23Use shape information in YJIT's definedivar implementation (#7579)Ole Friis Østergaard
* Use shape information in YJIT's definedivar implementation * Handle complex shape for definedivar Notes: Merged-By: maximecb <maximecb@ruby-lang.org>