summaryrefslogtreecommitdiff
path: root/zjit
AgeCommit message (Collapse)Author
2025-06-30ZJIT: Don't compile functions with unhandled parameter types (#13749)Max Bernstein
2025-06-30ZJIT: Add new ZJIT types for Set (#13743)Stan Lo
2025-06-30ZJIT: setglobal should not return output (#13744)Takashi Kokubun
* ZJIT: setglobal should not return output * Let the caller wrap Some
2025-06-28ZJIT: Codegen for `defined?(yield)`Alan Wu
Lots of stdlib methods such as Integer#times and Kernel#then use this, so at least this will make writing tests slightly easier.
2025-06-28ZJIT: Use `std::fmt::Display` when codegen for instruction failsAlan Wu
It's nicer since e.g. you get text representation of enums like `defined_type` instead of just a number.
2025-06-27ZJIT: Add TODOs and omitted test for nested scope local accessAlan Wu
2025-06-27ZJIT: Function::find(): Use find_vec!() moreAlan Wu
2025-06-27ZJIT: Function::find(): Use clone() instead of doing it manuallyAlan Wu
2025-06-27ZJIT: Add codegen for GetLocal and SetLocalAlan Wu
They're only used when level≠0. Same EP hopping logic as interpreter and YJIT. Change assert_compiles() to get ISeq by method name since the old code didn't support methods defined using define_method() which I need for the new test.
2025-06-27ZJIT: `getlocal` and `setlocal` to HIRAlan Wu
2025-06-26ZJIT: Stop loading an extra parameter (#13719)Takashi Kokubun
2025-06-26ZJIT: Disable profiling instructions before asserting opcodes in tests (#13720)Max Bernstein
2025-06-24Remove trailing spacesNobuyoshi Nakada
2025-06-23ZJIT: Parse putspecialobject(VMCore) into Const (#13683)Max Bernstein
This way we get more information in HIR for the optimizer. Fix https://github.com/Shopify/ruby/issues/587
2025-06-23ZJIT: Optimize frozen array aref (#13666)Max Bernstein
If we have a frozen array `[..., a, ...]` and a compile-time fixnum index `i`, we can do the array load at compile-time.
2025-06-24ZJIT: `anytostring` to HIR (GH-13658)ywenc
Pop two values from the stack, return the first if it is a string, otherwise return string coercion of the second Also piggybacks a fix for string subclasses skipping `to_s` for `objtostring`. Co-authored-by: composerinteralia <composerinteralia@github.com>
2025-06-21ZJIT: Move ccall comments near ccall instructions (#13662)Max Bernstein
Don't confuse them with other nearby instructions.
2025-06-20ZJIT: Typofix (#13665)Hiroshi SHIBATA
2025-06-20ZJIT: Add pass to clean CFG (#13655)Max Bernstein
We can fuse linked lists of blocks. This can be run any time, improves future analyses, improves codegen, and also makes the HIR output look nicer. Inspired by my implementation of CleanCFG for Cinder, which was itself inspired by Brett Simmers' implementation in HHVM. Notes: Merged-By: tekknolagi <donotemailthisaddress@bernsteinbear.com>
2025-06-20ZJIT: objtostring to HIRywenc
Add a fast path for known strings at compile time, otherwise calls method id to_s using Insn::SendWithoutBlock Co-authored-by: composerinteralia <composerinteralia@github.com> More specific test name in zjit/src/hir.rs Co-authored-by: Max Bernstein <tekknolagi@gmail.com> Notes: Merged: https://github.com/ruby/ruby/pull/13627
2025-06-19ZJIT: Add `dupn` supportAlan Wu
Notes: Merged: https://github.com/ruby/ruby/pull/13641
2025-06-19ZJIT: Implement `opt_reverse`Alan Wu
Notes: Merged: https://github.com/ruby/ruby/pull/13653
2025-06-18ZJIT: Support invokebuiltin opcodes (#13632)Daniel Colson
* `invokebuiltin` * `invokebuiltin_delegate` * `invokebuiltin_delegate_leave` These instructions all call out to a C function, passing EC, self, and some number of arguments. `invokebuiltin` gets the arguments from the stack, whereas the `_delegate` instructions use a subset of the locals. `opt_invokebuiltin_delegate_leave` has a fast path for `leave`, but I'm not sure we need to do anything special for that here (FWIW YJIT appears to treat the two delegate instructions the same). Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2025-06-17Rename `imemo_class_fields` -> `imemo_fields`Jean Boussier
Notes: Merged: https://github.com/ruby/ruby/pull/13626
2025-06-17ZJIT: Add codegen (and FrameState) for GetConstPathAlan Wu
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
2025-06-17ZJIT: Parse opt freeze insns to HIRDaniel Colson
* `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 <ywenc@github.com> Co-authored-by: Max Bernstein <max@bernsteinbear.com> Notes: Merged: https://github.com/ruby/ruby/pull/13588
2025-06-17ZJIT: Add codegen for StringCopyDaniel Colson
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
2025-06-16ZJIT: Add support for putspecialobject (#13565)Stan Lo
* ZJIT: Add support for putspecialobject * Address feedback * Update tests * Adjust the indentation of a Ruby test --------- Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com> Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2025-06-13Get rid of FL_EXIVARJean Boussier
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
2025-06-13ZJIT: Only write LIR output of HIR instructions with outputMax Bernstein
Notes: Merged: https://github.com/ruby/ruby/pull/13602
2025-06-13ZJIT: Add codegen for SideExitMax Bernstein
Notes: Merged: https://github.com/ruby/ruby/pull/13602
2025-06-12ZJIT: Write a callee frame on JIT-to-JIT calls (#13579)Takashi Kokubun
Co-authored-by: Max Bernstein <tekknolagi@gmail.com> Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
2025-06-12Get rid of `rb_shape_lookup`Jean Boussier
Notes: Merged: https://github.com/ruby/ruby/pull/13596
2025-06-12Turn `rb_classext_t.fields` into a T_IMEMO/class_fieldsJean Boussier
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
2025-06-11ZJIT: x86: Fix panic writing 32-bit number with top bit setAlan Wu
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
2025-06-11ZJIT: Restore x86 assembler testsAlan Wu
Notes: Merged: https://github.com/ruby/ruby/pull/13576
2025-06-11ZJIT: Restore some A64 backend tests to fix unused warningAlan Wu
Notes: Merged: https://github.com/ruby/ruby/pull/13576
2025-06-11ZJIT: Restore most x64 backend testsAlan Wu
Notes: Merged: https://github.com/ruby/ruby/pull/13576
2025-06-10ZJIT: Support get/set on global variablesAaron Patterson
Adds support for code like: ```ruby $foo $foo = x ``` Notes: Merged: https://github.com/ruby/ruby/pull/13569
2025-06-09ZJIT: Parse opt_regexpmatch2 into HIRAlan Wu
Notes: Merged: https://github.com/ruby/ruby/pull/13549
2025-06-09ZJIT: Parse opt_not into HIRAlan Wu
Notes: Merged: https://github.com/ruby/ruby/pull/13549
2025-06-09ZJIT: Parse opt_or into HIRAlan Wu
Notes: Merged: https://github.com/ruby/ruby/pull/13549
2025-06-09ZJIT: Parse opt_and into HIRAlan Wu
Notes: Merged: https://github.com/ruby/ruby/pull/13549
2025-06-09ZJIT: Parse opt_succ into HIRAlan Wu
Notes: Merged: https://github.com/ruby/ruby/pull/13549
2025-06-09ZJIT: Parse opt_empty_p into HIRAlan Wu
Notes: Merged: https://github.com/ruby/ruby/pull/13549
2025-06-07Get rid of rb_shape_t.heap_idJean Boussier
Notes: Merged: https://github.com/ruby/ruby/pull/13556
2025-06-06ZJIT: Fix build error from commit raceAlan Wu
2025-06-06ZJIT: Fix insn arg index for `defined`, add testsAlan Wu
Notes: Merged: https://github.com/ruby/ruby/pull/13528
2025-06-06ZJIT: Parse definedivar into HIRAlan Wu
Notes: Merged: https://github.com/ruby/ruby/pull/13528
2025-06-06ZJIT: Take a slice instead of Vec in test codeAlan Wu
Shorter code and more efficient. Notes: Merged: https://github.com/ruby/ruby/pull/13528