diff --git a/.github/workflows/annocheck.yml b/.github/workflows/annocheck.yml index 7e48cb1e76749a..a7363e3a9ab39f 100644 --- a/.github/workflows/annocheck.yml +++ b/.github/workflows/annocheck.yml @@ -73,7 +73,7 @@ jobs: builddir: build makeup: true - - uses: ruby/setup-ruby@9eb537ca036ebaed86729dcb9309076e4c5c3b74 # v1.314.0 + - uses: ruby/setup-ruby@0dafeac902942906541bc140009cdbf32665b601 # v1.315.0 with: ruby-version: '3.1' bundler: none diff --git a/.github/workflows/auto_review_pr.yml b/.github/workflows/auto_review_pr.yml index 2804062041f5b1..bcbdec54dae635 100644 --- a/.github/workflows/auto_review_pr.yml +++ b/.github/workflows/auto_review_pr.yml @@ -29,7 +29,7 @@ jobs: with: persist-credentials: false - - uses: ruby/setup-ruby@9eb537ca036ebaed86729dcb9309076e4c5c3b74 # v1.314.0 + - uses: ruby/setup-ruby@0dafeac902942906541bc140009cdbf32665b601 # v1.315.0 with: ruby-version: '3.4' bundler: none diff --git a/.github/workflows/baseruby.yml b/.github/workflows/baseruby.yml index 37cf18a2fe0c4c..27f98d2d50479a 100644 --- a/.github/workflows/baseruby.yml +++ b/.github/workflows/baseruby.yml @@ -48,7 +48,7 @@ jobs: - ruby-3.3 steps: - - uses: ruby/setup-ruby@9eb537ca036ebaed86729dcb9309076e4c5c3b74 # v1.314.0 + - uses: ruby/setup-ruby@0dafeac902942906541bc140009cdbf32665b601 # v1.315.0 with: ruby-version: ${{ matrix.ruby }} bundler: none diff --git a/.github/workflows/bundled_gems.yml b/.github/workflows/bundled_gems.yml index 18bf729a130231..fe485d2bfbfa10 100644 --- a/.github/workflows/bundled_gems.yml +++ b/.github/workflows/bundled_gems.yml @@ -38,7 +38,7 @@ jobs: with: token: ${{ (github.repository == 'ruby/ruby' && !startsWith(github.event_name, 'pull')) && secrets.MATZBOT_AUTO_UPDATE_TOKEN || secrets.GITHUB_TOKEN }} - - uses: ruby/setup-ruby@9eb537ca036ebaed86729dcb9309076e4c5c3b74 # v1.314.0 + - uses: ruby/setup-ruby@0dafeac902942906541bc140009cdbf32665b601 # v1.315.0 with: ruby-version: 4.0 diff --git a/.github/workflows/check_dependencies.yml b/.github/workflows/check_dependencies.yml index 5715e05e0e393b..6bd21df6faa1aa 100644 --- a/.github/workflows/check_dependencies.yml +++ b/.github/workflows/check_dependencies.yml @@ -42,7 +42,7 @@ jobs: - uses: ./.github/actions/setup/directories - - uses: ruby/setup-ruby@9eb537ca036ebaed86729dcb9309076e4c5c3b74 # v1.314.0 + - uses: ruby/setup-ruby@0dafeac902942906541bc140009cdbf32665b601 # v1.315.0 with: ruby-version: '3.1' bundler: none diff --git a/.github/workflows/check_misc.yml b/.github/workflows/check_misc.yml index 7ba8a334123094..0879d72b24ed39 100644 --- a/.github/workflows/check_misc.yml +++ b/.github/workflows/check_misc.yml @@ -23,7 +23,7 @@ jobs: token: ${{ (github.repository == 'ruby/ruby' && !startsWith(github.event_name, 'pull')) && secrets.MATZBOT_AUTO_UPDATE_TOKEN || secrets.GITHUB_TOKEN }} persist-credentials: false - - uses: ruby/setup-ruby@9eb537ca036ebaed86729dcb9309076e4c5c3b74 # v1.314.0 + - uses: ruby/setup-ruby@0dafeac902942906541bc140009cdbf32665b601 # v1.315.0 with: ruby-version: head diff --git a/.github/workflows/modgc.yml b/.github/workflows/modgc.yml index 8349cf38aa96df..8dce73ab16134f 100644 --- a/.github/workflows/modgc.yml +++ b/.github/workflows/modgc.yml @@ -67,7 +67,7 @@ jobs: uses: ./.github/actions/setup/ubuntu if: ${{ contains(matrix.os, 'ubuntu') }} - - uses: ruby/setup-ruby@9eb537ca036ebaed86729dcb9309076e4c5c3b74 # v1.314.0 + - uses: ruby/setup-ruby@0dafeac902942906541bc140009cdbf32665b601 # v1.315.0 with: ruby-version: '3.1' bundler: none diff --git a/.github/workflows/parse_y.yml b/.github/workflows/parse_y.yml index e37e2fc6d1cfcf..026fb28c9fe30b 100644 --- a/.github/workflows/parse_y.yml +++ b/.github/workflows/parse_y.yml @@ -59,7 +59,7 @@ jobs: - uses: ./.github/actions/setup/ubuntu - - uses: ruby/setup-ruby@9eb537ca036ebaed86729dcb9309076e4c5c3b74 # v1.314.0 + - uses: ruby/setup-ruby@0dafeac902942906541bc140009cdbf32665b601 # v1.315.0 with: ruby-version: '3.1' bundler: none diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8dda6601061dfd..8dc18ca9f472d5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -22,7 +22,7 @@ jobs: with: persist-credentials: false - - uses: ruby/setup-ruby@9eb537ca036ebaed86729dcb9309076e4c5c3b74 # v1.314.0 + - uses: ruby/setup-ruby@0dafeac902942906541bc140009cdbf32665b601 # v1.315.0 with: ruby-version: 3.3.4 diff --git a/.github/workflows/spec_guards.yml b/.github/workflows/spec_guards.yml index d08defca552597..8b4137f935404c 100644 --- a/.github/workflows/spec_guards.yml +++ b/.github/workflows/spec_guards.yml @@ -49,7 +49,7 @@ jobs: with: persist-credentials: false - - uses: ruby/setup-ruby@9eb537ca036ebaed86729dcb9309076e4c5c3b74 # v1.314.0 + - uses: ruby/setup-ruby@0dafeac902942906541bc140009cdbf32665b601 # v1.315.0 with: ruby-version: ${{ matrix.ruby }} bundler: none diff --git a/.github/workflows/sync_default_gems.yml b/.github/workflows/sync_default_gems.yml index 06353247e93ffe..f4f176b356c341 100644 --- a/.github/workflows/sync_default_gems.yml +++ b/.github/workflows/sync_default_gems.yml @@ -39,7 +39,7 @@ jobs: with: token: ${{ github.repository == 'ruby/ruby' && secrets.MATZBOT_AUTO_UPDATE_TOKEN || secrets.GITHUB_TOKEN }} - - uses: ruby/setup-ruby@9eb537ca036ebaed86729dcb9309076e4c5c3b74 # v1.314.0 + - uses: ruby/setup-ruby@0dafeac902942906541bc140009cdbf32665b601 # v1.315.0 with: ruby-version: '3.4' bundler: none diff --git a/.github/workflows/tarball-ubuntu.yml b/.github/workflows/tarball-ubuntu.yml index 015d6f70969861..932ed4a8298b05 100644 --- a/.github/workflows/tarball-ubuntu.yml +++ b/.github/workflows/tarball-ubuntu.yml @@ -43,7 +43,7 @@ jobs: set -x sudo apt-get update -q sudo apt-get install --no-install-recommends -q -y build-essential libssl-dev libyaml-dev zlib1g-dev libffi-dev libgmp-dev bison- autoconf- - - uses: ruby/setup-ruby@9eb537ca036ebaed86729dcb9309076e4c5c3b74 # v1.314.0 + - uses: ruby/setup-ruby@0dafeac902942906541bc140009cdbf32665b601 # v1.315.0 with: ruby-version: '3.2' # test-bundled-gems requires executable host ruby diff --git a/.github/workflows/tarball-windows.yml b/.github/workflows/tarball-windows.yml index a472af6e9e0fbe..c13ba7b0d0cc45 100644 --- a/.github/workflows/tarball-windows.yml +++ b/.github/workflows/tarball-windows.yml @@ -47,7 +47,7 @@ jobs: - run: md build working-directory: - - uses: ruby/setup-ruby@9eb537ca036ebaed86729dcb9309076e4c5c3b74 # v1.314.0 + - uses: ruby/setup-ruby@0dafeac902942906541bc140009cdbf32665b601 # v1.315.0 with: ruby-version: '3.2' bundler: none diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index c77aaaa594eaec..1b0371bb5f314d 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -79,7 +79,7 @@ jobs: with: arch: ${{ matrix.arch }} - - uses: ruby/setup-ruby@9eb537ca036ebaed86729dcb9309076e4c5c3b74 # v1.314.0 + - uses: ruby/setup-ruby@0dafeac902942906541bc140009cdbf32665b601 # v1.315.0 with: ruby-version: '3.1' bundler: none diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml index 3e00373df485d6..458676137a79e2 100644 --- a/.github/workflows/wasm.yml +++ b/.github/workflows/wasm.yml @@ -65,7 +65,7 @@ jobs: sparse-checkout: /.github persist-credentials: false - - uses: ruby/setup-ruby@9eb537ca036ebaed86729dcb9309076e4c5c3b74 # v1.314.0 + - uses: ruby/setup-ruby@0dafeac902942906541bc140009cdbf32665b601 # v1.315.0 with: ruby-version: '3.1' bundler: none diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 2059285e07fa0d..90e2a93ebe37d2 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -58,7 +58,7 @@ jobs: - run: md build working-directory: - - uses: ruby/setup-ruby@9eb537ca036ebaed86729dcb9309076e4c5c3b74 # v1.314.0 + - uses: ruby/setup-ruby@0dafeac902942906541bc140009cdbf32665b601 # v1.315.0 with: # windows-11-arm has only 3.4.1, 3.4.2, 3.4.3, head ruby-version: ${{ !endsWith(matrix.os, 'arm') && '3.1' || '3.4' }} diff --git a/.github/workflows/yjit-ubuntu.yml b/.github/workflows/yjit-ubuntu.yml index 5528344d718acb..04740c03037ff3 100644 --- a/.github/workflows/yjit-ubuntu.yml +++ b/.github/workflows/yjit-ubuntu.yml @@ -138,7 +138,7 @@ jobs: - uses: ./.github/actions/setup/ubuntu - - uses: ruby/setup-ruby@9eb537ca036ebaed86729dcb9309076e4c5c3b74 # v1.314.0 + - uses: ruby/setup-ruby@0dafeac902942906541bc140009cdbf32665b601 # v1.315.0 with: ruby-version: '3.1' bundler: none diff --git a/.github/workflows/zjit-macos.yml b/.github/workflows/zjit-macos.yml index a8730fb59c5b42..d98672bda0e3c0 100644 --- a/.github/workflows/zjit-macos.yml +++ b/.github/workflows/zjit-macos.yml @@ -98,7 +98,7 @@ jobs: rustup install ${{ matrix.rust_version }} --profile minimal rustup default ${{ matrix.rust_version }} - - uses: taiki-e/install-action@9bcaee1dcae34154180f412e2fa69355a7cda9f6 # v2.82.6 + - uses: taiki-e/install-action@16b05812d776ae1dfaabc8277e421fb6d2506419 # v2.82.7 with: tool: nextest@0.9 if: ${{ matrix.test_task == 'zjit-check' }} diff --git a/.github/workflows/zjit-ubuntu.yml b/.github/workflows/zjit-ubuntu.yml index 0771e479317f57..7dd8e252b79235 100644 --- a/.github/workflows/zjit-ubuntu.yml +++ b/.github/workflows/zjit-ubuntu.yml @@ -136,12 +136,12 @@ jobs: - uses: ./.github/actions/setup/ubuntu - - uses: ruby/setup-ruby@9eb537ca036ebaed86729dcb9309076e4c5c3b74 # v1.314.0 + - uses: ruby/setup-ruby@0dafeac902942906541bc140009cdbf32665b601 # v1.315.0 with: ruby-version: '3.1' bundler: none - - uses: taiki-e/install-action@9bcaee1dcae34154180f412e2fa69355a7cda9f6 # v2.82.6 + - uses: taiki-e/install-action@16b05812d776ae1dfaabc8277e421fb6d2506419 # v2.82.7 with: tool: nextest@0.9 if: ${{ matrix.test_task == 'zjit-check' }} diff --git a/common.mk b/common.mk index 45666a5570506c..e00a7050dfe90f 100644 --- a/common.mk +++ b/common.mk @@ -1998,7 +1998,7 @@ gc/distclean gc/realclean:: -$(Q) $(RM) gc/Makefile modular-gc-precheck: -modular-gc: probes.h gc/Makefile +modular-gc: probes.h gc/Makefile $(PROGRAM) $(RBCONFIG) $(Q) DTRACE='$(DTRACE)' DTRACE_EXT='$(DTRACE_EXT)' \ DTRACE_OBJ='$(DTRACE_OBJ)' DTRACE_REBUILD='$(DTRACE_REBUILD)' \ $(RUNRUBY) $(srcdir)/ext/extmk.rb \ diff --git a/lib/bundler/cli/gem.rb b/lib/bundler/cli/gem.rb index c8c24c8e66cc11..fd34a1287df3c9 100644 --- a/lib/bundler/cli/gem.rb +++ b/lib/bundler/cli/gem.rb @@ -247,8 +247,7 @@ def run if use_git Bundler.ui.info "\nInitializing git repo in #{target}" - require "shellwords" - `git init #{target.to_s.shellescape}` + IO.popen(["git", "init", target.to_s], &:read) config[:git_default_branch] = File.read("#{target}/.git/HEAD").split("/").last.chomp end diff --git a/spec/bundler/commands/newgem_spec.rb b/spec/bundler/commands/newgem_spec.rb index 9ef4d873573cce..2b630d30b6c5d1 100644 --- a/spec/bundler/commands/newgem_spec.rb +++ b/spec/bundler/commands/newgem_spec.rb @@ -88,8 +88,6 @@ def installed_go? end it "properly initializes git repo" do - skip "path with spaces needs special handling on Windows" if Gem.win_platform? - bundle "gem #{gem_name}", dir: bundled_app("path with spaces") expect(bundled_app("path with spaces/#{gem_name}/.git")).to exist end diff --git a/zjit/Cargo.lock b/zjit/Cargo.lock index df96918cb9d233..b96d39cb985b40 100644 --- a/zjit/Cargo.lock +++ b/zjit/Cargo.lock @@ -180,9 +180,9 @@ dependencies = [ [[package]] name = "insta" -version = "1.47.2" +version = "1.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4a6248eb93a4401ed2f37dfe8ea592d3cf05b7cf4f8efa867b6895af7e094e" +checksum = "86f0f8fee8c926415c58d6ae43a08523a26faccb2323f5e6b644fe7dd4ef6b82" dependencies = [ "console", "once_cell", diff --git a/zjit/bindgen/src/main.rs b/zjit/bindgen/src/main.rs index 3e43d40efd6c74..c6f8e85b3d29ec 100644 --- a/zjit/bindgen/src/main.rs +++ b/zjit/bindgen/src/main.rs @@ -421,7 +421,6 @@ fn main() { .allowlist_function("rb_get_iseq_body_param_opt_table") .allowlist_function("rb_get_cikw_keyword_len") .allowlist_function("rb_get_cikw_keywords_idx") - .allowlist_function("rb_get_call_data_ci") .allowlist_function("rb_yarv_str_eql_internal") .allowlist_function("rb_str_neq_internal") .allowlist_function("rb_yarv_ary_entry_internal") diff --git a/zjit/src/cruby.rs b/zjit/src/cruby.rs index 7777faef0fbfc1..3b6f5bc5cb138f 100644 --- a/zjit/src/cruby.rs +++ b/zjit/src/cruby.rs @@ -83,11 +83,6 @@ #![allow(non_upper_case_globals)] #![allow(clippy::upper_case_acronyms)] -// Some of this code may not be used yet -#![allow(dead_code)] -#![allow(unused_macros)] -#![allow(unused_imports)] - use std::convert::From; use std::ffi::{c_void, CString, CStr}; use std::fmt::{Debug, Display, Formatter}; @@ -120,7 +115,6 @@ pub use autogened::*; // These are functions we expose from C files, not in any header. // Parsing it would result in a lot of duplicate definitions. // Use bindgen for functions that are defined in headers or in zjit.c. -#[cfg_attr(test, allow(unused))] // We don't link against C code when testing unsafe extern "C" { pub fn rb_check_overloaded_cme( me: *const rb_callable_method_entry_t, @@ -181,10 +175,7 @@ pub use rb_get_ec_cfp as get_ec_cfp; pub use rb_get_cfp_iseq as get_cfp_iseq; pub use rb_get_cfp_pc as get_cfp_pc; pub use rb_get_cfp_sp as get_cfp_sp; -pub use rb_get_cfp_self as get_cfp_self; -pub use rb_get_cfp_ep as get_cfp_ep; pub use rb_get_cfp_ep_level as get_cfp_ep_level; -pub use rb_vm_base_ptr as get_cfp_bp; pub use rb_get_cme_def_type as get_cme_def_type; pub use rb_get_cme_def_body_attr_id as get_cme_def_body_attr_id; pub use rb_get_cme_def_body_optimized_type as get_cme_def_body_optimized_type; @@ -196,26 +187,19 @@ pub use rb_get_mct_argc as get_mct_argc; pub use rb_get_mct_func as get_mct_func; pub use rb_get_def_iseq_ptr as get_def_iseq_ptr; pub use rb_iseq_encoded_size as get_iseq_encoded_size; -pub use rb_get_iseq_body_local_iseq as get_iseq_body_local_iseq; pub use rb_get_iseq_body_iseq_encoded as get_iseq_body_iseq_encoded; pub use rb_get_iseq_body_stack_max as get_iseq_body_stack_max; pub use rb_get_iseq_body_type as get_iseq_body_type; pub use rb_get_iseq_body_local_table_size as get_iseq_body_local_table_size; pub use rb_get_cikw_keyword_len as get_cikw_keyword_len; pub use rb_get_cikw_keywords_idx as get_cikw_keywords_idx; -pub use rb_get_call_data_ci as get_call_data_ci; -pub use rb_FL_TEST as FL_TEST; pub use rb_FL_TEST_RAW as FL_TEST_RAW; pub use rb_RB_TYPE_P as RB_TYPE_P; -pub use rb_BASIC_OP_UNREDEFINED_P as BASIC_OP_UNREDEFINED_P; pub use rb_vm_ci_argc as vm_ci_argc; pub use rb_vm_ci_mid as vm_ci_mid; pub use rb_vm_ci_flag as vm_ci_flag; -pub use rb_vm_ci_kwarg as vm_ci_kwarg; pub use rb_METHOD_ENTRY_VISI as METHOD_ENTRY_VISI; pub use rb_RCLASS_ORIGIN as RCLASS_ORIGIN; -pub use rb_vm_get_special_object as vm_get_special_object; -pub use rb_jit_fix_div_fix as rb_fix_div_fix; pub use rb_jit_fix_mod_fix as rb_fix_mod_fix; /// Helper so we can get a Rust string for insn_name() @@ -757,7 +741,6 @@ pub trait IseqAccess { impl IseqAccess for IseqPtr { /// Get a description of the ISEQ's signature. Analogous to `ISEQ_BODY(iseq)->param` in C. unsafe fn params<'a>(self) -> &'a IseqParameters { - use crate::cast::IntoUsize; unsafe { &*((*self).body.byte_add(ISEQ_BODY_OFFSET_PARAM.to_usize()) as *const IseqParameters) } } } @@ -968,7 +951,7 @@ pub fn ruby_sym_to_rust_string(v: VALUE) -> String { } pub fn ruby_call_method_id(cd: *const rb_call_data) -> ID { - let call_info = unsafe { rb_get_call_data_ci(cd) }; + let call_info = unsafe { (*cd).ci }; unsafe { rb_vm_ci_mid(call_info) } } @@ -1006,17 +989,6 @@ macro_rules! src_loc { pub(crate) use src_loc; -/// Run GC write barrier. Required after making a new edge in the object reference -/// graph from `old` to `young`. -macro_rules! obj_written { - ($old: expr, $young: expr) => { - let (old, young): (VALUE, VALUE) = ($old, $young); - let src_loc = $crate::cruby::src_loc!(); - unsafe { rb_yjit_obj_written(old, young, src_loc.file.as_ptr(), src_loc.line) }; - }; -} -pub(crate) use obj_written; - /// Acquire the VM lock, make sure all other Ruby threads are asleep then run /// some code while holding the lock. Returns whatever `func` returns. /// Use with [src_loc!]. @@ -1314,6 +1286,7 @@ pub mod test_utils { } /// Like inspect, but also asserts that all compilations triggered by this program succeed. + #[track_caller] pub fn assert_compiles_allowing_exits(program: &str) -> String { use crate::state::ZJITState; ZJITState::enable_assert_compiles(); @@ -1324,6 +1297,7 @@ pub mod test_utils { /// Like inspect, but also asserts that all compilations triggered by this program succeed and /// no side exits occurr during the program. + #[track_caller] pub fn assert_compiles(program: &str) -> String { use crate::state::ZJITState; let exits_before = crate::stats::total_exit_count(); diff --git a/zjit/src/cruby_bindings.inc.rs b/zjit/src/cruby_bindings.inc.rs index a54f0982019afd..d64876308f3c5a 100644 --- a/zjit/src/cruby_bindings.inc.rs +++ b/zjit/src/cruby_bindings.inc.rs @@ -2287,7 +2287,6 @@ unsafe extern "C" { pub fn rb_FL_TEST(obj: VALUE, flags: VALUE) -> VALUE; pub fn rb_FL_TEST_RAW(obj: VALUE, flags: VALUE) -> VALUE; pub fn rb_RB_TYPE_P(obj: VALUE, t: ruby_value_type) -> bool; - pub fn rb_get_call_data_ci(cd: *const rb_call_data) -> *const rb_callinfo; pub fn rb_BASIC_OP_UNREDEFINED_P(bop: ruby_basic_operators, klass: u32) -> bool; pub fn rb_RCLASS_ORIGIN(c: VALUE) -> VALUE; pub fn rb_assert_iseq_handle(handle: VALUE); diff --git a/zjit/src/hir.rs b/zjit/src/hir.rs index 6e5b64f18b7711..cc2468560b8f53 100644 --- a/zjit/src/hir.rs +++ b/zjit/src/hir.rs @@ -3790,7 +3790,7 @@ impl Function { continue; } }; - let ci = unsafe { get_call_data_ci(cd) }; // info about the call site + let ci = unsafe { (*cd).ci }; // info about the call site let flags = unsafe { rb_vm_ci_flag(ci) }; @@ -4152,7 +4152,7 @@ impl Function { continue; } - let ci = unsafe { get_call_data_ci(cd) }; + let ci = unsafe { (*cd).ci }; let flags = unsafe { rb_vm_ci_flag(ci) }; assert!(flags & VM_CALL_FCALL != 0); @@ -7998,7 +7998,7 @@ fn add_iseq_to_hir( // Check if #new resolves to rb_class_new_instance_pass_kw. // TODO: Guard on a profiled class and add a patch point for #new redefinition let argc = crate::profile::num_arguments_on_stack(cd); - let ci = unsafe { get_call_data_ci(cd) }; + let ci = unsafe { (*cd).ci }; let flags = unsafe { rb_vm_ci_flag(ci) }; assert_eq!(flags & VM_CALL_ARGS_BLOCKARG, 0); let val = state.stack_topn(argc)?; @@ -8469,7 +8469,7 @@ fn add_iseq_to_hir( YARVINSN_opt_neq => { // NB: opt_neq has two cd; get_arg(0) is for eq and get_arg(1) is for neq let cd: *const rb_call_data = get_arg(pc, 1).as_ptr(); - let call_info = unsafe { rb_get_call_data_ci(cd) }; + let call_info = unsafe { (*cd).ci }; let flags = unsafe { rb_vm_ci_flag(call_info) }; if let Err(call_type) = unhandled_call_type(flags) { // Can't handle the call type; side-exit into the interpreter @@ -8568,7 +8568,7 @@ fn add_iseq_to_hir( YARVINSN_opt_regexpmatch2 | YARVINSN_opt_send_without_block => { let cd: *const rb_call_data = get_arg(pc, 0).as_ptr(); - let call_info = unsafe { rb_get_call_data_ci(cd) }; + let call_info = unsafe { (*cd).ci }; let flags = unsafe { rb_vm_ci_flag(call_info) }; if let Err(call_type) = unhandled_call_type(flags) { // Can't handle tailcall; side-exit into the interpreter @@ -8662,7 +8662,7 @@ fn add_iseq_to_hir( YARVINSN_send => { let cd: *const rb_call_data = get_arg(pc, 0).as_ptr(); let blockiseq: IseqPtr = get_arg(pc, 1).as_iseq(); - let call_info = unsafe { rb_get_call_data_ci(cd) }; + let call_info = unsafe { (*cd).ci }; let flags = unsafe { rb_vm_ci_flag(call_info) }; if let Err(call_type) = unhandled_call_type(flags) { // Can't handle tailcall; side-exit into the interpreter @@ -8716,7 +8716,7 @@ fn add_iseq_to_hir( YARVINSN_sendforward => { let cd: *const rb_call_data = get_arg(pc, 0).as_ptr(); let blockiseq: IseqPtr = get_arg(pc, 1).as_iseq(); - let call_info = unsafe { rb_get_call_data_ci(cd) }; + let call_info = unsafe { (*cd).ci }; let flags = unsafe { rb_vm_ci_flag(call_info) }; let forwarding = (flags & VM_CALL_FORWARDING) != 0; if let Err(call_type) = unhandled_call_type(flags) { @@ -8761,7 +8761,7 @@ fn add_iseq_to_hir( } YARVINSN_invokesuper => { let cd: *const rb_call_data = get_arg(pc, 0).as_ptr(); - let call_info = unsafe { rb_get_call_data_ci(cd) }; + let call_info = unsafe { (*cd).ci }; let flags = unsafe { rb_vm_ci_flag(call_info) }; if let Err(call_type) = unhandled_call_type(flags) { // Can't handle tailcall; side-exit into the interpreter @@ -8807,7 +8807,7 @@ fn add_iseq_to_hir( YARVINSN_invokesuperforward => { let cd: *const rb_call_data = get_arg(pc, 0).as_ptr(); let blockiseq: IseqPtr = get_arg(pc, 1).as_iseq(); - let call_info = unsafe { rb_get_call_data_ci(cd) }; + let call_info = unsafe { (*cd).ci }; let flags = unsafe { rb_vm_ci_flag(call_info) }; let forwarding = (flags & VM_CALL_FORWARDING) != 0; if let Err(call_type) = unhandled_call_type(flags) { @@ -8853,7 +8853,7 @@ fn add_iseq_to_hir( } YARVINSN_invokeblock => { let cd: *const rb_call_data = get_arg(pc, 0).as_ptr(); - let call_info = unsafe { rb_get_call_data_ci(cd) }; + let call_info = unsafe { (*cd).ci }; let flags = unsafe { rb_vm_ci_flag(call_info) }; if let Err(call_type) = unhandled_call_type(flags) { // Can't handle tailcall; side-exit into the interpreter diff --git a/zjit/src/hir/opt_tests.rs b/zjit/src/hir/opt_tests.rs index 3172864db12865..2b29204f8e9381 100644 --- a/zjit/src/hir/opt_tests.rs +++ b/zjit/src/hir/opt_tests.rs @@ -1689,37 +1689,6 @@ mod hir_opt_tests { "); } - #[test] - fn test_optimize_private_call() { - eval(" - def foo = [] - private :foo - def test - foo - end - test; test - "); - assert_snapshot!(hir_string("test"), @" - fn test@:5: - bb1(): - EntryPoint interpreter - v1:BasicObject = LoadSelf - Jump bb3(v1) - bb2(): - EntryPoint JIT(0) - v4:BasicObject = LoadArg :self@0 - Jump bb3(v4) - bb3(v6:BasicObject): - PatchPoint MethodRedefined(Object@0x1000, foo@0x1008, cme:0x1010) - v18:ObjectSubclass[class_exact*:Object@VALUE(0x1000)] = GuardType v6, ObjectSubclass[class_exact*:Object@VALUE(0x1000)] recompile - PushInlineFrame v18 (0x1038) - v24:ArrayExact = NewArray - CheckInterrupts - PopInlineFrame - Return v24 - "); - } - #[test] fn test_optimize_call_with_overloaded_cme() { eval(" diff --git a/zjit/src/profile.rs b/zjit/src/profile.rs index 22e6835a6ac071..e3b89c9319ebe7 100644 --- a/zjit/src/profile.rs +++ b/zjit/src/profile.rs @@ -157,7 +157,7 @@ pub fn profile_recompile_insn(ec: EcPtr) -> bool { /// Return the argc as stated in the calldata plus: /// * 1 if there is an explicit blockarg, since that will be passed on the stack pub fn num_arguments_on_stack(cd: *const rb_call_data) -> usize { - let ci = unsafe { rb_get_call_data_ci(cd) }; + let ci = unsafe { (*cd).ci }; let flags = unsafe { rb_vm_ci_flag(ci) }; let has_blockarg = (flags & VM_CALL_ARGS_BLOCKARG) != 0; (unsafe { vm_ci_argc(ci) }) as usize + has_blockarg as usize