Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/tarball-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,12 @@ jobs:
"VCPKG_BINARY_SOURCES=clear;nuget,$Env:FEED_URL,$Env:FEED_MODE" >> $Env:GITHUB_ENV

- name: Install libraries with vcpkg
# The registry pinned by `builtin-baseline` can need a newer tool
# than the vcpkg.exe shipped in the runner image, so re-bootstrap
# it to the version the pulled registry asks for.
run: |
git -C "%VCPKG_INSTALLATION_ROOT%" pull --quiet
call "%VCPKG_INSTALLATION_ROOT%\bootstrap-vcpkg.bat"
vcpkg install
working-directory: ${{ inputs.archname }}

Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,13 @@ jobs:
# assertion timeouts (e.g. assert_separately) flake. Scale them up, as
# macos.yml does for slower/contended runners. SYNTAX_SUGGEST_TIMEOUT
# covers syntax_suggest's own internal search timeout, which
# RUBY_TEST_TIMEOUT_SCALE does not affect.
# RUBY_TEST_TIMEOUT_SCALE does not affect. Note: setting SYNTAX_SUGGEST_TIMEOUT
# also activates the "does not timeout on massive files" integration test, so
# it must be large enough for the slower architecture to complete the search.
- name: Set timeout scale for emulated runners
run: |
echo "RUBY_TEST_TIMEOUT_SCALE=10" >> $GITHUB_ENV
echo "SYNTAX_SUGGEST_TIMEOUT=10" >> $GITHUB_ENV
echo "SYNTAX_SUGGEST_TIMEOUT=60" >> $GITHUB_ENV
if: ${{ endsWith(matrix.os, 'ppc64le') || endsWith(matrix.os, 's390x') }}

