Граф коммитов

73437 Коммитов

Автор SHA1 Сообщение Дата
Takashi Kokubun 7908eabf6f
Port setivar to the new backend IR (https://github.com/Shopify/ruby/pull/362)
* 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-29 08:47:07 -07:00
Takashi Kokubun a55a3f8ad1
Port opt_minus, opt_or, and opt_and to the new IR (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-29 08:47:07 -07:00
Takashi Kokubun dcb6fc16e5
Port opt_mod to the new backend IR (https://github.com/Shopify/ruby/pull/363) 2022-08-29 08:47:07 -07:00
Maxime Chevalier-Boisvert e24037267f
Add Opnd::None error message to x86 backend as well 2022-08-29 08:47:07 -07:00
Noah Gibbs d131b41025
Fix to float guard in jit_guard_known_klass to use the correct output operand. (https://github.com/Shopify/ruby/pull/365) 2022-08-29 08:47:07 -07:00
Takashi Kokubun 74527a764d
Port send-only insns and write tests (https://github.com/Shopify/ruby/pull/360) 2022-08-29 08:47:07 -07:00
Maxime Chevalier-Boisvert b024b18f56
Fix block invalidation with new backend. Enable more btests on x86 (https://github.com/Shopify/ruby/pull/359) 2022-08-29 08:47:06 -07:00
Maxime Chevalier-Boisvert d63b3e43bd
Enable test_thread.rb on arm, now working 2022-08-29 08:47:06 -07:00
Alan Wu ddee4d3af8
Opnd::Value fixes (https://github.com/Shopify/ruby/pull/354)
* 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-29 08:47:06 -07:00
Takashi Kokubun 4539c21367
Port gen_send_cfunc to the new backend (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-29 08:47:06 -07:00
Maxime Chevalier-Boisvert c91a44cba4
Fix forward_pass usage in arm backend following John's PR 2022-08-29 08:47:06 -07:00
John Hawthorn 24ddc07d6e
Fix live_ranges idx calculation (https://github.com/Shopify/ruby/pull/353)
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-29 08:47:06 -07:00
Takashi Kokubun fe172aac04
Convert getinstancevariable to new backend IR (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-29 08:47:06 -07:00
Kevin Newton a95422a691
Binary OR instruction for the IR (https://github.com/Shopify/ruby/pull/355) 2022-08-29 08:47:06 -07:00
Maxime Chevalier-Boisvert 9db2ca723c
Add 1 more allocatable reg on arm 2022-08-29 08:47:06 -07:00
Maxime Chevalier-Boisvert ca68ccdadd
Fix C call reg alloc bug reported by Noah & Kokubun 2022-08-29 08:47:06 -07:00
Kevin Newton 0823260546
Implement iterators and double-linked list for IR SSA 2022-08-29 08:47:05 -07:00
Maxime Chevalier-Boisvert a75a6f7d7a
Remove empty lines 2022-08-29 08:47:05 -07:00
Zack Deveau dea4238544
Port gen_concatstring to new backend IR (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-29 08:47:05 -07:00
Takashi Kokubun 330c9e9850
Port anytostring, intern, and toregexp (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-29 08:47:05 -07:00
Takashi Kokubun 16307adf8f
Port only ATTRSET of opt_send_without_block (https://github.com/Shopify/ruby/pull/351) 2022-08-29 08:47:05 -07:00
Maxime Chevalier-Boisvert 45da697450
Push first pass at SSA IR sketch 2022-08-29 08:47:05 -07:00
Takashi Kokubun a674b8d8a1
Port class variable instructions (https://github.com/Shopify/ruby/pull/346) 2022-08-29 08:47:05 -07:00
Takashi Kokubun 1446e22aeb
Port setglobal to the new backend (https://github.com/Shopify/ruby/pull/347) 2022-08-29 08:47:05 -07:00
Alan Wu 869b0ba6e0
Minor cleanups (https://github.com/Shopify/ruby/pull/345)
* 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-29 08:47:05 -07:00
Zack Deveau 6ab71a8598
Port gen_checktype to the new IR assembler backend (https://github.com/Shopify/ruby/pull/343) 2022-08-29 08:47:05 -07:00
Noah Gibbs 4b1ab009c4
Port the YJIT defined opcode; fix C_ARG_REGS (https://github.com/Shopify/ruby/pull/342) 2022-08-29 08:47:05 -07:00
Alan Wu b2d255ad3c
A64: Fix off by one in offset encoding for BL (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-29 08:47:04 -07:00
Maxime Chevalier-Boisvert 2d9b98f9bc
Fix a bug in the x86 backend wrt large integer values, enable more tests 2022-08-29 08:47:04 -07:00
Noah Gibbs c9a947e5d8
Port and test checkkeyword (https://github.com/Shopify/ruby/pull/339) 2022-08-29 08:47:04 -07:00
Alan Wu 8617bac950
Fix IncrCounter on ARM
The order of operands to LDADDAL were flipped and the destination
pointer was dereferenced instead of passed as an address.
2022-08-29 08:47:04 -07:00
Maxime Chevalier-Boisvert e131b217cf
Test --yjit-stats in our CI workflows 2022-08-29 08:47:04 -07:00
Alan Wu 813df1f27a
Add LiveReg IR instruction to fix stats leave exit code (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-29 08:47:04 -07:00
Maxime Chevalier-Boisvert 133ad38777
Fix CI workflows 2022-08-29 08:47:04 -07:00
Kevin Newton 13e5b56a5d
Fixes (https://github.com/Shopify/ruby/pull/340)
* Fix conditional jumps to label

* Bitmask immediates cannot be u64::MAX
2022-08-29 08:47:04 -07:00
Kevin Newton f593b2c6db
Fixes for AArch64 (https://github.com/Shopify/ruby/pull/338)
* 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-29 08:47:04 -07:00
Maxime Chevalier-Boisvert 96303342e4
Enable more btests 2022-08-29 08:47:04 -07:00
Maxime Chevalier-Boisvert 4024553d13
Add ifdef to clear cache 2022-08-29 08:47:03 -07:00
Maxime Chevalier-Boisvert 7e22ec7439
Clear the icache on arm 2022-08-29 08:47:03 -07:00
Noah Gibbs b1ed4d9b94
Port and test duparray and splatarray (https://github.com/Shopify/ruby/pull/337)
* Port duparray opcode

* Port and test splatarray
2022-08-29 08:47:03 -07:00
Maxime Chevalier-Boisvert e9f9b8f43b
Fix bug with opt_lt, csel on x86 2022-08-29 08:47:03 -07:00
Maxime Chevalier-Boisvert 477c2df3fa
Work on opt_lt, fix x86 backend bug in cmp() 2022-08-29 08:47:03 -07:00
Kevin Newton 70e117d512
Fixes (https://github.com/Shopify/ruby/pull/336)
* Fix bitmask encoding to u32

* Fix splitting for Op::And to account for bitmask immediate
2022-08-29 08:47:03 -07:00
Maxime Chevalier-Boisvert e9a2effd74
Enable more btests in the CI workflows (https://github.com/Shopify/ruby/pull/334)
* Enable more btests in the CI workflows

* Update workflows
2022-08-29 08:47:03 -07:00
Kevin Newton 76b05ba9e8
Better splitting for Op::Test on AArch64 (https://github.com/Shopify/ruby/pull/335) 2022-08-29 08:47:03 -07:00
Maxime Chevalier-Boisvert b1dbc5f1a6
Fix crash in newhash ccall 2022-08-29 08:47:03 -07:00
Maxime Chevalier-Boisvert 8605efdd94
Fix corrupted X29 causing segfault, thanks Alan! 2022-08-29 08:47:03 -07:00
Maxime Chevalier-Boisvert 85872eecdd
Port over newrange 2022-08-29 08:47:03 -07:00
Maxime Chevalier-Boisvert 8d2560f1f5
Port over setlocal and getglobal 2022-08-29 08:47:02 -07:00
Maxime Chevalier-Boisvert 8259813bc3
Temporarily simplify code for emit_conditional_jump to fix a bug 2022-08-29 08:47:02 -07:00