Commit graph

65 commits

Author SHA1 Message Date
Maxime Chevalier-Boisvert
131fc9c074 Readd const arguments 2021-10-20 18:19:32 -04:00
Maxime Chevalier-Boisvert
5b613938eb Fix branch rewrite issue 2021-10-20 18:19:32 -04:00
Maxime Chevalier-Boisvert
2b522ad9f5 Update yjit_core.c 2021-10-20 18:19:32 -04:00
Alan Wu
21a6345023 YJIT: adjust branch shape properly when target already exists
The old code decides branch->shape based on the write position of the
native code block, which is unsound in case the block already exists
and no new code is written to the write position.

Make this decision with the start address of the target block instead.
Also handle when the branch becomes smaller after patching.
2021-10-20 18:19:32 -04:00
Maxime Chevalier-Boisvert
215a2f4010 Fix type_diff logic after Alan pointed out errors 2021-10-20 18:19:32 -04:00
Maxime Chevalier-Boisvert
aee44e4f2b Part 1 of improved type tracking logic 2021-10-20 18:19:32 -04:00
Alan Wu
9911f486a7 Stop all other ractors when patching machine code 2021-10-20 18:19:32 -04:00
Maxime Chevalier-Boisvert
5ec94e0d4a Fix issue with version matching logic 2021-10-20 18:19:32 -04:00
Alan Wu
a8f7eb2f35 Polymorphic opt_send_without_block 2021-10-20 18:19:32 -04:00
Alan Wu
ec1cbbb07d Get rid of dependency on rb_call_cache 2021-10-20 18:19:32 -04:00
Alan Wu
f4c04a9595 Tweak include order in yjit_core.c
This is playing it safe. Ruby headers rely on some macros generated by
autoconf that affect what system headers behave. We should take care to
bring in those configs before including systme headers to stay
consistent with the rest of Ruby.
2021-10-20 18:19:31 -04:00
Alan Wu
5d834bcf9f YJIT: lazy polymorphic getinstancevariable
Lazily compile out a chain of checks for different known classes and
whether `self` embeds its ivars or not.

* Remove trailing whitespaces

* Get proper addresss in Capstone disassembly

* Lowercase address in Capstone disassembly

Capstone uses lowercase for jump targets in generated listings. Let's
match it.

* Use the same successor in getivar guard chains

Cuts down on duplication

* Address reviews

* Fix copypasta error

* Add a comment
2021-10-20 18:19:31 -04:00
Alan Wu
cee597bd01 Include ruby/ruby.h before vm_core.h
This is how vm.c does it, and if we don't follow it in yjit
compilation units, rb_vm_t would have a conflicting size.
2021-10-20 18:19:31 -04:00
Maxime Chevalier-Boisvert
c6156e5113 Fix trailing spaces 2021-10-20 18:19:31 -04:00
Jose Narvaez
4e2eb7695e Yet Another Ruby JIT!
Renaming uJIT to YJIT. AKA s/ujit/yjit/g.
2021-10-20 18:19:31 -04:00
Renamed from ujit_core.c (Browse further)