- name: make ${{ matrix.test_task }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,12 @@ jobs:
"VCPKG_BINARY_SOURCES=clear;nuget,$Env:FEED_URL,$Env:FEED_MODE" >> $Env:GITHUB_ENV

- name: Install libraries with vcpkg
# The registry pinned by `builtin-baseline` can need a newer tool
# than the vcpkg.exe shipped in the runner image, so re-bootstrap
# it to the version the pulled registry asks for.
run: |
git -C "%VCPKG_INSTALLATION_ROOT%" pull --quiet
call "%VCPKG_INSTALLATION_ROOT%\bootstrap-vcpkg.bat"
vcpkg install
working-directory: src

Expand Down
5 changes: 3 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ releases.
* 0.3.0 to [v0.4.0][syslog-v0.4.0]
* csv 3.3.6
* 3.3.5 to [v3.3.6][csv-v3.3.6]
* repl_type_completor 0.1.15
* 0.1.12 to [v0.1.13][repl_type_completor-v0.1.13], [v0.1.14][repl_type_completor-v0.1.14], [v0.1.15][repl_type_completor-v0.1.15]
* repl_type_completor 0.1.16
* 0.1.12 to [v0.1.13][repl_type_completor-v0.1.13], [v0.1.14][repl_type_completor-v0.1.14], [v0.1.15][repl_type_completor-v0.1.15], [v0.1.16][repl_type_completor-v0.1.16]
* pstore 0.2.1
* 0.2.0 to [v0.2.1][pstore-v0.2.1]
* rdoc 8.0.0
Expand Down Expand Up @@ -355,6 +355,7 @@ A lot of work has gone into making Ractors more stable, performant, and usable.
[repl_type_completor-v0.1.13]: https://github.com/ruby/repl_type_completor/releases/tag/v0.1.13
[repl_type_completor-v0.1.14]: https://github.com/ruby/repl_type_completor/releases/tag/v0.1.14
[repl_type_completor-v0.1.15]: https://github.com/ruby/repl_type_completor/releases/tag/v0.1.15
[repl_type_completor-v0.1.16]: https://github.com/ruby/repl_type_completor/releases/tag/v0.1.16
[pstore-v0.2.1]: https://github.com/ruby/pstore/releases/tag/v0.2.1
[rdoc-v7.0.4]: https://github.com/ruby/rdoc/releases/tag/v7.0.4
[rdoc-v7.1.0]: https://github.com/ruby/rdoc/releases/tag/v7.1.0
Expand Down
22 changes: 7 additions & 15 deletions compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -3677,30 +3677,22 @@ iseq_peephole_optimize(rb_iseq_t *iseq, LINK_ELEMENT *list, const int do_tailcal
*/
INSN *nobj = (INSN *)get_destination_insn(iobj);

/* This is super nasty hack!!!
*
* This jump-jump optimization may ignore event flags of the jump
* instruction being skipped. Actually, Line 2 TracePoint event
* is never fired in the following code:
/* This jump-jump optimization may ignore line events on the jump
* instruction being skipped. For example, the Line 2 TracePoint
* event would otherwise never fire in the following code:
*
* 1: raise if 1 == 2
* 2: while true
* 3: break
* 4: end
*
* This is critical for coverage measurement. [Bug #15980]
*
* This is a stopgap measure: stop the jump-jump optimization if
* coverage measurement is enabled and if the skipped instruction
* has any event flag.
*
* Note that, still, TracePoint Line event does not occur on Line 2.
* This should be fixed in future.
* Do not skip a jump that carries a line event. This applies even
* when coverage is disabled because TracePoint consumes the same
* event. [Bug #15980]
*/
int stop_optimization =
ISEQ_COVERAGE(iseq) && ISEQ_LINE_COVERAGE(iseq) &&
nobj->link.type == ISEQ_ELEMENT_INSN &&
nobj->insn_info.events;
(nobj->insn_info.events & (RUBY_EVENT_LINE | RUBY_EVENT_COVERAGE_LINE));
if (!stop_optimization) {
INSN *pobj = (INSN *)iobj->link.prev;
int prev_dup = 0;
Expand Down
19 changes: 17 additions & 2 deletions gc/mmtk/mmtk.c
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,20 @@ obj_can_parallel_free_p(VALUE obj)
}
}

static bool
obj_need_obj_free_p(VALUE obj)
{
switch (RB_BUILTIN_TYPE(obj)) {
case T_FLOAT:
case T_RATIONAL:
case T_COMPLEX:
case T_OBJECT:
return false;
default:
return true;
}
}

static void
mmtk_flush_obj_free_buffer(struct MMTk_ractor_cache *cache)
{
Expand Down Expand Up @@ -1001,8 +1015,9 @@ rb_gc_impl_new_obj(void *objspace_ptr, void *cache_ptr, VALUE klass, VALUE flags
mmtk_post_alloc_fast_immix(objspace, ractor_cache, (uintptr_t)alloc_obj);
}

// TODO: only add when object needs obj_free to be called
mmtk_buffer_obj_free_candidate(ractor_cache, (VALUE)alloc_obj);
if (obj_need_obj_free_p((VALUE)alloc_obj)) {
mmtk_buffer_obj_free_candidate(ractor_cache, (VALUE)alloc_obj);
}

objspace->total_allocated_objects++;

Expand Down
2 changes: 1 addition & 1 deletion gems/bundled_gems
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ drb 2.2.3 https://github.com/ruby/drb
nkf 0.3.0 https://github.com/ruby/nkf
syslog 0.4.0 https://github.com/ruby/syslog
csv 3.3.6 https://github.com/ruby/csv
repl_type_completor 0.1.15 https://github.com/ruby/repl_type_completor
repl_type_completor 0.1.16 https://github.com/ruby/repl_type_completor
ostruct 0.6.3 https://github.com/ruby/ostruct
pstore 0.2.1 https://github.com/ruby/pstore
benchmark 0.5.0 https://github.com/ruby/benchmark
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# or Bundler.setup to setup environment where only specified gems and their
# specified versions could be used.
#
# See {Bundler website}[https://bundler.io/docs.html] for extensive documentation
# See {Bundler documentation}[https://guides.rubygems.org/command-reference/bundle/] for extensive documentation
# on gemfiles creation and Bundler usage.
#
# As a standard library inside project, Bundler could be used for introspection
Expand Down
4 changes: 2 additions & 2 deletions lib/bundler/cli/issue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ def run
https://github.com/ruby/rubygems/blob/master/doc/bundler/TROUBLESHOOTING.md

2. Instructions for common Bundler uses can be found on the documentation
site: https://bundler.io/
site: https://guides.rubygems.org/

3. Information about each Bundler command can be found in the Bundler
man pages: https://bundler.io/man/bundle.1.html
man pages: https://guides.rubygems.org/command-reference/bundle/

Hopefully the troubleshooting steps above resolved your problem! If things
still aren't working the way you expect them to, please let us know so
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/man/bundle-add.1
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ You can assign the gem to more than one group\.
\fBbundle add rails \-\-group "development, test"\fR
.IP "" 0
.SH "SEE ALSO"
Gemfile(5) \fIhttps://bundler\.io/man/gemfile\.5\.html\fR, bundle\-remove(1) \fIbundle\-remove\.1\.html\fR
Gemfile(5) \fIhttps://guides\.rubygems\.org/gemfile/\fR, bundle\-remove(1) \fIbundle\-remove\.1\.html\fR
2 changes: 1 addition & 1 deletion lib/bundler/man/bundle-add.1.ronn
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,5 @@ Adds the named gem to the [`Gemfile(5)`][Gemfile(5)] and run `bundle install`.

## SEE ALSO

[Gemfile(5)](https://bundler.io/man/gemfile.5.html),
[Gemfile(5)](https://guides.rubygems.org/gemfile/),
[bundle-remove(1)](bundle-remove.1.html)
4 changes: 2 additions & 2 deletions lib/bundler/man/bundle-console.1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
.SH "DESCRIPTION"
Starts an interactive Ruby console session in the context of the current bundle\.
.P
If no \fBGROUP\fR is specified, all gems in the \fBdefault\fR group in the Gemfile(5) \fIhttps://bundler\.io/man/gemfile\.5\.html\fR are preliminarily loaded\.
If no \fBGROUP\fR is specified, all gems in the \fBdefault\fR group in the Gemfile(5) \fIhttps://guides\.rubygems\.org/gemfile/\fR are preliminarily loaded\.
.P
If \fBGROUP\fR is specified, all gems in the given group in the Gemfile in addition to the gems in \fBdefault\fR group are loaded\. Even if the given group does not exist in the Gemfile, IRB console starts without any warning or error\.
.P
Expand All @@ -30,4 +30,4 @@ Resolving dependencies\|\.\|\.\|\.
[1] pry(main)>
.fi
.SH "SEE ALSO"
Gemfile(5) \fIhttps://bundler\.io/man/gemfile\.5\.html\fR
Gemfile(5) \fIhttps://guides\.rubygems\.org/gemfile/\fR
4 changes: 2 additions & 2 deletions lib/bundler/man/bundle-console.1.ronn
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ bundle-console(1) -- Open an IRB session with the bundle pre-loaded

Starts an interactive Ruby console session in the context of the current bundle.

If no `GROUP` is specified, all gems in the `default` group in the [Gemfile(5)](https://bundler.io/man/gemfile.5.html) are
If no `GROUP` is specified, all gems in the `default` group in the [Gemfile(5)](https://guides.rubygems.org/gemfile/) are
preliminarily loaded.

If `GROUP` is specified, all gems in the given group in the Gemfile in addition
Expand All @@ -36,4 +36,4 @@ the shell from the following:

## SEE ALSO

[Gemfile(5)](https://bundler.io/man/gemfile.5.html)
[Gemfile(5)](https://guides.rubygems.org/gemfile/)
2 changes: 1 addition & 1 deletion lib/bundler/man/bundle-init.1
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ Use the specified name for the gemfile instead of \fBGemfile\fR
.SH "FILES"
Included in the default [\fBGemfile(5)\fR][Gemfile(5)] generated is the line \fB# frozen_string_literal: true\fR\. This is a magic comment supported for the first time in Ruby 2\.3\. The presence of this line results in all string literals in the file being implicitly frozen\.
.SH "SEE ALSO"
Gemfile(5) \fIhttps://bundler\.io/man/gemfile\.5\.html\fR
Gemfile(5) \fIhttps://guides\.rubygems\.org/gemfile/\fR
2 changes: 1 addition & 1 deletion lib/bundler/man/bundle-init.1.ronn
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ results in all string literals in the file being implicitly frozen.

## SEE ALSO

[Gemfile(5)](https://bundler.io/man/gemfile.5.html)
[Gemfile(5)](https://guides.rubygems.org/gemfile/)
2 changes: 1 addition & 1 deletion lib/bundler/man/bundle-plugin.1
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ Describe subcommands or one specific subcommand\.
No options\.
.SH "SEE ALSO"
.IP "\(bu" 4
How to write a Bundler plugin \fIhttps://bundler\.io/guides/bundler_plugins\.html\fR
How to write a Bundler plugin \fIhttps://guides\.rubygems\.org/bundler_plugins/\fR
.IP "" 0

2 changes: 1 addition & 1 deletion lib/bundler/man/bundle-plugin.1.ronn
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ No options.

## SEE ALSO

* [How to write a Bundler plugin](https://bundler.io/guides/bundler_plugins.html)
* [How to write a Bundler plugin](https://guides.rubygems.org/bundler_plugins/)
2 changes: 1 addition & 1 deletion lib/bundler/man/bundle.1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
.SH "DESCRIPTION"
Bundler manages an \fBapplication's dependencies\fR through its entire life across many machines systematically and repeatably\.
.P
See the bundler website \fIhttps://bundler\.io\fR for information on getting started, and Gemfile(5) for more information on the \fBGemfile\fR format\.
See the RubyGems guides \fIhttps://guides\.rubygems\.org/\fR for information on getting started, and Gemfile(5) for more information on the \fBGemfile\fR format\.
.SH "OPTIONS"
.TP
\fB\-\-no\-color\fR
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/man/bundle.1.ronn
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ bundle(1) -- Ruby Dependency Management
Bundler manages an `application's dependencies` through its entire life
across many machines systematically and repeatably.

See [the bundler website](https://bundler.io) for information on getting
See [the RubyGems guides](https://guides.rubygems.org/) for information on getting
started, and Gemfile(5) for more information on the `Gemfile` format.

## OPTIONS
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/man/gemfile.5
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ bundle config set \-\-local without development test
.P
Also, calling \fBBundler\.setup\fR with no parameters, or calling \fBrequire "bundler/setup"\fR will setup all groups except for the ones you excluded via \fB\-\-without\fR (since they are not available)\.
.P
Note that on \fBbundle install\fR, bundler downloads and evaluates all gems, in order to create a single canonical list of all of the required gems and their dependencies\. This means that you cannot list different versions of the same gems in different groups\. For more details, see Understanding Bundler \fIhttps://bundler\.io/rationale\.html\fR\.
Note that on \fBbundle install\fR, bundler downloads and evaluates all gems, in order to create a single canonical list of all of the required gems and their dependencies\. This means that you cannot list different versions of the same gems in different groups\. For more details, see Dependency management \fIhttps://guides\.rubygems\.org/dependency_management/\fR\.
.SS "PLATFORMS"
If a gem should only be used in a particular platform or set of platforms, you can specify them\. Platforms are essentially identical to groups, except that you do not need to use the \fB\-\-without\fR install\-time flag to exclude groups of gems for other platforms\.
.P
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/man/gemfile.5.ronn
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ are not available).
Note that on `bundle install`, bundler downloads and evaluates all gems, in order to
create a single canonical list of all of the required gems and their dependencies.
This means that you cannot list different versions of the same gems in different
groups. For more details, see [Understanding Bundler](https://bundler.io/rationale.html).
groups. For more details, see [Dependency management](https://guides.rubygems.org/dependency_management/).

### PLATFORMS

Expand Down
4 changes: 2 additions & 2 deletions lib/rubygems/commands/help_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class Gem::Commands::HelpCommand < Gem::Command
compatible with Bundler's Gemfile format. You can see additional
documentation on the format at:

https://bundler.io
https://guides.rubygems.org/

RubyGems automatically looks for these gem dependencies files:

Expand Down Expand Up @@ -174,7 +174,7 @@ class Gem::Commands::HelpCommand < Gem::Command
See the bundler Gemfile manual page for a list of platforms supported in a gem
dependencies file.:

https://bundler.io/v2.5/man/gemfile.5.html
https://guides.rubygems.org/gemfile/

Ruby Version and Engine Dependency
==================================
Expand Down
56 changes: 56 additions & 0 deletions test/ruby/test_settracefunc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2808,6 +2808,62 @@ def test_while_in_while
assert_equal [__LINE__ - 5, __LINE__ - 4, __LINE__ - 3], lines, 'Bug #17868'
end

def test_line_event_after_guard_before_while
lines = []
while_line = body_line = nil

TracePoint.new(:line) {|tp|
next unless target_thread?
lines << tp.lineno
}.enable {
raise if 1 == 2
while_line = __LINE__ + 1
while true
body_line = __LINE__ + 1
break
end
}

assert_includes lines, while_line
assert_includes lines, body_line
assert_operator lines.index(while_line), :<, lines.index(body_line)
end

def test_line_event_after_guard_before_while_predicate
parent = Class.new do
def read
@values.shift
end
end

child = Class.new(parent) do
def initialize
@values = ["chunk", nil]
end
end

start_line = __LINE__ + 2
while_line = start_line + 2
child.class_eval <<~RUBY, __FILE__, start_line
def read
return if @finished
while chunk = super
chunk.upcase
end
end
RUBY

lines = []
TracePoint.new(:line) {|tp|
next unless target_thread?
lines << tp.lineno
}.enable {
child.new.read
}

assert_includes lines, while_line
end

def test_allow_reentry
event_lines = []
_l1 = _l2 = _l3 = _l4 = nil
Expand Down
1 change: 1 addition & 0 deletions zjit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ def stats_string
# use multiple complex features, a decrease in this number does not
# necessarily mean an increase in number of optimized calls.
print_counters_with_prefix(prefix: 'complex_arg_pass_', prompt: 'popular complex argument-parameter features not optimized', buf:, stats:, limit: 10)
print_counters_with_prefix(prefix: 'caller_splat_profile_', prompt: 'caller splat length profiles', buf:, stats:, limit: 10)

# Show exit counters, ordered by the typical amount of exits for the prefix at the time
print_counters_with_prefix(prefix: 'compile_error_', prompt: 'compile error reasons', buf:, stats:, limit: 20)
Expand Down
Loading