summaryrefslogtreecommitdiff
path: root/bootstraptest
AgeCommit message (Collapse)Author
2021-10-20Clear JIT code when tracepoints get enabledAaron Patterson
Clear out any JIT code on iseqs when tracepoints get enabled. We can't handle tracepoints right now, so we'll just try to recompile later.
2021-10-20Add a guard that we start executing on the first PCAaron Patterson
Methods with optional parameters don't always start executing at the first PC, but we compile all methods assuming that they do. This commit adds a guard to ensure that we're actually starting at the first PC for methods with optional params
2021-10-20Ensure we guard the value before we returnKevin Newton
Otherwise you can end up not implicitly calling `to_ary`, which if it has side-effects will result in different behavior.
2021-10-20Code review for expandarray and testsKevin Newton
2021-10-20Implement splatarrayKevin Newton
2021-10-20Implement opt_divKevin Deisz
2021-10-20Implement opt_multKevin Deisz
Basically the same thing as opt_mod, but for multiplying.
2021-10-20Add FLONUM detectionJohn Hawthorn
2021-10-20Support guards against symbols and integersJohn Hawthorn
This adds guards
2021-10-20Add tests, comments, and an assert for invokesuperAlan Wu
2021-10-20Handle non-material empty singleton class properlyAlan Wu
As an optimization, multiple objects could share the same singleton class. The optimization introduced in 6698e433934d810b16ee3636b63974c0a75c07f0 wasn't handling this correctly so was generating guards that never pass for the inputs we defer compilation to wait for. After generating identical code multiple times and failing, the call site is falsely recognized as megamorphic and it side exits. See disassembly for the following before this commit: def foo(obj) obj.itself end o = Object.new.singleton_class foo(o) puts YJIT.disasm(method(:foo)) See also: comment in rb_singleton_class_clone_and_attach().
2021-10-20Disable invokesuper codegen for now. Add testAlan Wu
The added test fails with SystemStackError with --yjit-call-threshold=1.
2021-10-20Fix bug in generic case for gen_checktypeAlan Wu
When checking for T_HASH, which is Qnil and when the type check succeeds we were outputting to the stack a Qnil instead of a Qtrue.
2021-10-20Simplify known class check for singletonsJohn Hawthorn
Singleton classes should only ever be attached to one object. This means that checking for the object should be the same as checking for the class. This should be slightly faster by avoiding one memory acccess as well as allowing us to skip checking if the receiver is a heap object. This will be most common for calling class methods.
2021-10-20Improve opt_not by expanding cfunc codegenAlan Wu
This commit improves opt_not by making it correct when TrueClass#! and/or FalseClass#! is defined and genearting better code when the receiver is a heap object. guard_known_class() can now handle true, false, and nil, and we introduce a codegen function reimplementing rb_obj_not(), used when we know we are calling into rb_obj_not(). Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com> Co-authored-by: Noah Gibbs <the.codefolio.guy@gmail.com>
2021-10-20Implement invokebuiltin_delegateJohn Hawthorn
invokebuiltin_delegate is a special version of invokebuiltin used for sending a contiguous subset of the current method's locals. In some cases YJIT would already handle this for trivial cases it could be inlined, implementing this OP allows it to work when the method isn't inlinable (not marked as 'inline', does more than just call, not called from yjit, etc).
2021-10-20Implement topn instructionAaron Patterson
This commit implements the topn instruction Co-Authored-By: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com> Co-Authored-By: Noah Gibbs <noah.gibbs@shopify.com>
2021-10-20Implement gen_getlocalJohn Hawthorn
This extracts the generation code from getlocal_wc1, since this is the same just with more loops inside vm_get_ep.
2021-10-20Add concatstrings to yjit codegen (#58)John Hawthorn
* Add ETYPE_TRUE and ETYPE_FALSE * Implement checktype * Implement concatstrings * Update deps
2021-10-20Add newhash and newarray instructions to yjit codegen (#48)John Hawthorn
* Implement gen_newarray * Implement newhash for n=0 * Add yjit tests for newhash/newarray * Fix integer size warning on clang * Save PC and SP in newhash and newarray Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
2021-10-20Implement getblockparamproxyAlan Wu
* Implement getblockparamproxy * Parallel runner: wait for timeout thread to terminate after killing Or else the leak cheaker could sees the thread as running and cause test failures in test-tool. * Add a comment, use jne * Comment about where 0x3 comes from
2021-10-20Implement opt_mod as call to interpreter function (#29)Maxime Chevalier-Boisvert
2021-10-20Check for easy-to-handle cases of block param (#24)Alan Wu
In some cases, methods taking block parameters don't require extra paramter setup. They are fairly popular in railsbench.
2021-10-20Implement send with alias method (#23)Maxime Chevalier-Boisvert
* Implement send with alias method * Add alias_method tests
2021-10-20Implement send with blocksAlan Wu
* Implement send with blocks Not that much extra work compared to `opt_send_without_block`. Moved the stack over flow check because it could've exited after changes are made to cfp. * rename oswb counters * Might as well implement sending block to cfuncs * Disable sending blocks to cfuncs for now * Reconstruct interpreter sp before calling into cfuncs In case the callee cfunc calls a method or delegates to a block. This also has the side benefit of letting call sites that sometimes are iseq calls and sometimes cfunc call share the same successor. * only sync with interpreter sp when passing a block Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com> Co-authored-by: Aaron Patterson <aaron.patterson@shopify.com>
2021-10-20Use rb_ivar_get() for general case of getivar (#17)Alan Wu
* Use rb_ivar_get() for general case of getivar Pretty straight forward. Buys about 1% coverage on railsbench. * Update yjit_codegen.c Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
2021-10-20Implement calls to methods with simple optional paramsAlan Wu
* Implement calls to methods with simple optional params * Remove unnecessary MJIT_STATIC See comment for MJIT_STATIC. I added it not knowing whether it's required because the function next to it has it. Don't use it and wait for problems to come up instead. * Better naming, some comments * Count bailing on kw only iseqs On railsbench: ``` opt_send_without_block exit reasons: bmethod 59729 (27.7%) optimized_method 59137 (27.5%) iseq_complex_callee 41362 (19.2%) alias_method 33346 (15.5%) callsite_not_simple 19170 ( 8.9%) iseq_only_keywords 1300 ( 0.6%) kw_splat 1299 ( 0.6%) cfunc_ruby_array_varg 18 ( 0.0%) ```
2021-10-20Fix assertions in `invalidate_block_version()`, add small repro (#14)Maxime Chevalier-Boisvert
* Fix block invalidation assertions * Add Alan's small repro for double invalidation bug
2021-10-20Improve set instance variableAaron Patterson
This commit improves the set ivar implementation.
2021-10-20Fix local type tracking in getlocal, setlocal. Add test.Maxime Chevalier-Boisvert
2021-10-20add a couple of getivar tests for symbolsAlan Wu
2021-10-20YJIT: implement calls to ivar getter methodsAlan Wu
2021-10-20Polymorphic opt_send_without_blockAlan Wu
2021-10-20YJIT: hash specialization for opt_arefAlan Wu
Make it lazy and add a hash specialization in addition to the array specialization.
2021-10-20YJIT: lazy polymorphic getinstancevariableAlan Wu
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-20Remove trailing whitespacesMaxime Chevalier-Boisvert
2021-10-20Make Blocks depend on BOPSAaron Patterson
When a BOP is redefined, the BOP redefinition callback will invalidate any blocks that depend on BOPS. This allows us to eliminate runtime checks for BOP redefinition.
2021-10-20Machinery to implement deferred compilationMaxime Chevalier-Boisvert
2021-10-20Rename test filesMaxime Chevalier-Boisvert
2021-10-20Implement support for variadic C functionsMaxime Chevalier-Boisvert
2021-10-20Stop using UJIT.install_entry in btestAlan Wu
CI runs on some platforms uJIT doesn't support. They don't have UJIT.install_entry. Maybe we want something like `install_entry_if_possible`.
2021-10-20Mark and update object references in generated codeAlan Wu
Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
2021-10-20Check for ::Array, not T_ARRAY in opt_arefAlan Wu
2021-10-20Add regression test for extended table bounds checkAlan Wu
2021-10-20Added more tests to `make btest`Maxime Chevalier-Boisvert
2021-10-20Add another torture test to `make btest`Maxime Chevalier-Boisvert
2021-10-20Add failing test identified by Aaron PattersonMaxime Chevalier-Boisvert
2021-10-20Added failing test to `make btest`Maxime Chevalier-Boisvert
2021-10-20Added synthetic torture test with 30K tiny methodsMaxime Chevalier-Boisvert
2021-10-20Fixed two bugs in JIT-to-JIT calls (thanks Alan!)Maxime Chevalier-Boisvert