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

75439 Коммитов

Автор SHA1 Сообщение Дата
Takashi Kokubun 033e19dabf Document the public interface of YJIT [ci skip] 2022-12-22 14:43:58 -08:00
Takashi Kokubun 0b2aea861c Polish the public docs for MJIT [ci skip]
Now every private interface is cleaned up, and the public interface is
documented.
2022-12-22 14:30:09 -08:00
Takashi Kokubun cce6a30fdd Avoid calling it a stdlib [ci skip]
It technically is, but it's probably just confusing for most people.
2022-12-22 13:39:08 -08:00
Nobuyoshi Nakada dc8c5bafcf
Clean intermediate source file in `TestMJIT#test_jit_failure` (#6994) 2022-12-22 13:06:31 -08:00
Jeremy Evans 7e8fa06022 Always issue deprecation warning when calling Regexp.new with 3rd positional argument
Previously, only certain values of the 3rd argument triggered a
deprecation warning.

First step for fix for bug #18797.  Support for the 3rd argument
will be removed after the release of Ruby 3.2.

Fix minor fallout discovered by the tests.

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2022-12-22 11:50:26 -08:00
Takashi Kokubun 9dcee2d80e Remove MJIT's private constants from docs [ci skip] 2022-12-22 11:35:46 -08:00
Takashi Kokubun ad1ce2b7b6 Remove mjit.md from public documentation [ci skip]
It's for CRuby developers. Not meant to be a documentation for users.
Creating a directory seems like the easiest way to exclude this from
doc/.document.
2022-12-22 11:17:25 -08:00
Takashi Kokubun 1679ba61f8 Update MJIT documentation [ci skip] 2022-12-22 11:15:05 -08:00
Peter Zhu 4f73de67ed Fix typo in array.c
We should be using the size of RArray and not RString for arrays.
2022-12-22 13:16:55 -05:00
Alan Wu 98675ac09c
[DOC] IO#read doesn't always read in binary mode
When `maxlen` is `nil`, it uses the data mode of the stream.
For example in the following:

```ruby
File.binwrite("a.txt", "\r\n\r")
p File.open("a.txt", "rt").read    # "\n\n"
p File.open("a.txt", "rt").read(3) # "\r\n\r"
```

Note, this newline translation is _not_ specific to Windows.
2022-12-22 13:15:04 -05:00
Alan Wu bba2bfc975 [DOC] encodings.rdoc: universal_newline reacts to \r
It wasn't clear that the mode also translates "\r" to "\n".
2022-12-22 13:10:22 -05:00
Yusuke Endoh 95a1d1fde8 addr2line.c: Support DW_FORM_rnglistx 2022-12-23 00:32:35 +09:00
Yusuke Endoh 53c82a6ce4 addr2line.c: Implement DW_AT_*_base
... and add code to parse the sections of .debug_addr_base and
.debug_rnglists_base.
2022-12-23 00:32:35 +09:00
Yusuke Endoh 515f816b7f addr2line.c: Support DW_FORM_strx* forms 2022-12-23 00:32:35 +09:00
Yusuke Endoh 5234f99b76 addr2line.c: Support DW_FORM_addrx* forms
... and add VAL_addr value type
2022-12-23 00:32:35 +09:00
Yusuke Endoh 303e11697d addr2line.c: Keep .debug_str_offsets and .debug_addr sections as well
clang generates DWARF with the sections
2022-12-23 00:32:35 +09:00
Peter Zhu d7388f720c Fix buffer overrun with auto-compact for shapes
The following script crashes:

```ruby
GC.auto_compact = true
GC.stress = true

class Foo
  def initialize
    @a = @b = @c = 0
  end

  def add_ivars
    @d = @e = @f = 0
  end
end

ary = 1_000.times.map { Foo.new }
ary.each { |f| f.add_ivars }
```

This is because in rb_grow_iv_list, it first calls
rb_ensure_iv_list_size to allocate the buffer (and also unsets the
embed bit) then rb_shape_transition_shape_capa to get the new shape.
However, auto-compact can trigger in rb_shape_transition_shape_capa
which would re-embed the object since it doesn't have the new shape yet.
This causes a crash as the object is now embedded but has a non-embed
shape which would cause the object to have a buffer overrun.
2022-12-22 09:23:40 -05:00
Yusuke Endoh d1d61cabbc addr2line.c: Fix another indexing bug 2022-12-22 20:37:40 +09:00
Yusuke Endoh ebd6b5d826 addr2line.c: Fix indexing bug 2022-12-22 20:28:03 +09:00
Nobuyoshi Nakada e61e4ae60b
Refactor `reg_extract_args` to return regexp if given 2022-12-22 19:27:27 +09:00
Yusuke Endoh 78826ad486 addr2info.c: Make it work with --enable-yjit
Background: GCC 12 generates DWARF 5 with .debug_rnglists, while rustc
generates DWARF 4 with .debug_ranges.

The previous logic always used .debug_rnglists if there is the section.
However, we need to refer .debug_ranges for DWARF 4.

This change keeps DWARF version of the current compilation unit and use
a proper section depending on the version.
2022-12-22 18:57:06 +09:00
Yusuke Endoh c827d724b7 addr2line.c: Support "Line Number Program Header" in DWARF 5 2022-12-22 18:57:06 +09:00
Yusuke Endoh 2445a4c5b7 addr2line.c: Keep .debug_line_str section as well
... and properly support DW_FORM_line_strp.

This is a prepartion to support DWARF 5.
2022-12-22 18:57:06 +09:00
git ed81d0f5f6 Update default gems list at fe7190a8c1 [ci skip] 2022-12-22 08:49:43 +00:00
Hiroshi SHIBATA fe7190a8c1
[ruby/optparse] Bump version to 0.3.1
https://github.com/ruby/optparse/commit/2a1e157ae1
2022-12-22 17:48:22 +09:00
Kazuki Tsujimoto 298176f23a
NEWS.md: Update power_assert version 2022-12-22 16:20:23 +09:00
Nobuyoshi Nakada 454c00723a Share argument parsing in `Regexp#initialize` and `Regexp.linear_time?` 2022-12-22 15:51:00 +09:00
Takashi Kokubun bb4cbd0803
Put RubyVM::MJIT::Compiler under ruby_vm directory (#6989)
[Misc #19250]
2022-12-21 22:46:15 -08:00
Nobuyoshi Nakada 43f4093a31
Adjust style [ci skip] 2022-12-22 15:12:05 +09:00
Kazuhiro NISHIYAMA af0ea88b30
Fix link [ci skip] 2022-12-22 15:02:36 +09:00
Takashi Kokubun 186b5c0086
Revert "Update bundled gems list at 2022-12-22"
This reverts commit 89a66f20d8.
2022-12-21 21:49:30 -08:00
Jeremy Evans 1e193c78d2 Clarify NEWS entry for Bug #16889 2022-12-21 21:05:08 -08:00
Jeremy Evans 4213f42555
Make sure TracePoint#binding returns nil for c_call/c_return events
This makes sure the method returns nil for these events, as
described in NEWS, even if the TracePoint could create a binding.
2022-12-21 21:02:43 -08:00
zverok ae455a129e [DOC] Update TracePoint.allow_reentry docs
Adjust call-seq to mention block, and add examples
and explanations.
2022-12-22 13:37:58 +09:00
Kazuki Tsujimoto b7bb14b96e
Update documentation about Time#deconstruct_keys 2022-12-22 13:05:09 +09:00
Nobuyoshi Nakada 4e6c44e297
[DOC] Fix the paragraph about PRNG update 2022-12-22 12:48:11 +09:00
Hiroshi SHIBATA e3847f39a1
Added the missing word with 1e1d7047fc 2022-12-22 12:27:09 +09:00
Hiroshi SHIBATA 1e1d7047fc
Introduce GH releases for default gems and bundled gems 2022-12-22 12:25:00 +09:00
Yusuke Endoh 2811d9d224 NEWS.md: Tweak "Constant lookup when defining a class/module" 2022-12-18 19:18:35 +09:00
Yusuke Endoh dd338ae124 NEWS.md: Fix typos 2022-12-18 18:48:02 +09:00
Yusuke Endoh 937299ede1 NEWS.md: Fix a typo 2022-12-18 18:47:19 +09:00
git 89a66f20d8 Update bundled gems list at 2022-12-22 2022-12-22 02:34:24 +00:00
Kazuki Tsujimoto 5b85e4040e
Update power_assert to 2.0.3 2022-12-22 11:12:59 +09:00
Takashi Kokubun 5b76a8ed56
Introduce some notable IRB features in NEWS [ci skip] 2022-12-21 17:41:00 -08:00
Takashi Kokubun 67ef3cd3cc
Skip a flaky Ractor test for mswin 2022-12-21 16:56:41 -08:00
Takashi Kokubun 2537182063
Make it clear that it doesn't update the receiver [ci skip] 2022-12-21 16:45:54 -08:00
Takashi Kokubun 4e6b4cce80
Add Data#with to examples in the NEWS [ci skip] 2022-12-21 16:44:47 -08:00
Ufuk Kayserilioglu 99cee85775
Add copy with changes functionality for Data objects (#6766)
Implements [Feature #19000]

This commit adds copy with changes functionality for `Data` objects
using a new method `Data#with`.

Since Data objects are immutable, the only way to change them is by
creating a copy. This PR adds a `with` method for `Data` class instances
that optionally takes keyword arguments.

If the `with` method is called with no arguments, the behaviour is the
same as the `Kernel#dup` method, i.e. a new shallow copy is created
with no field values changed.

However, if keyword arguments are supplied to the `with` method, then
the copy is created with the specified field values changed. For
example:
```ruby
    Point = Data.define(:x, :y)
    point = Point.new(x: 1, y: 2)
    point.with(x: 3) # => #<data Point x: 3, y: 2>
```

Passing positional arguments to `with` or passing keyword arguments to
it that do not correspond to any of the members of the Data class will
raise an `ArgumentError`.

Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
2022-12-21 16:27:38 -08:00
Nobuyoshi Nakada 398aaed2f0
Fix the case trailer without newline
cf0b413ef8
2022-12-22 00:34:21 +09:00
Nobuyoshi Nakada 98fbebf110
[DOC] Fix typo 2022-12-22 00:01:18 +09:00