summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-11-20Fix crash when evacuating generic ivarPeter Zhu
When transitioning generic instance variable objects to too complex, we set the shape first before performing inserting the new gen_ivtbl. The st_insert for the new gen_ivtbl could allocate and cause a GC. If that happens, then it will crash because the object will have a too complex shape but not yet be backed by a st_table. This commit changes the order so that the insert happens first before the new shape is set. The following script reproduces the issue: ``` o = [] o.instance_variable_set(:@a, 1) i = 0 o = Object.new while RubyVM::Shape.shapes_available > 0 o.instance_variable_set(:"@i#{i}", 1) i += 1 end ary = 1_000.times.map { [] } GC.stress = true ary.each do |o| o.instance_variable_set(:@a, 1) o.instance_variable_set(:@b, 1) end ```
2023-11-20[PRISM] Updated LocalVariableTargetNodes tooJemma Issroff
2023-11-20[PRISM] Fix LocalVariableWriteNodes within blocksJemma Issroff
Prior to this commit, we weren't recursing up scopes to look for the local definition. With this commit, we do so, fixing local writes within blocks
2023-11-20YJIT: make --yjit-max-versions=N option undocumented (#8962)Maxime Chevalier-Boisvert
Not useful for the vast majority of end users to change this option.
2023-11-20RubyVM::InstructionSequence.compile_file_prismKevin Newton
* Provide a new API compile_file_prism which mirrors compile_file but uses prism to parse/compile. * Provide the ability to run test-all with RUBY_ISEQ_DUMP_DEBUG set to "prism". If it is, we'll use the new compile_file_prism API to load iseqs during the test run.
2023-11-20[PRISM] Implement once node for interpolated regexeileencodes
This PR implements the once node on interpolated regexes. There is a bug in Prism where the interpolated regex with the once flag only works when there is not a local variable so the test uses a "1". We'll need to fix that.
2023-11-20[PRISM] Don't pop args to YieldNodeJemma Issroff
2023-11-20[ruby/prism] adds encodings for ibm869Lynne Ashminov
(https://github.com/ruby/prism/pull/1886) https://github.com/ruby/prism/commit/41462400b7
2023-11-20[ruby/prism] Add and test ibm863 encodingMaple Ong
(https://github.com/ruby/prism/pull/1853) * Add and test ibm863 * Remove dup encoding and add alias * Update test/prism/encoding_test.rb Co-authored-by: Kevin Newton <kddnewton@gmail.com> * Readd bitfield table lol --------- https://github.com/ruby/prism/commit/4cd756d7ff Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2023-11-20Fix indentation [ci skip]Peter Zhu
2023-11-20proc.c: Make Method and UnboundMethod embdedJean Boussier
Avoid some needless malloc churn ``` compare-ruby: ruby 3.3.0dev (2023-11-20T02:02:55Z master 701b0650de) [arm64-darwin22] last_commit=[ruby/prism] feat: add encoding for IBM865 (https://github.com/ruby/prism/pull/1884) built-ruby: ruby 3.3.0dev (2023-11-20T16:23:07Z embedded-methods e35284bfaa) [arm64-darwin22] warming up.. | |compare-ruby|built-ruby| |:------------------------|-----------:|---------:| |allocate_method | 8.413M| 12.333M| | | -| 1.47x| |allocate_unbound_method | 8.083M| 11.607M| | | -| 1.44x| ``` ``` prelude: | class SomeClass def foo end end some_object = SomeClass.new benchmark: allocate_method: some_object.method(:foo) allocate_unbound_method: SomeClass.instance_method(:foo) ```
2023-11-20marshal.c: embed load and dump argument objectsJean Boussier
This avoid a bit of needless malloc churn.
2023-11-20compile.c: make pinned_list embedableJean Boussier
This saves some malloc churn for small pin lists.
2023-11-20[ruby/prism] Disallow defining a numbered parameter methodKevin Newton
(https://github.com/ruby/prism/pull/1797) https://github.com/ruby/prism/commit/c13165e6aa
2023-11-20[ruby/prism] feat: Adds macCroatian encodingDavid Wessman
(https://github.com/ruby/prism/pull/1880) * feat: Adds macCroatian encoding - Based on: https://en.wikipedia.org/wiki/Mac_OS_Croatian_encoding https://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/CROATIAN.TXT Co-authored-by: Josefine Rost <nijrost@gmail.com> * Use output from bin/encodings and adds to docs/encoding.md --------- https://github.com/ruby/prism/commit/019a82d8f3 Co-authored-by: Josefine Rost <nijrost@gmail.com>
2023-11-20[ruby/prism] Add character APIs for locationsKevin Newton
(https://github.com/ruby/prism/pull/1809) https://github.com/ruby/prism/commit/d493ccd093
2023-11-20[ruby/prism] Correctly parse the `resuce` modifier in the rhs of theHiroya Fujinami
assignments (https://github.com/ruby/prism/pull/1879) Fix https://github.com/ruby/prism/pull/1541 https://github.com/ruby/prism/commit/9fb276e1f4
2023-11-20[ruby/prism] Remove non-ASCII source charactersKevin Newton
(https://github.com/ruby/prism/pull/1787) https://github.com/ruby/prism/commit/5acc38a2f3
2023-11-20[ruby/prism] Fix parsing `...` in argumentsHiroya Fujinami
(https://github.com/ruby/prism/pull/1882) * Fix parsing `...` in arguments Fix https://github.com/ruby/prism/pull/1830 Fix https://github.com/ruby/prism/pull/1831 * Rename the constant name to PM_ERR_ARGUMENT_FORWARDING_UNBOUND https://github.com/ruby/prism/pull/1882#discussion_r1398461156 https://github.com/ruby/prism/commit/519653aec2
2023-11-20Fix crash when iterating over generic ivarsPeter Zhu
2023-11-20Switching first argument in pm_interpolated_node_compileeileencodes
This changes the first argument in `pm_interpolated_node_compile` to use a pointer.
2023-11-20Embed Thread::Backtrace::Location into Thread::BacktraceÉtienne Barrié
Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
2023-11-20Specialize String#dupJean Boussier
`String#+@` is 2-3 times faster than `String#dup` because it can directly go through `rb_str_dup` instead of using the generic much slower `rb_obj_dup`. This fact led to the existance of the ugly `Performance/UnfreezeString` rubocop performance rule that encourage users to rewrite the much more readable and convenient `"foo".dup` into the ugly `(+"foo")`. Let's make that rubocop rule useless. ``` compare-ruby: ruby 3.3.0dev (2023-11-20T02:02:55Z master 701b0650de) [arm64-darwin22] last_commit=[ruby/prism] feat: add encoding for IBM865 (https://github.com/ruby/prism/pull/1884) built-ruby: ruby 3.3.0dev (2023-11-20T12:51:45Z faster-str-lit-dup 6b745bbc5d) [arm64-darwin22] warming up.. | |compare-ruby|built-ruby| |:------|-----------:|---------:| |uplus | 16.312M| 16.332M| | | -| 1.00x| |dup | 5.912M| 16.329M| | | -| 2.76x| ```
2023-11-20[ruby/prism] feat: add encoding for IBM865Derek Moore
(https://github.com/ruby/prism/pull/1884) * feat: add encoding for IBM865 * style: fix incorrect autoformat https://github.com/ruby/prism/commit/14c6ae0182
2023-11-19[wasm] Enable more ext libraries on CI as much as possibleYuta Saito
2023-11-19[ruby/open3] [DOC] RDoc for Open3Burdette Lamar
(https://github.com/ruby/open3/pull/20) https://github.com/ruby/open3/commit/4c9e7492eb
2023-11-19[ruby/prism] Don't add an invalid identifier capture to localsHiroya Fujinami
(https://github.com/ruby/prism/pull/1836) * Don't add an invalid identifier capture to locals Fix https://github.com/ruby/prism/pull/1815 * Delay creating a MatchWriteNode https://github.com/ruby/prism/pull/1836#discussion_r1393716600 https://github.com/ruby/prism/commit/635f595a36
2023-11-19[ruby/prism] feat: add encoding for ibm866Syed Faraaz Ahmad
(https://github.com/ruby/prism/pull/1864) Add encoding for ibm866 --------- https://github.com/ruby/prism/commit/1a96cc71f7 Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2023-11-19[ruby/prism] Add GB1988 encodingOrhan Toy
https://github.com/ruby/prism/commit/78d3fa7172
2023-11-19[ruby/prism] Add macCyrillic encodingOrhan Toy
https://github.com/ruby/prism/commit/220b40921a
2023-11-19[ruby/prism] Fix typos in comments and docsMartin Emde
https://github.com/ruby/prism/commit/16b3d19758
2023-11-18[prism] Update common.mk for prism big5 hkscsKevin Newton
2023-11-18[ruby/prism] Big5 HKSCS encodingRyan Garver
https://github.com/ruby/prism/commit/3ca9823eb4
2023-11-18[ruby/prism] Add IBM864 encodingMike Dalton
Fixes https://github.com/ruby/prism/pull/1868 Related #1843 https://github.com/ruby/prism/commit/abc136dfc9
2023-11-18[ruby/prism] Faster lex_keywordHaldun Bayhantopcu
https://github.com/ruby/prism/commit/23a68dcda2
2023-11-18[ruby/prism] Add macCentEuro encodingThomas Marshall
https://github.com/ruby/prism/commit/ff95edbd99
2023-11-18[ruby/irb] Fix irb crash on `{}.` completiontomoya ishida
(https://github.com/ruby/irb/pull/764) https://github.com/ruby/irb/commit/07e4d540cc
2023-11-18Ensure keyword splat method argument is hashJeremy Evans
Commit e87d0882910001ef3b0c2ccd43bf00cee8c34a0c introduced a regression where the keyword splat object passed by the caller would be directly used by callee as keyword splat parameters, if it implemented #to_hash. The return value of #to_hash would be ignored in this case.
2023-11-18Lrama v0.5.10yui-knk
2023-11-18[ruby/prism] Revert "Ensure serialized file is little endian"Kevin Newton
https://github.com/ruby/prism/commit/4cec275fff
2023-11-17Fix ordering for auto compaction in get_overloaded_cme()Alan Wu
Found through GC.stress + GC.auto_compact crashes in GH-8932. Previously, the compaction run within `rb_method_entry_alloc()` could move the `def->body.iseq.cref` and `iseqptr` set up before the call and leave the `def` pointing to moved addresses. Nothing was marking `def` during that GC run. Low probability reproducer: GC.stress = true GC.auto_compact = true arr = [] alloc = 1000.times.map { [] } alloc = nil a = arr.first GC.start
2023-11-17Fix File.directory? doc hidding File::Stat#directory? docDana Sherson
Now the documentation that was already in the codebase for `File::Stat#directory?` shows up.
2023-11-17Fix corruption when out of shape during ivar removePeter Zhu
Reproduction script: ``` o = Object.new 10.times { |i| o.instance_variable_set(:"@a#{i}", i) } i = 0 a = Object.new while RubyVM::Shape.shapes_available > 2 a.instance_variable_set(:"@i#{i}", 1) i += 1 end o.remove_instance_variable(:@a0) puts o.instance_variable_get(:@a1) ``` Before this patch, it would incorrectly output `2` and now it correctly outputs `1`.
2023-11-17[ruby/prism] Ensure serialized file is little endianKevin Newton
https://github.com/ruby/prism/commit/0c762ee68a
2023-11-17[ruby/prism] Silence clang analyzer warnings for the memory leaksHaldun Bayhantopcu
https://github.com/ruby/prism/commit/68112c556e
2023-11-17[ruby/prism] add Windows-874 encodingPeter Cai
https://github.com/ruby/prism/commit/0670dd3b9a
2023-11-17[ruby/prism] Update spacing in encoding_test.rbKevin Newton
https://github.com/ruby/prism/commit/56508c2201
2023-11-17[ruby/prism] Add macThaiHaldun Bayhantopcu
https://github.com/ruby/prism/commit/f654058f50
2023-11-17[ruby/prism] Add macRomanHaldun Bayhantopcu
https://github.com/ruby/prism/commit/42b20ee399
2023-11-17[ruby/prism] Add macUkraineHaldun Bayhantopcu
https://github.com/ruby/prism/commit/440557fddc