summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* YJIT: Rest and block_arg support (#7557)Jimmy Miller2023-03-173-9/+24
| | | | | | | | | * YJIT: Rest and block_arg support * Update bootstraptest/test_yjit.rb --------- Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
* * remove trailing spaces. [ci skip]git2023-03-172-11/+11
|
* [ci skip] Move rp helper to new LLDB formatMatt Valentine-House2023-03-177-16/+455
| | | | | For now, the old function still exists as `old_rp`, in order to debug issues with this command.
* * remove trailing spaces. [ci skip]git2023-03-171-1/+1
|
* Update Makefile dependenciesMatt Valentine-House2023-03-171-0/+20
|
* Document the declarative marking apiMatt Valentine-House2023-03-171-0/+56
|
* Implement declarative references for enumeratorMatt Valentine-House2023-03-171-36/+15
|
* Implement declarative references for dir_data_typeMatt Valentine-House2023-03-171-9/+6
|
* [Feature #19406] Allow declarative definition of referencesMatt Valentine-House2023-03-173-6/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using rb_data_type_struct to wrap a C struct, that C struct can contain VALUE references to other Ruby objects. If this is the case then one must also define dmark and optionally dcompact callbacks in order to allow these objects to be correctly handled by the GC. This is suboptimal as it requires GC related logic to be implemented by extension developers. This can be a cause of subtle bugs when references are not marked of updated correctly inside these callbacks. This commit provides an alternative approach, useful in the simple case where the C struct contains VALUE members (ie. there isn't any conditional logic, or data structure manipulation required to traverse these references). In this case references can be defined using a declarative syntax as a list of edges (or, pointers to references). A flag can be set on the rb_data_type_struct to notify the GC that declarative references are being used, and a list of those references can be assigned to the dmark pointer instead of a function callback, on the rb_data_type_struct. Macros are also provided for simple declaration of the reference list, and building edges. To avoid having to also find space in the struct to define a length for the references list, I've chosed to always terminate the references list with RUBY_REF_END - defined as UINTPTR_MAX. My assumption is that no single struct will ever be large enough that UINTPTR_MAX is actually a valid reference.
* YJIT: Support entry for multiple PCs per ISEQ (GH-7535)Takashi Kokubun2023-03-177-32/+268
|
* ObjectSpace::WeakMap: clean inverse reference when an entry is re-assignedJean Boussier2023-03-172-17/+91
| | | | | | | | | | | | [Bug #19531] ```ruby wmap[1] = "A" wmap[1] = "B" ``` In the example above, we need to remove the `"A" => 1` inverse reference so that when `"A"` is GCed the `1` key isn't deleted.
* core_assertions.rb: Relax `assert_linear_performance`Nobuyoshi Nakada2023-03-182-15/+26
| | | | | | | | * Use an `Enumerable` as factors, instead of three arguments. * Include `assert_operator` time in rehearsal time. * Round up max expected time.
* YJIT: Use raw pointers and shared references over `Rc<RefCell<_>>`Alan Wu2023-03-175-637/+965
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `Rc` and `RefCell` both incur runtime space costs. In addition, `RefCell` has given us some headaches with the non obvious borrow panics it likes to throw out. The latest one started with 7fd53eeb46db261bbc20025cdab70096245a5cbe and is yet to be resolved. Since we already rely on the GC to properly reclaim memory for `Block` and `Branch`, we might as well stop paying the overhead of `Rc` and `RefCell`. The `RefCell` panics go away with this change, too. On 25 iterations of `railsbench` with a stats build I got `yjit_alloc_size: 8,386,129 => 7,348,637`, with the new memory size 87.6% of the status quo. This makes the metadata and machine code size roughly line up one-to-one. The general idea here is to use `&` shared references with [interior mutability][1] with `Cell`, which doesn't take any extra space. The `noalias` requirement that `&mut` imposes is way too hard to meet and verify. Imagine replacing places where we would've gotten `BorrowError` from `RefCell` with Rust/LLVM miscompiling us due to aliasing violations. With shared references, we don't have to think about subtle cases like the GC _sometimes_ calling the mark callback while codegen has an aliasing reference in a stack frame below. We mostly only need to worry about liveness, with which the GC already helps. There is now a clean split between blocks and branches that are not yet fully constructed and ones that are "in-service", so to speak. Working with `PendingBranch` and `JITState` don't really involve `unsafe` stuff. This change allows `Branch` and `Block` to not have as many optional fields as many of them are only optional during compilation. Fields that change post-compilation are wrapped in `Cell` to facilitate mutation through shared references. I do some `unsafe` dances here. I've included just a couple tests to run with Miri (`cargo +nightly miri test miri`). We can add more Miri tests if desired. [1]: https://doc.rust-lang.org/std/cell/struct.UnsafeCell.html
* Skip a flaky test that might not workTakashi Kokubun2023-03-171-1/+1
|
* [ruby/irb] Fix 2 minor issues in test suitelukeg2023-03-172-233/+237
| | | | | | | | * undefine Kernel#irb_original_require in without_rdoc method * Don't rescue all LoadErrors/NameErrors in test_rendering.rb, just the one for require 'yamatanooroti' https://github.com/ruby/irb/commit/52b79806ea
* Assume that FL_FINALIZE is in finalizer_tablePeter Zhu2023-03-171-3/+3
| | | | | If the flag FL_FINALIZE is set, then it's guaranteed to be in the finalizer_table, so we can directly assume that without checking.
* YJIT: skip intermediate arrays in print_sorted_exit_counts (#7547)Mau Magnaguagno2023-03-171-9/+10
| | | | | Early total_exits condition. Replace Array#sort_by/first(how_many) with Array#max_by(how_many). Replace Array#map/max with Array#max_by, match print_counters style for longest_name_length.
* When running `bundle lock --update <name>`, checkout locked revision of ↵David Rodríguez2023-03-172-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | unrelated git sources directly Since Bundler 2.4, we will try to checkout any branch specified in the Gemfile, while until Bundler 2.3 we would directly checkout the locked revision. This should not make any difference in most situations, but in some edge cases, like if the branch specified in the `Gemfile` has been renamed, but the locked revision still exist, it causes an error now while before it would update the lockfile without issues. I debated which behavior was best, since I was not sure. But my conclusion is that if the situation does not require expiring the lockfile source in favor of the Gemfile source, we should use the locked revision directly and proceed happily. So I restored Bundler 2.3 behavior. I think this is consistent with how yanked gems are handled, for example. Of course, if explicitly updating the git source itself, or all gems, we will still get any errors like missing branches related to the git source.
* Don´t consider platform specific candidates when `force_ruby_platform` setDavid Rodríguez2023-03-172-1/+49
| | | | | | | | This was working fine for direct dependencies using `force_ruby_platform` explicitly through Gemfile, but not for indirect dependencies. In general, indirect dependencies do not have this property set, but in truffleruby this is different and the default value is to have it set.
* Don't ignore pre-releases when there's only one candidateDavid Rodríguez2023-03-172-1/+26
| | | | | | | | | This should be a very rare edge case, however, it does happen when using a .dev version of Bundler because in that case, that's the only version that the resolver considers, and it should not be ignored. We could've special cased this specifically for Bundler, but I think it does make sense for every gem.
* Normalize git sourcesDavid Rodríguez2023-03-176-4/+45
| | | | | Just like gem sources, a "style-only" change, like adding a trailing slash, should not expire them.
* util/rubocop -A --only Style/MultipleComparisonHiroshi SHIBATA2023-03-174-5/+5
|
* util/rubocop -A --only Style/TernaryParenthesesHiroshi SHIBATA2023-03-176-6/+6
|
* util/rubocop -A --only Style/SymbolArrayHiroshi SHIBATA2023-03-172-2/+2
|
* util/rubocop -A --only Style/RedundantSelfHiroshi SHIBATA2023-03-1710-43/+43
|
* util/rubocop -A --only Style/SymbolProcHiroshi SHIBATA2023-03-1761-295/+239
|
* util/rubocop -A --only Layout/ParameterAlignmentHiroshi SHIBATA2023-03-175-18/+9
|
* util/rubocop -A --only Layout/SpaceInsideArrayLiteralBracketsHiroshi SHIBATA2023-03-176-46/+49
|
* util/rubocop -A --only Layout/DotPositionHiroshi SHIBATA2023-03-172-6/+6
|
* util/rubocop -A --only Performance/CasecmpHiroshi SHIBATA2023-03-173-4/+4
|
* [rubygems/rubygems] util/rubocop -A --only Style/SemicolonHiroshi SHIBATA2023-03-171-1/+4
| | | | https://github.com/rubygems/rubygems/commit/97f062be05
* [rubygems/rubygems] util/rubocop -A --only Style/CharacterLiteralHiroshi SHIBATA2023-03-171-2/+2
| | | | https://github.com/rubygems/rubygems/commit/aa058ff6b8
* [rubygems/rubygems] util/rubocop -A --only Style/RedundantBeginHiroshi SHIBATA2023-03-1716-191/+151
| | | | https://github.com/rubygems/rubygems/commit/b595d3cf0f
* [rubygems/rubygems] util/rubocop -A --only Style/RedundantSortByHiroshi SHIBATA2023-03-172-2/+2
| | | | https://github.com/rubygems/rubygems/commit/3e4f5dc008
* [rubygems/rubygems] util/rubocop -A --only Style/DoubleNegationHiroshi SHIBATA2023-03-173-3/+3
| | | | https://github.com/rubygems/rubygems/commit/01c2b5542f
* [rubygems/rubygems] util/rubocop -A --only Style/IfUnlessModifierOfIfUnlessHiroshi SHIBATA2023-03-173-3/+9
| | | | https://github.com/rubygems/rubygems/commit/97e0af2518
* [rubygems/rubygems] util/rubocop -A --only Style/BarePercentLiteralsHiroshi SHIBATA2023-03-172-3/+2
| | | | https://github.com/rubygems/rubygems/commit/02d8147243
* [rubygems/rubygems] util/rubocop -A --only Style/OrAssignmentHiroshi SHIBATA2023-03-173-6/+4
| | | | https://github.com/rubygems/rubygems/commit/965fc82cfd
* [rubygems/rubygems] util/rubocop -A --only Style/UnlessElseHiroshi SHIBATA2023-03-175-31/+31
| | | | https://github.com/rubygems/rubygems/commit/184c03270c
* [rubygems/rubygems] util/rubocop -A --only Style/IdenticalConditionalBranchesHiroshi SHIBATA2023-03-171-2/+1
| | | | https://github.com/rubygems/rubygems/commit/64f437a428
* [rubygems/rubygems] util/rubocop -A --only Style/RescueStandardErrorHiroshi SHIBATA2023-03-1723-33/+33
| | | | https://github.com/rubygems/rubygems/commit/80b57da926
* [rubygems/rubygems] util/rubocop -A --only Style/RescueModifierHiroshi SHIBATA2023-03-1712-20/+100
| | | | https://github.com/rubygems/rubygems/commit/b490379eab
* [rubygems/rubygems] util/rubocop -A --only Style/PreferredHashMethodsHiroshi SHIBATA2023-03-173-3/+3
| | | | https://github.com/rubygems/rubygems/commit/ae3bdc0e85
* [rubygems/rubygems] util/rubocop -A --only Style/NonNilCheckHiroshi SHIBATA2023-03-171-2/+2
| | | | https://github.com/rubygems/rubygems/commit/2b056b25c3
* [rubygems/rubygems] util/rubocop -A --only Style/ParenthesesAroundConditionHiroshi SHIBATA2023-03-173-4/+4
| | | | https://github.com/rubygems/rubygems/commit/c766a65885
* [rubygems/rubygems] util/rubocop -A --only Style/EmptyCaseConditionHiroshi SHIBATA2023-03-171-10/+18
| | | | https://github.com/rubygems/rubygems/commit/dae8fc70a4
* [rubygems/rubygems] util/rubocop -A --only Style/SelfAssignmentHiroshi SHIBATA2023-03-172-2/+2
| | | | https://github.com/rubygems/rubygems/commit/7c1168c623
* [rubygems/rubygems] util/rubocop -A --only Style/EmptyElseHiroshi SHIBATA2023-03-178-16/+1
| | | | https://github.com/rubygems/rubygems/commit/04227104ac
* [rubygems/rubygems] util/rubocop -A --only Style/RedundantParenthesesHiroshi SHIBATA2023-03-175-6/+6
| | | | https://github.com/rubygems/rubygems/commit/295691d4dc
* [rubygems/rubygems] util/rubocop -A --only Style/StabbyLambdaParenthesesHiroshi SHIBATA2023-03-171-2/+2
| | | | https://github.com/rubygems/rubygems/commit/23ce9793e5