summaryrefslogtreecommitdiff
path: root/test/ruby
Commit message (Collapse)AuthorAgeFilesLines
* s/mjit/rjit/Takashi Kokubun2023-03-064-17/+17
|
* s/MJIT/RJIT/Takashi Kokubun2023-03-0611-21/+21
|
* Omit test_version for Cirrus for nowTakashi Kokubun2023-03-051-0/+1
|
* Remove an obsoleted testTakashi Kokubun2023-03-051-7/+0
|
* Skip a failing shape testTakashi Kokubun2023-03-051-0/+1
|
* Drop existing MJIT testsTakashi Kokubun2023-03-053-1450/+0
|
* [Bug #19471] `Regexp.compile` should handle keyword argumentsNobuyoshi Nakada2023-03-031-0/+5
| | | | | As well as `Regexp.new`, it should pass keyword arguments to the `Regexp#initialize` method.
* Remove support for the Regexp.new 3rd argumentJeremy Evans2023-03-011-32/+0
| | | | | | This was deprecated in Ruby 3.2. Fixes [Bug #18797]
* YJIT: Detect and reject `send(:alias_for_send, :foo)`Alan Wu2023-02-271-0/+20
| | | | | | | | | | | | | | | | | Previously, YJIT failed to put the stack into the correct shape when `BasicObject#send` calls an alias method for the send method itself. This can manifest as strange `NoMethodError`s in the final non-send receiver, as [seen][1] with the kt-paperclip gem. I also found a case where it makes YJIT fail the stack size assertion while compiling `leave`. YJIT's `BasicObject#__send__` implementation already rejects sends to `send`, but didn't detect sends to aliases of `send`. Adjust the detection and reject these cases. Fixes [Bug #19464] [1]: https://github.com/Shopify/yjit/issues/306
* Prefer to use File.foreach instead of IO.foreachHiroshi SHIBATA2023-02-273-3/+3
|
* Prefer to use File.readlines instead of IO.readlinesHiroshi SHIBATA2023-02-272-2/+2
|
* Add `IO::Buffer.string` for efficient string creation. (#7364)Samuel Williams2023-02-251-0/+14
|
* YJIT: Generate Block::entry_exit with block entry PCAlan Wu2023-02-241-0/+41
| | | | | | | | | | | | | | | | Previously, when Block::entry_exit is requested from any instruction that is not the first one in the block, we generated the exit with an incorrect PC. We should always be using the PC for the entry of the block for Block::entry_exit. It was a simple typo. The bug was [introduced][1] while we were refactoring to use the current backend. Later, we had a chance to spot this issue while [preparing][2] to enable unused variable warnings, but didn't spot the issue. Fixes [Bug #19463] [1]: 27fcab995e6dde19deb91dc6e291bdb72100af68 [2]: 31461c7e0eab4963ccc8649ea8ebf27979132c0c
* Implement ObjectSpace::WeakKeyMap basic allocatorJean Boussier2023-02-231-0/+112
| | | | [Feature #18498]
* Add marking and sweeping time to GC.statPeter Zhu2023-02-211-0/+2
| | | | | | | | | | | | There is a `time` key in GC.stat that gives us the total time spent in GC. However, we don't know what proportion of the time is spent between marking and sweeping. This makes it difficult to tune the GC as we're not sure where to focus our efforts on. This PR adds keys `marking_time` and `sweeping_time` to GC.stat for the time spent marking and sweeping, in milliseconds. [Feature #19437]
* YJIT: Fix assertion for partially mapped last pages (#7337)Takashi Kokubun2023-02-201-0/+19
| | | Follows up [Bug #19400]
* Update some tests for the new message format of NoMethodErrorYusuke Endoh2023-02-202-2/+2
|
* [Bug#19445] Fix keyword splat in enumeratorNobuyoshi Nakada2023-02-171-0/+3
| | | Extracted arguments do not have keyword hash to splat.
* YJIT: Fix false assumption that String#+@ => ::StringAlan Wu2023-02-161-0/+17
| | | | | | Could return a subclass. [Bug #19444]
* YJIT: jit_prepare_routine_call() for String#+@ missingAlan Wu2023-02-161-0/+27
| | | | | | | | We saw SEGVs due to this when running with StackProf, which needs a correct PC for RUBY_INTERNAL_EVENT_NEWOBJ, the same event used for ObjectSpace allocation tracing. [Bug #19444]
* Fix removing ivars from clases and modules.Haldun Bayhantopcu2023-02-151-0/+26
| | | | Co-authored-by: Adam Hess <hparker@github.com>
* [Bug #19259] `Data#with` should call `initialize` methodNobuyoshi Nakada2023-02-141-0/+16
|
* use correct svar even if env is escapedKoichi Sasada2023-02-101-0/+78
| | | | | | | | This patch is follo-up of 0a82bfe. Without this patch, if env is escaped (Proc'ed), strange svar can be touched. This patch tracks escaped env and use it.
* Copy cvar table on cloneeileencodes2023-02-091-0/+6
| | | | | | | | | | | | When a class with a class variable is cloned we need to also copy the cvar cache table from the original table to the clone. I found this bug while working on fixing [Bug #19379]. While this does not fix that bug directly it is still a required change to fix another bug revealed by the fix in https://github.com/ruby/ruby/pull/7265 This needs to be backported to 3.2.x and 3.1.x. Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
* [Bug #19426] Fix endless `Range#step` with `#succ` methodNobuyoshi Nakada2023-02-091-0/+40
|
* Only emit circular dependency warning for owned thread shieldsJean byroot Boussier2023-02-081-3/+0
| | | | | | | | | | [Bug #19415] If multiple threads attemps to load the same file concurrently it's not a circular dependency issue. So we check that the existing ThreadShield is owner by the current fiber before warning about circular dependencies.
* Add RUBY_GC_HEAP_INIT_SIZE_%d_SLOTS to pre-init pools granularlyJean Boussier2023-02-081-0/+15
| | | | | | | | The old RUBY_GC_HEAP_INIT_SLOTS isn't really usable anymore as it initalize all the pools by the same factor, but it's unlikely that pools will need similar sizes. In production our 40B pool is 5 to 6 times bigger than our 80B pool.
* Use more agressive RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR for GC testsJean Boussier2023-02-071-4/+6
|
* Revert "Only emit circular dependency warning for owned thread shields"Jean byroot Boussier2023-02-061-0/+3
| | | | This reverts commit fa49651e05a06512e18ccb2f54a7198c9ff579de.
* Only emit circular dependency warning for owned thread shieldsJean Boussier2023-02-061-3/+0
| | | | | | | | | | [Bug #19415] If multiple threads attemps to load the same file concurrently it's not a circular dependency issue. So we check that the existing ThreadShield is owner by the current fiber before warning about circular dependencies.
* Limit maximum number of IVs on a shape on T_OBJECTSJemma Issroff2023-02-061-0/+20
| | | | | | | | | | | Create SHAPE_MAX_NUM_IVS (currently 50) and limit all shapes of T_OBJECTS to that number of IVs. When a shape with a T_OBJECT has more than 50 IVs, fall back to the obj_too_complex shape which uses hash lookup for ivs. Note that a previous version of this commit 78fcc9847a9db6d42c8c263154ec05903a370b6b was reverted in 88f2b94065be3fcd6769a3f132cfee8ecfb663b8 because it did not account for non-T_OBJECTS
* Add a test for svar #7225 (#7228)Takashi Kokubun2023-02-011-0/+12
|
* [Bug #19398] Memory leak in WeakMapPeter Zhu2023-02-011-0/+9
| | | | | | | | | | | | | | | | There's a memory leak in ObjectSpace::WeakMap due to not freeing the `struct weakmap`. It can be seen in the following script: ``` 100.times do 10000.times do ObjectSpace::WeakMap.new end # Output the Resident Set Size (memory usage, in KB) of the current Ruby process puts `ps -o rss= -p #{$$}` end ```
* YJIT: Fix BorrowMutError on BOP invalidation (#7212)Takashi Kokubun2023-01-311-0/+18
|
* YJIT: Fix BorrowMutError on GC.compact (#7176)Takashi Kokubun2023-01-301-0/+16
| | | YJIT: Fix BorrowMutError
* Fix parsing of regexps that toggle extended mode on/off inside regexpJeremy Evans2023-01-301-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was broken in ec3542229b29ec93062e9d90e877ea29d3c19472. That commit didn't handle cases where extended mode was turned on/off inside the regexp. There are two ways to turn extended mode on/off: ``` /(?-x:#y)#z /x =~ '#y' /(?-x)#y(?x)#z /x =~ '#y' ``` These can be nested inside the same regexp: ``` /(?-x:(?x)#x (?-x)#y)#z /x =~ '#y' ``` As you can probably imagine, this makes handling these regexps somewhat complex. Due to the nesting inside portions of regexps, the unassign_nonascii function needs to be recursive. In recursive mode, it needs to track both opening and closing parentheses, similar to how it already tracked opening and closing brackets for character classes. When scanning the regexp and coming to `(?` not followed by `#`, scan for options, and use `x` and `i` to determine whether to turn on or off extended mode. For `:`, indicting only the current regexp section should have the extended mode switched, recurse with the extended mode set or unset. For `)`, indicating the remainder of the regexp (or current regexp portion if already recursing) should turn extended mode on or off, just change the extended mode flag and keep scanning. While testing this, I noticed that `a`, `d`, and `u` are accepted as options, in addition to `i`, `m`, and `x`, but I can't see where those options are documented. I'm not sure whether or not handling `a`, `d`, and `u` as options is a bug. Fixes [Bug #19379]
* bignum.c: rb_int_parse_cstr handle `0` stringsJean Boussier2023-01-301-0/+4
| | | | | | | [Bug #19390] We shouldn't check the string length when skipping zeros, as the string might only contains zero characters, resulting in an empty string.
* Add tests for variables in `END` block shared with the toplevelNobuyoshi Nakada2023-01-241-0/+5
|
* Fix Integer#ceildiv to respect #coerce (#7118)Kouhei Yanagita2023-01-221-0/+4
| | | Fixes [Bug #19343]
* [Feature #19314] Add new arguments of String#bytespliceShugo Maeda2023-01-201-27/+71
| | | | | | | bytesplice(index, length, str, str_index, str_length) -> string bytesplice(range, str, str_range) -> string In these forms, the content of +self+ is replaced by str.byteslice(str_index, str_length) or str.byteslice(str_range); however the substring of +str+ is not allocated as a new string.
* [ci skip] Add ticket label to testPeter Zhu2023-01-191-1/+1
|
* don't allow setting class variable on module that's frozen [Bug #19341]lukeg2023-01-191-0/+15
|
* String#bytesplice should return selfShugo Maeda2023-01-191-1/+1
| | | | | | | | In Feature #19314, we concluded that the return value of String#bytesplice should be changed from the source string to the receiver, because the source string is useless and confusing when extra arguments are added. This change should be included in Ruby 3.2.1.
* Change ArgumentError message when Comparable#clamp receives min value higher ↵Kaíque Kandy Koga2023-01-171-2/+2
| | | | than max value
* Fix crash when defining ivars on special constantsPeter Zhu2023-01-171-0/+6
| | | | [Bug #19339]
* [Bug #19335] `Integer#remainder` should respect `#coerce` (#7120)Nobuyoshi Nakada2023-01-152-5/+24
| | | Also `Numeric#remainder` should.
* Remove MIN_PRE_ALLOC_SIZE from Strings.Matt Valentine-House2023-01-131-0/+21
| | | | | This optimisation is no longer helpful now that we use VWA to allocate strings in larger size pools where they can be embedded.
* Skip time-related assertions on /dev/nullNobuyoshi Nakada2023-01-131-3/+6
|
* Do not use VM stack for splat arg on cfuncKoichi Sasada2023-01-131-0/+84
| | | | | | | | | | | | | | On the cfunc methods, if a splat argument is given, all array elements are expanded on the VM stack and it can cause SystemStackError. The idea to avoid it is making a hidden array to contain all parameters and use this array as an argv. This patch is reviesed version of https://github.com/ruby/ruby/pull/6816 The main change is all changes are closed around calling cfunc logic. Fixes [Bug #4040] Co-authored-by: Jeremy Evans <code@jeremyevans.net>
* Remove Encoding#replicateBenoit Daloze2023-01-111-48/+0
|