summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Remove MIN_PRE_ALLOC_SIZE from Strings.Matt Valentine-House2023-01-132-13/+25
| | | | | This optimisation is no longer helpful now that we use VWA to allocate strings in larger size pools where they can be embedded.
* [DOC] Add gem lists to NEWS.md automaticallyNobuyoshi Nakada2023-01-131-4/+9
|
* [DOC] Changed gem list style in NEWS.mdNobuyoshi Nakada2023-01-132-15/+16
|
* [DOC] Extract tool/update-NEWS-gemlist.rbNobuyoshi Nakada2023-01-133-53/+36
|
* [ruby/error_highlight] Identify which node in `Foo::Bar::Baz` causes a NameErrorYusuke Endoh2023-01-132-0/+79
| | | | | | | | | | | | | In Ruby 3.2 or later, a nested constant access like `Foo::Bar::Baz` is compiled to one instruction by the optimization https://github.com/ruby/ruby/pull/6187 We try to spot which sub-node caues a NameError in question based on the constant name. We will give up if the same constant name is accessed in a nested access (`Foo::Foo`). Fixes https://github.com/ruby/error_highlight/pull/31 https://github.com/ruby/error_highlight/commit/0a4db7da0a
* Skip time-related assertions on /dev/nullNobuyoshi Nakada2023-01-131-3/+6
|
* fix `unused variables` warningKoichi Sasada2023-01-131-3/+4
| | | | Now `ccs` is not needed there.
* Return 0 if there is no CFP on the EC yetAaron Patterson2023-01-121-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | StackProf uses a signal handler to call `rb_profile_frames`. Signals are delivered to threads randomly, and can be delivered after the thread has been created but before the CFP has been established on the EC. This commit returns early if there is no CFP to use. Here is some info from the core files we are seeing. Here you can see the CFP on the current EC is 0x0: ``` (gdb) p ruby_current_ec $20 = (struct rb_execution_context_struct *) 0x7f3481301b50 (gdb) p ruby_current_ec->cfp $21 = (rb_control_frame_t *) 0x0 ``` Here is where VM_FRAME_CFRAME_P gets a 0x0 CFP: ``` 6 VM_FRAME_CFRAME_P (cfp=0x0) at vm_core.h:1350 7 VM_FRAME_RUBYFRAME_P (cfp=<optimized out>) at vm_core.h:1350 8 rb_profile_frames (start=0, limit=2048, buff=0x7f3493809590, lines=0x7f349380d590) at vm_backtrace.c:1587 ``` Down the stack we can see this is happening after thread creation: ``` 19 0x00007f3495bf9420 in <signal handler called> () at /lib/x86_64-linux-gnu/libpthread.so.0 20 0x000055d531574e55 in thread_start_func_2 (th=<optimized out>, stack_start=<optimized out>) at thread.c:676 21 0x000055d531575b31 in thread_start_func_1 (th_ptr=<optimized out>) at thread_pthread.c:1170 22 0x00007f3495bed609 in start_thread (arg=<optimized out>) at pthread_create.c:477 23 0x00007f3495b12133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 ```
* [DOC] Fix markup [ci skip]Kazuhiro NISHIYAMA2023-01-131-1/+1
|
* Do not use VM stack for splat arg on cfuncKoichi Sasada2023-01-133-12/+200
| | | | | | | | | | | | | | On the cfunc methods, if a splat argument is given, all array elements are expanded on the VM stack and it can cause SystemStackError. The idea to avoid it is making a hidden array to contain all parameters and use this array as an argv. This patch is reviesed version of https://github.com/ruby/ruby/pull/6816 The main change is all changes are closed around calling cfunc logic. Fixes [Bug #4040] Co-authored-by: Jeremy Evans <code@jeremyevans.net>
* Fix write barrier order for `klass` to `cme` edgeAlan Wu2023-01-123-8/+8
| | | | | | | | | | | | | | | | | | | | Previously, the following crashes with `CFLAGS=-DRGENGC_CHECK_MODE=2 -DRUBY_DEBUG=1 -fno-inline`: $ ./miniruby -e 'GC.stress = true; Marshal.dump({})' It crashes with a write barrier (WB) miss assertion on an edge from the `Hash` class object to a newly allocated negative method entry. This is due to usages of vm_ccs_create() running the WB too early, before the method entry is inserted into the cc table, so before the reference edge is established. The insertion can trigger GC and promote the class object, so running the WB after the insertion is necessary. Move the insertion into vm_ccs_create() and run the WB after the insertion. Discovered on CI: http://ci.rvm.jp/results/trunk-asserts@ruby-sp2-docker/4391770
* YJIT: Do not refer to an undefined constant (#7112)Takashi Kokubun2023-01-121-6/+3
|
* Enable `clippy` checks for yjit in CI (#7093)Ian Ker-Seymer2023-01-127-29/+39
| | | | | | | | | | | * Add job to check clippy lints in CI * Address all remaining clippy lints * Check lints on arm64 as well * Apply latest clippy lints * Do not exit 0 on clippy warnings
* Add str_enc_copy_directPeter Zhu2023-01-121-5/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds str_enc_copy_direct, which is like str_enc_copy but does not check the frozen status of str1 and does not check the validity of the encoding of str2. This makes certain string operations ~5% faster. ```ruby puts(Benchmark.measure do 100_000_000.times do "a".downcase end end) ``` Before this patch: ``` 7.587598 0.040858 7.628456 ( 7.669022) ``` After this patch: ``` 7.133128 0.039809 7.172937 ( 7.183124) ```
* [ruby/irb] Avoid calling private methods on the main objectStan Lo2023-01-122-4/+17
| | | | | | | | | | | | (https://github.com/ruby/irb/pull/498) When the main object is frozen, `IRB` wraps a `SimpleDelegator` around it. But because `SimpleDelegator` doesn't delegate private methods, methods like `require_relative` or `const_get` would cause error, which are needed for lazily loading commands. This commit works around this limitation by avoiding those private method calls when setting up command execution.
* Update bundled gems list at b7598b535e49d316110aa96542a746 [ci skip]git2023-01-121-0/+1
|
* Bump up typeprof-0.21.4Hiroshi SHIBATA2023-01-121-1/+1
|
* Try to use https://github.com/ruby/rbs/pull/1207Hiroshi SHIBATA2023-01-121-1/+1
|
* [ruby/irb] Remove redundant argument defaults from some RubyLexStan Lo2023-01-121-8/+8
| | | | | | | | | | | | | | methods (https://github.com/ruby/irb/pull/502) * Remove unnecessary parameter defaults These methods are always called with tokens specified. So their default `@tokens` value is never used and is misleading. * Remove unnecessary context default * Require tokens for `RubyLex#check_state`
* [ruby/reline] Update to Unicode 15.0.0elfham2023-01-121-56/+88
| | | | | | | | (https://github.com/ruby/reline/pull/437) * Update to Unicode 14.0.0 * Update to Unicode 15.0.0
* Assert possible hash functions in RHASH_ST_TABLE (#7107)Takashi Kokubun2023-01-111-0/+4
| | | | | | | | | | Because of the function pointer, it's hard to figure out what hash functions could be used in Hash objects when st_lookup is used. Having this assertion makes it easier to understand what hash_stlike_lookup could possibly do. (AR uses only rb_any_hash) For example, this clarifies that hash_stlike_lookup never calls a #hash method when a key is T_STRING or T_SYMBOL.
* [ruby/mutex_m] Avoid anonymous evalJean Boussier2023-01-122-7/+26
| | | | | | It makes it hard to locate code when profiling etc. https://github.com/ruby/mutex_m/commit/8760ab19ec
* [ruby/mutex_m] Drop to support Ruby 2.4Hiroshi SHIBATA2023-01-121-0/+1
| | | | https://github.com/ruby/mutex_m/commit/9245b9a63a
* Suppressing installation messages with test-bundlerHiroshi SHIBATA2023-01-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Ignoring the following messages: ``` (snip) -e 'load "spec/bundler/support/bundle.rb"' -- install --gemfile=tool/bundler/dev_gems.rb Using rake 13.0.6 Using bundler 2.5.0.dev Using diff-lcs 1.5.0 Using parallel 1.22.1 Using parallel_tests 2.32.0 Using power_assert 2.0.2 Using rb_sys 0.9.52 Using rspec-support 3.12.0 Using rspec-core 3.12.0 Using rspec-expectations 3.12.0 Using rspec-mocks 3.12.1 Using test-unit 3.5.5 Using uri 0.12.0 Using webrick 1.7.0 Bundle complete! 11 Gemfile dependencies, 14 gems now installed. Gems in the groups 'lint' and 'doc' were not installed. Use `bundle info [gemname]` to see where a bundled gem is installed. ```
* enhance build matrix卜部昌平2023-01-122-0/+2
|
* Strip trailing spaces [ci skip]Nobuyoshi Nakada2023-01-123-4/+4
|
* [ruby/reline] Pass unmodifined lines(that does not include escapetomoya ishida2023-01-123-4/+33
| | | | | | | | | sequence) to check_multiline_prompt (https://github.com/ruby/reline/pull/458) * pass unmodified lines to check_multiline_prompt * Add test to check that output modified by output_modifier_proc is not passed to prompt_proc
* Generate parser-text.rb with bcdc058e50674aedb180eea91e0fdb15bcf529dbHiroshi SHIBATA2023-01-121-4/+4
|
* [ruby/racc] Get rid of anonymous eval callsJean Boussier2023-01-123-8/+8
| | | | | | | Things declared in anonymous eval are always annoying to locate. (profilers, etc) https://github.com/ruby/racc/commit/f304205256
* [ruby/racc] Make racc Ractor compatibleMasataka Pocke Kuwabara2023-01-1221-13/+55
| | | | https://github.com/ruby/racc/commit/1948de9d1d
* [ruby/irb] Formatting to header stylesHiroshi SHIBATA2023-01-1133-133/+10
| | | | https://github.com/ruby/irb/commit/cef125850d
* [ruby/irb] After Ruby 2.0, coding is always utf-8Hiroshi SHIBATA2023-01-111-1/+0
| | | | https://github.com/ruby/irb/commit/7a94bc4135
* [ruby/irb] Removed Release Version and Revisions for old VCS softwareHiroshi SHIBATA2023-01-1135-71/+0
| | | | https://github.com/ruby/irb/commit/07fae94862
* [ruby/irb] Drop unused arguments in `RubyLex`Stan Lo2023-01-112-12/+7
| | | | | | | | | | | | | (https://github.com/ruby/irb/pull/504) * Simplify `RubyLex#set_prompt` It's optional argument is never used by any caller. * Remove the optional `p` argument from `RubyLex#set_input` The argument is only used in a test case, which can be easily replaced by a block argument.
* YJIT: Add a few asm comments (#7105)Takashi Kokubun2023-01-112-2/+8
| | | | | | | * YJIT: Add a few asm comments * YJIT: Clarify exiting insns * YJIT: Fix cargo test
* Remove unnecessary set of INVALID_SHAPE_ID in rb_callcacheJemma Issroff2023-01-111-1/+0
| | | | We don't use this value, so there's no need to set it.
* Move classpath to rb_classext_tPeter Zhu2023-01-114-38/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit moves the classpath (and tmp_classpath) from instance variables to the rb_classext_t. This improves performance as we no longer need to set an instance variable when assigning a classpath to a class. I benchmarked with the following script: ```ruby name = :MyClass puts(Benchmark.measure do 10_000_000.times do |i| Object.const_set(name, Class.new) Object.send(:remove_const, name) end end) ``` Before this patch: ``` 5.440119 0.025264 5.465383 ( 5.467105) ``` After this patch: ``` 4.889646 0.028325 4.917971 ( 4.942678) ```
* Make variation_count an unsigned charPeter Zhu2023-01-111-2/+7
| | | | | Since SHAPE_MAX_VARIATIONS is 8, it can easily fit inside an unsigned char.
* [DOC] Mention the conditional regexpNobuyoshi Nakada2023-01-111-0/+9
|
* Remove check for RCLASS_EXT in variable.cPeter Zhu2023-01-111-1/+0
| | | | | A class/module should always have a RCLASS_EXT, so we shouldn't need to check that it exists.
* Skip rbs Encoding#replicate testBenoit Daloze2023-01-111-0/+1
|
* Remove Encoding#replicateBenoit Daloze2023-01-118-113/+203
|
* [ruby/reline] Reset IOGate in test_resetPhillip Hellewell2023-01-113-2/+2
| | | | https://github.com/ruby/reline/commit/331c1094ef
* [ruby/reline] Change IOGate back to GeneralIOPhillip Hellewell2023-01-112-0/+2
| | | | | | Staying with ANSI can cause side effects with other tests. https://github.com/ruby/reline/commit/ba36067802
* Suppressing pending messages with RSpecHiroshi SHIBATA2023-01-112-6/+12
|
* [ruby/psych] Get rid of anonymous eval callsJean Boussier2023-01-114-7/+7
| | | | | | Things declared in anonymous eval are always annoying to locate. https://github.com/ruby/psych/commit/38871ad4e5
* [ruby/set] Avoid the `block or return` pattern to save Proc allocationsJean Boussier2023-01-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using the block param in a boolean context like this cause it to be allocated. Using it with an `if` or `unless` was optimized in 3.2 (https://github.com/ruby/ruby/pull/6286) but using it with `or` or `and` wasn't. ```ruby def foo(&block) block or return 1 end puts RubyVM::InstructionSequence.of(method(:foo)).disasm == disasm: #<ISeq:foo@(irb):11 (11,0)-(13,3)> (catch: false) local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: 0, kw: -1@-1, kwrest: -1]) [ 1] block@0<Block> 0000 getblockparam block@0, 0 ( 12)[LiCa] 0003 dup 0004 branchif 10 0006 pop 0007 putobject_INT2FIX_1_ 0008 leave [Re] 0009 putnil 0010 leave ``` versus ``` def foo(&block) return 1 if block end puts RubyVM::InstructionSequence.of(method(:foo)).disasm == disasm: #<ISeq:foo@(irb):15 (15,0)-(17,3)> (catch: false) local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: 0, kw: -1@-1, kwrest: -1]) [ 1] block@0<Block> 0000 getblockparamproxy block@0, 0 ( 16)[LiCa] 0003 branchunless 7 0005 putobject_INT2FIX_1_ 0006 leave ( 17)[Re] 0007 putnil ( 16) 0008 leave ``` https://github.com/ruby/set/commit/e89da977d4
* Skip unfixed assertion about objspace/dump_allKoichi Sasada2023-01-111-2/+6
| | | | | | | | | | | | | | | | | ``` {"address":"0x7f8c03e9fcf0", "type":"STRING", "shape_id":10, "slot_size":40, "class":"0x7f8c00dbed98", "frozen":true, "embedded":true, "fstring":true, "bytesize":5, "value":"TEST2", "encoding":"US-ASCII", "coderange":"7bit", "memsize":40, "flags":{"wb_protected":true}} {"address":"0x7f8c03e9ffc0", "type":"STRING", "shape_id":0, "slot_size":40, "class":"0x7f8c00dbed98", "embedded":true, "bytesize":5, "value":"TEST2", "encoding":"US-ASCII", "coderange":"7bit", "memsize":40, "flags":{"wb_protected":true}} {"address":"0x7f8c03e487c0", "type":"STRING", "shape_id":0, "slot_size":40, "class":"0x7f8c00dbed98", "embedded":true, "bytesize":5, "value":"TEST2", "encoding":"UTF-8", "coderange":"unknown", "file":"-", "line":4, "method":"dump_my_heap_please", "generation":1, "memsize":40, "flags":{"wb_protected":true}} 1) Failure: TestObjSpace#test_dump_all [/tmp/ruby/src/trunk-gc-asserts/test/objspace/test_objspace.rb:622]: number of strings. <2> expected but was <3>. ``` This failure only occurred on a ruby built with `DEFS=\"-DRGENGC_CHECK_MODE=2\""` and only on a specific machine (Docker container) and difficult to reproduce, so skip this failure to check other failures.
* Remove about ext/psych/yaml which is no longer bundled [ci skip]Kazuhiro NISHIYAMA2023-01-111-27/+1
|
* Differentiate T_ARRAY and array subclasses (#7091)Aaron Patterson2023-01-102-8/+22
| | | | | | | | | | | | | * Differentiate T_ARRAY and array subclasses This commit teaches the YJIT context the difference between Arrays (objects with type T_ARRAY and class rb_cArray) vs Array subclasses (objects with type T_ARRAY but _not_ class rb_cArray). It uses this information to reduce the number of guards emitted when using `jit_guard_known_klass` with rb_cArray, notably opt_aref * Update yjit/src/core.rs Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>