summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-11-29debugger can never be nilPeter Zhu
2023-11-29[rubygems/rubygems] Avoid re-compiling static regexp in a loopSamuel Giddins
Pathname::SEPARATOR_PAT is a constant and can safely be interpolated once, avoiding creating a new regexp object on every iteration https://github.com/rubygems/rubygems/commit/75d9c0f1e4
2023-11-29[PRISM] Compile empty array as newarray 0Jemma Issroff
Prior to this commit, we were compiling an empty array as a duparray of [] which meant we were allocating a new value unnecessarily. With this commit, we emit a newarray with size 0 instead.
2023-11-29[PRISM] Implement CallNodes with splat followed by argsJemma Issroff
2023-11-29[PRISM] Account for ImplicitRestNodeJemma Issroff
Prism introduced a new ImplicitRestNode. This adds tests for the ImplicitRestNode cases, and changes one assert which is no longer accurate.
2023-11-29[PRISM] Fix EnsureNode, pass depth to get localsJemma Issroff
This commit fixes a bug with locals in ensure nodes by setting the local tables correctly. It also changes accessing locals to look at local tables in parent scopes, and account for this correctly on depths of get or setlocals.
2023-11-29GC guard catch_table_ary in iseq_set_exception_tablePeter Zhu
The function iseq_set_exception_table allocates memory which can cause a GC compaction to run. Since catch_table_ary is not on the stack, it can be moved, which would make tptr incorrect.
2023-11-29[prism] Add MacJapanese encodings to common.mkKevin Newton
2023-11-29[ruby/prism] Add MacJapanese encodingMatt Boldt
MacJapanese (also aliased as MacJapan) is a modified Shift_JIS encoding, but is implemented identically in Ruby https://github.com/ruby/prism/commit/9e0a097699
2023-11-29[ruby/irb] Use gem repl_type_completor, remove type_completiontomoya ishida
implementation (https://github.com/ruby/irb/pull/772) https://github.com/ruby/irb/commit/a4868a5373
2023-11-29[prism] Add pm_cp950 to make targetsKevin Newton
2023-11-29[ruby/prism] added CP950 encodingDhaval
https://github.com/ruby/prism/commit/9c2d1cf4ba
2023-11-29Assert that the left and right nodes are correctPeter Zhu
2023-11-29[ruby/prism] Fixed comment on pm_parser_numbered_parameters_setJemma Issroff
https://github.com/ruby/prism/commit/ceae5727b8
2023-11-29Add missing assertion in test_use_all_shapes_then_freezePeter Zhu
2023-11-29[ruby/prism] Convert start line to signed integersJean Boussier
Ruby allows for 0 or negative line start, this is often used with `eval` calls to get a correct offset when prefixing a snippet. e.g. ```ruby caller = caller_locations(1, 1).first class_eval <<~RUBY, caller.path, caller.line - 2 # frozen_string_literal: true def some_method #{caller_provided_code_snippet} end RUBY ``` https://github.com/ruby/prism/commit/0d14ed1452
2023-11-29[ruby/prism] Rename varint as varuintJean Boussier
Line numbers may be negative, so we need to introduce signed varint, so renaming unsigned ones first avoid confusion. https://github.com/ruby/prism/commit/90d862361e
2023-11-29[Bug #17037] Improve accuracy of division near precision limitsNobuyoshi Nakada
When dividing near the precision limit of `double`, use Bignum division to get rid of rounding errors.
2023-11-29[Bug #20025] Check if upper/lower before fallback to case-foldingNobuyoshi Nakada
2023-11-29[rubygems/rubygems] update Magnus library in Rust extension gem templateMichael Go
https://github.com/rubygems/rubygems/commit/46f09800da
2023-11-29[ruby/prism] Reject class/module defs in method params/rescue/ensure/elseTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/1936 https://github.com/ruby/prism/commit/232e77a003
2023-11-29Remove written-but-never-read `me->def.body.refined.owner`Alan Wu
This also removes aliasing rule violations; the anonymous structs were distinct types from `rb_method_refined_t`.
2023-11-29Do not call the inplicit convercion spec on older ruby versionsTema Bolshakov
2023-11-29Fix Array#rassoc specTema Bolshakov
2023-11-29Array#rassoc should try to convert to array implicitly. Fixes #20003Tema Bolshakov
2023-11-28Fix Ractor sharing for too complex ObjectsPeter Zhu
2023-11-28Fix Ractor sharing for too complex generic ivarsPeter Zhu
2023-11-28[ruby/prism] Implicit rest nodesKevin Newton
Fundamentally, `foo { |bar,| }` is different from `foo { |bar, *| }` because of arity checks. This PR introduces a new node to handle that, `ImplicitRestNode`, which goes in the `rest` slot of parameter nodes instead of `RestParameterNode` instances. This is also used in a couple of other places, namely: * pattern matching: `foo in [bar,]` * multi target: `for foo, in bar do end` * multi write: `foo, = bar` Now the only splat nodes with a `NULL` value are when you're forwarding, as in: `def foo(*) = bar(*)`. https://github.com/ruby/prism/commit/dba2a3b652
2023-11-28YJIT: fix bug in top cfunc logging in `--yjit-stats` (#9056)Maxime Chevalier-Boisvert
YJIT: correctly handle case where there are no cfunc calls Fix bug in top cfunc logging in `--yjit-stats`
2023-11-28[PRISM] Don't calculate params size based on localsJemma Issroff
Prior to this commit, we were conflating the size of the locals list with the number of parameters. This commit distinguishes the two, and fixes a related bug which would occur if we set a local that was not a parameter
2023-11-28[ruby/prism] Add numbered_parameters field to BlockNode and LambdaNodeJemma Issroff
We are aware at parse time how many numbered parameters we have on a BlockNode or LambdaNode, but prior to this commit, did not store that information anywhere in its own right. The numbered parameters were stored as locals, but this does not distinguish them from other locals that have been set, for example in `a { b = 1; _1 }` there is nothing on the AST that distinguishes b from _1. Consumers such as the compiler need to know information about how many numbered parameters exist to set up their own tables around parameters. Since we have this information at parse time, we should compute it here, instead of deferring the work later on. https://github.com/ruby/prism/commit/bf4a1e124d
2023-11-28YJIT: reduce default exec-mem-size to 64MiB (#9054)Maxime Chevalier-Boisvert
2023-11-28Further fix the GVL instrumentation APIJean Boussier
Followup: https://github.com/ruby/ruby/pull/9029 [Bug #20019] Some events still weren't triggered from the right place. The test suite was also improved a bit more.
2023-11-28[PRISM] Implement more compilation of SplatNodesJemma Issroff
There was a bug with the rest argument in SplatNodes, this commit fixes it, and adds more tests illustrating the behavior of SplatNodes
2023-11-28[PRISM] Compile YieldNode with different argumentsJemma Issroff
2023-11-28Assert node inserted into red-black tree existsPeter Zhu
2023-11-28Fix cache incoherency for ME resolved through VM_METHOD_TYPE_REFINEDAlan Wu
Previously, we didn't invalidate the method entry wrapped by VM_METHOD_TYPE_REFINED method entries which could cause calls to land in the wrong method like it did in the included test. Do the invalidation, and adjust rb_method_entry_clone() to accommodate this new invalidation vector. Fix: cfd7729ce7a31c8b6ec5dd0e99c67b2932de4732 See-also: e201b81f79828c30500947fe8c8ea3c515e3d112
2023-11-28Add in missing errorKevin Newton
2023-11-28[PRISM] Run test setting global constant separatelyAlan Wu
This impacted other tests. Please mind the commons. /home/runner/work/ruby/ruby/src/test/ruby/test_compile_prism.rb:394: warning: already initialized constant Bar /tmp/test_reline_config_60145/bazbarbob.rb:6: warning: previous definition of Bar was here 1) Failure: TestModule#test_const_get_evaled [/home/runner/work/ruby/ruby/src/test/ruby/test_module.rb:1239]: NameError expected but nothing was raised.
2023-11-28[ruby/prism] Fix testsTSUYUSATO Kitsune
https://github.com/ruby/prism/commit/1e6ecbaf04
2023-11-28[ruby/prism] Reset `current_param_name` around closed scopesTSUYUSATO Kitsune
It is for supporting `def foo(bar = (def baz(bar) = bar; 1)) = 2` case. https://github.com/ruby/prism/commit/c789a833c5
2023-11-28[ruby/prism] Use `0` for the default valie of `current_param_name`TSUYUSATO Kitsune
https://github.com/ruby/prism/commit/896915de24
2023-11-28[ruby/prism] Check circular references in default values of paramsTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/1637 https://github.com/ruby/prism/commit/0172d69cba
2023-11-28[ruby/irb] Change show_source tests into integration testsPeter Zhu
* Remove trailing spaces * Migrate show_source tests to integration tests Because show_source tests often need to define class and/or methods, they can easily leak state to other tests. Changing them to integration tests will ensure that they are run in a clean environment. * Fix NoMethodError caused by SourceFinder#method_target https://github.com/ruby/irb/commit/3c39f13397c72a8db24e50afdcb8942e6c4ea12f
2023-11-28YJIT: Assert no patch overlap on pos_marker (#9048)Takashi Kokubun
2023-11-28[ruby/irb] This enhancement allows a user to add the -s flag if theypaulreece
want to access a methods origin definition. It allows for chaining of multiple esses to further go up the classes as needed. (https://github.com/ruby/irb/pull/770) https://github.com/ruby/irb/commit/eec1329d5a
2023-11-28[ruby/irb] Rescue errors from main.to_s/inspect when formattingKasumi Hanazuki
prompt (https://github.com/ruby/irb/pull/791) Currently, IRB just terminates if `main.to_s` raises while IRB constructs the prompt string. This can easily happen if the user wants to start an IRB session in the instance scope of an uninitialized object, for example: ``` class C def initialize binding.irb @values = [] end def to_s = @values.join(',') # raises if uninitialized end C.new ``` This patch makes IRB rescue from such an exception and displays the class name of the exception instead of `main.to_s` to indicate some error has occurred. We may display more detailed information about the exception, but this patch chooses not to do so because 1) the prompt has limited space, 2) users can evaluate `to_s` in IRB to examine the error if they want, and 3) obtaining the details can also raise, which requires nested exception handling and can be complicated. https://github.com/ruby/irb/commit/412ab26067
2023-11-28[ruby/prism] Fix to parse `*` as forwarding in `foo[*]` caseTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/1924 https://github.com/ruby/prism/commit/7cde900065
2023-11-28[ruby/prism] Move DATA parsing into its own parse result fieldKevin Newton
https://github.com/ruby/prism/commit/42b60b6e95
2023-11-28Fix indentation in ivar_set [ci skip]Peter Zhu