Commit graph

339 commits

Author SHA1 Message Date
Takashi Kokubun
00c659d246 Move the insn dispatch table to InsnCompiler 2023-03-05 22:11:20 -08:00
Takashi Kokubun
4b6c738180 Rewrite the stub if it's the last code 2023-03-05 22:11:20 -08:00
Takashi Kokubun
c3d99d0f12 Implement defer_compilation 2023-03-05 22:11:20 -08:00
Takashi Kokubun
2b8d1c93ea Support extended registers
and move argument registers to a couple of them.
2023-03-05 22:11:20 -08:00
Takashi Kokubun
d7dba4c510 Colorize outlined code 2023-03-05 22:11:20 -08:00
Takashi Kokubun
36cec59f0a Implement ocb 2023-03-05 22:11:20 -08:00
Takashi Kokubun
7abff797b4 Use the term "compile" in different places 2023-03-05 22:11:20 -08:00
Takashi Kokubun
c51baf9404 Carve out CodeBlock 2023-03-05 22:11:20 -08:00
Takashi Kokubun
28290d5198 Try carving out ExitCompiler 2023-03-05 22:11:20 -08:00
Takashi Kokubun
7a19aad8c3 Implement putobject 2023-03-05 22:11:20 -08:00
Takashi Kokubun
9352f94a1b Implement getlocal_WC_0 2023-03-05 22:11:20 -08:00
Takashi Kokubun
4eb6f1dbb9 Put nil on an appropriate index 2023-03-05 22:11:20 -08:00
Takashi Kokubun
e9535a439b Split branches for mov src and dst 2023-03-05 22:11:20 -08:00
Takashi Kokubun
5760f7fd3c Skip compiling at_exit without --mjit-stats 2023-03-05 22:11:20 -08:00
Takashi Kokubun
e4a824f769 Fix broken rebase 2023-03-05 22:11:20 -08:00
Takashi Kokubun
9f8f1afba2 Implement --mjit-stats 2023-03-05 22:11:20 -08:00
Takashi Kokubun
4fe5efbf7f Implement asm comments 2023-03-05 22:11:20 -08:00
Takashi Kokubun
3b398513be Check interrupts on leave 2023-03-05 22:11:20 -08:00
Takashi Kokubun
25ae82b83e Skip supporting has_opt for now 2023-03-05 22:11:20 -08:00
Takashi Kokubun
d46cc2c104 Remove <main> specialization 2023-03-05 22:11:20 -08:00
Takashi Kokubun
5db2ef5e14 Define constants for magic registers 2023-03-05 22:11:20 -08:00
Takashi Kokubun
23a58105ee Implement callee-saved registers 2023-03-05 22:11:20 -08:00
Takashi Kokubun
71595a37ba Consider stack_size on side exits 2023-03-05 22:11:20 -08:00
Takashi Kokubun
bee5af407d Rename InsnCompiler to Codegen
because I'm not gonna limit this to insns anymore.
2023-03-05 22:11:20 -08:00
Takashi Kokubun
b99d62bf92 Implement initial side exit 2023-03-05 22:11:20 -08:00
Takashi Kokubun
145c937f3f Compile putnil properly 2023-03-05 22:11:20 -08:00
Takashi Kokubun
396d575451 Implement mov encoding properly 2023-03-05 22:11:20 -08:00
Takashi Kokubun
2700d35b7b Split responsibilities differently 2023-03-05 22:11:20 -08:00
Takashi Kokubun
d9c2eb6f42 Move modules around 2023-03-05 22:11:20 -08:00
Takashi Kokubun
6fc336fedc Compile a real return value 2023-03-05 22:11:20 -08:00
Takashi Kokubun
fd04e1b4db Implement a no-op JIT compiler 2023-03-05 22:11:20 -08:00
Takashi Kokubun
baa120ee80 Prepare a JIT buffer 2023-03-05 22:11:20 -08:00
Takashi Kokubun
9c2f612017 Prepare for compiling an ISEQ 2023-03-05 22:11:20 -08:00
Aaron Patterson
fc5482d088
Expose the address of MJIT Pointers (#7446)
This way we can manually dereference pointers with Fiddle
2023-03-05 13:00:34 -08:00
Aaron Patterson
06b62cbbdd Add offsetof so we can get the offset of members
I want to get the offset of fields inside structs, but I don't want to
instantiate the struct.  I need to embed the offsets inside machine
code, and I can't get the offsets without calling `new` on the struct.

This commit adds an `offset` method so you can get the offset of a
member without instantiating anything.  You can do:

```ruby
C.rb_control_frame_t.offsetof(:sp) #=> 8
```

I don't think this implementation is perfect, you can only get immediate
fields.  But it is better than nothing!
2023-01-20 14:11:05 -08:00
Takashi Kokubun
fc03ba50f1 MJIT: Fix JIT code for multiple values in a single case
[Bug #19263]
2022-12-25 22:48:36 -08:00
Takashi Kokubun
b9332ac8e7
MJIT: Cancel all on disastrous situations (#7019)
I noticed this while running test_yjit with --mjit-call-threshold=1, 
which redefines `Integer#<`. When Ruby is monkey-patched, 
MJIT itself could be broken.

Similarly, Ruby scripts could break MJIT in many different ways. I
prepared the same set of hooks as YJIT so that we could possibly
override it and disable it on those moments. Every constant under
RubyVM::MJIT is private and thus it's an unsupported behavior though.
2022-12-24 01:13:40 -08:00
Takashi Kokubun
9dcee2d80e Remove MJIT's private constants from docs [ci skip] 2022-12-22 11:35:46 -08:00
Takashi Kokubun
bb4cbd0803
Put RubyVM::MJIT::Compiler under ruby_vm directory (#6989)
[Misc #19250]
2022-12-21 22:46:15 -08:00