Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into Ractor-Local-GC-v…
Browse files Browse the repository at this point in the history
…ersion-1
  • Loading branch information
rm155 committed Sep 1, 2023
2 parents 09936f6 + cfe1edd commit 2ae606a
Show file tree
Hide file tree
Showing 429 changed files with 10,535 additions and 6,838 deletions.
3 changes: 2 additions & 1 deletion .github/actions/setup/directories/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ runs:
run: |
touch config.status
touch .rbconfig.time
sed -f tool/prereq.status template/Makefile.in common.mk > Makefile
sed -f tool/prereq.status template/Makefile.in > Makefile
sed -f tool/prereq.status template/GNUmakefile.in > GNUmakefile
make up
# Cleanup, runs even on failure
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ jobs:
category: '/language:${{ matrix.language }}'
upload: False
output: sarif-results
ram: 8192

- name: filter-sarif
uses: advanced-security/filter-sarif@f3b8118a9349d88f7b1c0c488476411145b6270d # v1.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rjit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
timeout-minutes: 40
env:
GNUMAKEFLAGS: ''
RUBY_TESTOPTS: '-v --tty=no'
RUBY_TESTOPTS: '-q --tty=no'
RUN_OPTS: ${{ matrix.run_opts }}

- name: make test-spec
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ lcov*.info
/wasm/tests/*.wasm

# YARP
/lib/yarp/mutation_visitor.rb
/lib/yarp/node.rb
/lib/yarp/serialize.rb
/yarp/api_node.c
Expand Down
54 changes: 36 additions & 18 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,37 @@ Note that each entry is kept to a minimum, see links for details.
* A new `performance` warning category was introduced.
They are not displayed by default even in verbose mode.
Turn them on with `-W:performance` or `Warning[:performance] = true`. [[Feature #19538]]
* The `RUBY_GC_HEAP_INIT_SLOTS` environment variable has been deprecated and
removed. Environment variables `RUBY_GC_HEAP_%d_INIT_SLOTS` should be
used instead. [[Feature #19785]]

## Core classes updates

Note: We're only listing outstanding class updates.

* Array

* `Array#pack` now raises ArgumentError for unknown directives. [[Bug #19150]]
* Array#pack now raises ArgumentError for unknown directives. [[Bug #19150]]

* Dir

* `Dir.for_fd` added for returning a Dir object for the directory specified
* Dir.for_fd added for returning a Dir object for the directory specified
by the provided directory file descriptor. [[Feature #19347]]
* `Dir.fchdir` added for changing the directory to the directory specified
* Dir.fchdir added for changing the directory to the directory specified
by the provided directory file descriptor. [[Feature #19347]]
* `Dir#chdir` added for changing the directory to the directory specified
by the provided `Dir` object. [[Feature #19347]]
* Dir#chdir added for changing the directory to the directory specified by
the provided `Dir` object. [[Feature #19347]]

* MatchData

* MatchData#named_captures now accepts optional `symbolize_names` keyword. [[Feature #19591]]
* MatchData#named_captures now accepts optional `symbolize_names`
keyword. [[Feature #19591]]

* String

* `String#unpack` now raises ArgumentError for unknown directives. [[Bug #19150]]
* `String#bytesplice` now accepts new arguments index/length or range of the source string to be copied. [[Feature #19314]]
* String#unpack now raises ArgumentError for unknown directives. [[Bug #19150]]
* String#bytesplice now accepts new arguments index/length or range of the
source string to be copied. [[Feature #19314]]

* ObjectSpace::WeakKeyMap

Expand All @@ -47,7 +52,8 @@ Note: We're only listing outstanding class updates.

* Module

* `Module#set_temporary_name` added for setting a temporary name for a module. [[Feature #19521]]
* Module#set_temporary_name added for setting a temporary name for a
module. [[Feature #19521]]

* Process.warmup

Expand All @@ -59,10 +65,17 @@ Note: We're only listing outstanding class updates.
* Refinement

* Add Refinement#target as an alternative of Refinement#refined_class.
Refinement#refined_class is deprecated and will be removed in Ruby 3.4. [[Feature #19714]]
Refinement#refined_class is deprecated and will be removed in Ruby
3.4. [[Feature #19714]]

## Stdlib updates

* RubyGems and Bundler warn if users require gem that is scheduled to become the bundled gems
in the future version of Ruby. [[Feature #19351]] [[Feature #19776]] [[Feature #19843]]

* Random::Formatter#alphanumeric is extended to accept optional `chars`
keyword argument. [[Feature #18183]]

The following default gems are updated.

* RubyGems 3.5.0.dev
Expand All @@ -72,18 +85,18 @@ The following default gems are updated.
* erb 4.0.3
* fiddle 1.1.2
* fileutils 1.7.1
* irb 1.7.4
* irb 1.8.0
* nkf 0.1.3
* optparse 0.4.0.pre.1
* psych 5.1.0
* reline 0.3.8
* stringio 3.0.8
* stringio 3.0.9
* strscan 3.0.7
* syntax_suggest 1.1.0
* time 0.2.2
* timeout 0.4.0
* uri 0.12.2
* yarp 0.8.0
* yarp 0.9.0

The following bundled gems are updated.

Expand All @@ -92,8 +105,8 @@ The following bundled gems are updated.
* rexml 3.2.6
* rss 0.3.0
* net-imap 0.3.7
* rbs 3.1.3
* typeprof 0.21.7
* rbs 3.2.1
* typeprof 0.21.8
* debug 1.8.0

The following default gem is now bundled.
Expand Down Expand Up @@ -131,13 +144,13 @@ changelog for details of the default gems or bundled gems.
* Instance variables no longer exit to the interpreter
with megamorphic Object Shapes.
* Unsupported call types no longer exit to the interpreter.
* `Integer#!=`, `String#!=`, `Kernel#block_given?`, `Kernel#is_a?`,
`Kernel#instance_of?`, `Module#===` are specially optimized.
* Integer#!=, String#!=, Kernel#block_given?, Kernel#is_a?,
Kernel#instance_of?, Module#=== are specially optimized.
* Now more than 3x faster than the interpreter on optcarrot!
* Metadata for compiled code uses a lot less memory.
* Generate more compact code on ARM64
* Option to start YJIT in paused mode and then later enable it manually
* `--yjit-pause` and `RubyVM::YJIT.resume`
* `--yjit-pause` and RubyVM::YJIT.resume
* This can be used to enable YJIT only once your application is done booting
* `ratio_in_yjit` stat produced by `--yjit-stats` is now avaiable in release builds,
a special stats or dev build is no longer required.
Expand All @@ -155,12 +168,17 @@ changelog for details of the default gems or bundled gems.
* RJIT exists only for experimental purposes.
* You should keep using YJIT in production.

[Feature #18183]: https://bugs.ruby-lang.org/issues/18183
[Feature #18498]: https://bugs.ruby-lang.org/issues/18498
[Feature #18885]: https://bugs.ruby-lang.org/issues/18885
[Bug #19150]: https://bugs.ruby-lang.org/issues/19150
[Feature #19314]: https://bugs.ruby-lang.org/issues/19314
[Feature #19347]: https://bugs.ruby-lang.org/issues/19347
[Feature #19351]: https://bugs.ruby-lang.org/issues/19351
[Feature #19521]: https://bugs.ruby-lang.org/issues/19521
[Feature #19538]: https://bugs.ruby-lang.org/issues/19538
[Feature #19591]: https://bugs.ruby-lang.org/issues/19591
[Feature #19714]: https://bugs.ruby-lang.org/issues/19714
[Feature #19776]: https://bugs.ruby-lang.org/issues/19776
[Feature #19785]: https://bugs.ruby-lang.org/issues/19785
[Feature #19843]: https://bugs.ruby-lang.org/issues/19843
6 changes: 3 additions & 3 deletions array.c
Original file line number Diff line number Diff line change
Expand Up @@ -3522,8 +3522,8 @@ rb_ary_bsearch_index(VALUE ary)
const VALUE zero = INT2FIX(0);
switch (rb_cmpint(rb_funcallv(v, id_cmp, 1, &zero), v, zero)) {
case 0: return INT2FIX(mid);
case 1: smaller = 1; break;
case -1: smaller = 0;
case 1: smaller = 0; break;
case -1: smaller = 1;
}
}
else {
Expand Down Expand Up @@ -4310,7 +4310,7 @@ rb_ary_reject(VALUE ary)
* a = [:foo, 'bar', 2]
* a.delete_if # => #<Enumerator: [:foo, "bar", 2]:delete_if>
*
3 */
*/

