Граф коммитов

74854 Коммитов

Автор SHA1 Сообщение Дата
Stan Lo 8abf9e6ad0 [ruby/irb] Test debug commands without yamatanooroti
(https://github.com/ruby/irb/pull/464)

* Add debug command tests that don't require yamatanooroti

* Remove debug command related yamatanooroti tests

As discussed in https://github.com/ruby/irb/pull/449#pullrequestreview-1187255149,
we should avoid adding new tests that need yamatanooroti because it's
not maintained by the Ruby org. And since debug commands are now tested
in `test/irb/test_debug_cmd.rb`, we don't need these tests anymore.

* Test against latest debug gem

https://github.com/ruby/irb/commit/78a8aa8834
2022-12-02 01:05:22 +00:00
schneems 85a1c67a65 [ruby/syntax_suggest] Add temp support for 3.2.0-preview{3,2,1}
This SyntaxError#path feature only exists in Ruby HEAD. Until it is released in a preview I want to continue to support existing releases of 3.2.0 (and also so CI will continue to work, as it still uses a preview version to execute tests).

https://github.com/ruby/syntax_suggest/commit/9862032465
2022-12-02 09:36:40 +09:00
Hiroshi SHIBATA 652e2d8f5d [ruby/syntax_suggest] No longer need PathnameFromMessage with SyntaxError#path.
https://bugs.ruby-lang.org/issues/19138

  Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>

https://github.com/ruby/syntax_suggest/commit/8e1e7b3298
2022-12-02 09:36:39 +09:00
John Hawthorn def258e775 Improve packing of iseq_constant_body struct
By moving the two bools into a packing gap above the mark_bits
pointer/union we can save 8 bytes in the struct and avoid an extra cache
line (328 bytes vs 320 bytes).

Co-authored-by: Adam Hess <HParker@github.com>
2022-12-01 16:31:54 -08:00
Takashi Kokubun dcbea7671b
YJIT: Respect destination num_bits on STUR (#6848) 2022-12-01 16:13:38 -08:00
Takashi Kokubun 8ffa8fc192
Relax the timeout of a YAML test
https://cirrus-ci.com/task/4752663775019008
2022-12-01 15:37:41 -08:00
John Hawthorn f0cf70c840 Add a macro for SHAPE_DEBUG
Like before, default to VM_CHECK_MODE > 0, but this allows just enabling
shape debug helpers without the rest of VM_CHECK_MODE.
2022-12-01 15:37:15 -08:00
John Hawthorn da204d2eee Inherit max_iv_count from superclass
In 274870bd5434ab64ac3a3c9db9aa27d262c1d6d6 we gained the ability to
make an educated guess at the max_iv_count of a class based on its
initialize method. This commit makes subclasses inherit their super's
max_iv_count, which makes the estimate work in cases that the subclass
does not have an initialize method.
2022-12-01 15:37:15 -08:00
Burdette Lamar 171e94bd95 [ruby/net-http] [DOC] Enhanced RDoc for Net::HTTPHeader
(https://github.com/ruby/net-http/pull/83)

https://github.com/ruby/net-http/commit/1ea5004098
2022-12-01 23:17:47 +00:00
Jean byroot Boussier 3d272b0fc8
Module#remove_method: Check frozen on the right object
Previously, the frozen check happened on `RCLASS_ORIGIN(self)`, which
can return an iclass. The frozen check is supposed to respond to objects
that users can call methods on while iclasses are hidden from users.
Other mutation methods like Module#{define_method,alias_method,public}
don't do this. Check frozen status on the module itself.

Fixes [Bug #19164] and [Bug #19166].

Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
2022-12-01 17:32:41 -05:00
Nobuyoshi Nakada 9da2a5204f
[Bug #19087] Merge to "trailing garbage" case 2022-12-02 01:50:48 +09:00
Nobuyoshi Nakada c94cd8534a
[Bug #19087] Fix an assertion of `String#to_c` 2022-12-02 01:47:30 +09:00
Nobuyoshi Nakada c0dc717c45 [Bug #19087] Disallow successive underscores in Complex string 2022-12-02 01:35:45 +09:00
S-H-GAMELINKS 914cf26d6e parenthesize to macro 2022-12-02 01:31:27 +09:00
S-H-GAMELINKS 1a64d45c67 Introduce encoding check macro 2022-12-02 01:31:27 +09:00
S-H-GAMELINKS 7bc63d6f43 Introduce argf_encoding function 2022-12-02 01:30:01 +09:00
S-H-GAMELINKS 040e0c8d67 Reuse NIL_OR_UNDEF_P macro 2022-12-02 01:19:55 +09:00
Takashi Kokubun 2c939458ca
YJIT: Reorder branches for Fixnum opt_case_dispatch (#6841)
* YJIT: Reorder branches for Fixnum opt_case_dispatch

Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>

* YJIT: Don't support too large values

Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>
2022-12-01 10:59:56 -05:00
Nobuyoshi Nakada 5872fd6f6c [Feature #19163] Marshal-loaded Data object also should be frozen 2022-12-02 00:56:52 +09:00
Nobuyoshi Nakada a14a1a5626 [Feature #19163] Data object should be frozen 2022-12-02 00:56:52 +09:00
Jemma Issroff 06a0c58016
YJIT: fix 32 and 16 bit register store (#6840)
* Fix 32 and 16 bit register store in YJIT

Co-Authored-By: Takashi Kokubun <takashikkbn@gmail.com>

* Remove an unnecessary diff

* Reuse an rm_num_bits result

* Use u16::MAX instead

* Update the link

Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>

* Just use sturh for 16 bits

Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
2022-12-01 10:53:50 -05:00
Nobuyoshi Nakada 01790de9e6
Fix indents in NEWS [ci skip]
The MarkDown parser in RDoc requires 4 columns indentation for
paragraphs following list items.  Otherwise, the following paragraphs
are not interpreted as the part of the preceeding list item,
2022-12-01 23:01:28 +09:00
Samuel Williams 0436f1e15a
Introduce `Fiber#storage` for inheritable fiber-scoped variables. (#6612) 2022-12-01 23:00:33 +13:00
Nobuyoshi Nakada 9869bd1d61 [Bug #19108] Check for the encoding of pack/unpack format 2022-12-01 17:38:33 +09:00
Nobuyoshi Nakada a1d341efaf [ruby/delegate] Revert "Fix `DelegateClass` block "method redefined" warning"
https://github.com/ruby/delegate/commit/2a91436284
2022-12-01 08:08:02 +00:00
Nobuyoshi Nakada 4e68b59431 [Feature #19138] Add `SyntaxError#path` 2022-12-01 17:05:41 +09:00
Alan Wu 5752d11f1f Use RTEST and add test for GH-6832
Technically we shouldn't see Qfalse now, but RTEST also compiles down to
just one branch anyways. Pretty contrived issue, but easy to fix.
2022-11-30 16:27:39 -05:00
Zack Deveau 4b9d10b833 struct.c (struct_ivar_get): add conditional for potential Qnil returned by rb_class_superclass
struct_ivar_get recently started using rb_class_superclass to
resolve super instead of RCLASS_SUPER. This change made
Qnil a possible case we need to return from within the
struct_ivar_get for loop.
2022-11-30 16:27:39 -05:00
Takashi Kokubun 0d3fc08ff4
YJIT: Optimize rb_int_equal (#6838) 2022-11-30 16:16:11 -05:00
Maxime Chevalier-Boisvert d98d84b75d
YJIT: add new counters for deferred compilation and queued blocks (#6837) 2022-11-30 14:09:10 -05:00
Yusuke Endoh ab4c7077cc Prevent segfault in String#scan with ObjectSpace.each_object
Calling `String#scan` without a block creates an incomplete MatchData
object whose `RMATCH(match)->str` is Qfalse. Usually this object is not
leaked, but it was possible to pull it by using ObjectSpace.each_object.

This change hides the internal MatchData object by using rb_obj_hide.

Fixes [Bug #19159]
2022-12-01 02:38:51 +09:00
Nobuyoshi Nakada f0c9d2a0c8 [ruby/rdoc] Fix `=end` delimiter
https://github.com/ruby/rdoc/commit/e1679fa7e4
2022-12-01 02:36:20 +09:00
Nobuyoshi Nakada 99cad3fccd [ruby/rdoc] Non-RD part feature has not been imported to RDoc
https://github.com/ruby/rdoc/commit/fe0159de2f
2022-12-01 02:36:20 +09:00
Nobuyoshi Nakada c87b3ee671 [ruby/rdoc] Use Tempfile
https://github.com/ruby/rdoc/commit/0b9dde5ab4
2022-12-01 02:36:20 +09:00
Nobuyoshi Nakada d752cf7601 Use class methods of `File` over `Kernel.open` and `IO.read` 2022-12-01 02:28:49 +09:00
Alan Wu a0b0365e90 YJIT: Deallocate `struct Block` to plug memory leaks
Previously we essentially never freed block even after invalidation.
Their reference count never reached zero for a couple of reasons:
1. `Branch::block` formed a cycle with the block holding the branch
2. Strong count on a branch that has ever contained a stub never
   reached 0 because we increment the `.clone()` call for
   `BranchRef::into_raw()` didn't have a matching decrement.

It's not safe to immediately deallocate blocks during
invalidation since `branch_stub_hit()` can end up
running with a branch pointer from an invalidated branch.
To plug the leaks, we wait until code GC or global invalidation and
deallocate the blocks for iseqs that are definitely not running.
2022-11-30 12:23:50 -05:00
Alan Wu b30248f74a YJIT: Deallocate when assumptions tables are empty
When we run global invalidation for TracePoints or code GC, we clear out
all blocks in our assumptions table but we don't deallocate the backing
buffers. Let's reclaim some memory during these rare events.
2022-11-30 12:23:50 -05:00
Alan Wu 03f1e6a2aa YJIT: Fix IseqPayload::pages memory bloat
HashSet::clear() doesn't deallocate the backing buffer and shrink the
capacity. Replace with a 0-capcity set instead so we reclaim some memory
each code GC.
2022-11-30 12:23:50 -05:00
Nobuyoshi Nakada 817193104d
Enable to dispatch Code scanning [ci skip] 2022-11-30 20:03:54 +09:00
Nobuyoshi Nakada d532d27507 [ruby/irb] Use class methods of `File` over `Kernel.open`
https://github.com/ruby/irb/commit/e0ec5e1bd8
2022-11-30 10:18:57 +00:00
Nobuyoshi Nakada cf3b305c43 [ruby/un] wait_writable: close opened file
https://github.com/ruby/un/commit/b08aeb9c48
2022-11-30 10:09:17 +00:00
Hiroshi SHIBATA c8bfbbc25e
Removed documentation for incomplete option about [Feature #17134] 2022-11-30 17:20:38 +09:00
Takashi Kokubun d0c0d7fa5b MJIT: Revert FL_EXIVAR check optimization
It seems to slow down optcarrot. I'll revisit this later.
2022-11-29 22:35:26 -08:00
Takashi Kokubun a1d70f5b12 MJIT: Rename mjit_compile_attr to mjit_sp_inc
There's no mjit_compile.inc, so no need to use this prefix anymore.
2022-11-29 21:45:34 -08:00
Takashi Kokubun 7a2b1364ef MJIT: Merge mjit_unit.h into mjit_c.h
The distinction doesn't make much difference today.
2022-11-29 21:34:46 -08:00
Takashi Kokubun ecc15bc94a MJIT: Rename mjit_compiler.c to mjit_c.c
It's no longer about the compiler logic itself.
2022-11-29 21:26:59 -08:00
Takashi Kokubun 9a84971315 [ruby/irb] Make sure ls doesn't return an array
(https://github.com/ruby/irb/pull/461)

https://github.com/ruby/irb/commit/367797bb05
2022-11-30 04:52:33 +00:00
git 062c5a9e6b Update default gems list at d6e91784ab [ci skip] 2022-11-30 03:59:46 +00:00
schneems d6e91784ab Update SyntaxSuggest to use angle brackets `>`
```
$ ruby tool/sync_default_gems.rb syntax_suggest
Sync ruby/syntax_suggest
```

https://github.com/ruby/syntax_suggest/pull/161
2022-11-30 12:58:47 +09:00
Yusuke Endoh 33a9a7fd8d Mention Exception#detailed_message in NEWS.md 2022-11-30 11:35:44 +09:00