summaryrefslogtreecommitdiff
path: root/yjit.rb
AgeCommit message (Collapse)Author
2024-02-23YJIT: Lazily push a frame for specialized C funcs (#10080)Takashi Kokubun
* YJIT: Lazily push a frame for specialized C funcs Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com> * Fix a comment on pc_to_cfunc * Rename rb_yjit_check_pc to rb_yjit_lazy_push_frame * Rename it to jit_prepare_lazy_frame_call * Fix a typo * Optimize String#getbyte as well * Optimize String#byteslice as well --------- Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
2024-02-16YJIT: Remove unused countersAlan Wu
2024-02-12YJIT: Adjust the padding size of counts automatically (#9912)Takashi Kokubun
2024-02-12[DOC] `:stopdoc:` directive must be on its own line (#9916)Nobuyoshi Nakada
2024-02-10YJIT: Remove unused variablesNobuyoshi Nakada
2024-02-09YJIT: Add top ISEQ call counts to --yjit-stats (#9906)Takashi Kokubun
2024-02-09YJIT: Fallback megamorphic opt_case_dispatch (#9894)Takashi Kokubun
2024-01-30YJIT: Specialize splatkw on T_HASH (#9764)Takashi Kokubun
* YJIT: Specialize splatkw on T_HASH * Fix a typo Co-authored-by: Alan Wu <XrXr@users.noreply.github.com> * Fix a few more comments --------- Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
2024-01-25YJIT: Add a counter for invokebuiltin exits (#9696)Takashi Kokubun
2024-01-23YJIT: Allow inlining ISEQ calls with a block (#9622)Takashi Kokubun
* YJIT: Allow inlining ISEQ calls with a block * Leave a TODO comment about u16 inline_block
2024-01-17YJIT: specialized codegen for integer right shift (#9564)Maxime Chevalier-Boisvert
* YJIT: specialized codegen for integer right shift Used in optcarrot. May also be used to write pure-Ruby gems. No overflow check or fixnum untagging required. * Update yjit/src/codegen.rs Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com> --------- Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
2024-01-15YJIT: Optimize Integer#succ (#9519)Takashi Kokubun
2024-01-08YJIT: Fallback Integer#<< if a shift amount varies (#9426)Takashi Kokubun
* YJIT: Fallback Integer#<< if a shift amount varies * YJIT: Do not fallback lshift in the first chain
2024-01-05YJIT: Let RubyVM::YJIT.enable respect --yjit-stats (#9415)Takashi Kokubun
2023-12-19YJIT: Add stats option to RubyVM::YJIT.enable (#9297)Takashi Kokubun
2023-11-28YJIT: fix bug in top cfunc logging in `--yjit-stats` (#9056)Maxime Chevalier-Boisvert
YJIT: correctly handle case where there are no cfunc calls Fix bug in top cfunc logging in `--yjit-stats`
2023-11-27YJIT: add top C function call counts to `--yjit-stats` (#9047)Maxime Chevalier-Boisvert
* YJIT: gather call counts for individual cfuncs Co-authored by Takashi Kokubun
2023-11-23YJIT: record `num_send_cfunc` stat (#9022)Maxime Chevalier-Boisvert
* YJIT: record num_send_cfunc stat Also report num_send_known_cfunc as percentage of num_send_cfunc * Rename num_send_known_cfunc => num_send_cfunc_inline Name seems more descriptive of what we do with out custom codegen
2023-11-10[DOC] RubyVM::YJIT doc improvementsAlan Wu
* Weaken notice about API stability. A few public APIs in here now. * Prune out APIs from the docs that are private in nature * Enable markdown mode and ensure `--` options are quoted so they are rendered as two dashes in the HTML.
2023-11-08YJIT: refactor format_number (#8869)Mau Magnaguagno
Replace enumerators with simpler and faster version that only inserts commas before '.' or end of integer string.
2023-11-07YJIT: Inline basic Ruby methods (#8855)Takashi Kokubun
* YJIT: Inline basic Ruby methods * YJIT: Fix "InsnOut operand made it past register allocation" checktype should not generate a useless instruction.
2023-11-01YJIT: skip to_a in format_number (#8815)Mau Magnaguagno
String#chars returns an array instead of an enumerator since Ruby 2.0.
2023-10-19YJIT: Print exit reasons on failure in test_yjit.rbAlan Wu
For <https://bugs.ruby-lang.org/issues/19921>, I suspect the test is failing due to a timing related interrupt, which on paper could happen with slow-enough GC runs. In any case, it's helpful for debugging to have more information when tests fail. Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
2023-10-19YJIT: Add RubyVM::YJIT.enable (#8705)Takashi Kokubun
2023-10-18YJIT: Add a live ISeq counter Alan Wu
It's an estimator for application size and could be used as a compilation heuristic later. Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com> Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
2023-10-17YJIT: Add a few missing counters for send fallback (#8681)Takashi Kokubun
2023-10-12YJIT: port call threshold logic from Rust to C for performance (#8628)Maxime Chevalier-Boisvert
* Port call threshold logic from Rust to C for performance * Prefix global/field names with yjit_ * Fix linker error * Fix preprocessor condition for rb_yjit_threshold_hit * Fix third linker issue * Exclude yjit_calls_at_interv from RJIT bindgen --------- Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
2023-10-03YJIT: add heuristic to avoid compiling cold ISEQs (#8522)Maxime Chevalier-Boisvert
* YJIT: Add counter to measure how often we compile "cold" ISEQs (#535) Fix counter name in DEFAULT_COUNTERS YJIT: add --yjit-cold-threshold, don't compile cold ISEQs YJIT: increase default cold threshold to 200_000 Remove rb_yjit_call_threshold() Remove conflict markers Fix compilation errors Threshold 1 should compile immediately Debug deadlock issue with test_ractor Fix call threshold issue with tests * Revert exception threshold logic. Document option in yjid.md * (void) for 0 parameter functions in C99 * Rename iseq_entry_cold => cold_iseq_entry * Document --yjit-cold-threshold in ruby.c * Update doc/yjit/yjit.md Co-authored-by: Jean byroot Boussier <jean.boussier+github@shopify.com> * Shorten help string to appease test * Address bug found by Kokubun. Reorder logic. --------- Co-authored-by: Alan Wu <XrXr@users.noreply.github.com> Co-authored-by: Jean byroot Boussier <jean.boussier+github@shopify.com>
2023-09-29YJIT: Report all insn exit reasons (#8541)Takashi Kokubun
2023-09-12YJIT: Add compilation time counter (#8417)Takashi Kokubun
* YJIT: Add compilation time counter * YJIT: Use Instant instead Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-08-22YJIT: add code_region_overhead stat output (#8262)Maxime Chevalier-Boisvert
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-08-18YJIT: Quiet mode when running with `--yjit-stats` (#8251)ywenc
Quiet mode for running with --yjit-stats Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-08-11YJIT: implement codegen for rb_int_lshift (#8201)Maxime Chevalier-Boisvert
* YJIT: implement codegen for rb_int_lshift * Update yjit/src/asm/x86_64/mod.rs Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com> --------- Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com> Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-08-09YJIT: Distinguish exit and fallback reasons for invokesuper/invokeblock (#8194)Takashi Kokubun
YJIT: Distinguish exit and fallback reasons for invokesuper/invokeblock Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-08-09YJIT: Count throw instructions for each tag (#8188)Takashi Kokubun
* YJIT: Count throw instructions for each tag * Show % of each throw type Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2023-08-09YJIT: Count all opt_getconstant_path exit reasons (#8187)Takashi Kokubun
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-08-02YJIT: Distinguish exit and fallback reasons for send (#8159)Takashi Kokubun
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-07-27YJIT: Use dynamic dispatch for megamorphic send (#8125)Takashi Kokubun
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-07-26YJIT: Count the number of dynamic send dispatches (#8122)Takashi Kokubun
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2023-07-26Implement `opt_aref_with` instruction (#8118)ywenc
Implement gen_opt_aref_with Vm opt_aref_with is available Test opt_aref_with Stats for opt_aref_with Co-authored-by: jhawthorn <jhawthorn@github.com> Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-07-20YJIT: Rename exec_instruction to yjit_insns_count (#8102)Takashi Kokubun
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-07-20YJIT: Avoid undercounting retired_in_yjit (#8038)Takashi Kokubun
* YJIT: Count the number of failed instructions * Rename yjit_insns_count to exec_instructions instead * Hoist out the exec_instruction counter Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-07-13YJIT: Make ratio_in_yjit always available (#8064)Takashi Kokubun
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-07-06YJIT: add new stats counter for compiled ISEQ entry points (#8032)Maxime Chevalier-Boisvert
* YJIT: add new stats counter for compiled ISEQ entry points * Update yjit.rb Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com> --------- Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com> Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-06-01YJIT: Introduce RubyVM::YJIT.stats_string (#7857)Takashi Kokubun
* YJIT: Introduce RubyVM::YJIT.printed_stats * Use #string instead Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> * Rename it to #stats_string Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com> --------- Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com> Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2023-05-10For YJIT stats, set avg_len_in_yjit to 0 if denominator would be 0 (#7793)Noah Gibbs
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-04-24YJIT: Show definedivar exit reasons (#7755)Takashi Kokubun
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
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-14YJIT: Add a counter to all side exits (#7720)Takashi Kokubun
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-04-13YJIT: Fix edge and total counts in exit_locations (#7702)John Hawthorn
The stackprof-format raw samples are suffixed with a count (ie. how many times did the previously recorded side-exit repeat). Previously we were correctly using this value to increment the :samples count, but not the :total_samples count or edges. This made the stackprof aggregate results incorrect (though any flamegraphs generated should have been correct, since those only rely on raw samples). Notes: Merged-By: maximecb <maximecb@ruby-lang.org>