Age | Commit message (Collapse) | Author |
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13626
|
|
Issue a call to rb_vm_opt_getconstant_path() like the interpreter, but
since that allocates the IC, we need to save the PC before calling. Add
FrameState to GetConstPath to get access to the PC.
Notes:
Merged: https://github.com/ruby/ruby/pull/13628
|
|
* `opt_hash_freeze`
* `opt_ary_freeze`
* `opt_str_freeze`
* `opt_str_uminus`
Similar to `opt_neq`, but there are no args for `freeze`
Co-authored-by: ywenc <[email protected]>
Co-authored-by: Max Bernstein <[email protected]>
Notes:
Merged: https://github.com/ruby/ruby/pull/13588
|
|
Prior to this commit we compiled `putstring` and `putchilledstring` to
`StringCopy`, but then failed to compile past HIR.
This commit adds codegen for `StringCopy` to call `rb_ec_str_ressurrect`
as the VM does for these instructions.
Notes:
Merged: https://github.com/ruby/ruby/pull/13625
|
|
* ZJIT: Add support for putspecialobject
* Address feedback
* Update tests
* Adjust the indentation of a Ruby test
---------
Co-authored-by: Takashi Kokubun <[email protected]>
Notes:
Merged-By: k0kubun <[email protected]>
|
|
Now that the shape_id gives us all the same information, it's no
longer needed.
Notes:
Merged: https://github.com/ruby/ruby/pull/13612
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13602
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13602
|
|
Co-authored-by: Max Bernstein <[email protected]>
Notes:
Merged-By: k0kubun <[email protected]>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13596
|
|
This behave almost exactly as a T_OBJECT, the layout is entirely
compatible.
This aims to solve two problems.
First, it solves the problem of namspaced classes having
a single `shape_id`. Now each namespaced classext
has an object that can hold the namespace specific
shape.
Second, it open the door to later make class instance variable
writes atomics, hence be able to read class variables
without locking the VM.
In the future, in multi-ractor mode, we can do the write
on a copy of the `fields_obj` and then atomically swap it.
Considerations:
- Right now the `RClass` shape_id is always synchronized,
but with namespace we should likely mark classes that have
multiple namespace with a specific shape flag.
Notes:
Merged: https://github.com/ruby/ruby/pull/13411
|
|
Previously, `asm.mov(m32, imm32)` panicked when `imm32 > 0x80000000`. It
attempted to split imm32 into a register before doing the store, but
then the register size didn't match the destination size.
Instead of splitting, use the `MOV r/m32, imm32` form which works for
all 32-bit values. Adjust asserts that assumed that all forms undergo
sign extension, which is not true for this case.
See: 54edc930f9f0a658da45cfcef46648d1b6f82467
Notes:
Merged: https://github.com/ruby/ruby/pull/13576
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13576
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13576
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13576
|
|
Adds support for code like:
```ruby
$foo
$foo = x
```
Notes:
Merged: https://github.com/ruby/ruby/pull/13569
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13549
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13549
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13549
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13549
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13549
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13549
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13556
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13528
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13528
|
|
Shorter code and more efficient.
Notes:
Merged: https://github.com/ruby/ruby/pull/13528
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13527
|
|
I didn't know `rb_ivar_get` existed until @Xrxr pointed me to it.
Thanks, Alan!
Notes:
Merged: https://github.com/ruby/ruby/pull/13527
|
|
Notes:
Merged-By: k0kubun <[email protected]>
|
|
* ZJIT: Pass self through basic block params
Co-authored-by: Max Bernstein <[email protected]>
* Add comments for self
* Use self_param for ivar
* Make self_param a loop local
* Fix rest parameter type check
* Push self_param first
* Add a test case for putself
* Use SELF_PARAM_IDX
Co-authored-by: Max Bernstein <[email protected]>
* Fix test_unknown
---------
Co-authored-by: Max Bernstein <[email protected]>
Notes:
Merged-By: k0kubun <[email protected]>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13524
|
|
Now all flags are only in the `shape_id_t`, and can all be checked
without needing to dereference a pointer.
Notes:
Merged: https://github.com/ruby/ruby/pull/13515
|
|
* Add newrange support to zjit
* Add RangeType enum for Range insn's flag
* Address other feedback
Notes:
Merged-By: k0kubun <[email protected]>
|
|
Co-authored-by: Max Bernstein <[email protected]>
Co-authored-by: Alan Wu <[email protected]>
Notes:
Merged-By: k0kubun <[email protected]>
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13487
Merged-By: XrXr
|
|
Instead it's now a `shape_id` flag.
This allows to check if an object is complex without having
to chase the `rb_shape_t` pointer.
Notes:
Merged: https://github.com/ruby/ruby/pull/13511
|
|
The FrameState on the SendWithoutBlock represents the entry state,
but for instructions that push to the stack in the middle of the
instruction before actually doing the send like opt_aref_with,
the FrameState is incorrect. We need to write to the stack using the
arguments for the instruction.
Notes:
Merged: https://github.com/ruby/ruby/pull/13468
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13468
|
|
Followup: https://github.com/ruby/ruby/pull/13341 / [Feature #21353]
Even thought `shape_id_t` has been make 32bits, we were still limited
to use only the lower 16 bits because they had to fit alongside `attr_index_t`
inside a `uintptr_t` in inline caches.
By enlarging inline caches we can unlock the full 32bits on all
platforms, allowing to use these extra bits for tagging.
Notes:
Merged: https://github.com/ruby/ruby/pull/13500
|
|
Whenever we run into an inline cache miss when we try to set
an ivar, we may need to take the global lock, just to be able to
lookup inside `shape->edges`.
To solve that, when we're in multi-ractor mode, we can treat
the `shape->edges` as immutable. When we need to add a new
edge, we first copy the table, and then replace it with
CAS.
This increases memory allocations, however we expect that
creating new transitions becomes increasingly rare over time.
```ruby
class A
def initialize(bool)
@a = 1
if bool
@b = 2
else
@c = 3
end
end
def test
@d = 4
end
end
def bench(iterations)
i = iterations
while i > 0
A.new(true).test
A.new(false).test
i -= 1
end
end
if ARGV.first == "ractor"
ractors = 8.times.map do
Ractor.new do
bench(20_000_000 / 8)
end
end
ractors.each(&:take)
else
bench(20_000_000)
end
```
The above benchmark takes 27 seconds in Ractor mode on Ruby 3.4,
and only 1.7s with this branch.
Co-Authored-By: Étienne Barrié <[email protected]>
Notes:
Merged: https://github.com/ruby/ruby/pull/13441
|
|
Notes:
Merged-By: k0kubun <[email protected]>
|
|
Notes:
Merged-By: k0kubun <[email protected]>
|
|
This will be useful when we split Send into Lookup+Call.
For reasoning about various method types during optimization.
|
|
Previously we used a flag to set whether a module was uninitialized.
When checked whether a class was initialized, we first had to check that
it had a non-zero superclass, as well as that it wasn't BasicObject.
With the advent of namespaces, RCLASS_SUPER is now an expensive
operation, and though we could just check for the prime superclass, we
might as well take this opportunity to use a flag so that we can perform
the initialized check with as few instructions as possible.
It's possible in the future that we could prevent uninitialized classes
from being available to the user, but currently there are a few ways to
do that.
Notes:
Merged: https://github.com/ruby/ruby/pull/13443
|
|
Further reduce exposure of `rb_shape_t`.
Notes:
Merged: https://github.com/ruby/ruby/pull/13450
|
|
We should avoid conversions from `rb_shape_t *` into `shape_id_t`
outside of `shape.c` as the short term goal is to have `shape_id_t`
contain tags.
Notes:
Merged: https://github.com/ruby/ruby/pull/13448
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13432
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13432
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/13432
|