summaryrefslogtreecommitdiff
path: root/rjit_c.rb
AgeCommit message (Collapse)Author
2023-08-08YJIT: Compile exception handlers (#8171)Takashi Kokubun
Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com> Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2023-07-17Remove __bp__ and speed-up bmethod calls (#8060)Alan Wu
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
2023-06-23Expose rb_hash_resurrectAaron Patterson
This is for implementing the `duphash` instruction Notes: Merged: https://github.com/ruby/ruby/pull/7969
2023-06-06Unify length field for embedded and heap strings (#7908)Peter Zhu
* 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 Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-04-18Update RJIT to support newarray_sendAaron Patterson
This also adds max / hash support Notes: Merged: https://github.com/ruby/ruby/pull/6090
2023-04-11Move `catch_except_p` to `compile_data`eileencodes
The `catch_except_p` flag is used for communicating between parent and child iseq's that a throw instruction was emitted. So for example if a child iseq has a throw in it and the parent wants to catch the throw, we use this flag to communicate to the parent iseq that a throw instruction was emitted. This flag is only useful at compile time, it only impacts the compilation process so it seems to be fine to move it from the iseq body to the compile_data struct. Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org> Notes: Merged: https://github.com/ruby/ruby/pull/7652
2023-04-07Expose rb_sym_to_proc via RJITAaron Patterson
This is needed for getblockparamproxy Notes: Merged: https://github.com/ruby/ruby/pull/7673
2023-04-04[Feature #19579] Remove !USE_RVARGC code (#7655)Peter Zhu
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. Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
2023-04-04RJIT: Add --rjit-verify-ctx optionTakashi Kokubun
2023-04-02RJIT: Store type information in ContextTakashi Kokubun
2023-04-02RJIT: Support entry with different PCsTakashi Kokubun
2023-04-02RJIT: Support has_opt ISEQsTakashi Kokubun
2023-04-02RJIT: Simplify cfunc implementationTakashi Kokubun
2023-04-02RJIT: Simplify invokesuper implementationTakashi Kokubun
2023-04-02RJIT: Group blockarg exit reasonsTakashi Kokubun
2023-04-02RJIT: Support splat argsTakashi Kokubun
2023-04-02RJIT: Update exit reasonsTakashi Kokubun
2023-04-01Remove an unneeded function copyTakashi Kokubun
2023-04-01RJIT: Support rest argsTakashi Kokubun
2023-04-01RJIT: Fix has_rest exit conditionsTakashi Kokubun
2023-04-01RJIT: Remove unused countersTakashi Kokubun
2023-04-01RJIT: Start moving away from VM-like ISEQ handlingTakashi Kokubun
2023-03-26RJIT: Implement leaf builtin callTakashi Kokubun
2023-03-26RJIT: Implement attr_writerTakashi Kokubun
2023-03-25RJIT: Put a guard for splat w/ var-arg cfuncTakashi Kokubun
2023-03-25RJIT: Support optional params on splatTakashi Kokubun
2023-03-25RJIT: Remove send_iseq_complex_splat exitTakashi Kokubun
2023-03-25RJIT: Initial support of splatTakashi Kokubun
2023-03-23`vm_call_single_noarg_inline_builtin`Koichi Sasada
If the iseq only contains `opt_invokebuiltin_delegate_leave` insn and the builtin-function (bf) is inline-able, the caller doesn't need to build a method frame. `vm_call_single_noarg_inline_builtin` is fast path for such cases. Notes: Merged: https://github.com/ruby/ruby/pull/7486
2023-03-21RJIT: Update bindingTakashi Kokubun
2023-03-21RJIT: Split has_rest_or_post exit reasonsTakashi Kokubun
2023-03-21RJIT: Fix invokesuperTakashi Kokubun
2023-03-19RJIT: Break up RJIT send_iseq_complex exit reasonsTakashi Kokubun
2023-03-19RJIT: Implement ifunc invokeblockTakashi Kokubun
2023-03-19RJIT: Fix ISeq invokeblockTakashi Kokubun
2023-03-19RJIT: Implement invokeblock with ISeqTakashi Kokubun
2023-03-19RJIT: Optimize Kernel#respond_to?Takashi Kokubun
2023-03-19RJIT: Optimize String#+@Takashi Kokubun
2023-03-19RJIT: Optimize String#<<Takashi Kokubun
2023-03-19RJIT: Drop duplicated obj_is_kind_ofTakashi Kokubun
2023-03-18RJIT: Workaround USE_RVARGC=0 CITakashi Kokubun
2023-03-18RJIT: Optimize String#bytesizeTakashi Kokubun
2023-03-18RJIT: Optimize String#empty?Takashi Kokubun
2023-03-18RJIT: Optimize Kernel#instance_of?Takashi Kokubun
2023-03-18RJIT: Optimize Kernel#is_a?Takashi Kokubun
2023-03-18RJIT: Reorder opt_case_dispatch branchesTakashi Kokubun
2023-03-18RJIT: Implement setclassvariableTakashi Kokubun
2023-03-18RJIT: Implement internTakashi Kokubun
2023-03-18RJIT: Implement toregexpTakashi Kokubun
2023-03-18RJIT: Prefix rjit_options with rb_Takashi Kokubun