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
|
|
str_new_shared already has all the necessary logic to do this
and is also smart enough to skip this step if the source string
is already a shared string itself.
This saves a useless String allocation on each call.
Notes:
Merged: https://github.com/ruby/ruby/pull/6443
|
|
Leave the new coderange unknown if the original encoding is not
ASCII-compatible. Non-ASCII-compatible encoding strings with valid or
broken coderange can end up as ascii-only.
Fixes 9a8f6e392fbd ("Cheaply derive code range for String#b return
value", 2022-07-25).
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6439
|
|
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
|
|
The following warning appears without this fix:
```
parse.y:78:1: warning: unknown warning group '-Wpsabi', ignored
[-Wunknown-warning-option]
RBIMPL_WARNING_IGNORED(-Wpsabi)
^
./include/ruby/internal/warning_push.h:103:39: note: expanded from macro
'RBIMPL_WARNING_IGNORED'
^
./include/ruby/internal/warning_push.h:99:39: note: expanded from macro
'RBIMPL_WARNING_PRAGMA2'
^
./include/ruby/internal/warning_push.h:98:39: note: expanded from macro
'RBIMPL_WARNING_PRAGMA1'
^
./include/ruby/internal/warning_push.h:97:39: note: expanded from macro
'RBIMPL_WARNING_PRAGMA0'
^
<scratch space>:49:27: note: expanded from here
clang diagnostic ignored "-Wpsabi"
^
1 warning generated.
```
|
|
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
|
|
Except for GNU make which updates makefiles automatically, repeating
configure in the same directory causes `make` to stop whenever pulled
a new commit. This is unexpected in CIs.
Notes:
Merged: https://github.com/ruby/ruby/pull/6436
|
|
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
|
|
Since macOS 13, CFString family API used in
`rb_str_append_normalized_ospath` may internally use Objective-C classes
(`NSTaggedPointerString` and `NSPlaceholderMutableString`) for small strings.
On the other hand, Objective-C classes should not be used for the first
time in a `fork()`'ed but not `exec()`'ed process. Violations for this rule
can result deadlock during class initialization, so Objective-C runtime
conservatively crashes on such cases by default.
Therefore, we need to use CFString API to initialize Objective-C classes
used internally *before* `fork()`.
For more details, see https://bugs.ruby-lang.org/issues/18912
Notes:
Merged: https://github.com/ruby/ruby/pull/6426
|
|
(https://github.com/ruby/rdoc/pull/927)
Because it's syntax error.
https://github.com/ruby/rdoc/commit/993f2532ff
|
|
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
|
|
This make variable is very useful for daily build.
Notes:
Merged: https://github.com/ruby/ruby/pull/6433
Merged-By: nobu <nobu@ruby-lang.org>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6430
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6430
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6430
|
|
https://github.com/ruby/bigdecimal/commit/223d193f01
|
|
Fixes https://github.com/ruby/bigdecimal/issues/78 by describing behaviour for positive and negative zero in the docs.
https://github.com/ruby/bigdecimal/commit/5415b120ab
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6425
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6425
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6429
|
|
|
|
|
|
Allow refinements to be used at the toplevel within a script that is
loaded under a module.
Fixes [Bug #18960]
Notes:
Merged: https://github.com/ruby/ruby/pull/6226
|
|
This used to be used for module names but its uses were removed in
b00f280d4b9569e7153365d7e1c522b3d6b3c6cf.
Notes:
Merged: https://github.com/ruby/ruby/pull/6427
|
|
* YJIT: Test Rust 1.58.1 as well on Cirrus
* YJIT: Avoid using a Rust 1.60.0 feature
* YJIT: Use autoconf to detect support
* YJIT: We actually need to run it
for checking it properly
* YJIT: Try cfg!(target_feature = "lse")
* Revert "YJIT: Try cfg!(target_feature = "lse")"
This reverts commit 4e2a9ca9a9c83052c23b5e205c91bdf79e88342e.
* YJIT: Add --features stats only when it works
* Update configure.ac
Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
Notes:
Merged-By: maximecb <maximecb@ruby-lang.org>
|
|
This is necessary for object shapes.
|
|
Write some method names in linkable form; make some capitalization consistent.
Notes:
Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
|
|
This reverts commit b9f030954a8a1572032f3548b39c5b8ac35792ce.
[Bug #18170]
|
|
|
|
* Add chain guards in guard_two_fixnums, opt_eq with symbols
* Remove symbol comparison in gen_equality_specialized
Notes:
Merged-By: maximecb <maximecb@ruby-lang.org>
|
|
This refactors the "push frame" operation common to both gen_send_iseq
and gen_send_cfunc into its own method. This allows that logic to live
in one place.
Notes:
Merged-By: maximecb <maximecb@ruby-lang.org>
|
|
across different environments
Notes:
Merged: https://github.com/ruby/ruby/pull/6418
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6418
|
|
except for bit fields.
I made a risky assumption on leading bit fields and just gave up
non-leading bit fields for now. I'll change it to let C code access bit
fields later.
Notes:
Merged: https://github.com/ruby/ruby/pull/6418
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6418
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6418
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6418
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6418
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6418
|
|
to easily use it with `tool/mjit/bindgen.rb BUILDDIR` instead of using
`make mjit-bindgen`.
Notes:
Merged: https://github.com/ruby/ruby/pull/6418
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6418
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6418
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6418
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6418
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6418
|
|
yjit uses _Unwind_* functions from libunwind. These functions
are available in libc++abi (which requires libpthread), so
add those to LDFLAGS if enabling yjit on OpenBSD.
Notes:
Merged: https://github.com/ruby/ruby/pull/6421
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/6419
|
|
Co-authored-by: John Hawthorn <jhawthorn@github.com>
Notes:
Merged: https://github.com/ruby/ruby/pull/6414
|
|
Co-authored-by: John Hawthorn <jhawthorn@github.com>
Notes:
Merged: https://github.com/ruby/ruby/pull/6414
|