summaryrefslogtreecommitdiff
path: root/yjit/src
AgeCommit message (Collapse)Author
2022-08-29Use bindgen for old manual extern declarations ↵Alan Wu
(https://github.com/Shopify/ruby/pull/404) We have a large extern block in cruby.rs leftover from the port. We can use bindgen for it now and reserve the manual declaration for just a handful of vm_insnhelper.c functions. Fixup a few minor discrepencies bindgen found between the C declaration and the manual declaration. Mostly missing `const` on the C side.
2022-08-29Optimize bitmask immediates (https://github.com/Shopify/ruby/pull/403)Kevin Newton
2022-08-29AArch64 Ruby immediates (https://github.com/Shopify/ruby/pull/400)Kevin Newton
2022-08-29Fix bugs in gen_opt_getinlinecacheMaxime Chevalier-Boisvert
2022-08-29Port opt_getinlinecache to the new backend ↵Zack Deveau
(https://github.com/Shopify/ruby/pull/399)
2022-08-29Enable skipdata on Capstone to allow embedded data without early stop to ↵Noah Gibbs
disasm (https://github.com/Shopify/ruby/pull/398)
2022-08-29Op::Xor for backend IR (https://github.com/Shopify/ruby/pull/397)Kevin Newton
2022-08-29Fix code invalidation while OOM and OOM simulation ↵Alan Wu
(https://github.com/Shopify/ruby/pull/395) `YJIT.simulate_oom!` used to leave one byte of space in the code block, so our test didn't expose a problem with asserting that the write position is in bounds in `CodeBlock::set_pos`. We do the following when patching code: 1. save current write position 2. seek to middle of the code block and patch 3. restore old write position The bounds check fails on (3) when the code block is already filled up. Leaving one byte of space also meant that when we write that byte, we need to fill the entire code region with trapping instruction in `VirtualMem`, which made the OOM tests unnecessarily slow. Remove the incorrect bounds check and stop leaving space in the code block when simulating OOM.
2022-08-29Port opt_aref and opt_aset to the new backend IR ↵Takashi Kokubun
(https://github.com/Shopify/ruby/pull/387) * Port opt_aref and opt_aset to the new backend IR * Recompute memory operands
2022-08-29Handle out of memory tests (https://github.com/Shopify/ruby/pull/393)Maxime Chevalier-Boisvert
2022-08-29Port getblockparamproxy and getblockparam ↵Takashi Kokubun
(https://github.com/Shopify/ruby/pull/394)
2022-08-29Port invokesuper to the new backend IR ↵Takashi Kokubun
(https://github.com/Shopify/ruby/pull/391)
2022-08-29Port the remaining method types in opt_send_without_block ↵Takashi Kokubun
(https://github.com/Shopify/ruby/pull/390)
2022-08-29Update asm comments for gen_send_iseqMaxime Chevalier-Boisvert
2022-08-29Port cfunc lookup, plus simpler cfunc generators. ↵Noah Gibbs
(https://github.com/Shopify/ruby/pull/388) This port does *not* create invalidation regions to ensure minimum invalidatable block sizes, and so it does not port the to_s generator.
2022-08-29Prefer asm.store over asm.mov (https://github.com/Shopify/ruby/pull/385)Takashi Kokubun
* Prefer asm.store over asm.mov * Reverse a couple of unsure changes * Revert changes that don't work
2022-08-29Iterator (https://github.com/Shopify/ruby/pull/372)Kevin Newton
* Iterator * Use the new iterator for the X86 backend split * Use iterator for reg alloc, remove forward pass * Fix up iterator usage on AArch64 * Update yjit/src/backend/ir.rs Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com> * Various PR feedback for iterators for IR * Use a local mutable reference for a64_split * Move tests from ir.rs to tests.rs in backend * Fix x86 shift instructions live range calculation * Iterator * Use the new iterator for the X86 backend split * Fix up x86 iterator usage * Fix ARM iterator usage * Remove unintentionally duplicated tests
2022-08-29Port expandarray to the new backend IR ↵Takashi Kokubun
(https://github.com/Shopify/ruby/pull/376) * Port expandarray to the new backend IR * More use of into() * Break out live ranges * Refactor the code further * Reuse registers more
2022-08-29Port gen_send_iseq to the new backend IR ↵Takashi Kokubun
(https://github.com/Shopify/ruby/pull/381) * Port gen_send_iseq to the new backend IR * Replace occurrences of 8 by SIZEOF_VALUE Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com> Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
2022-08-29Fix tests on yjit_backend_ir for AArch64 backend ↵Kevin Newton
(https://github.com/Shopify/ruby/pull/383)
2022-08-29Load mem displacement when necessary on AArch64 ↵Kevin Newton
(https://github.com/Shopify/ruby/pull/382) * LDR instruction for AArch64 * Split loads in arm64_split when memory address displacements do not fit
2022-08-29Update flags for data processing on ARM ↵Kevin Newton
(https://github.com/Shopify/ruby/pull/380) * Update flags for data processing on ARM * Update yjit/src/backend/arm64/mod.rs Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
2022-08-29Use new assembler to support global invalidation on A64Alan Wu
Previously, we patched in an x64 JMP even on A64, which resulted in invalid machine code. Use the new assembler to generate a jump instead. Add an assert to make sure patches don't step on each other since it's less clear cut on A64, where the size of the jump varies depending on its placement relative to the target. Fixes a lot of tests that use `set_trace_func` in `test_insns.rb`. PR: https://github.com/Shopify/ruby/pull/379
2022-08-29Port invokebuiltin* insns to the new backend IR ↵Takashi Kokubun
(https://github.com/Shopify/ruby/pull/375) * Port invokebuiltin* insns to the new backend IR * Fix the C_ARG_OPNDS check boundary
2022-08-29Left and right shift for IR (https://github.com/Shopify/ruby/pull/374)Kevin Newton
* Left and right shift for IR * Update yjit/src/backend/x86_64/mod.rs Co-authored-by: Alan Wu <XrXr@users.noreply.github.com> Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
2022-08-29More concise csel with IntoAlan Wu
2022-08-29Port send to the new backend and test it ↵Takashi Kokubun
(https://github.com/Shopify/ruby/pull/373)
2022-08-29Port opt_eq and opt_neq to the new backend ↵Takashi Kokubun
(https://github.com/Shopify/ruby/pull/371) * Port opt_eq and opt_neq to the new backend * Just use into() outside Co-authored-by: Alan Wu <XrXr@users.noreply.github.com> * Use C_RET_OPND to share the register * Revert "Use C_RET_OPND to share the register" This reverts commit 99381765d0008ff0f03ea97c6c8db608a2298e2b. Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
2022-08-29Port objtostring to the new backend (https://github.com/Shopify/ruby/pull/369)Takashi Kokubun
2022-08-29Port opt_str_uminus to new backend IR ↵Zack Deveau
(https://github.com/Shopify/ruby/pull/370)
2022-08-29Port gen_opt_str_freeze to new backend IR ↵Zack Deveau
(https://github.com/Shopify/ruby/pull/366)
2022-08-29x86 TEST should do a load for mem opnds first ↵Noah Gibbs
(https://github.com/Shopify/ruby/pull/368)
2022-08-29Port setivar to the new backend IR (https://github.com/Shopify/ruby/pull/362)Takashi Kokubun
* Port setivar to the new backend IR * Add a few more setivar test cases * Prefer const_ptr Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
2022-08-29Port opt_minus, opt_or, and opt_and to the new IR ↵Takashi Kokubun
(https://github.com/Shopify/ruby/pull/364) * Port opt_minus, opt_or, and opt_and to the new IR * Fix the Op::Or issue with push_insn * Prefer asm.store for clarity
2022-08-29Port opt_mod to the new backend IR (https://github.com/Shopify/ruby/pull/363)Takashi Kokubun
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>