aboutsummaryrefslogtreecommitdiffstats
path: root/yjit.rb
Commit message (Collapse)AuthorAgeFilesLines
* [DOC] RubyVM::YJIT doc improvementsAlan Wu2023-11-101-25/+25
| | | | | | | * 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.
* YJIT: refactor format_number (#8869)Mau Magnaguagno2023-11-081-5/+4
| | | Replace enumerators with simpler and faster version that only inserts commas before '.' or end of integer string.
* YJIT: Inline basic Ruby methods (#8855)Takashi Kokubun2023-11-071-0/+3
| | | | | | | * YJIT: Inline basic Ruby methods * YJIT: Fix "InsnOut operand made it past register allocation" checktype should not generate a useless instruction.
* YJIT: skip to_a in format_number (#8815)Mau Magnaguagno2023-11-011-1/+1
| | | String#chars returns an array instead of an enumerator since Ruby 2.0.
* YJIT: Print exit reasons on failure in test_yjit.rbAlan Wu2023-10-191-7/+12
| | | | | | | | | | | 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>
* YJIT: Add RubyVM::YJIT.enable (#8705)Takashi Kokubun2023-10-191-4/+4
|
* YJIT: Add a live ISeq counter Alan Wu2023-10-181-0/+1
| | | | | | | 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>
* YJIT: Add a few missing counters for send fallback (#8681)Takashi Kokubun2023-10-171-1/+1
|
* YJIT: port call threshold logic from Rust to C for performance (#8628)Maxime Chevalier-Boisvert2023-10-121-1/+1
| | | | | | | | | | | | | | | | | * 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>
* YJIT: add heuristic to avoid compiling cold ISEQs (#8522)Maxime Chevalier-Boisvert2023-10-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* YJIT: Report all insn exit reasons (#8541)Takashi Kokubun2023-09-291-9/+30
|
* YJIT: Add compilation time counter (#8417)Takashi Kokubun2023-09-121-0/+1
| | | | | * YJIT: Add compilation time counter * YJIT: Use Instant instead
* YJIT: add code_region_overhead stat output (#8262)Maxime Chevalier-Boisvert2023-08-221-0/+4
|
* YJIT: Quiet mode when running with `--yjit-stats` (#8251)ywenc2023-08-181-1/+3
| | | Quiet mode for running with --yjit-stats
* YJIT: implement codegen for rb_int_lshift (#8201)Maxime Chevalier-Boisvert2023-08-111-0/+1
| | | | | | | | | | | * 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>
* YJIT: Distinguish exit and fallback reasons for invokesuper/invokeblock (#8194)Takashi Kokubun2023-08-091-2/+4
| | | | | YJIT: Distinguish exit and fallback reasons for invokesuper/invokeblock
* YJIT: Count throw instructions for each tag (#8188)Takashi Kokubun2023-08-091-0/+4
| | | | | * YJIT: Count throw instructions for each tag * Show % of each throw type
* YJIT: Count all opt_getconstant_path exit reasons (#8187)Takashi Kokubun2023-08-091-1/+1
|
* YJIT: Distinguish exit and fallback reasons for send (#8159)Takashi Kokubun2023-08-021-1/+2
|
* YJIT: Use dynamic dispatch for megamorphic send (#8125)Takashi Kokubun2023-07-271-1/+3
|
* YJIT: Count the number of dynamic send dispatches (#8122)Takashi Kokubun2023-07-261-0/+1
|
* Implement `opt_aref_with` instruction (#8118)ywenc2023-07-261-0/+1
| | | | | | | | | | | 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>
* YJIT: Rename exec_instruction to yjit_insns_count (#8102)Takashi Kokubun2023-07-201-2/+2
|
* YJIT: Avoid undercounting retired_in_yjit (#8038)Takashi Kokubun2023-07-201-1/+1
| | | | | | | * YJIT: Count the number of failed instructions * Rename yjit_insns_count to exec_instructions instead * Hoist out the exec_instruction counter
* YJIT: Make ratio_in_yjit always available (#8064)Takashi Kokubun2023-07-131-15/+8
|
* YJIT: add new stats counter for compiled ISEQ entry points (#8032)Maxime Chevalier-Boisvert2023-07-061-0/+1
| | | | | | | | | | | * 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>
* YJIT: Introduce RubyVM::YJIT.stats_string (#7857)Takashi Kokubun2023-06-011-74/+84
| | | | | | | | | | | | | | | | * 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>
* For YJIT stats, set avg_len_in_yjit to 0 if denominator would be 0 (#7793)Noah Gibbs2023-05-101-1/+1
|
* YJIT: Show definedivar exit reasons (#7755)Takashi Kokubun2023-04-241-0/+1
|
* YJIT: Fix raw sample stack lengths in exit traces (#7728)John Hawthorn2023-04-181-1/+1
| | | | | | | | | | 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>
* YJIT: Add a counter to all side exits (#7720)Takashi Kokubun2023-04-141-1/+1
|
* YJIT: Fix edge and total counts in exit_locations (#7702)John Hawthorn2023-04-131-5/+5
| | | | | | | | | | 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).
* YJIT: Count the number of actually written bytes (#7658)Takashi Kokubun2023-04-051-1/+1
|
* YJIT: add stats for ratio of versions per block (#7653)Maxime Chevalier-Boisvert2023-04-041-0/+4
|
* YJIT: Stack temp register allocation (#7651)Takashi Kokubun2023-04-041-0/+3
| | | Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
* YJIT: Add `--yjit-pause` and `RubyVM::YJIT.resume` (#7609)Maxime Chevalier-Boisvert2023-03-281-0/+5
| | | | | | | | | | | | | | | | | | | * 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>
* YJIT: skip intermediate arrays in print_sorted_exit_counts (#7547)Mau Magnaguagno2023-03-171-9/+10
| | | | | Early total_exits condition. Replace Array#sort_by/first(how_many) with Array#max_by(how_many). Replace Array#map/max with Array#max_by, match print_counters style for longest_name_length.
* YJIT: add stats to keep track of when branch direction is known (#7544)Maxime Chevalier-Boisvert2023-03-161-0/+4
| | | This measures the impact of changes made by @jhawthorn last year.
* YJIT: reject large stacks so we can use i8/u8 stack_size and stack_offset ↵Maxime Chevalier-Boisvert2023-03-011-0/+2
| | | | | | | (#7412) * Reject large stacks so we can use i8/u8 stack_size and stack_offset * Add rejection test for iseq too long as well
* YJIT: add defer_empty_count statMaxime Chevalier-Boisvert2023-02-281-0/+1
| | | | Count how often we defer from a block that is empty
* YJIT: Use rb_ivar_get at the end of ivar chains (#7334)Takashi Kokubun2023-02-171-0/+1
| | | | | * YJIT: Use rb_ivar_get at the end of ivar chains * Rename the counter to get_ivar_max_depth
* YJIT: Show Context stats on exit (#7327)Takashi Kokubun2023-02-161-3/+5
|
* YJIT: Pad more spaces to accommodate delimiters (#7302)Takashi Kokubun2023-02-141-33/+33
|
* YJIT: add counters for polymorphic send and send with known class (#7288)Maxime Chevalier-Boisvert2023-02-101-11/+18
|
* YJIT: format numbers in stats printouts with comma separators (#7281)Maxime Chevalier-Boisvert2023-02-091-31/+43
|
* Add stats so we can keep track of x86 rel32 vs register calls (#7142)Maxime Chevalier-Boisvert2023-01-181-0/+5
| | | | | | | * Add stats so we can keep track of x86 rel32 vs register calls To know if we get that "prime real estate" as Alan put it. * Fix bug pointed by Alan
* YJIT: Do not refer to an undefined constant (#7112)Takashi Kokubun2023-01-121-6/+3
|
* Document the public interface of YJIT [ci skip]Takashi Kokubun2022-12-221-6/+7
|
* YJIT: skip map in print_sorted_exit_counts (#6954)Mau Magnaguagno2022-12-191-1/+1
| | | Array#sum accepts a block.
* Make it so YJIT is no longer marked as experimental (#6909)Maxime Chevalier-Boisvert2022-12-121-1/+1
| | | | | Tested on production workloads at Shopify for > 1 year and proven to be quite stable. Enabling YJIT at run-time is still guarded behind the --yjit command-line option for now.