Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
d15d1c0
Rename --mjit-min-calls to --mjit-call-threshold (#6731)
k0kubun Nov 15, 2022
69e47b7
MJIT: Remove reference to ROBJECT_EMBED_LEN_MAX
k0kubun Nov 15, 2022
2652bc3
[ruby/racc] Update racc.gemspec
jwillemsen Nov 15, 2022
f500ca9
Handle more MJIT compilation failures
k0kubun Nov 15, 2022
1a9e87f
MJIT: Fix vm_cc_cme(cc).def.type to use bit field
k0kubun Nov 15, 2022
1eae151
[ruby/irb] Remove duplicated TestInputMethod definitions
st0012 Nov 13, 2022
4f348e4
[ruby/irb] Rename leftover Reidline references
st0012 Oct 5, 2022
34320d8
[ruby/irb] Deprecate reidline flags
st0012 Oct 5, 2022
aecb7f6
[ruby/irb] Deprecate USE_RELINE and USE_REIDLINE
st0012 Oct 5, 2022
36dc99a
Added empty class for test methods in TestIRB cases
hsbt Nov 15, 2022
5dcbe58
Fix buffer overrun in ivars when rebuilding shapes
peterzhu2118 Nov 14, 2022
ac063fd
Depending on revision.h with VPATH
nobu Nov 15, 2022
9751b54
[ruby/irb] Improve testing infra
st0012 Nov 15, 2022
1125274
YJIT: Invalidate redefined methods only through cme (#6734)
k0kubun Nov 15, 2022
d1fb659
YJIT: Count getivar side exits by receiver flag changes (#6735)
k0kubun Nov 15, 2022
0d384ce
YJIT: Include actual memory region size in stats (#6736)
k0kubun Nov 15, 2022
41b0f64
YJIT: Always encode Opnd::Value in 64 bits on x86_64 for GC offsets (…
k0kubun Nov 15, 2022
e7443db
Rewrite Symbol#to_sym and #intern in Ruby (#6683)
k0kubun Nov 16, 2022
cd2da09
MJIT: Refactor BitField dereference a little
k0kubun Nov 16, 2022
fca50ab
Let mjit-bindgen use BASERUBY and bundle/inline (#6740)
k0kubun Nov 16, 2022
be65cf5
Remove `-j` option from `MFLAGS` for sub-makes
nobu Nov 16, 2022
dc1c4e4
Clean extension build directories and exts.mk file
nobu Nov 16, 2022
1f4f6c9
Using UNDEF_P macro
S-H-GAMELINKS Nov 15, 2022
24cbc50
Remove duplicate `.rbinc` on `.rb` dependencies
nobu Nov 4, 2022
05af417
YJIT: Show YJIT build option in RUBY_DESCRIPTION (#6738)
k0kubun Nov 16, 2022
3eb7a65
YJIT: Shrink the vectors of Block after mutation (#6739)
k0kubun Nov 16, 2022
6de4032
YJIT: Stop wrapping CmePtr with CmeDependency (#6747)
k0kubun Nov 16, 2022
1b8236a
YJIT: Add compiled_branch_count stats (#6746)
k0kubun Nov 16, 2022
3259ace
YJIT: Pack BlockId and CodePtr (#6748)
k0kubun Nov 16, 2022
a777ec0
YJIT: Shrink version lists after mutation (#6749)
k0kubun Nov 17, 2022
e61b3e6
[ruby/irb] Fix https://github.com/ruby/irb/pull/295: Ignore Java
byteit101 Sep 30, 2022
923c1aa
Drop Ruby 2.5 support
st0012 Jul 25, 2022
c76909e
[ruby/irb] Bump up 1.4.3
hsbt Nov 17, 2022
71e668e
Update default gems list at c76909e551f0f60b7a354ab748ef1a [ci skip]
matzbot Nov 17, 2022
7b1d23f
Windows: Readlink improvements (#6745)
larskanis Nov 17, 2022
a145a20
[DOC] Update about `sec` argument of `Time.new`
nobu Nov 17, 2022
90bfac2
Add OP_CCLASS_MB case
makenowjust Nov 16, 2022
189e3c0
Add default cases for cache point finding function
makenowjust Nov 17, 2022
0446d96
YJIT: Fix typo in stats references (#6753)
k0kubun Nov 17, 2022
3f3a539
YJIT: Add missing key for non-stats build
k0kubun Nov 17, 2022
4b29eb1
Fix indentation of switch statement in shape.c
peterzhu2118 Nov 17, 2022
c80edc9
YJIT: Add object shape count to stats (#6754)
k0kubun Nov 17, 2022
4e4b29b
YJIT: Make the code GC test stabler
k0kubun Nov 17, 2022
ea8a728
Add support for `sockaddr_un` on Windows. (#6513)
ioquatix Nov 17, 2022
cb4c89e
Fix quoting of code in `NEWS.md`.
ioquatix Nov 17, 2022
d8202a5
[ruby/irb] Add an option to suppress code_around_binding
k0kubun Nov 18, 2022
ab4379e
Refactor RB_SPECIAL_CONST_P (#6759)
k0kubun Nov 18, 2022
98e9165
Fix bug involving .send and overwritten methods. (#6752)
jimmyhmiller Nov 18, 2022
bd148a2
tool/generic_erb.rb: Use ERB#result_with_hash instead of #result
mame Nov 18, 2022
096ffeb
Prevent a "warning: assigned but unused variable - s2"
mame Nov 18, 2022
e19afe3
Revert "tool/generic_erb.rb: Use ERB#result_with_hash instead of #res…
mame Nov 18, 2022
417f3cd
tool/generic_erb.rb: Add a hack to prevent "unused variable" warnings
mame Nov 18, 2022
ca1aa7a
Prevent a "method redefined" warning
mame Nov 18, 2022
a80b66e
Added build instructions of psych and fiddle with source files of lib…
hsbt Nov 18, 2022
00872d1
[ruby/irb] Add debug command (https://github.com/ruby/irb/pull/446)
st0012 Nov 18, 2022
ddd62fa
Allow anonymous keyword rest parameter with other keyword parameters
shugo Nov 16, 2022
f0ce118
Make anonymous rest arg (*) and block arg (&) accessible from ARGS node
yui-knk Nov 17, 2022
1078816
Differentiate T_OBJECT shapes from other objects
tenderlove Nov 17, 2022
b1cbc88
[ruby/irb] Minor fixes on debug command
k0kubun Nov 18, 2022
ba3b40a
[ruby/irb] Discover and load debug.gem even if it's not in Gemfile
k0kubun Nov 18, 2022
6582f34
rename SHAPE_BITS to SHAPE_ID_NUM_BITS
tenderlove Nov 18, 2022
9e067df
32 bit comparison on shape id
tenderlove Nov 15, 2022
2185f0c
Update assertion
tenderlove Nov 18, 2022
7f269a3
Fix io/console test for --with-static-linked-ext
XrXr Nov 18, 2022
5c505f4
Rename misleading label
XrXr Nov 19, 2022
082cfcf
Add test cases for args forwarding after rest argument
yui-knk Nov 18, 2022
6dcb7b9
YJIT: Improve the failure message on enlarging a branch (#6769)
k0kubun Nov 19, 2022
574d849
Run skipped minitest tests that now pass
XrXr Nov 18, 2022
50c6cab
[DOC] Change formatting in the exec docs
mrzasa Nov 19, 2022
951eabd
[ruby/net-http] Enhanced RDoc for Net::HTTP
BurdetteLamar Nov 15, 2022
dbb902f
[ruby/net-http] Enhanced RDoc for Net::HTTP
BurdetteLamar Nov 16, 2022
2047636
[ruby/net-http] Update lib/net/http/request.rb
BurdetteLamar Nov 16, 2022
e616272
[ruby/net-http] Enhanced RDoc for Net::HTTP
BurdetteLamar Nov 18, 2022
909ea6b
[ruby/net-http] About the Examples moved to separate file
BurdetteLamar Nov 18, 2022
01bc2fc
Update fake.rb for test-spec
nobu Nov 19, 2022
23750c8
[ruby/irb] Update documentation about Autocompletion
k0kubun Nov 19, 2022
5958c30
[ruby/irb] Document a full list of commands
k0kubun Nov 19, 2022
ffdd02e
Merge remote-tracking branch 'upstream/master' into merge-from-upstream
chrisseaton Nov 19, 2022
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
1 change: 1 addition & 0 deletions .document
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ nilclass.rb
pack.rb
ractor.rb
string.rb
symbol.rb
timev.rb
thread_sync.rb
trace_point.rb
Expand Down
36 changes: 15 additions & 21 deletions .github/workflows/mjit-bindgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ jobs:
include:
- task: mjit-bindgen
fail-fast: false
env:
SETARCH: ${{ matrix.arch && format('setarch {0}', matrix.arch) }}
runs-on: ubuntu-20.04
if: ${{ !contains(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }}
steps:
Expand All @@ -39,20 +37,20 @@ jobs:
run: |
echo "GNUMAKEFLAGS=-j$((1 + $(nproc --all)))" >> $GITHUB_ENV
- name: Install libraries
env:
arch: ${{ matrix.arch }}
run: |
set -x
arch=${arch:+:${arch/i[3-6]86/i386}}
${arch:+sudo dpkg --add-architecture ${arch#:}}
sudo apt-get update -q || :
sudo apt-get install --no-install-recommends -q -y \
${arch:+cross}build-essential${arch/:/-} \
libssl-dev${arch} libyaml-dev${arch} libreadline6-dev${arch} \
zlib1g-dev${arch} libncurses5-dev${arch} libffi-dev${arch} \
libclang1-10${arch} \
bison autoconf ruby
sudo apt-get install -q -y pkg-config${arch} || :
build-essential \
libssl-dev libyaml-dev libreadline6-dev \
zlib1g-dev libncurses5-dev libffi-dev \
libclang1-10 \
bison autoconf
sudo apt-get install -q -y pkg-config || :
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
- name: git config
run: |
git config --global advice.detachedHead 0
Expand All @@ -72,15 +70,11 @@ jobs:
- run: ./autogen.sh
working-directory: src
- name: Run configure
env:
arch: ${{ matrix.arch }}
run: >-
$SETARCH ../src/configure -C --disable-install-doc --prefix=$(pwd)/install --enable-yjit=dev_nodebug
${arch:+--target=$arch-$OSTYPE --host=$arch-$OSTYPE}
- run: $SETARCH make incs
- run: $SETARCH make
- run: $SETARCH make install
- run: $SETARCH make ${{ matrix.task }}
run: ../src/configure -C --disable-install-doc --prefix=$(pwd)/install --enable-yjit=dev_nodebug
- run: make incs
- run: make
- run: make install
- run: make ${{ matrix.task }}
- run: git diff --exit-code
working-directory: src
- uses: ruby/action-slack@v3.0.0
Expand Down
29 changes: 26 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ Note that each entry is kept to a minimum, see links for details.
Note: We're only listing outstanding class updates.

* Fiber::Scheduler
* Introduce `Fiber::Scheduler#io_select` for non-blocking `IO.select`. [[Feature #19060]]
* Introduce `Fiber::Scheduler#io_select` for non-blocking `IO.select`.
[[Feature #19060]]

* IO
* Introduce `IO#timeout=` and `IO#timeout` which can cause
Expand All @@ -115,6 +116,11 @@ Note: We're only listing outstanding class updates.
STDIN.read # => Blocking operation timed out! (IO::TimeoutError)
```

* UNIXSocket
* Add support for `UNIXSocket` on Windows. Emulate anonymous sockets. Add
support for `File.socket?` and `File::Stat#socket?` where possible.
[[Feature #19135]]

* Class
* `Class#attached_object`, which returns the object for which
the receiver is the singleton class. Raises `TypeError` if the
Expand Down Expand Up @@ -239,7 +245,7 @@ Note: We're only listing outstanding class updates.
* io-nonblock 0.1.1
* io-wait 0.3.0.pre
* ipaddr 1.2.4
* irb 1.4.2
* irb 1.4.3
* json 2.6.2
* logger 1.5.1
* net-http 0.3.0
Expand Down Expand Up @@ -301,7 +307,22 @@ The following deprecated methods are removed.
* `Psych` no longer bundles libyaml sources.
And also `Fiddle` no longer bundles libffi sources.
Users need to install the libyaml/libffi library themselves via the package
system. [[Feature #18571]]
manager like apt, yum, brew, etc.

Psych and fiddle supported the static build with specific version of libyaml
and libffi sources. You can build psych with libyaml-0.2.5 like this.

```bash
$ ./configure --with-libyaml-source-dir=/path/to/libyaml-0.2.5
```

And you can build fiddle with libffi-3.4.4 like this.

```bash
$ ./configure --with-libffi-source-dir=/path/to/libffi-3.4.4
```

[[Feature #18571]]

## C API updates

Expand Down Expand Up @@ -356,6 +377,7 @@ The following deprecated APIs are removed.
doing it in a native thread called MJIT worker. [[Feature #18968]]
* As a result, Microsoft Visual Studio (MSWIN) is no longer supported.
* MinGW is no longer supported. [[Feature #18824]]
* Rename `--mjit-min-calls` to `--mjit-call-threshold`.

## Static analysis

Expand Down Expand Up @@ -416,3 +438,4 @@ The following deprecated APIs are removed.
[Feature #19026]: https://bugs.ruby-lang.org/issues/19026
[Feature #19060]: https://bugs.ruby-lang.org/issues/19060
[Bug #19100]: https://bugs.ruby-lang.org/issues/19100
[Feature #19135]: https://bugs.ruby-lang.org/issues/19135
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,50 @@ see [Building Ruby](doc/contributing/building_ruby.md)

https://www.ruby-lang.org/

## Commands

The following commands are available on IRB.

* `cwws`
* Show the current workspace.
* `cb`, `cws`, `chws`
* Change the current workspace to an object.
* `bindings`, `workspaces`
* Show workspaces.
* `pushb`, `pushws`
* Push an object to the workspace stack.
* `popb`, `popws`
* Pop a workspace from the workspace stack.
* `load`
* Load a Ruby file.
* `require`
* Require a Ruby file.
* `source`
* Loads a given file in the current session.
* `irb`
* Start a child IRB.
* `jobs`
* List of current sessions.
* `fg`
* Switches to the session of the given number.
* `kill`
* Kills the session with the given number.
* `help`
* Enter the mode to look up RI documents.
* `irb_info`
* Show information about IRB.
* `ls`
* Show methods, constants, and variables.
`-g [query]` or `-G [query]` allows you to filter out the output.
* `measure`
* `measure` enables the mode to measure processing time. `measure :off` disables it.
* `$`, `show_source`
* Show the source code of a given method or constant.
* `@`, `whereami`
* Show the source code around binding.irb again.
* `debug`
* Start the debugger of debug.gem.

## Documentation

- [English](https://docs.ruby-lang.org/en/master/index.html)
Expand Down
18 changes: 9 additions & 9 deletions array.c
Original file line number Diff line number Diff line change
Expand Up @@ -4555,7 +4555,7 @@ take_items(VALUE obj, long n)
if (!NIL_P(result)) return rb_ary_subseq(result, 0, n);
result = rb_ary_new2(n);
args[0] = result; args[1] = (VALUE)n;
if (rb_check_block_call(obj, idEach, 0, 0, take_i, (VALUE)args) == Qundef)
if (UNDEF_P(rb_check_block_call(obj, idEach, 0, 0, take_i, (VALUE)args)))
rb_raise(rb_eTypeError, "wrong argument type %"PRIsVALUE" (must respond to :each)",
rb_obj_class(obj));
return result;
Expand Down Expand Up @@ -5048,7 +5048,7 @@ rb_ary_fill(int argc, VALUE *argv, VALUE ary)
ARY_SET_LEN(ary, end);
}

if (item == Qundef) {
if (UNDEF_P(item)) {
VALUE v;
long i;

Expand Down Expand Up @@ -5505,7 +5505,7 @@ rb_ary_cmp(VALUE ary1, VALUE ary2)
if (NIL_P(ary2)) return Qnil;
if (ary1 == ary2) return INT2FIX(0);
v = rb_exec_recursive_paired(recursive_cmp, ary1, ary2, ary2);
if (v != Qundef) return v;
if (!UNDEF_P(v)) return v;
len = RARRAY_LEN(ary1) - RARRAY_LEN(ary2);
if (len == 0) return INT2FIX(0);
if (len > 0) return INT2FIX(1);
Expand Down Expand Up @@ -6068,7 +6068,7 @@ rb_ary_max(int argc, VALUE *argv, VALUE ary)
if (rb_block_given_p()) {
for (i = 0; i < RARRAY_LEN(ary); i++) {
v = RARRAY_AREF(ary, i);
if (result == Qundef || rb_cmpint(rb_yield_values(2, v, result), v, result) > 0) {
if (UNDEF_P(result) || rb_cmpint(rb_yield_values(2, v, result), v, result) > 0) {
result = v;
}
}
Expand All @@ -6090,7 +6090,7 @@ rb_ary_max(int argc, VALUE *argv, VALUE ary)
}
}
}
if (result == Qundef) return Qnil;
if (UNDEF_P(result)) return Qnil;
return result;
}

Expand Down Expand Up @@ -6237,7 +6237,7 @@ rb_ary_min(int argc, VALUE *argv, VALUE ary)
if (rb_block_given_p()) {
for (i = 0; i < RARRAY_LEN(ary); i++) {
v = RARRAY_AREF(ary, i);
if (result == Qundef || rb_cmpint(rb_yield_values(2, v, result), v, result) < 0) {
if (UNDEF_P(result) || rb_cmpint(rb_yield_values(2, v, result), v, result) < 0) {
result = v;
}
}
Expand All @@ -6259,7 +6259,7 @@ rb_ary_min(int argc, VALUE *argv, VALUE ary)
}
}
}
if (result == Qundef) return Qnil;
if (UNDEF_P(result)) return Qnil;
return result;
}

Expand Down Expand Up @@ -8148,7 +8148,7 @@ finish_exact_sum(long n, VALUE r, VALUE v, int z)
{
if (n != 0)
v = rb_fix_plus(LONG2FIX(n), v);
if (r != Qundef) {
if (!UNDEF_P(r)) {
v = rb_rational_plus(r, v);
}
else if (!n && z) {
Expand Down Expand Up @@ -8227,7 +8227,7 @@ rb_ary_sum(int argc, VALUE *argv, VALUE ary)
else if (RB_BIGNUM_TYPE_P(e))
v = rb_big_plus(e, v);
else if (RB_TYPE_P(e, T_RATIONAL)) {
if (r == Qundef)
if (UNDEF_P(r))
r = e;
else
r = rb_rational_plus(r, e);
Expand Down
2 changes: 1 addition & 1 deletion benchmark/lib/benchmark_driver/runner/mjit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def parse(**)
job.prelude = "#{job.prelude}\n#{<<~EOS}"
if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
__bmdv_ruby_i = 0
while __bmdv_ruby_i < 10000 # jit_min_calls
while __bmdv_ruby_i < 10000 # MJIT call threshold
#{job.script}
__bmdv_ruby_i += 1
end
Expand Down
2 changes: 1 addition & 1 deletion bootstraptest/test_ractor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def test n
30.times.map{|i|
test i
}
} unless ENV['RUN_OPTS'] =~ /--jit-min-calls=5/ || # This always fails with --jit-wait --jit-min-calls=5
} unless ENV['RUN_OPTS'] =~ /--mjit-call-threshold=5/ || # This always fails with --mjit-wait --mjit-call-threshold=5
(ENV.key?('TRAVIS') && ENV['TRAVIS_CPU_ARCH'] == 'arm64') # https://bugs.ruby-lang.org/issues/17878

# Exception for empty select
Expand Down
23 changes: 23 additions & 0 deletions bootstraptest/test_yjit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,29 @@ def call_graph_root
Object.send(:remove_const, :Foo)
}

assert_normal_exit %q{
# Test to ensure send on overriden c functions
# doesn't corrupt the stack
class Bar
def bar(x)
x
end
end

class Foo
def bar
Bar.new
end
end

foo = Foo.new
# before this change, this line would error
# because "s" would still be on the stack
# String.to_s is the overridden method here
p foo.bar.bar("s".__send__(:to_s))
}


assert_equal '[nil, nil, nil, nil, nil, nil]', %q{
[NilClass, TrueClass, FalseClass, Integer, Float, Symbol].each do |klass|
klass.class_eval("def foo = @foo")
Expand Down
6 changes: 3 additions & 3 deletions class.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ push_subclass_entry_to_list(VALUE super, VALUE klass)
void
rb_class_subclass_add(VALUE super, VALUE klass)
{
if (super && super != Qundef) {
if (super && !UNDEF_P(super)) {
rb_subclass_entry_t *entry = push_subclass_entry_to_list(super, klass);
RCLASS_SUBCLASS_ENTRY(klass) = entry;
}
Expand Down Expand Up @@ -277,7 +277,7 @@ rb_class_update_superclasses(VALUE klass)
VALUE super = RCLASS_SUPER(klass);

if (!RB_TYPE_P(klass, T_CLASS)) return;
if (super == Qundef) return;
if (UNDEF_P(super)) return;

// If the superclass array is already built
if (RCLASS_SUPERCLASSES(klass))
Expand Down Expand Up @@ -608,7 +608,7 @@ rb_singleton_class_clone_and_attach(VALUE obj, VALUE attach)
arg.klass = clone;
rb_id_table_foreach(RCLASS_CONST_TBL(klass), clone_const_i, &arg);
}
if (attach != Qundef) {
if (!UNDEF_P(attach)) {
rb_singleton_class_attached(clone, attach);
}
RCLASS_M_TBL_INIT(clone);
Expand Down
Loading