summaryrefslogtreecommitdiff
path: root/yjit
AgeCommit message (Collapse)Author
2022-08-29Add Opnd::None error message to x86 backend as wellMaxime Chevalier-Boisvert
2022-08-29Fix to float guard in jit_guard_known_klass to use the correct output ↵Noah Gibbs
operand. (https://github.com/Shopify/ruby/pull/365)
2022-08-29Port send-only insns and write tests (https://github.com/Shopify/ruby/pull/360)Takashi Kokubun
2022-08-29Fix block invalidation with new backend. Enable more btests on x86 ↵Maxime Chevalier-Boisvert
(https://github.com/Shopify/ruby/pull/359)
2022-08-29Opnd::Value fixes (https://github.com/Shopify/ruby/pull/354)Alan Wu
* Fix asm.load(VALUE) - `<VALUE as impl Into<Opnd>>` didn't track that the value is a value - `Iterator::map` doesn't evaluate the closure you give it until you call `collect`. Use a for loop instead so we put the gc offsets into the compiled block properly. * x64: Mov(mem, VALUE) should load the value first Tripped in codegen for putobject now that we are actually feeding `Opnd::Value` into the backend. * x64 split: Canonicallize VALUE loads * Update yjit/src/backend/x86_64/mod.rs
2022-08-29Port gen_send_cfunc to the new backend ↵Takashi Kokubun
(https://github.com/Shopify/ruby/pull/357) * Port gen_send_cfunc to the new backend * Remove an obsoleted test * Add more cfunc tests * Use csel_e instead and more into() Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com> * Add a missing lea for build_kwargs * Split cfunc test cases Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
2022-08-29Fix forward_pass usage in arm backend following John's PRMaxime Chevalier-Boisvert
2022-08-29Fix live_ranges idx calculation (https://github.com/Shopify/ruby/pull/353)John Hawthorn
forward_pass adjusts the indexes of our opnds to reflect the new instructions as they are generated in the forward pass. However, we were using the old live_ranges array, for which the new indexes are incorrect. This caused us to previously generate an IR which contained unnecessary trivial load instructions (ex. mov rax, rax), because it was looking at the wrong lifespans. Presumably this could also cause bugs because the lifespan of the incorrectly considered operand idx could be short. We've added an assert which would have failed on the previous trivial case (but not necessarily all cases). Co-authored-by: Matthew Draper <matthew@trebex.net>
2022-08-29Convert getinstancevariable to new backend IR ↵Takashi Kokubun
(https://github.com/Shopify/ruby/pull/352) * Convert getinstancevariable to new backend IR * Support mem-based mem * Use more into() * Add tests for getivar * Just load obj_opnd to a register * Apply another into() * Flip the nil-out condition * Fix duplicated counts of side_exit
2022-08-29Binary OR instruction for the IR (https://github.com/Shopify/ruby/pull/355)Kevin Newton
2022-08-29Add 1 more allocatable reg on armMaxime Chevalier-Boisvert
2022-08-29Fix C call reg alloc bug reported by Noah & KokubunMaxime Chevalier-Boisvert
2022-08-29Implement iterators and double-linked list for IR SSAKevin Newton
2022-08-29Remove empty linesMaxime Chevalier-Boisvert
2022-08-29Port gen_concatstring to new backend IR ↵Zack Deveau
(https://github.com/Shopify/ruby/pull/350) * Port gen_concatstring to new backend IR * Update yjit/src/codegen.rs Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
2022-08-29Port anytostring, intern, and toregexp ↵Takashi Kokubun
(https://github.com/Shopify/ruby/pull/348) * Port anytostring, intern, and toregexp * Port getspecial to the new backend (#349) PR: https://github.com/Shopify/ruby/pull/349
2022-08-29Port only ATTRSET of opt_send_without_block ↵Takashi Kokubun
(https://github.com/Shopify/ruby/pull/351)
2022-08-29Push first pass at SSA IR sketchMaxime Chevalier-Boisvert
2022-08-29Port class variable instructions (https://github.com/Shopify/ruby/pull/346)Takashi Kokubun
2022-08-29Port setglobal to the new backend (https://github.com/Shopify/ruby/pull/347)Takashi Kokubun
2022-08-29Minor cleanups (https://github.com/Shopify/ruby/pull/345)Alan Wu
* Move allocation into Assembler::pos_marker We wanted to do this to begin with but didn't because we were confused about the lifetime parameter. It's actually talking about the lifetime of the references that the closure captures. Since all of our usages capture no references (they use `move`), it's fine to put a `+ 'static` here. * Use optional token syntax for calling convention macro * Explicitly request C ABI on ARM It looks like the Rust calling convention for functions are the same as the C ABI for now and it's unlikely to change, but it's easy for us to be explicit here. I also tried saying `extern "aapcs"` but that unfortunately doesn't work.
2022-08-29Port gen_checktype to the new IR assembler backend ↵Zack Deveau
(https://github.com/Shopify/ruby/pull/343)
2022-08-29Port the YJIT defined opcode; fix C_ARG_REGS ↵Noah Gibbs
(https://github.com/Shopify/ruby/pull/342)
2022-08-29A64: Fix off by one in offset encoding for BL ↵Alan Wu
(https://github.com/Shopify/ruby/pull/344) * A64: Fix off by one in offset encoding for BL It's relative to the address of the instruction not the end of it. * A64: Fix off by one when encoding B It's relative to the start of the instruction not the end. * A64: Add some tests for boundary offsets
2022-08-29Fix a bug in the x86 backend wrt large integer values, enable more testsMaxime Chevalier-Boisvert
2022-08-29Port and test checkkeyword (https://github.com/Shopify/ruby/pull/339)Noah Gibbs
2022-08-29Fix IncrCounter on ARMAlan Wu
The order of operands to LDADDAL were flipped and the destination pointer was dereferenced instead of passed as an address.
2022-08-29Add LiveReg IR instruction to fix stats leave exit code ↵Alan Wu
(https://github.com/Shopify/ruby/pull/341) It allows for reserving a specific register and prevents the register allocator from clobbering it. Without this `./miniruby --yjit-stats --yjit-callthreshold=1 -e0` was crashing because the counter incrementing code was clobbering RAX incorrectly.
2022-08-29Fixes (https://github.com/Shopify/ruby/pull/340)Kevin Newton
* Fix conditional jumps to label * Bitmask immediates cannot be u64::MAX
2022-08-29Fixes for AArch64 (https://github.com/Shopify/ruby/pull/338)Kevin Newton
* Better splitting for Op::Add, Op::Sub, and Op::Cmp * Split stores if the displacement is too large * Use a shifted immediate argument * Split all places where shifted immediates are used * Add more tests to the cirrus workflow
2022-08-29Port and test duparray and splatarray (https://github.com/Shopify/ruby/pull/337)Noah Gibbs
* Port duparray opcode * Port and test splatarray
2022-08-29Fix bug with opt_lt, csel on x86Maxime Chevalier-Boisvert
2022-08-29Work on opt_lt, fix x86 backend bug in cmp()Maxime Chevalier-Boisvert
2022-08-29Fixes (https://github.com/Shopify/ruby/pull/336)Kevin Newton
* Fix bitmask encoding to u32 * Fix splitting for Op::And to account for bitmask immediate
2022-08-29Better splitting for Op::Test on AArch64 ↵Kevin Newton
(https://github.com/Shopify/ruby/pull/335)
2022-08-29Fix crash in newhash ccallMaxime Chevalier-Boisvert
2022-08-29Fix corrupted X29 causing segfault, thanks Alan!Maxime Chevalier-Boisvert
2022-08-29Port over newrangeMaxime Chevalier-Boisvert
2022-08-29Port over setlocal and getglobalMaxime Chevalier-Boisvert
2022-08-29Temporarily simplify code for emit_conditional_jump to fix a bugMaxime Chevalier-Boisvert
2022-08-29Refactor YJIT branches to use PosMarker ↵Maxime Chevalier-Boisvert
(https://github.com/Shopify/ruby/pull/333) * Refactor defer_compilation to use PosMarker * Port gen_direct_jump() to use PosMarker * Port gen_branch, branchunless * Port over gen_jump() * Port over branchif and branchnil * Fix use od record_boundary_patch_point in jump_to_next_insn
2022-08-29Update disasm to work on ARM (https://github.com/Shopify/ruby/pull/331)Noah Gibbs
2022-08-29Fix dupn (https://github.com/Shopify/ruby/pull/330)Noah Gibbs
* get_dupn was allocating and throwing away an Assembler object instead of using the one passed in * Uncomment remaining tests in codegen.rs, which seem to work now
2022-08-29Implement PosMarker instruction (https://github.com/Shopify/ruby/pull/328)Maxime Chevalier-Boisvert
* Implement PosMarker instruction * Implement PosMarker in the arm backend * Make bindgen run only for clang image * Fix if-else in cirrus CI file * Add missing semicolon * Try removing trailing semicolon * Try to fix shell/YAML syntax Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
2022-08-29A lot of fixes coming from our pairing session ↵Kevin Newton
(https://github.com/Shopify/ruby/pull/329) * Move to/from SP on AArch64 * Consolidate loads and stores * Implement LDR post-index and LDR pre-index for AArch64 * Implement STR post-index and STR pre-index for AArch64 * Module entrypoints for LDR pre/post -index and STR pre/post -index * Use STR (pre-index) and LDR (post-index) to implement push/pop * Go back to using MOV for to/from SP
2022-08-29Fix push/pop and frame setup/teardown with Kevin & AlanMaxime Chevalier-Boisvert
2022-08-29Fix some of the codegen.rs tests (https://github.com/Shopify/ruby/pull/327)Noah Gibbs
2022-08-29Assert not the same register in AArch64Kevin Newton
2022-08-29BLR instruction for AArch64 (https://github.com/Shopify/ruby/pull/325)Kevin Newton
2022-08-29Use frame_setup() and frame_teardown()Maxime Chevalier-Boisvert