Age | Commit message (Collapse) | Author |
|
Object Shapes is used for accessing instance variables and representing the
"frozenness" of objects. Object instances have a "shape" and the shape
represents some attributes of the object (currently which instance variables are
set and the "frozenness"). Shapes form a tree data structure, and when a new
instance variable is set on an object, that object "transitions" to a new shape
in the shape tree. Each shape has an ID that is used for caching. The shape
structure is independent of class, so objects of different types can have the
same shape.
For example:
```ruby
class Foo
def initialize
# Starts with shape id 0
@a = 1 # transitions to shape id 1
@b = 1 # transitions to shape id 2
end
end
class Bar
def initialize
# Starts with shape id 0
@a = 1 # transitions to shape id 1
@b = 1 # transitions to shape id 2
end
end
foo = Foo.new # `foo` has shape id 2
bar = Bar.new # `bar` has shape id 2
```
Both `foo` and `bar` instances have the same shape because they both set
instance variables of the same name in the same order.
This technique can help to improve inline cache hits as well as generate more
efficient machine code in JIT compilers.
This commit also adds some methods for debugging shapes on objects. See
`RubyVM::Shape` for more details.
For more context on Object Shapes, see [Feature: #18776]
Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
Co-Authored-By: Eileen M. Uchitelle <eileencodes@gmail.com>
Co-Authored-By: John Hawthorn <john@hawthorn.email>
Notes:
Merged: https://github.com/ruby/ruby/pull/6386
|
|
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
|
|
As of fbaac837cfba23a9d34dc7ee144d7940248222a2, when we were performing
a safe call (`o&.x=`) with a conditional assign (`||= 1`) and discarding
the result the stack would end up in a bad state due to a missing pop.
This commit fixes that by adjusting the target label of the branchnil to
be before a pop in that case (as was previously done in the
non-conditional assignment case).
Notes:
Merged: https://github.com/ruby/ruby/pull/6437
|
|
(https://github.com/ruby/rdoc/pull/927)
Because it's syntax error.
https://github.com/ruby/rdoc/commit/993f2532ff
|
|
This reverts commit b9f030954a8a1572032f3548b39c5b8ac35792ce.
[Bug #18170]
|
|
https://github.com/ruby/reline/commit/f08be5da09
|
|
https://github.com/ruby/reline/commit/e8e8d81f47
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6396
|
|
https://github.com/ruby/irb/commit/52446eb77f
|
|
https://github.com/ruby/irb/commit/d14e56a65d
|
|
https://github.com/ruby/irb/commit/eb1691f636
|
|
In addition to String values, $LOAD_PATH can also take objects that
respond_to the `to_path` method, like Pathname objects. So `irb` should
be able to handle those objects too.
And if $LOAD_PATH contains objects that can't be converted into String,
`irb` should simply ignore it.
https://github.com/ruby/irb/commit/b2f562176b
|
|
defined.
Notes:
Merged: https://github.com/ruby/ruby/pull/6411
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6411
|
|
|
|
Check for that the daemon process is detached, that means it is not a
child and not waitable.
Notes:
Merged: https://github.com/ruby/ruby/pull/6402
|
|
This test has been unstable, and it seems like we're not interested in
fixing that for MinGW.
https://github.com/ruby/ruby/actions/runs/3073317191/jobs/4965373284
|
|
script
Also add --script option to turn the option back on.
Previously there wasn't a way to get an interactive IRB session
and access arguments provided on the command line.
Additionally, handle `-` as script as stdin. In Unix-like tools, `-`
means to take standard input instead of a file. This doesn't
result in exactly the same output for:
```
echo 'p ARGV' > args.rb; irb args.rb a b c
```
and
```
echo 'p ARGV' | irb - a b c
```
Due to how irb handles whether stdin is a tty.
However, this change allows use of `-` as a argument, instead of
giving an unrecognized switch error. This required some small
changes to context.rb (to handle `-` as standard input) and
input-method.rb (to have FileInputMethod accept IO arguments in
addition to strings).
Implements [Feature #15371]
https://github.com/ruby/irb/commit/4192683ba2
|
|
This test seems to leak a thread and let TestIOWait fail:
https://github.com/ruby/ruby/actions/runs/3065426880/jobs/4949517274
DRb almost never seemed to stably work on MinGW. I don't think we intend
to fix it either. We should just omit DRb tests when they fail on MinGW.
|
|
When extracting files from the tarball, a mode is retrieved from
the header. Occasionally you'll encounter a gem that was packaged
on a system whose permission bits result in a value that is larger
than the value that File.chmod will allow (anything >= 2^16). In
that case the extraction fails with a RangeError, which is pretty
esoteric.
If you extract the tarball with the tar and gunzip utilities, the
file permissions end up being just the bottom 16 bits masked off
from the original value. I've mirrored that behavior here. Per the
tar spec:
> Modes which are not supported by the operating system restoring
> files from the archive will be ignored.
I think that basically means what I've done here.
---
This commit also changes the behavior very slightly with regard to
when the chmod is called. Previously it was called while the file
descriptor was still open, but after the write call.
When write flushes, the file permissions are changed to the mode
value from the File.open call, undoing the changes made by
FileUtils.chmod. CRuby appears to flush the buffer after the
chmod call, whereas TruffleRuby flushes before the chmod call.
So the file permissions can change depending on implementation.
Both implementations end up getting the correct file permissions
for the bottom 9 bits (user, group, world), but differ with
regard to the sticky bit in the next 3.
To get consistent behavior, this commit changes it to close the
file descriptor before attempting to chmod anything, which makes
it consistent because the write flushes in both cases.
https://github.com/rubygems/rubygems/commit/22ce076e99
|
|
https://github.com/ruby/irb/commit/fd047512b3
|
|
https://github.com/ruby/irb/commit/a15f68ffdb
|
|
file doesn't exist
If history file didn't exist when irb was started, @loaded_history_mtime
would be nil. However, if the history file didn't exist before, but it
exists when saving history, that means the history file was modified,
and we should handle it the same way as we handle the other case where
the history file was modified.
Fixes #388
https://github.com/ruby/irb/commit/8d277aafcb
|
|
UTF-16/UTF-32
* And simplify callers of get_actual_encoding().
* See [Feature #18949].
* See https://github.com/ruby/ruby/pull/6322#issuecomment-1242758474
|
|
Raise `ArgumentError` in `IO#sysread` on Windows when given a negative
length.
Fixes [Bug #18880]
Notes:
Merged: https://github.com/ruby/ruby/pull/6354
Merged-By: nobu <nobu@ruby-lang.org>
|
|
(https://github.com/ruby/fiddle/pull/110)
https://github.com/ruby/fiddle/commit/4a71246645ccff001292c9d80b855b2ef5bf06c1
|
|
* See [Feature #18949].
|
|
* So deprecated methods/constants/functions are dealt with early,
instead of many tests breaking suddenly when removing a deprecated
method/constant/function.
* Follows https://bugs.ruby-lang.org/issues/17591
Notes:
Merged: https://github.com/ruby/ruby/pull/6321
|
|
Gems without specific platform were being preferred over matching
platform specific gems.
https://github.com/rubygems/rubygems/commit/37b95b9159
|
|
matching
[Bug #18990]
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6330
|
|
|
|
Fix ruby/psych#572
https://github.com/ruby/psych/commit/92304269bc
|
|
we should handle ensure block when omit this test
|
|
https://github.com/rubygems/rubygems/commit/e4cee1f975
|
|
http://rubyci.s3.amazonaws.com/freebsd13/ruby-master/log/20220906T043002Z.fail.html.gz
http://rubyci.s3.amazonaws.com/freebsd13/ruby-master/log/20220905T103002Z.fail.html.gz
|
|
Investigating:
http://ci.rvm.jp/logfiles/brlog.trunk-mjit.20220906-025646
which is not immediately reproducible on my laptop.
|
|
It didn't work either.
http://rubyci.s3.amazonaws.com/s390x/ruby-master/log/20220905T080003Z.fail.html.gz
|
|
https://github.com/rubygems/rubygems/commit/16c3535413afebcdbab7582c6017c27b5da8a8dc
Notes:
Merged: https://github.com/ruby/ruby/pull/6326
|
|
The assertions that "an argument of a Complex constructor must not be
a Complex" may not hold for some Numeric objects.
Notes:
Merged: https://github.com/ruby/ruby/pull/6317
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6317
|
|
Previously YARV bytecode implemented constant caching by having a pair
of instructions, opt_getinlinecache and opt_setinlinecache, wrapping a
series of getconstant calls (with putobject providing supporting
arguments).
This commit replaces that pattern with a new instruction,
opt_getconstant_path, handling both getting/setting the inline cache and
fetching the constant on a cache miss.
This is implemented by storing the full constant path as a
null-terminated array of IDs inside of the IC structure. idNULL is used
to signal an absolute constant reference.
$ ./miniruby --dump=insns -e '::Foo::Bar::Baz'
== disasm: #<ISeq:<main>@-e:1 (1,0)-(1,13)> (catch: FALSE)
0000 opt_getconstant_path <ic:0 ::Foo::Bar::Baz> ( 1)[Li]
0002 leave
The motivation for this is that we had increasingly found the need to
disassemble the instructions between the opt_getinlinecache and
opt_setinlinecache in order to determine the constant we are fetching,
or otherwise store metadata.
This disassembly was done:
* In opt_setinlinecache, to register the IC against the constant names
it is using for granular invalidation.
* In rb_iseq_free, to unregister the IC from the invalidation table.
* In YJIT to find the position of a opt_getinlinecache instruction to
invalidate it when the cache is populated
* In YJIT to register the constant names being used for invalidation.
With this change we no longe need disassemly for these (in fact
rb_iseq_each is now unused), as the list of constant names being
referenced is held in the IC. This should also make it possible to make
more optimizations in the future.
This may also reduce the size of iseqs, as previously each segment
required 32 bytes (on 64-bit platforms) for each constant segment. This
implementation only stores one ID per-segment.
There should be no significant performance change between this and the
previous implementation. Previously opt_getinlinecache was a "leaf"
instruction, but it included a jump (almost always to a separate cache
line). Now opt_getconstant_path is a non-leaf (it may
raise/autoload/call const_missing) but it does not jump. These seem to
even out.
Notes:
Merged: https://github.com/ruby/ruby/pull/6187
|
|
https://github.com/ruby/did_you_mean/commit/c3fc412f6f
|
|
The "dumb" terminal is considered only on MSys tty now. However, the
`TERM` feature has been used on many Unix-like systems for decades,
not MSys specific.
https://github.com/ruby/reline/commit/53fd51ab62
|
|
https://github.com/rubygems/rubygems/commit/394d7a6fc9
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6306
|
|
We're not fully in control of this folder, even when running our own
tests, because MJIT creates some temp folders there when invoking GC.
This bite tests running in ruby-core when making the behavior of
`FileUtils.rm_rf` more strict, because these extra files could not be
removed.
Since this was originally added due to some failures on systems with non
standard permissions on tmp folders, but I can no longer reproduce
those, I'll remove it.
https://github.com/rubygems/rubygems/commit/d2f21596ee
|
|
* Respect RUBY_TESTOPTS on test-all
* Increase the Cirrus timeout
* Increase the CSV test timeout
Notes:
Merged: https://github.com/ruby/ruby/pull/6289
|
|
This should fix a version string test
Notes:
Merged: https://github.com/ruby/ruby/pull/6289
|
|
|