summaryrefslogtreecommitdiff
path: root/yjit.rb
AgeCommit message (Collapse)Author
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>
2023-04-05YJIT: Count the number of actually written bytes (#7658)Takashi Kokubun
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
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-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-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-17YJIT: skip intermediate arrays in print_sorted_exit_counts (#7547)Mau Magnaguagno
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. Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-03-16YJIT: add stats to keep track of when branch direction is known (#7544)Maxime Chevalier-Boisvert
This measures the impact of changes made by @jhawthorn last year. Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-03-01YJIT: reject large stacks so we can use i8/u8 stack_size and stack_offset ↵Maxime Chevalier-Boisvert
(#7412) * Reject large stacks so we can use i8/u8 stack_size and stack_offset * Add rejection test for iseq too long as well Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-02-28YJIT: add defer_empty_count statMaxime Chevalier-Boisvert
Count how often we defer from a block that is empty Notes: Merged: https://github.com/ruby/ruby/pull/7396
2023-02-17YJIT: Use rb_ivar_get at the end of ivar chains (#7334)Takashi Kokubun
* YJIT: Use rb_ivar_get at the end of ivar chains * Rename the counter to get_ivar_max_depth Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2023-02-16YJIT: Show Context stats on exit (#7327)Takashi Kokubun
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2023-02-14YJIT: Pad more spaces to accommodate delimiters (#7302)Takashi Kokubun
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2023-02-10YJIT: add counters for polymorphic send and send with known class (#7288)Maxime Chevalier-Boisvert
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-02-09YJIT: format numbers in stats printouts with comma separators (#7281)Maxime Chevalier-Boisvert
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-01-18Add stats so we can keep track of x86 rel32 vs register calls (#7142)Maxime Chevalier-Boisvert
* 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 Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-01-12YJIT: Do not refer to an undefined constant (#7112)Takashi Kokubun
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2022-12-22Document the public interface of YJIT [ci skip]Takashi Kokubun
2022-12-19YJIT: skip map in print_sorted_exit_counts (#6954)Mau Magnaguagno
Array#sum accepts a block. Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2022-12-12Make it so YJIT is no longer marked as experimental (#6909)Maxime Chevalier-Boisvert
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. Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2022-12-09YJIT: Filter out 0-exit ops from Top-20 exit ops (#6892)Takashi Kokubun
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2022-11-30YJIT: add new counters for deferred compilation and queued blocks (#6837)Maxime Chevalier-Boisvert
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2022-11-17YJIT: Add object shape count to stats (#6754)Takashi Kokubun
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2022-11-17YJIT: Add missing key for non-stats buildTakashi Kokubun
2022-11-17YJIT: Fix typo in stats references (#6753)Takashi Kokubun
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2022-11-16YJIT: Add compiled_branch_count stats (#6746)Takashi Kokubun
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2022-11-15YJIT: Include actual memory region size in stats (#6736)Takashi Kokubun
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2022-11-13YJIT: Instrument global allocations on stats build (#6712)Takashi Kokubun
* YJIT: Instrument global allocations on stats build * Just use GLOVAL_ALLOCATOR.stats() Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2022-11-10Remove inconsistencyTakashi Kokubun
I meant they should be also fixed in https://github.com/ruby/ruby/pull/6694#discussion_r1019445575
2022-11-10Enable --yjit-stats for release builds (#6694)Jimmy Miller
* Enable --yjit-stats for release builds In order for people in the real world to report information about how their application runs with YJIT, we want to expose stats without requiring rebuilding ruby. We can do this without overhead, with the exception of count ratio in yjit, since this relies on the interpreter also counting instructions. This change exposes those stats, while not showing ratio in yjit if we are not in a stats build. * Update yjit.rb Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com> Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com> Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2022-11-09Fix exit locations dump (#6703)Eileen M. Uchitelle
While I was working on my RubyConf talk for tracing yjit exit locations I realized that there were exits from the dump code included in the stats data. For example I saw 224 interp leave exits for a simple script that should have had 1 or 2. I realized that the dump code needs to be called _after_ the stats are generated, otherwise the dump code will be counted in the stats exits. I've added a `_dump_locations` method to the `at_exit` for stats generation to ensure that it runs last. I've updated the documentation to add a note that if you call `dump_exit_locations` directly, your stats will include the dump code exits as well. Notes: Merged-By: maximecb <maximecb@ruby-lang.org>