aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ruby_vm
Commit message (Collapse)AuthorAgeFilesLines
* YJIT: Compile exception handlers (#8171)Takashi Kokubun2023-08-082-5/+5
| | | Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
* Remove __bp__ and speed-up bmethod calls (#8060)Alan Wu2023-07-171-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove rb_control_frame_t::__bp__ and optimize bmethod calls This commit removes the __bp__ field from rb_control_frame_t. It was introduced to help MJIT, but since MJIT was replaced by RJIT, we can use vm_base_ptr() to compute it from the SP of the previous control frame instead. Removing the field avoids needing to set it up when pushing new frames. Simply removing __bp__ would cause crashes since RJIT and YJIT used a slightly different stack layout for bmethod calls than the interpreter. At the moment of the call, the two layouts looked as follows: ┌────────────┐ ┌────────────┐ │ frame_base │ │ frame_base │ ├────────────┤ ├────────────┤ │ ... │ │ ... │ ├────────────┤ ├────────────┤ │ args │ │ args │ ├────────────┤ └────────────┘<─prev_frame_sp │ receiver │ prev_frame_sp─>└────────────┘ RJIT & YJIT interpreter Essentially, vm_base_ptr() needs to compute the address to frame_base given prev_frame_sp in the diagrams. The presence of the receiver created an off-by-one situation. Make the interpreter use the layout the JITs use for iseq-to-iseq bmethod calls. Doing so removes unnecessary argument shifting and vm_exec_core() re-entry from the interpreter, yielding a speed improvement visible through `benchmark/vm_defined_method.yml`: patched: 7578743.1 i/s master: 4796596.3 i/s - 1.58x slower C-to-iseq bmethod calls now store one more VALUE than before, but that should have negligible impact on overall performance. Note that re-entering vm_exec_core() used to be necessary for firing TracePoint events, but that's no longer the case since 9121e57a5f50bc91bae48b3b91edb283bf96cb6b. Closes ruby/ruby#6428
* Remove RARRAY_CONST_PTR_TRANSIENTPeter Zhu2023-07-131-1/+1
| | | | RARRAY_CONST_PTR now does the same things as RARRAY_CONST_PTR_TRANSIENT.
* YJIT: Fix autosplat miscomp for blocks with optionals (#8006)Alan Wu2023-07-041-1/+9
| | | | | | | | | | | | | | | | | | * YJIT: Fix autosplat miscomp for blocks with optionals When passing an array as the sole argument to `yield`, and the yieldee takes more than 1 optional parameter, the array is expanded similar to `*array` splat calls. This is called "autosplat" in `setup_parameters_complex()`. Previously, YJIT did not detect this autosplat condition. It passed the array without expanding it, deviating from interpreter behavior. Detect this conditon and refuse to compile it. Fixes: Shopify/yjit#313 * RJIT: Fix autosplat miscomp for blocks with optionals This is mirrors the same issue as YJIT. See previous commit.
* Unify length field for embedded and heap strings (#7908)Peter Zhu2023-06-061-4/+1
| | | | | | | | * Unify length field for embedded and heap strings The length field is of the same type and position in RString for both embedded and heap allocated strings, so we can unify it. * Remove RSTRING_EMBED_LEN
* Update an Intel SDM link [ci skip]Takashi Kokubun2023-04-281-1/+1
|
* RJIT: Fix unspecified_bits with localsTakashi Kokubun2023-04-261-2/+2
|
* Update RJIT to support newarray_sendAaron Patterson2023-04-181-3/+66
| | | | This also adds max / hash support
* RJIT: argc check in known cfuncsJohn Hawthorn2023-04-121-1/+1
|
* RJIT: Skip a class guard if known to be T_STRINGTakashi Kokubun2023-04-051-3/+6
|
* RJIT: Handle include_all argument of respond_to?Takashi Kokubun2023-04-051-13/+15
|
* RJIT: Remove unused variablesTakashi Kokubun2023-04-041-8/+0
|
* RJIT: Always use guard_two_fixnumsTakashi Kokubun2023-04-041-59/+27
|
* RJIT: Eliminate known-result guards for blockargTakashi Kokubun2023-04-041-10/+4
|
* RJIT: Eliminate known-result branchesTakashi Kokubun2023-04-042-95/+132
|
* RJIT: Propagate argument types on method callsTakashi Kokubun2023-04-041-0/+7
|
* RJIT: Fix mapping offsets in stack_swapTakashi Kokubun2023-04-041-4/+4
|
* [Feature #19579] Remove !USE_RVARGC code (#7655)Peter Zhu2023-04-041-1/+0
| | | | | | | | | | | Remove !USE_RVARGC code [Feature #19579] The Variable Width Allocation feature was turned on by default in Ruby 3.2. Since then, we haven't received bug reports or backports to the non-Variable Width Allocation code paths, so we assume that nobody is using it. We also don't plan on maintaining the non-Variable Width Allocation code, so we are going to remove it.
* RJIT: Fix the argument of shift_stackTakashi Kokubun2023-04-041-1/+1
|
* RJIT: Fix the argument for definedTakashi Kokubun2023-04-041-5/+5
|
* RJIT: Add --rjit-verify-ctx optionTakashi Kokubun2023-04-043-9/+86
|
* RJIT: Fix arguments to SPECIAL_CONST_PTakashi Kokubun2023-04-041-2/+2
|
* RJIT: Update type information on setlocalTakashi Kokubun2023-04-031-6/+23
|
* RJIT: Fix arguments for shift_stackTakashi Kokubun2023-04-031-3/+3
|
* Fix a test_rubyoptions failureTakashi Kokubun2023-04-032-21/+0
|
* RJIT: Propagate self's type informationTakashi Kokubun2023-04-031-3/+10
|
* RJIT: Upgrade type on jit_guard_known_classTakashi Kokubun2023-04-033-27/+118
|
* RJIT: Upgrade type to Fixnum after guardTakashi Kokubun2023-04-032-8/+60
|
* RJIT: Upgrade type to String after guardTakashi Kokubun2023-04-022-2/+28
|
* RJIT: Upgrade type to Array after guardTakashi Kokubun2023-04-022-5/+28
|
* RJIT: Limit the number of versions per blockTakashi Kokubun2023-04-021-0/+31
|
* RJIT: Find a best matching block versionTakashi Kokubun2023-04-022-2/+87
|
* RJIT: Upgrade type to UnknownHeap after guardTakashi Kokubun2023-04-022-20/+89
|
* RJIT: Update type information on setn insnTakashi Kokubun2023-04-021-0/+3
|
* RJIT: Swap type information on swap insnTakashi Kokubun2023-04-021-0/+6
|
* * remove trailing spaces. [ci skip]git2023-04-031-1/+1
|
* RJIT: Store type information in ContextTakashi Kokubun2023-04-024-134/+610
|
* RJIT: Refactor getlocal and setlocalTakashi Kokubun2023-04-021-76/+38
|
* RJIT: Support entry with different PCsTakashi Kokubun2023-04-024-19/+74
|
* RJIT: Support has_opt ISEQsTakashi Kokubun2023-04-022-7/+38
|
* RJIT: C::FL_TEST_RAW returns RBOOLTakashi Kokubun2023-04-021-1/+1
|
* RJIT: Lazily guard block argTakashi Kokubun2023-04-021-28/+23
| | | | to simplify the implementation
* RJIT: Simplify cfunc implementationTakashi Kokubun2023-04-021-106/+170
|
* RJIT: Remove an unneeded branchTakashi Kokubun2023-04-021-9/+6
|
* Skip assert_linear_performance for RJITTakashi Kokubun2023-04-021-8/+1
|
* RJIT: Simplify invokesuper implementationTakashi Kokubun2023-04-021-93/+102
|
* RJIT: Group blockarg exit reasonsTakashi Kokubun2023-04-021-4/+4
|
* RJIT: Support splat argsTakashi Kokubun2023-04-021-8/+33
|
* RJIT: Prefix a constant with C namespaceTakashi Kokubun2023-04-021-1/+1
|
* RJIT: Support keyword argumentsTakashi Kokubun2023-04-021-18/+215
|