summaryrefslogtreecommitdiff
path: root/bootstraptest
Commit message (Collapse)AuthorAgeFilesLines
* RJIT: Skip a flaky test_thread test for nowTakashi Kokubun2023-03-102-3/+2
| | | | and unskip a ractor test that was actually running
* YJIT: Handle special case of splat and rest lining up (#7422)Jimmy Miller2023-03-071-0/+22
| | | | | | | | | | | | | | | | If you have a method that takes rest arguments and a splat call that happens to line up perfectly with that rest, you can just dupe the array rather than move anything around. We still have to dupe, because people could have a custom to_a method or something like that which means it is hard to guarantee we have exclusive access to that array. Example: ```ruby def foo(a, b, *rest) end foo(1, 2, *[3, 4]) ```
* s/mjit/rjit/Takashi Kokubun2023-03-062-3/+3
|
* s/MJIT/RJIT/Takashi Kokubun2023-03-063-5/+5
|
* Rename MJIT filenames to RJITTakashi Kokubun2023-03-061-0/+0
|
* Add more GC guardsTakashi Kokubun2023-03-051-1/+1
|
* Deal with too slow testTakashi Kokubun2023-03-051-1/+1
|
* Support SP motion in all insnsTakashi Kokubun2023-03-051-0/+6
|
* Implement initial opt_ltTakashi Kokubun2023-03-051-0/+6
|
* Put nil on an appropriate indexTakashi Kokubun2023-03-051-0/+4
|
* add a test for RactorKoichi Sasada2023-03-061-0/+28
| | | | | Ractor should take care method cache invalidation. Added test will miss method cache on each method call.
* Another attempt to skip test_ractor on ci.rvm.jpTakashi Kokubun2023-03-031-1/+1
| | | | This reverts commit 8d31a60f47fb053bcfe0c744a89bd666dae48539.
* Fix a YJIT enablement checkTakashi Kokubun2023-03-031-1/+1
| | | | | This should be enough for `make test` and `make btest-ruby` while it doesn't work for `make btest`.
* YJIT: fix CI issue reported by Koichi caused by small stack patch (#7442)Maxime Chevalier-Boisvert2023-03-031-0/+27
| | | | | Includes small reproduction produced by Kokubun. http://ci.rvm.jp/results/trunk-yjit@ruby-sp2-docker
* Re-skip an unstable Ractor testTakashi Kokubun2023-03-021-1/+2
| | | | | https://github.com/ruby/ruby/actions/runs/4316423442/jobs/7532190115 http://ci.rvm.jp/results/trunk-yjit@ruby-sp2-docker/4466770
* Revert "Revert "Re-enable test_ractor for YJIT""Takashi Kokubun2023-03-021-5/+3
| | | | | | This reverts commit 9792d9e40f790e6deb18ead56a8befc9d5c4bc51. Ractor implementation has been rewritten. Let's see if it works now.
* YJIT: Fix cfunc splatJimmy Miller2023-03-021-1/+12
| | | Follow-up for cb8a040b7906c09d9d3ac3d3fe853f633005024f.
* `Ractor::Selector#empty?`Koichi Sasada2023-03-031-0/+96
| | | | | | It returns the waiting set is empty or not. Also add Ractor::Selector's tests.
* Enable flaky ractor testKoichi Sasada2023-03-021-2/+1
| | | | I hope a4421bd73c286253311c2cdf8c78ed258f8cff44 will solve the issue...
* Rewrite Ractor synchronization mechanismKoichi Sasada2023-03-021-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch rewrites Ractor synchronization mechanism, send/receive and take/yield. * API * Ractor::Selector is introduced for lightweight waiting for many ractors. * Data structure * remove `struct rb_ractor_waiting_list` and use `struct rb_ractor_queue takers_queue` to manage takers. * remove `rb_ractor_t::yield_atexit` and use `rb_ractor_t::sync::will_basket::type` to check the will. * add `rb_ractor_basket::p.take` to represent a taking ractor. * Synchronization protocol * For the Ractor local GC, `take` can not make a copy object directly so ask to generate the copy from the yielding ractor. * The following steps shows what `r1.take` does on `r0`. * step1: (r0) register `r0` into `r1`'s takers. * step2: (r0) check `r1`'s status and wakeup r0 if `r1` is waiting for yielding a value. * step3: (r0) sleep until `r1` wakes up `r0`. * The following steps shows what `Ractor.yield(v)` on `r1`. * step1: (r1) check first takers of `r1` and if there is (`r0`), make a copy object of `v` and pass it to `r0` and wakes up `r0`. * step2: (r1) if there is no taker ractors, sleep until another ractor try to take.
* YJIT: Properly deal with cfunc splat when no args needed (#7413)Jimmy Miller2023-03-011-0/+10
| | | | | | | | | | Related to: https://github.com/ruby/ruby/pull/7377 Previously it was believed that there was a problem with a combination of cfuncs + splat + send, but it turns out the same issue happened without send. For example `Integer.sqrt(1, *[])`. The issue was happened not because of send, but because of setting the wrong argc when we don't need to splat any args.
* YJIT: Reject __send__ with splat to cfunc for nowAlan Wu2023-02-271-0/+5
| | | | | | | | | | `make test-spec` revealed this issue after applying an unrelated bug fix. A crashing case is included, though I suspect there are other scenarios where it misbehaves. Don't compile for now. Note that this is *not* an issue on the 3.2.x series; it has `send_args_splat_non_iseq` which already rejects all splats to cfuncs, including sends with splats.
* YJIT: `Kernel#{is_a?,instance_of?}` fast paths (GH-7297)Jimmy Miller2023-02-151-0/+27
| | | | Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com> Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
* YJIT: Check correct BOP on gen_fixnum_cmp (#7303)Takashi Kokubun2023-02-141-0/+39
|
* YJIT: Support invokesuper in a block (#7264)Maple Ong2023-02-091-0/+32
| | | | | | | Support invokesuper in a block on YJIT invokesuper previously side exited when it is in a block. To make sure we're compiling the correct method in super, we now use the local environment pointer (LEP) to get the method, which will work in a block. Co-authored-by: John Hawthorn <john@hawthorn.email>
* Implement splat for cfuncs. Split exit exit cases to better capture where we ↵Jimmy Miller2023-01-191-0/+25
| | | | | | | | | | | | | | are exiting (#6929) YJIT: Implement splat for cfuncs. Split exit cases This also implements a new check for ruby2keywords as the last argument of a splat. This does mean that we generate more code, but in actual benchmarks where we gained speed from this (binarytrees) I don't see any significant slow down. I did have to struggle here with the register allocator to find code that didn't allocate too many registers. It's a bit hard when everything is implicit. But I think I got to the minimal amount of copying and stuff given our current allocation strategy.
* Remove Encoding#replicateBenoit Daloze2023-01-111-15/+0
|
* Revert "Re-enable test_ractor for YJIT"Takashi Kokubun2023-01-091-3/+5
| | | | | | | This reverts commit 650a20a3e1205f47224a987676cdbad7d826d597. Now that 3.2.0 is released, let's disable flaky tests. Koichi said he'll rework Ractor implementation for this, and it has not been done yet.
* MJIT: Cancel all on disastrous situations (#7019)Takashi Kokubun2022-12-241-3/+3
| | | | | | | | | | 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.
* Skip a flaky Ractor test for mswinTakashi Kokubun2022-12-211-1/+1
|
* Re-enable test_ractor for YJITTakashi Kokubun2022-12-191-4/+3
| | | | | | This would be still flaky, but we want to make sure there's no YJIT-specific issue when Ruby 3.2 is released. We might skip it again after the release.
* fixed encoding tableKoichi Sasada2022-12-161-2/+2
| | | | | This reduces global lock acquiring for reading. https://bugs.ruby-lang.org/issues/18949
* Skip yet another flaky Ractor testTakashi Kokubun2022-12-131-1/+1
|
* Skip another flaky Ractor test for YJITTakashi Kokubun2022-12-021-1/+1
|
* Skip a couple of Ractor testsTakashi Kokubun2022-12-021-2/+4
| | | | | Koichi plans to rework Ractor implementation to address these failures. He agreed to skip flaky Ractor tests for now.
* YJIT: Make case-when optimization respect === redefinition (#6846)Alan Wu2022-12-021-0/+20
| | | | | | | | | | | | | | | | | | * YJIT: Make case-when optimization respect === redefinition Even when a fixnum key is in the dispatch hash, if there is a case such that its basic operations for === is redefined, we need to fall back to checking each case like the interpreter. Semantically we're always checking each case by calling === in order, it's just that this is not observable when basic operations are intact. When all the keys are fixnums, though, we can do the optimization we're doing right now. Check for this condition. * Update yjit/src/cruby_bindings.inc.rs Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com> Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
* YJIT: Deallocate `struct Block` to plug memory leaksAlan Wu2022-11-301-0/+13
| | | | | | | | | | | | | | | Previously we essentially never freed block even after invalidation. Their reference count never reached zero for a couple of reasons: 1. `Branch::block` formed a cycle with the block holding the branch 2. Strong count on a branch that has ever contained a stub never reached 0 because we increment the `.clone()` call for `BranchRef::into_raw()` didn't have a matching decrement. It's not safe to immediately deallocate blocks during invalidation since `branch_stub_hit()` can end up running with a branch pointer from an invalidated branch. To plug the leaks, we wait until code GC or global invalidation and deallocate the blocks for iseqs that are definitely not running.
* Fix bug involving .send and overwritten methods. (#6752)Jimmy Miller2022-11-171-0/+23
| | | | | | | | | @casperisfine reporting a bug in this gist https://gist.github.com/casperisfine/d59e297fba38eb3905a3d7152b9e9350 After investigating I found it was caused by a combination of send and a c_func that we have overwritten in the JIT. For send calls, we need to do some stack manipulation before making the call. Because of the way exits works, we need to do that stack manipulation at the last possible moment. In this case, we weren't doing that stack manipulation at all. Unfortunately, with how the code is structured there isn't a great place to do that stack manipulation for our overridden C funcs. Each overridden C func can return a boolean stating that it shouldn't be used. We would need to do the stack manipulation after all of those checks are done. We could pass a lambda(?) or separate out the logic for "can I run this override" from "now generate the code for it". Since we are coming up on a release, I went with the path of least resistence and just decided to not use these overrides if we are in a send call. We definitely should revist this in the future.
* Rename --mjit-min-calls to --mjit-call-threshold (#6731)Takashi Kokubun2022-11-141-1/+1
| | | for consistency with YJIT
* YJIT: Fix invalidation for c_call and c_return (#6719)Alan Wu2022-11-131-0/+20
| | | | | | | | | | | Follow-up for 2b8191bdad7545b71f270d2b25a34cd2b3afa02f. Since that commit, we stopped doing code invalidation the second time the call and return events are enabled. We need to do it every time these events are enabled because we might have generated code while these events are disabled. Also rename locals and edit comments to make it more clear that the iseq rewrite code path only happens the first time a particular iseq trace event is enabled.
* Let other test runners follow the change of GNU make 4.4 jobserverNobuyoshi Nakada2022-11-071-3/+9
|
* YJIT: Support nil and blockparamproxy as blockarg in send (#6492)Matthew Draper2022-10-261-0/+43
| | | | | Co-authored-by: John Hawthorn <john@hawthorn.email> Co-authored-by: John Hawthorn <john@hawthorn.email>
* [Bug #19081] Show the caller location in warning for RactorNobuyoshi Nakada2022-10-261-0/+6
| | | | | | | The internal location in ractor.rb is not usefull at all. ``` $ ruby -e 'Ractor.new {}' <internal:ractor>:267: warning: Ractor is experimental, ... ```
* Add test for ractor race condition on ivar setsJemma Issroff2022-10-141-0/+39
|
* Revert "Revert "This commit implements the Object Shapes technique in CRuby.""Jemma Issroff2022-10-111-0/+16
| | | | This reverts commit 9a6803c90b817f70389cae10d60b50ad752da48f.
* YJIT: add support for calling bmethods (#6489)Alan Wu2022-10-041-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | * YJIT: fix a parameter name * YJIT: add support for calling bmethods This commit adds support for the VM_METHOD_TYPE_BMETHOD method type in YJIT. You can get these type of methods from facilities like Kernel#define_singleton_method and Module#define_method. Even though the body of these methods are blocks, the parameter setup for them is exactly the same as VM_METHOD_TYPE_ISEQ, so we can reuse the same logic in gen_send_iseq(). You can see this from how vm_call_bmethod() eventually calls setup_parameters_complex() with arg_setup_method. Bmethods do need their frame environment to be setup differently. We handle this by allowing callers of gen_send_iseq() to control the iseq, the frame flag, and the prev_ep. The `prev_ep` goes into the same location as the block handler would go into in an iseq method frame. Co-authored-by: John Hawthorn <john@hawthorn.email> Co-authored-by: John Hawthorn <john@hawthorn.email>
* Indent folded bootstraptest dotsNobuyoshi Nakada2022-10-011-10/+16
|
* Revert "This commit implements the Object Shapes technique in CRuby."Aaron Patterson2022-09-301-16/+0
| | | | This reverts commit 68bc9e2e97d12f80df0d113e284864e225f771c2.
* bootstraptest/runner: run in parallel if in parallel buildNobuyoshi Nakada2022-09-291-5/+5
|
* This commit implements the Object Shapes technique in CRuby.Jemma Issroff2022-09-281-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Object Shapes is used for accessing instance variables and representing the "frozenness" of objects. Object instances have a "shape" and the shape represents some attributes of the object (currently which instance variables are set and the "frozenness"). Shapes form a tree data structure, and when a new instance variable is set on an object, that object "transitions" to a new shape in the shape tree. Each shape has an ID that is used for caching. The shape structure is independent of class, so objects of different types can have the same shape. For example: ```ruby class Foo def initialize # Starts with shape id 0 @a = 1 # transitions to shape id 1 @b = 1 # transitions to shape id 2 end end class Bar def initialize # Starts with shape id 0 @a = 1 # transitions to shape id 1 @b = 1 # transitions to shape id 2 end end foo = Foo.new # `foo` has shape id 2 bar = Bar.new # `bar` has shape id 2 ``` Both `foo` and `bar` instances have the same shape because they both set instance variables of the same name in the same order. This technique can help to improve inline cache hits as well as generate more efficient machine code in JIT compilers. This commit also adds some methods for debugging shapes on objects. See `RubyVM::Shape` for more details. For more context on Object Shapes, see [Feature: #18776] Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org> Co-Authored-By: Eileen M. Uchitelle <eileencodes@gmail.com> Co-Authored-By: John Hawthorn <john@hawthorn.email>