aboutsummaryrefslogtreecommitdiffstats
path: root/rjit_c.rb
Commit message (Collapse)AuthorAgeFilesLines
* shape.h: Make attr_index_t uint8_tJean Boussier2023-10-111-2/+2
| | | | | | | | | | Given `SHAPE_MAX_NUM_IVS 80`, we transition to TOO_COMPLEX way before we could overflow a 8bit counter. This reduce the size of `rb_shape_t` from 32B to 24B. If we decide to raise `SHAPE_MAX_NUM_IVS` we can always increase that type again.
* Refactor rb_shape_transition_shape_capa to not accept capacityJean Boussier2023-10-101-2/+2
| | | | | This way the groth factor is encapsulated, which allows rb_shape_transition_shape_capa to be smarter about ideal sizes.
* Use reference counting to avoid memory leak in kwargsHParker2023-10-011-0/+1
| | | | | | | | Tracks other callinfo that references the same kwargs and frees them when all references are cleared. [bug #19906] Co-authored-by: Peter Zhu <peter@peterzhu.ca>
* [Bug #19896]Adam Hess2023-09-221-3/+3
| | | | | | | | | fix memory leak in vm_method This introduces a unified reference_count to clarify who is referencing a method. This also allows us to treat the refinement method as the def owner since it counts itself as a reference Co-authored-by: Peter Zhu <peter@peterzhu.ca>
* YJIT: Compile exception handlers (#8171)Takashi Kokubun2023-08-081-2/+2
| | | 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
* Expose rb_hash_resurrectAaron Patterson2023-06-231-0/+4
| | | | This is for implementing the `duphash` instruction
* Unify length field for embedded and heap strings (#7908)Peter Zhu2023-06-061-2/+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 RJIT to support newarray_sendAaron Patterson2023-04-181-0/+8
| | | | This also adds max / hash support
* Move `catch_except_p` to `compile_data`eileencodes2023-04-111-5/+4
| | | | | | | | | | | | | | 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>
* Expose rb_sym_to_proc via RJITAaron Patterson2023-04-071-0/+4
| | | | This is needed for getblockparamproxy
* [Feature #19579] Remove !USE_RVARGC code (#7655)Peter Zhu2023-04-041-0/+5
| | | | | | | | | | | 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: Add --rjit-verify-ctx optionTakashi Kokubun2023-04-041-0/+1
|
* RJIT: Store type information in ContextTakashi Kokubun2023-04-021-0/+8
|
* RJIT: Support entry with different PCsTakashi Kokubun2023-04-021-8/+8
|
* RJIT: Support has_opt ISEQsTakashi Kokubun2023-04-021-0/+2
|
* RJIT: Simplify cfunc implementationTakashi Kokubun2023-04-021-0/+14
|
* RJIT: Simplify invokesuper implementationTakashi Kokubun2023-04-021-0/+2
|
* RJIT: Group blockarg exit reasonsTakashi Kokubun2023-04-021-4/+1
|
* RJIT: Support splat argsTakashi Kokubun2023-04-021-1/+2
|
* RJIT: Update exit reasonsTakashi Kokubun2023-04-021-0/+4
|
* Remove an unneeded function copyTakashi Kokubun2023-04-011-4/+4
|
* RJIT: Support rest argsTakashi Kokubun2023-04-011-0/+12
|
* RJIT: Fix has_rest exit conditionsTakashi Kokubun2023-04-011-1/+1
|
* RJIT: Remove unused countersTakashi Kokubun2023-04-011-12/+3
|
* RJIT: Start moving away from VM-like ISEQ handlingTakashi Kokubun2023-04-011-4/+29
|
* RJIT: Implement leaf builtin callTakashi Kokubun2023-03-261-0/+2
|
* RJIT: Implement attr_writerTakashi Kokubun2023-03-261-3/+9
|
* RJIT: Put a guard for splat w/ var-arg cfuncTakashi Kokubun2023-03-251-0/+1
|
* RJIT: Support optional params on splatTakashi Kokubun2023-03-251-1/+0
|
* RJIT: Remove send_iseq_complex_splat exitTakashi Kokubun2023-03-251-1/+0
|
* RJIT: Initial support of splatTakashi Kokubun2023-03-251-0/+7
|
* `vm_call_single_noarg_inline_builtin`Koichi Sasada2023-03-231-0/+1
| | | | | | | | 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.
* RJIT: Update bindingTakashi Kokubun2023-03-211-1/+2
|
* RJIT: Split has_rest_or_post exit reasonsTakashi Kokubun2023-03-211-2/+2
|
* RJIT: Fix invokesuperTakashi Kokubun2023-03-211-0/+4
|
* RJIT: Break up RJIT send_iseq_complex exit reasonsTakashi Kokubun2023-03-191-1/+14
|
* RJIT: Implement ifunc invokeblockTakashi Kokubun2023-03-191-1/+6
|
* RJIT: Fix ISeq invokeblockTakashi Kokubun2023-03-191-0/+2
|
* RJIT: Implement invokeblock with ISeqTakashi Kokubun2023-03-191-1/+2
|
* RJIT: Optimize Kernel#respond_to?Takashi Kokubun2023-03-191-0/+24
|
* RJIT: Optimize String#+@Takashi Kokubun2023-03-191-0/+5
|
* RJIT: Optimize String#<<Takashi Kokubun2023-03-191-0/+9
|
* RJIT: Drop duplicated obj_is_kind_ofTakashi Kokubun2023-03-191-4/+0
|
* RJIT: Workaround USE_RVARGC=0 CITakashi Kokubun2023-03-181-5/+0
|
* RJIT: Optimize String#bytesizeTakashi Kokubun2023-03-181-0/+4
|
* RJIT: Optimize String#empty?Takashi Kokubun2023-03-181-0/+25
|
* RJIT: Optimize Kernel#instance_of?Takashi Kokubun2023-03-181-0/+5
|
* RJIT: Optimize Kernel#is_a?Takashi Kokubun2023-03-181-0/+6
|
* RJIT: Reorder opt_case_dispatch branchesTakashi Kokubun2023-03-181-3/+20
|