aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [PRISM] Fixed redo nodeJemma Issroff2023-12-042-13/+81
|
* [PRISM] Handle percent literals for `defined?`eileencodes2023-12-042-0/+12
| | | | | | | | | | | | | | | | | | | | | | | Tests all the possible percent literal with `defined?`. Implements the missing `PM_X_STRING_NODE` for the `%x` literal. Code: ```ruby defined?(%x[1,2,3]) ``` ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,19)> 0000 putobject "expression" 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,19)> 0000 putobject "expression" 0002 leave ```
* [PRISM] Implement `PM_INTERPOLATED_REGULAR_EXPRESSION_NODE`eileencodes2023-12-042-0/+2
| | | | | | | | | | | | | | | | | | | | | | Implements `PM_INTERPOLATED_REGULAR_EXPRESSION_NODE` for `defined?` Code: ```ruby defined?(/#{1}/) ``` ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,16)> 0000 putobject "expression" 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,16)> 0000 putobject "expression" 0002 leave ```
* [PRISM] Implement `PM_INTERPOLATED_STRING_NODE`eileencodes2023-12-042-0/+2
| | | | | | | | | | | | | | | | | | | | | | Implements `PM_INTERPOLATED_STRING_NODE` for `defined?` Code: ```ruby defined?("#{expr}") ``` ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,19)> 0000 putobject "expression" 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,19)> 0000 putobject "expression" 0002 leave ```
* [PRISM] Fix `PM_PARENTHESES_NODE`eileencodes2023-12-042-1/+11
| | | | | | | | | | | | | | | | | | | | | | | In #9101 I only accounted for an empty paren. This change implements the `PM_PARENTHESES_NODE` for when it's `nil` and when it's an expression. Code: ```ruby defined?(("a")) ``` ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,15)> 0000 putobject "expression" 0002 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,15)> 0000 putobject "expression" 0002 leave ```
* [Prism] Implement backref and numbered reference for `defined?`eileencodes2023-12-042-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This PR implements `PM_BACK_REFERENCE_READ_NODE` and `PM_NUMBERED_REFERENCE_READ_NODE` for `defined?`. The following now works: * `PM_NUMBERED_REFERENCE_READ_NODE` ``` defined? $1 defined? $2 ``` Instructions: ``` "********* RUBY *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,12)> 0000 putnil 0001 defined ref, :$1, "global-variable" 0005 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,12)> 0000 putnil 0001 defined ref, :$1, "global-variable" 0005 leave ``` * `PM_BACK_REFERENCE_READ_NODE` ``` defined? $' defined? $` defined? $& ``` Instructions: ``` "********* RUBY *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,12)> 0000 putnil 0001 defined ref, :$`, "global-variable" 0005 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:0 (0,0)-(0,12)> 0000 putnil 0001 defined ref, :$`, "global-variable" 0005 leave ```
* [PRISM] Fix compilation for NextNodeJemma Issroff2023-12-042-8/+104
| | | | | This code was almost enitrely the same as the existing compiler's code for its NextNode.
* Use 32-bit integers for redblack_id_tPeter Zhu2023-12-041-2/+2
| | | | | | | | | | | | | | On 32-bit systems, the shape cache size is 1048576 (value of REDBLACK_CACHE_SIZE), but a 16-bit unsigned integer can only go up to 65536. This means that the redblack_id_t can overflow and lead to a corrupted red-black tree. The following script crashes on 32-bit systems: o = Object.new 1_000_000.times do |i| o.instance_variable_set(:"@i#{i}", i) end
* [ruby/prism] Fix up docs for lex_compatKevin Newton2023-12-041-4/+4
| | | | https://github.com/ruby/prism/commit/9131e84060
* [ruby/prism] Ripper compat docs updateKevin Newton2023-12-042-39/+52
| | | | https://github.com/ruby/prism/commit/5f70b32b02
* [PRISM] Fix dependenciesPeter Zhu2023-12-041-0/+3
|
* YJIT: Mark and update stubs in invalidated blocks (#9104)Alan Wu2023-12-042-49/+121
| | | | | Like in the example given in delayed_deallocation(), stubs can be hit even if the block housing it is invalidated. Mark them so we don't work with invalidate ISeqs when hitting these stubs.
* Make rb_obj_copy_ivs_to_hash_table_i staticPeter Zhu2023-12-041-1/+1
|
* [ruby/prism] Refactor pm_diagnostic_t and pm_comment_t to use pm_location_tLily Lyons2023-12-046-28/+18
| | | | https://github.com/ruby/prism/commit/115b6a2fc6
* [ruby/prism] Check "void value expression" for array literalsTSUYUSATO Kitsune2023-12-042-3/+25
| | | | | | Fix https://github.com/ruby/prism/pull/1978 https://github.com/ruby/prism/commit/194c997d0a
* Revert "Add missing GVL hooks for M:N threads and ractors"John Hawthorn2023-12-034-94/+46
| | | | This reverts commit ad54fbf281ca1935e79f4df1460b0106ba76761e.
* Fix format specifiers for `size_t`Nobuyoshi Nakada2023-12-041-1/+2
|
* Remove `rb_libruby_selfpath` for MJITNobuyoshi Nakada2023-12-041-20/+3
|
* Win32: ruby-runner is unnecessary on Windows in favor of SxS [ci skip]Nobuyoshi Nakada2023-12-041-0/+4
|
* Update default gems list at 52eabf2e329485088672beefe4bc59 [ci skip]git2023-12-031-1/+1
|
* [ruby/irb] Bump version to v1.10.0Stan Lo2023-12-031-2/+2
| | | | | | (https://github.com/ruby/irb/pull/798) https://github.com/ruby/irb/commit/4acc9b8d6c
* [ruby/irb] Disable pager in eval_history testtomoya ishida2023-12-031-0/+1
| | | | | | (https://github.com/ruby/irb/pull/799) https://github.com/ruby/irb/commit/ee85e84935
* [Fix] Support when nil is assigned to variable `name` (#9105)jinroq2023-12-021-1/+1
| | | * Add `!name.nil?` to if condition
* Add missing GVL hooks for M:N threads and ractorsJohn Hawthorn2023-12-024-46/+94
| | | | | | | | | | | [Bug #20019] This fixes GVL instrumentation in three locations it was missing: - Suspending when blocking on a Ractor - Suspending when doing a coroutine transfer from an M:N thread - Resuming after an M:N thread starts Co-authored-by: Matthew Draper <matthew@trebex.net>
* [DOC] More on What's Here (#9099)Burdette Lamar2023-12-021-1/+4
| | | | | * More on What's Here * More on What's Here
* Pin instruction storagePeter Zhu2023-12-023-10/+17
| | | | | | | The operands in each instruction needs to be pinned because if auto-compaction runs in iseq_set_sequence, then the objects could exist on the generated_iseq buffer, which would not be reference updated which can lead to T_MOVED (and subsequently T_NONE) objects on the iseq.
* [DOC] Markup class name `Time` as codeNobuyoshi Nakada2023-12-023-36/+36
|
* [DOC] Include timezones document in timev.rbNobuyoshi Nakada2023-12-023-14/+14
| | | | So that it can be referred as a part of the document of `Time`.
* [ruby/rdoc] Markup punctuations need to be separated with a spaceNobuyoshi Nakada2023-12-022-2/+14
| | | | https://github.com/ruby/rdoc/commit/83f0149fc1
* [ruby/irb] Implement `history` commandGary Tou2023-12-023-0/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://github.com/ruby/irb/pull/761) * Implement `history` command Lists IRB input history with indices. Also aliased as `hist`. * Add tests for `history` command * Address feedback: `puts` with multiple arguments instead of `join`ing * Address feedback: Handle nil from splitting an empty input string * Refactor line truncation * Add `-g` grep option to `history` command * Add `history` command to README * Remove unused `*args` parameter * Allow spaces to be included in grep * Allow `/` to be included in grep regex * Handle `input` being an empty string * Exclude "#{index}: " from matching the grep regex * Add new line after joining https://github.com/ruby/irb/commit/3f9eacbfa9
* Lrama v0.5.11yui-knk2023-12-0221-423/+526
|
* Implement paren node for `defined?`eileencodes2023-12-012-2/+4
| | | | Implements and adds a test for passing a parentheses node to `defined?`.
* [DOC] Update ARGF.readlines documentation to match/reference IO.readlines.Ryan Davis2023-12-011-6/+8
|
* Make expandarray compaction safePeter Zhu2023-12-012-24/+30
| | | | | | | | | | | | The expandarray instruction can allocate an array, which can trigger a GC compaction. However, since it does not increment the sp until the end of the instruction, the objects it places on the stack are not marked or reference updated by the GC, which can cause the objects to move which leaves broken or incorrect objects on the stack. This commit changes the instruction to be handles_sp so the sp is incremented inside of the instruction right after the object is written on the stack.
* [ruby/prism] Prism.parse_success?(source)Kevin Newton2023-12-016-1/+133
| | | | | | | | | | | | A lot of tools use Ripper/RubyVM::AbstractSyntaxTree to determine if a source is valid. These tools both create an AST instead of providing an API that will return a boolean only. This new API only creates the C structs, but doesn't bother reifying them into Ruby/the serialization API. Instead it only returns true/false, which is significantly more efficient. https://github.com/ruby/prism/commit/7014740118
* Remove unneeded local variablesPeter Zhu2023-12-011-2/+0
|
* [ruby/prism] Fix parsing heredoc endsHaldun Bayhantopcu2023-12-015-28/+147
| | | | https://github.com/ruby/prism/commit/aa8c702271
* Implements missing literals for `defined?`eileencodes2023-12-012-1/+16
| | | | | | | | | | | | | | | This PR implements the following literals: - String - Symbols - Integers - Floats - Regexs - Ranges - Lambdas - Hashes and tests for them.
* Make String#undump compaction safePeter Zhu2023-12-012-0/+13
|
* Pin embedded shared stringsPeter Zhu2023-12-013-23/+10
| | | | | | | Embedded shared strings cannot be moved because strings point into the slot of the shared string. There may be code using the RSTRING_PTR on the stack, which would pin the string but not pin the shared string, causing it to move.
* [rubygems/rubygems] Reduce array allocations when loading definitionSamuel Giddins2023-12-012-4/+14
| | | | | | The same array was being re-created in a loop (as well as the `generic_local_platform`), which is avoidable by hoisting it to a frozen array created once https://github.com/rubygems/rubygems/commit/009a3c6d0d
* [Bug #20033] Dynamic regexp should not assign capturesNobuyoshi Nakada2023-12-023-10/+23
|
* [ruby/prism] Provide heredoc? queriesKevin Newton2023-12-012-16/+53
| | | | https://github.com/ruby/prism/commit/e148e8fe6a
* [PRISM] Account for RescueNodes with no statementsJemma Issroff2023-12-012-0/+11
| | | | We need a PUTNIL if a RescueNode has no statements.
* [PRISM] Fix behavior of BlockParameters with only one parameterJemma Issroff2023-12-012-4/+23
| | | | | | This commit sets the ambiguous param flag if there is only one parameter on a block node. It also fixes a small bug with a trailing comma on params.
* [ruby/irb] Scrub past history input before splithogelog2023-12-012-3/+20
| | | | | | | | | | (https://github.com/ruby/irb/pull/795) * Scrub past history input before split * Don't rewrite ENV["LANG"] https://github.com/ruby/irb/commit/0f344f66d9
* [rubygems/rubygems] Many major_deprecations supply :removed_messageEric Mueller2023-12-017-46/+91
| | | | | | | | | | Generally the removed message is very similar, but often it needs to specify that the feature has "been removed" instead of "will be removed", or "been deprecated". And a few chunks of text needed more substantial updates. And a number of them seemed to have been carefully crafted to make sense in either context, so I left those alone. https://github.com/rubygems/rubygems/commit/8d42cf9104
* [rubygems/rubygems] major_deprecation accepts :removed_messageEric Mueller2023-12-012-3/+35
| | | | | | | If supplied, it uses that in place of the message for the case where the deprecation version is already past. https://github.com/rubygems/rubygems/commit/1deb73663c
* [Bug #19838] Flush delayed token nonconsecutive with the next tokenNobuyoshi Nakada2023-12-022-0/+69
|
* Extract `end_with_newline_p`Nobuyoshi Nakada2023-12-021-1/+7
|