| Age | Commit message (Collapse) | Author |
|
It only makes sense for heap objects.
|
|
|
|
* ZJIT: Handle ISEQ moves in IseqCall
* ZJIT: Handle ISEQ moves in Invariants
* Let gen_iseq_call take a reference
* Avoid unneeded iter()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
They don't need it anymore; jit.get_opnd doesn't return Option anymore.
|
|
We have a verifier that runs in debug mode that should prevent this.
Simplify a bunch of call sites.
|
|
Make LIR SSA.
|
|
This is my first contribution to ZJIT.
Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
Co-authored-by: Max Bernstein <ruby@bernsteinbear.com>
|
|
|
|
|
|
|
|
|
|
ZJIT: Implement getspecial in ZJIT
Adds support for the getspecial instruction in zjit.
We split getspecial into two instructions, one for special symbols
(`$&`, $'`, etc) and one for special backrefs (`$1`, `$2`, etc).
Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
|
|
|
|
|
|
|
|
|
|
* ZJIT: Add test and implement display for StringIntern HIR
Co-authored-by: Emily Samp <emily.samp@shopify.com>
* ZJIT: Implement StringIntern codegen
Co-authored-by: Emily Samp <emily.samp@shopify.com>
* ZJIT: Fix StringIntern's return type
---------
Co-authored-by: Emily Samp <emily.samp@shopify.com>
|
|
ZJIT: Fix ObjToString rewrite
Currently, the rewrite for `ObjToString` always replaces it with a
`SendWithoutBlock(to_s)` instruction when the receiver is not a
string literal. This is incorrect because it calls `to_s` on the
receiver even if it's already a string.
This change fixes it by:
- Avoiding the `SendWithoutBlock(to_s)` rewrite
- Implement codegen for `ObjToString`
|
|
Hashing and checking operands for equality is re-entrant. We could later
optimize this to check for hash/eq methods on operands and eliminate if
they don't have side effects, but this is fine for now.
|
|
|
|
When trace_var is used, setting a global variable can cause exceptions
to be raised. We need to prepare for that.
|
|
|
|
Also add a check in the bisect script that can assign blame to the HIR
optimizer.
|
|
* ZJIT: Avoid splitting add_into/sub_into
* Require add_into/sub_into to take a Reg
|
|
Rust PRs will have a failed CI step if they trigger any warnings.
This helps us stay on top of warnings from new Rust releases and
also ones we accidentally write.
Fix a typo for demo, since this only runs when Rust files are changed.
|
|
* ZJIT: Add --zjit-exec-mem-size
* Add a comment about the limit
|
|
Co-authored-by: Alexander Momchilov <alexander.momchilov@shopify.com>
|
|
Co-authored-by: Stan Lo <stan001212@gmail.com>
|
|
|
|
These `...` ISEQs have a special calling convention in the interpreter
and our stubs and JIT calling convention don't deal well. Reject for now.
Debugged with help from `@tekknolagi` and `tool/zjit_bisect.rb`.
Merely avoiding direct sends is enough to pass the attached test, but also
avoid compiling ISEQs with `...` parameter to limit exposure for now.
`SendWithoutBlock`, which does dynamic dispatch using interpreter code,
seems to handle calling into forwardable ISEQs correctly, so they are
fine -- we can't predict where these dynamic sends land anyways.
|
|
|
|
This is moderately useful just in stdout (copy and paste into a renderer) but potentially more useful alongside a tool that parses stdout looking for `digraph G { ... }` and renders those automatically.
|
|
* ZJIT: Remove the need for unwrap() on with_num_bits()
* Fix arm64 tests
* Track the caller of with_num_bits
Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
---------
Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
|
|
|
|
Replace `rb_yarv_class_of` call with:
- a constant check for special constants (nil, fixnums, symbols, etc)
- a check for false
- direct memory read at offset 8 for regular heap objects for the class check
|
|
ZJIT: Remove GC offsts overwritten by invalidation
|
|
This is a counterpoint to the Immediate type and it represents all BasicObject subclasses except for the several immediate objects.
If we know something is a HeapObject, we know we can treat it as an RBasic pointer.
|
|
ZJIT: Set PC before StringCopy
This function allocates.
|
|
We can rewrite SendWithoutBlock to GetIvar.
|
|
* ZJIT: Implement SingleRactorMode invalidation
* ZJIT: Add macro for compiling jumps
* ZJIT: Fix typo in comment
* YJIT: Fix typo in comment
* ZJIT: Avoid using unexported types in zjit.h
`enum ruby_vminsn_type` is declared in `insns.inc` and is not exported.
Using it in `zjit.h` would cause build errors when the file including it
doesn't include `insns.inc`.
|
|
Previously we crashed panicked due to index bounds check running
test_fixnum.rb.
On ARM and in other places in the x86 backend, this isn't a problem
because they inspect the output of instructions which is never replaced.
|
|
Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>
|
|
As pointed out in https://github.com/ruby/ruby/pull/14078#discussion_r2255427676, the return type should be `Float` instead.
|