| Age | Commit message (Collapse) | Author |
|
A little follow-up on https://github.com/ruby/ruby/pull/14653
Now that we don't generate a PC-less side exit at the entry block, we
shouldn't need this guard that was added by https://github.com/ruby/ruby/pull/14643.
|
|
|
|
|
|
|
|
Without this, we crash during reference update.
|
|
The old code was doing a manual HashSet/HashMap rebuild, and there isn't
a clear performance advantage over `Iterator::map`. So let's use `map`
since it looks clearer and it's easier to see that everything was indeed
updated. This also adds assertions the old code did not have by way
of as_iseq() and as_cme().
|
|
|
|
* ZJIT: Incorporate bb0-prologue and PC check into HIR
* Fix an outdated comment
* Use shallow clone for LoadPC and EntryPoint
* Reproduce the actual HIR graph to pass validation
* Fill out param types for jit_entry_block
* Add Type::from_cptr
* Add a TODO comment about Const::CPtr printing
|
|
This:
* gets us out of the business of manually writing a bunch of `if`s
* gets us more type information
* cleans up the code
* also adds `types::Numeric`
|
|
* ZJIT: Allow testing JIT code on zjit-test
* Resurrect TestingAllocator tests
|
|
ZJIT: Add stack overflow check to gen_ccall_variadic
|
|
|
|
Add test.
|
|
|
|
* ZJIT: Add polymorphism counters
* .
* .
|
|
## Context
#14409
https://github.com/ruby/ruby/pull/14409#discussion_r2350238583
>You may have noticed that this doesn't produce a New range instruction. For that you probably need to use a local variable (makes it harder for the bytecode compiler to reason about, but the JIT sees through it). If you have time, please rewrite these tests.
https://github.com/ruby/ruby/pull/14409#discussion_r2350240389
>There's some code above to do this for you: see arguments_likely_fixnums and coerce something or other
## Changes
### Refactor tests
Modify tests force the usage of `NewRangeFixnum` instruction and make tests names more consistent.
### Refactor optimize ranges
Didn't found `arguments_likely_fixnums` to be applicable unless we enable profiling for `NewRange` and change the criteria of when the optimization fires. But there were other ways to clean up the code.
Simplify the logic and move it to `type_specialize`. Deleted the standalone `optimize_ranges` function.
|
|
The stack layout is incompatible with the way we reify the stack for
generating fallback SendWithoutBlock: the receiver is an embedded VALUE
in the bytecode, not on the stack. Since we don't expect these to be
overridden often, instead of fussing about with the stack layout, just
hope for the best and PatchPoint/SideExit.
Fix https://github.com/Shopify/ruby/issues/760
|
|
It's not just the default allocator; other allocators are also leaf.
|
|
|
|
* ZJIT: Avoid unnecessary `PopOpnds` codegen
If there's no opnds to restore, we don't need to do anything.
* ZJIT: Avoid unnecessary sub_into when there's no opnds to allocate
|
|
|
|
* ZJIT: Fix disasm tests on release build
* Rename string() to hexdump()
|
|
We can use `Vec<Opnd>` instead of `Vec<(Opnd, Opnd)>` in NewHash HIR
as it's the only usage of such type, which requires special handling.
|
|
|
|
Make sure these parameter types are counted in the fallback def_types.
|
|
ZJIT: Measure writing to locals with level > 0
|
|
|
|
This is a) a lot of memory traffic and b) is another good proxy for our
ability to strength reduce method calls.
|
|
* ZJIT: Compile sendforward with dynamic dispatch
* Reload locals only if it has blockiseq
* Add a test case of ... with other args
|
|
* ZJIT: Support variadic C calls
This reduces the `dynamic_send_count` in `liquid-render` by ~21%
* ZJIT: Reuse gen_push_frame
* ZJIT: Avoid optimizing variadic C call when tracing is enabled
|
|
It's a no-op and always returns `nil`.
Fixes https://github.com/Shopify/ruby/issues/755
|
|
|
|
|
|
|
|
|
|
This has fewer effects (can be elided!) and will eventually get better
codegen, too.
Fix https://github.com/Shopify/ruby/issues/752
|
|
* ZJIT: Split Insn::Const from Insn::GetBlockParamProxy
* Print [BlockParamProxy]
* Link a TODO comment to a Shopify/ruby issue
|
|
I thought about creating a new HIR like `SendWithoutBlockFailedToOptimize` that can carry very specific reasons later. But it'll mean adding it to every branch matching `SendWithoutBlock` and may make code unnecessarily complicated.
So I take the easier path for now:
```
Top-4 send fallback def_types (100.0% of total 21,375,357):
cfunc: 20,164,487 (94.3%)
optimized: 1,197,897 ( 5.6%)
attrset: 12,953 ( 0.1%)
alias: 20 ( 0.0%)
```
|
|
|
|
Follow-up on https://github.com/ruby/ruby/pull/14565
I meant to push this this as well but it was left un-committed locally.
|
|
* functional debug mechanism; small refactor
* make all tests pass
* clean up implementation of debug mechanism for gen_prepare_call_with_gc
* revert unnecessary change to gen_object_alloc
* make ObjectAlloc non-leaf
* fix merge error; reintroduce accidentally deleted counter
* remove outdated comment
* changes as per review comments
* make set_stack_canary more stable
* add todo comment to specialize object_alloc
* revert whitespace changes
* create gen_prepare_leaf_call_with_gc helper
* fix spacing
|
|
|
|
|
|
|
|
* ZJIT: Share more code with YJIT in jit.c
* Fix ZJIT references to JIT
|
|
|
|
|
|
* Using the shared jit crate, support for a single global_allocator can
function
* Solves --zjit-mem-size
|
|
Previously, the included test crashed or turned into an infinite
loop due to the missing check.
|
|
* Revert "ZJIT: Removed unused self_val from Send"
This reverts commit 13c2f8d5c2b41ec78344ae60f9b5ec1564029418.
* Revert "ZJIT: Removed unused self_val from InvokeSuper"
This reverts commit 877b625922e0f8de4e7ad801dd0306e69b34d263.
* ZJIT: Rename self_val in dispatching HIRs to recv
* ZJIT: Remove unnecessary constructor param names
|