From: "jaruga (Jun Aruga)" Date: 2022-11-10T17:03:29+00:00 Subject: [ruby-core:110697] [Ruby master Misc#19120] How does YJIT work in --enable-shared case? Issue #19120 has been updated by jaruga (Jun Aruga). > How can we test the content of the yjit/src/**/*.rs? For example, if the command below works, I can say that I tested the content of the yjit/src/**/*.rs? Here is a bit old commit on the master branch `131c31a9209c61f84d318aa18b61f468f48b8219`. It was compiled with `./configure --enable-yjit=dev --enable-shared --prefix=$HOME/local/ruby-yjit-dev-so-131c31a920`. Can I say that I executed the content of the yjit/src/**/*.rs? ``` $ which ruby ~/local/ruby-yjit-dev-so-131c31a920/bin/ruby $ ruby --yjit --yjit-call-threshold=1 --yjit-stats -e 'puts "abc"' abc ***YJIT: Printing YJIT statistics on exit*** method call exit reasons: (all relevant counters are zero) invokesuper exit reasons: (all relevant counters are zero) leave exit reasons: interp_return 1 (100.0%) getblockparamproxy exit reasons: (all relevant counters are zero) getinstancevariable exit reasons: (all relevant counters are zero) setinstancevariable exit reasons: (all relevant counters are zero) opt_aref exit reasons: (all relevant counters are zero) expandarray exit reasons: (all relevant counters are zero) opt_getinlinecache exit reasons: (all relevant counters are zero) invalidation reasons: (all relevant counters are zero) bindings_allocations: 73 bindings_set: 0 compiled_block_count: 8 compiled_iseq_count: 4 compiled_page_count: 1 freed_iseq_count: 0 freed_page_count: 0 invalidation_count: 0 constant_state_bumps: 0 inline_code_size: 1047 outlined_code_size: 643 freed_code_size: 0 code_gc_count: 0 num_gc_obj_refs: 9 total_exit_count: 1 total_insns_count: 233888 vm_insns_count: 233876 yjit_insns_count: 12 ratio_in_yjit: 0.0% avg_len_in_yjit: 12.0 total_exits: 0 ``` ---------------------------------------- Misc #19120: How does YJIT work in --enable-shared case? https://bugs.ruby-lang.org/issues/19120#change-100039 * Author: jaruga (Jun Aruga) * Status: Open * Priority: Normal ---------------------------------------- We are trying to add the new YJIT feature that is ported to Rust[1][2] in Ruby 3.2 RPM on Fedora project.[3] I am trying to understand how the YJIT works in the case the `./configure --enable-yjit --enable-shared`. In the case below, when building Ruby on the latest master branch `199b59f065ce6f1c13b8424f35a70c513523211b`, the static libraries `libruby-static.a` and `./libruby-static.a` were built. ``` sh-5.2$ cat /etc/fedora-release Fedora release 38 (Rawhide) sh-5.2$ ./autogen.sh sh-5.2$ ./configure --prefix=$HOME/local/ruby-yjit-199b59f065 --enable-shared --enable-yjit 2>&1 | tee configure.log ... * MJIT support: yes * YJIT support: yes sh-5.2$ make sh-5.2$ find . -name "*.a" ./yjit/target/release/libyjit.a ./libruby-static.a ``` After running `make install`, these static libraries (`*.a` files) were not copied to the installed directory. That makes sense, as Ruby works with shared libraries (`*.so` files). ``` sh-5.2$ make install 2>&1 | tee make_install.log sh-5.2$ find ~/local/ruby-yjit-199b59f065/ -name "*.a" => empty ``` In this case, we really don't need the `libyjit.a` to run the YJIT right? I couldn't find the .so file something like `yjit.so`. Which .so file contains the YJIT feature (maybe the content of the `yjit/src/**/*.rs`)? ``` sh-5.2$ find ~/local/ruby-yjit-199b59f065/ -name "*.so" | grep yjit.so => empty ``` How can we test the content of the `yjit/src/**/*.rs`? For example, if the command below works, I can say that I tested the content of the `yjit/src/**/*.rs`? ``` sh-5.2$ which rustc /usr/bin/rustc sh-5.2$ rustc --version rustc 1.65.0 (Fedora 1.65.0-1.fc38) sh-5.2$ ~/local/ruby-yjit-199b59f065/bin/ruby --yjit -e 'puts "abc"' abc ``` ## References * [1] https://bugs.ruby-lang.org/issues/18481 * [2] https://github.com/ruby/ruby/commit/f90549cd38518231a6a74432fe1168c943a7cc18#diff-1d53751ddf3ffeb25cfe609c6bd28746651e23ea81d51fe582b0f635f0896e0d * [3] https://src.fedoraproject.org/rpms/ruby/pull-request/139 -- https://bugs.ruby-lang.org/ Unsubscribe: