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

69389 Коммитов

Автор SHA1 Сообщение Дата
Jean Boussier 217f7cb16f Include errno message in mmap failure output
It might help figure out why it is failing.
2021-10-20 18:19:40 -04:00
John Hawthorn 96fd8afbf4 Skip opt_case_dispatch 2021-10-20 18:19:40 -04:00
John Hawthorn fc13ff14a2 Add comments to getspecial 2021-10-20 18:19:40 -04:00
Aaron Patterson bf8557f487 Add comments for new function 2021-10-20 18:19:40 -04:00
Aaron Patterson 25f8431d46 only compile for T_OBJECT types 2021-10-20 18:19:40 -04:00
Aaron Patterson 5bc0343261 Refactor attrset to use a function
This new function will do the write barrier / resize the object / check
frozen for us
2021-10-20 18:19:40 -04:00
John Hawthorn 5092d6129a Fix opt_eq for overridden equality 2021-10-20 18:19:40 -04:00
Aaron Patterson 554d76afb4 Revert "disable yjit when testing mjit"
This reverts commit e8622ce5c0.
2021-10-20 18:19:40 -04:00
Aaron Patterson afc5db43ca is this right? 2021-10-20 18:19:40 -04:00
Aaron Patterson b78c50d800 Don't check MJIT if it's not enabled 2021-10-20 18:19:40 -04:00
Aaron Patterson 9d5beb6fde Disable YJIT by default if MJIT_FORCE_ENABLE is on
Compile time flag seems pretty forceful, so let MJIT turn on by default
if it is used.
2021-10-20 18:19:40 -04:00
Aaron Patterson ea453acf59 disable MJIT when --enable-all is set 2021-10-20 18:19:40 -04:00
John Hawthorn 44214e8ad9 Implement getspecial 2021-10-20 18:19:40 -04:00
Alan Wu cc2aa1221f Fix avg_len_in_yjit
We weren't counting completing an entire method in YJIT as exits so the
avg_len_in_yjit for

    ./miniruby --yjit-call-threshold=1 --yjit-stats -e'def foo; end; foo'

was infinite.
2021-10-20 18:19:40 -04:00
Alan Wu cbb0271dd6 Deduplicate side exits
Send instructions currently generate the exact same side exit twice.
Cache the exit the first time we generate it. Also add a comment
explaining what side exits do.

Closes GH-117.
2021-10-20 18:19:40 -04:00
Benson Muite 6e1f2519cc Info for Fedora and choosing C compiler 2021-10-20 18:19:40 -04:00
Maxime Chevalier-Boisvert 11599e5e1e Add rb_darray_clear() for Kevin. Fix some warnings. 2021-10-20 18:19:40 -04:00
Aaron Patterson f380856923 Add fixes for feedback 2021-10-20 18:19:40 -04:00
John Hawthorn f30f299060 Use C_ARG_REGS earlier 2021-10-20 18:19:40 -04:00
John Hawthorn c2b1934475 Add tests against opt_eq side exits 2021-10-20 18:19:40 -04:00
John Hawthorn 10f1d808d5 Remove rb_opt_equality_specialized 2021-10-20 18:19:40 -04:00
John Hawthorn 9ebcd576f3 String and fixnum equality 2021-10-20 18:19:40 -04:00
John Hawthorn 6db5e80dd7 Use method dispatch for opt_eq 2021-10-20 18:19:40 -04:00
John Hawthorn 692f94ba0c Add jit_rb_obj_equal 2021-10-20 18:19:40 -04:00
Alan Wu 4b58d698b1 Count interpreter instructions when -DYJIT_STATS=1
The interpreter instruction count was enabled based on RUBY_DEBUG as
opposed to YJIT_STATS. In builds with YJIT_STATS=1 but RUBY_DEBUG=0,
the count was not available.

Move YJIT_STATS in yjit.h where declarations are expoed to code outside
of YJIT. Also reduce the changes made to the interpreter for calling
into YJIT's instruction counting function.
2021-10-20 18:19:40 -04:00
Maxime Chevalier-Boisvert 9bd6ce4745 Update README.md 2021-10-20 18:19:40 -04:00
Aaron Patterson 580e1bab18 disable yjit when testing mjit 2021-10-20 18:19:40 -04:00
Maxime Chevalier-Boisvert a1d42c37f4 Update ruby.c 2021-10-20 18:19:40 -04:00
Aaron Patterson 234ab816ba Exit if YJIT and MJIT are both enabled
YJIT and MJIT can't be running in the same process otherwise they'll
clobber each other.  We should show an error and exit if they're both
enabled.
2021-10-20 18:19:40 -04:00
Maxime Chevalier-Boisvert 013a4a31d6 Prevent stats being enabled late at run-time 2021-10-20 18:19:40 -04:00
Aaron Patterson 640b162b51 Exit when the object is frozen
Exit when the object is frozen, also add tests
2021-10-20 18:19:39 -04:00
Aaron Patterson 376f5ec1a1 Add a write barrier to ivar set
We need to fire the write barrier during ivar set.  This function
extracts the write barrier function then calls it.

Co-Authored-By: John Hawthorn <john@hawthorn.email>
2021-10-20 18:19:39 -04:00
eileencodes 307a4369e1 Implement setivar method calls 2021-10-20 18:19:39 -04:00
John Hawthorn ce02aefabb Allow calling variadic cfuncs with many args
We have a check to ensure we don't have to push args on the stack to
call a cfunc with many args. However we never need to use the stack for
variadic cfuncs, so we shouldn't care about the number of arguments.
2021-10-20 18:19:39 -04:00
John Hawthorn 922aed92b5 Add codegen for rb_true and rb_false
These are used by .nil? and therefore opt_nil_p
2021-10-20 18:19:39 -04:00
John Hawthorn fd34c831f6 Allow special case of expandarray with nil 2021-10-20 18:19:39 -04:00
Alan Wu d098c5560b Shave a few instructions off of leave
The code path for leave that returns to the interpreter
(gen_leave() -> yjit_gen_leave_exit()) used to have the logic:

```
    cfp->sp++;
    cfp->sp[-1] = return_val;
    cfp->sp--;
    return return_val;
```

The SP changes it made was unnecessary and this change removes it.

After this change, `leave` doesn't adjust the `cfp->sp` of the caller
and only writes `cfp->sp[0]`. To accomodate this in the JIT-to-JIT
return case, return stubs have an `sp_offset` of 1.

The change removes sp adjustment from the JIT-to-JIT return case, too,
making it more efficient. Also, since the C method case of `send`
has an `sp_offset` of 1 after the call, this change enables block
version sharing.
2021-10-20 18:19:39 -04:00
Alan Wu ed85e8a33a Use reg1 in GEN_COUNTER_INC to avoid clobbering RAX 2021-10-20 18:19:39 -04:00
John Hawthorn c210fade27 Implement newrange 2021-10-20 18:19:39 -04:00
John Hawthorn 3a3f706698 Additional invokesuper tests 2021-10-20 18:19:39 -04:00
John Hawthorn 3ecc6befcd Implement invokesuper using cfp->ep[ME] check
This fixes and re-enables invokesuper, replacing the existing guards
with a guard on the method entry for the EP.
2021-10-20 18:19:39 -04:00
John Hawthorn fbde1d9bee Store block callee_cme in darray
This allows a block version to have dependencies on multiple CMEs.
2021-10-20 18:19:39 -04:00
Maxime Chevalier-Boisvert 9d5b3e1d0f Add a small test for the code GC 2021-10-20 18:19:39 -04:00
John Hawthorn e527912fe0 Use jit_prepare_routine_call 2021-10-20 18:19:39 -04:00
John Hawthorn 69a2531249 Implement gen_putstring 2021-10-20 18:19:39 -04:00
Ufuk Kayserilioglu 2c93ef7ab3 Add YJIT logo
Adding YJIT logo with a link to https://yjit.org
2021-10-20 18:19:39 -04:00
Alan Wu 2bd99d7d7a typo, rename, comment 2021-10-20 18:19:39 -04:00
John Hawthorn 812597676b Avoid immediate side exits in checktype
Previously checktype only supported heap objects, however it's not
uncommon to receive an immediate, for example when string interpolating
a Symbol or Integer.
2021-10-20 18:19:39 -04:00
Alan Wu 54db64f7a5 filter out internal events. add comments. reorder 2021-10-20 18:19:39 -04:00
Alan Wu 4b815abb37 Lock, don't loock. 2021-10-20 18:19:39 -04:00