aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* YJIT: Fallback setivar if the receiver isn't T_OBJECT (#8160)Jean byroot Boussier2023-08-022-1/+24
| | | | | | | | Followup: https://github.com/ruby/ruby/pull/8152 If the receiver is a T_MODULE or T_CLASS and has a lot of ivars, `get_next_shape_internal` will return `NULL`. Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
* Fix encoding switches when RUBYOPT is empty or only spacesBenoit Daloze2023-08-022-2/+10
| | | | * Follow-up of dbbc3583ba432c279f07b1fa0afb0a8a9ba50c91 which broke this.
* Fix wrong assignmentNobuyoshi Nakada2023-08-021-1/+1
|
* YJIT: Distinguish exit and fallback reasons for send (#8159)Takashi Kokubun2023-08-023-39/+42
|
* YJIT: Fix --yjit-dump-disasm coloring on less(1) (#8158)Takashi Kokubun2023-08-021-8/+9
|
* YJIT: Move ROBJECT_OFFSET_* to yjit.c (#8157)Takashi Kokubun2023-08-025-16/+18
|
* Fix crash in NoMethodError for dummy framesPeter Zhu2023-08-022-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [Bug #19793] Dummy frames are created at the top level when requiring another file. While requiring a file, it will try to convert using encodings. Some of these encodings will not respond to to_str. If method_missing is redefined on Object, then it will call method_missing and attempt raise an error. However, the iseq is invalid as it's a dummy frame so it will write an invalid iseq to the created NoMethodError. The following script crashes: ``` GC.stress = true class Object public :method_missing end File.write("/tmp/empty.rb", "") require "/tmp/empty.rb" ``` With the following backtrace: ``` frame #0: 0x00000001000fa8b8 miniruby`RVALUE_MARKED(obj=4308637824) at gc.c:1638:12 frame #1: 0x00000001000fb440 miniruby`RVALUE_BLACK_P(obj=4308637824) at gc.c:1763:12 frame #2: 0x00000001000facdc miniruby`gc_writebarrier_incremental(a=4308637824, b=4308332208, objspace=0x000000010180b000) at gc.c:8822:9 frame #3: 0x00000001000faad8 miniruby`rb_gc_writebarrier(a=4308637824, b=4308332208) at gc.c:8864:17 frame #4: 0x000000010016aff0 miniruby`rb_obj_written(a=4308637824, oldv=36, b=4308332208, filename="../iseq.c", line=1279) at gc.h:804:9 frame #5: 0x0000000100162a60 miniruby`rb_obj_write(a=4308637824, slot=0x0000000100d09888, b=4308332208, filename="../iseq.c", line=1279) at gc.h:837:5 frame #6: 0x0000000100165b0c miniruby`iseqw_new(iseq=0x0000000100d09880) at iseq.c:1279:9 frame #7: 0x0000000100165a64 miniruby`rb_iseqw_new(iseq=0x0000000100d09880) at iseq.c:1289:12 frame #8: 0x00000001000d8324 miniruby`name_err_init_attr(exc=4309777920, recv=4304780496, method=827660) at error.c:1830:35 frame #9: 0x00000001000d1b80 miniruby`name_err_init(exc=4309777920, mesg=4308332496, recv=4304780496, method=827660) at error.c:1869:12 frame #10: 0x00000001000d1bd4 miniruby`rb_nomethod_err_new(mesg=4308332496, recv=4304780496, method=827660, args=4308332448, priv=0) at error.c:1957:5 frame #11: 0x000000010039049c miniruby`rb_make_no_method_exception(exc=4304914512, format=4308332496, obj=4304780496, argc=1, argv=0x000000016fdfab00, priv=0) at vm_eval.c:959:16 frame #12: 0x00000001003b3274 miniruby`raise_method_missing(ec=0x0000000100b06f40, argc=1, argv=0x000000016fdfab00, obj=4304780496, last_call_status=MISSING_NOENTRY) at vm_eval.c:999:15 frame #13: 0x00000001003945d4 miniruby`rb_method_missing(argc=1, argv=0x000000016fdfab00, obj=4304780496) at vm_eval.c:944:5 ... frame #23: 0x000000010038f5e4 miniruby`rb_vm_call_kw(ec=0x0000000100b06f40, recv=4304780496, id=2865, argc=1, argv=0x000000016fdfab00, me=0x0000000100cbfcf0, kw_splat=0) at vm_eval.c:326:12 frame #24: 0x00000001003c18e4 miniruby`call_method_entry(ec=0x0000000100b06f40, defined_class=4304927952, obj=4304780496, id=2865, cme=0x0000000100cbfcf0, argc=1, argv=0x000000016fdfab00, kw_splat=0) at vm_method.c:2720:20 frame #25: 0x00000001003c440c miniruby`check_funcall_exec(v=6171896792) at vm_eval.c:589:12 frame #26: 0x00000001000dec00 miniruby`rb_vrescue2(b_proc=(miniruby`check_funcall_exec at vm_eval.c:587), data1=6171896792, r_proc=(miniruby`check_funcall_failed at vm_eval.c:596), data2=6171896792, args="Pȗ") at eval.c:919:18 frame #27: 0x00000001000deab0 miniruby`rb_rescue2(b_proc=(miniruby`check_funcall_exec at vm_eval.c:587), data1=6171896792, r_proc=(miniruby`check_funcall_failed at vm_eval.c:596), data2=6171896792) at eval.c:900:17 frame #28: 0x000000010039008c miniruby`check_funcall_missing(ec=0x0000000100b06f40, klass=4304923536, recv=4304780496, mid=3233, argc=0, argv=0x0000000000000000, respond=-1, def=36, kw_splat=0) at vm_eval.c:666:15 frame #29: 0x000000010038fa60 miniruby`rb_check_funcall_default_kw(recv=4304780496, mid=3233, argc=0, argv=0x0000000000000000, def=36, kw_splat=0) at vm_eval.c:703:21 frame #30: 0x000000010038fb04 miniruby`rb_check_funcall(recv=4304780496, mid=3233, argc=0, argv=0x0000000000000000) at vm_eval.c:685:12 frame #31: 0x00000001001c469c miniruby`convert_type_with_id(val=4304780496, tname="String", method=3233, raise=0, index=-1) at object.c:3061:15 frame #32: 0x00000001001c4a4c miniruby`rb_check_convert_type_with_id(val=4304780496, type=5, tname="String", method=3233) at object.c:3153:9 frame #33: 0x00000001002d59f8 miniruby`rb_check_string_type(str=4304780496) at string.c:2571:11 frame #34: 0x000000010014b7b0 miniruby`io_encoding_set(fptr=0x0000000100d09ca0, v1=4304780496, v2=4, opt=4) at io.c:11655:19 frame #35: 0x0000000100139a58 miniruby`rb_io_set_encoding(argc=1, argv=0x000000016fdfb450, io=4308334032) at io.c:13497:5 frame #36: 0x00000001003c0004 miniruby`ractor_safe_call_cfunc_m1(recv=4308334032, argc=1, argv=0x000000016fdfb450, func=(miniruby`rb_io_set_encoding at io.c:13487)) at vm_insnhelper.c:3271:12 ... frame #43: 0x0000000100390b08 miniruby`rb_funcall(recv=4308334032, mid=16593, n=1) at vm_eval.c:1137:12 frame #44: 0x00000001002a43d8 miniruby`load_file_internal(argp_v=6171899936) at ruby.c:2500:5 ... ```
* Allow to override environment variables for debugNobuyoshi Nakada2023-08-023-5/+3
|
* `EnvUtil.invoke_ruby` also passes ASAN optionsNobuyoshi Nakada2023-08-021-1/+0
|
* [rubygems/rubygems] Replaced remained local to lockfileHiroshi SHIBATA2023-08-022-2/+2
| | | | https://github.com/rubygems/rubygems/commit/6ed69223d4
* Implement StringIO#pread (#56)Jean byroot Boussier2023-08-022-0/+62
| | | | | | | Both for being closer to real IOs and also because it's a convenient API in multithreaded scenarios. Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
* [ruby/irb] Drop src_encoding.rbStan Lo2023-08-022-8/+0
| | | | | | | | | (https://github.com/ruby/irb/pull/634) Its method `IRB.default_src_encoding` was only used in `magic-file.rb`, which has been removed. https://github.com/ruby/irb/commit/ed98983b1f
* [ruby/fiddle] Include stdbool.h explicitlySutou Kouhei2023-08-021-0/+2
| | | | https://github.com/ruby/fiddle/commit/c313a74632
* [ruby/fiddle] Include stdbool.h explicitlySutou Kouhei2023-08-021-0/+2
| | | | https://github.com/ruby/fiddle/commit/69ff680bf6
* [ruby/fiddle] Add support for boolSutou Kouhei2023-08-025-0/+43
| | | | | | | | GitHub: fix https://github.com/ruby/fiddle/pull/130 Reported by Benoit Daloze. Thanks!!! https://github.com/ruby/fiddle/commit/bc6c66bbb9
* [ruby/fiddle] Use ifdefSutou Kouhei2023-08-021-1/+1
| | | | https://github.com/ruby/fiddle/commit/6cdf53726d
* Revert "YJIT: implement `expandarray_rhs_too_small` case (#8153)"Hiroshi SHIBATA2023-08-022-59/+18
| | | | | | This reverts commit 3b88a0bee841aee77bee306d9d34e587561515cf. This commit break aarch64 platform and Apple Silicon
* Tests to move between size pools are flaky on Windows too [ci skip]Nobuyoshi Nakada2023-08-021-2/+6
| | | | Needs more investigations.
* Find paths of tools [ci skip]Nobuyoshi Nakada2023-08-021-8/+14
| | | | Recent GitHub Actions Windows containers seem having Strawberry tools.
* Remove `kprintf` in addr2line.cNobuyoshi Nakada2023-08-021-456/+29
| | | | | According to @naruse, this `kprintf` was to avoid some segfaults, but turned out it seemed another issue after all.
* Avoid aborting inside addr2line.cNobuyoshi Nakada2023-08-021-46/+69
|
* Do not auto-cancel builds on pull requestsTakashi Kokubun2023-08-011-1/+0
| | | | | | | | For some reason, there was a pull request that contains a YJIT change but did not run Cirrus CI, which ended up failing Cirrus CI on master. This `auto_cancellation` config seems suspicious. Now that we have `only_if`, I don't think we need an extra guard besides that.
* YJIT: Let local yjit-bindgen exit successfully (#8156)Takashi Kokubun2023-08-012-1/+4
|
* YJIT: implement `expandarray_rhs_too_small` case (#8153)Maxime Chevalier-Boisvert2023-08-012-18/+59
| | | | | | | * YJIT: handle expandarray_rhs_too_small case * YJIT: fix csel bug in x86 backend, add test * Remove commented out lines
* YJIT: Fallback setivar if the next shape is too complex (#8152)Takashi Kokubun2023-08-012-50/+60
|
* Remove unnecessarily copied document [ci skip]Nobuyoshi Nakada2023-08-011-26/+0
|
* support `rescue` event for TracePointKoichi Sasada2023-08-018-9/+86
| | | | fix [Feature #19572]
* [ruby/irb] Add workspace categoryStan Lo2023-08-012-5/+5
| | | | | | | | | | (https://github.com/ruby/irb/pull/661) * Create a new Workspace command category * Update readme https://github.com/ruby/irb/commit/310650c213
* [Bug #19788] Use the result of `tCOLON2` eventNobuyoshi Nakada2023-08-013-8/+30
|
* remove strange line eventKoichi Sasada2023-08-012-0/+25
| | | | | | | | | | | | | | | ```ruby def helper_cant_rescue begin raise SyntaxError rescue cant_rescue # here end end ``` on this case, a line event is reported on `cant_rescue` line because of node structure. it should not be reported.
* [DOC] Update warning categoriesNobuyoshi Nakada2023-08-011-8/+14
| | | | | - Fix indentations of labeled lists. - Mention performance category.
* RDoc for module Process (#8141)Burdette Lamar2023-07-311-13/+81
|
* Supress warnings by Refinement#refined_class in test codeShugo Maeda2023-08-011-2/+6
|
* [rubygems/rubygems] Use Kernel.singleton_classHiroshi SHIBATA2023-08-012-6/+3
| | | | https://github.com/rubygems/rubygems/commit/9be984f281
* [DOC] Fix a link [ci skip]Kazuhiro NISHIYAMA2023-08-011-0/+1
|
* Skip flaky test on SolarisPeter Zhu2023-07-311-0/+1
| | | | | | | This test is flaky on "SPARC Solaris 10 (gcc)" CI with this message: TestGCCompact#test_moving_objects_between_size_pools [test/ruby/test_gc_compact.rb:378]: Expected 499 to be >= 500.
* [ruby/yarp] Document building, more macro changesKevin Newton2023-07-313-9/+34
| | | | https://github.com/ruby/yarp/commit/4214f262d2
* [ruby/irb] Decouple `edit` and `show_source` commandsStan Lo2023-07-313-65/+71
| | | | | | | | | | | | | | | | (https://github.com/ruby/irb/pull/658) * Decouple `edit` command from `show_source` 2 commands should not depend on each other. If `edit` command also needs to find a source, the source finding logic should be extracted into a separate class. * Return nil if is not an actual file path * Refactor SourceFinder https://github.com/ruby/irb/commit/9790517a0c
* Fix default value of global_init_slotsPeter Zhu2023-07-312-1/+3
| | | | | Not setting a value to global_init_slots causes get_envparam_size to output a broken default value.
* addr2line.c: fix `DW_FORM_ref_addr` parsing for DWARF 2 (#8146)Yuta Saito2023-07-311-14/+26
| | | | | | | | | | | | | | | | | addr2line.c: fix DW_FORM_ref_addr parsing for DWARF 2 This fixes a crash when retrieving backtrace info with YJIT enabled on macOS with Rust 1.71.0. Since Rust 1.71.0, the DWARF info generated by the Rust compiler uses DW_FORM_ref_addr instead of DW_FORM_ref4 for pointers to other DIEs. DW_FORM_ref_addr representation in DWARF 2 is different from DWARF 3+, so we need to handle it separately. This patch fixes the parsing of DW_FORM_ref_addr for DWARF 2, which is the default DWARF version Rustc uses on macOS. See the DWARF 2.0.0 spec, section 7.5.4 Attribute Encodings https://dwarfstd.org/doc/dwarf-2.0.0.pdf https://bugs.ruby-lang.org/issues/19789
* Fix test_gc_parameter_init_slotsPeter Zhu2023-07-311-0/+1
| | | | | | If the stack is not cleared (e.g. compiling with -O0), then `ary` could remain on the stack, which would be marked. Clear the array first to make sure all the objects can be GC'd.
* [DOC] Update description of `Process.daemon` argumentsNobuyoshi Nakada2023-08-011-7/+6
| | | | These arguments can only be `true` or `false` now. Also add markups.
* Assert that at least one element has been embeddedPeter Zhu2023-07-311-5/+5
| | | | It's not guaranteed that the first element will always be embedded.
* Store initial slots per size poolPeter Zhu2023-07-312-45/+99
| | | | | | | | This commit stores the initial slots per size pool, configured with the environment variables `RUBY_GC_HEAP_INIT_SIZE_%d_SLOTS`. This ensures that the configured initial slots remains a low bound for the number of slots in the heap, which can prevent heaps from thrashing in size.
* `Refinement#refined_class` is now deprecatedNobuyoshi Nakada2023-07-311-1/+1
|
* Reuse Regexp ptr when recompilingPeter Zhu2023-07-311-10/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When matching an incompatible encoding, the Regexp needs to recompile. If `usecnt == 0`, then we can reuse the `ptr` because nothing else is using it. This avoids allocating another `regex_t`. This speeds up matches that switch to incompatible encodings by 15%. Branch: ``` Regex#match? with different encoding 1.431M (± 1.3%) i/s - 7.264M in 5.076153s Regex#match? with same encoding 16.858M (± 1.1%) i/s - 85.347M in 5.063279s ``` Base: ``` Regex#match? with different encoding 1.248M (± 2.0%) i/s - 6.342M in 5.083151s Regex#match? with same encoding 16.377M (± 1.1%) i/s - 82.519M in 5.039504s ``` Script: ``` regex = /foo/ str1 = "日本語" str2 = "English".force_encoding("ASCII-8BIT") Benchmark.ips do |x| x.report("Regex#match? with different encoding") do |times| i = 0 while i < times regex.match?(str1) regex.match?(str2) i += 1 end end x.report("Regex#match? with same encoding") do |times| i = 0 while i < times regex.match?(str1) i += 1 end end end ```
* Add Refinement#target and deprecate Refinement#refined_classShugo Maeda2023-07-313-4/+25
| | | | [Feature #19714]
* use inline cache for refinementsKoichi Sasada2023-07-317-19/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From Ruby 3.0, refined method invocations are slow because resolved methods are not cached by inline cache because of conservertive strategy. However, `using` clears all caches so that it seems safe to cache resolved method entries. This patch caches resolved method entries in inline cache and clear all of inline method caches when `using` is called. fix [Bug #18572] ```ruby # without refinements class C def foo = :C end N = 1_000_000 obj = C.new require 'benchmark' Benchmark.bm{|x| x.report{N.times{ obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; }} } _END__ user system total real master 0.362859 0.002544 0.365403 ( 0.365424) modified 0.357251 0.000000 0.357251 ( 0.357258) ``` ```ruby # with refinment but without using class C def foo = :C end module R refine C do def foo = :R end end N = 1_000_000 obj = C.new require 'benchmark' Benchmark.bm{|x| x.report{N.times{ obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; }} } __END__ user system total real master 0.957182 0.000000 0.957182 ( 0.957212) modified 0.359228 0.000000 0.359228 ( 0.359238) ``` ```ruby # with using class C def foo = :C end module R refine C do def foo = :R end end N = 1_000_000 using R obj = C.new require 'benchmark' Benchmark.bm{|x| x.report{N.times{ obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; obj.foo; }} }
* `calling->cd` instead of `calling->ci`Koichi Sasada2023-07-314-35/+46
| | | | | | | | | | | | | | | `struct rb_calling_info::cd` is introduced and `rb_calling_info::ci` is replaced with it to manipulate the inline cache of iseq while method invocation process. So that `ci` can be acessed with `calling->cd->ci`. It adds one indirection but it can be justified by the following points: 1) `vm_search_method_fastpath()` doesn't need `ci` and also `vm_call_iseq_setup_normal()` doesn't need `ci`. It means reducing `cd->ci` access in `vm_sendish()` can make it faster. 2) most of method types need to access `ci` once in theory so that 1 additional indirection doesn't matter.
* Update bundled gems list at 2023-07-31git2023-07-312-2/+2
|