static VALUE
rb_ary_delete_if(VALUE ary)
Expand Down
25 changes: 25 additions & 0 deletions bootstraptest/test_yjit.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
# regression test for overly generous guard elision
assert_equal '[0, :sum, 0, :sum]', %q{
# In faulty versions, the following happens:
# 1. YJIT puts object on the temp stack with type knowledge
# (CArray or CString) about RBASIC_CLASS(object).
# 2. In iter=0, due to the type knowledge, YJIT generates
# a call to sum() without any guard on RBASIC_CLASS(object).
# 3. In iter=1, a singleton class is added to the object,
# changing RBASIC_CLASS(object), falsifying the type knowledge.
# 4. Because the code from (1) has no class guard, it is incorrectly
# reused and the wrong method is invoked.
# Putting a literal is important for gaining type knowledge.
def carray(iter)
array = []
array.sum(iter.times { def array.sum(_) = :sum })
end
def cstring(iter)
string = ""
string.sum(iter.times { def string.sum(_) = :sum })
end
[carray(0), carray(1), cstring(0), cstring(1)]
}

# regression test for return type of Integer#/
# It can return a T_BIGNUM when inputs are T_FIXNUM.
assert_equal 0x3fffffffffffffff.to_s, %q{
Expand Down
Loading

0 comments on commit 2ae606a

Please sign in to comment.