aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Ensure origins for all included, prepended, and refined modulesJeremy Evans2020-06-039-48/+204
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes various issues when a module is included in or prepended to a module or class, and then refined, or refined and then included or prepended to a module or class. Implement by renaming ensure_origin to rb_ensure_origin, making it non-static, and calling it when refining a module. Fix Module#initialize_copy to handle origins correctly. Previously, Module#initialize_copy did not handle origins correctly. For example, this code: ```ruby module B; end class A def b; 2 end prepend B end a = A.dup.new class A def b; 1 end end p a.b ``` Printed 1 instead of 2. This is because the super chain for a.singleton_class was: ``` a.singleton_class A.dup B(iclass) B(iclass origin) A(origin) # not A.dup(origin) ``` The B iclasses would not be modified, so the includer entry would be still be set to A and not A.dup. This modifies things so that if the class/module has an origin, all iclasses between the class/module and the origin are duplicated and have the correct includer entry set, and the correct origin is created. This requires other changes to make sure all tests still pass: * rb_undef_methods_from doesn't automatically handle classes with origins, so pass it the origin for Comparable when undefing methods in Complex. This fixed a failure in the Complex tests. * When adding a method, the method cache was not cleared correctly if klass has an origin. Clear the method cache for the klass before switching to the origin of klass. This fixed failures in the autoload tests related to overridding require, without breaking the optimization tests. Also clear the method cache for both the module and origin when removing a method. * Module#include? is fixed to skip origin iclasses. * Refinements are fixed to use the origin class of the module that has an origin. * RCLASS_REFINED_BY_ANY is removed as it was only used in a single place and is no longer needed. * Marshal#dump is fixed to skip iclass origins. * rb_method_entry_make is fixed to handled overridden optimized methods for modules that have origins. Fixes [Bug #16852]
* Append subsec part instead of creating new stringNobuyoshi Nakada2020-06-031-1/+1
|
* Quarantine specs which fail frequently with CHECK_LEAKS=trueBenoit Daloze2020-06-031-0/+2
|
* Fixed up 56ca006784dNobuyoshi Nakada2020-06-031-6/+13
| | | | | Run lldb just before sending ABRT or KILL signal. Some tests terminate child processes by TERM signal intentionally.
* vm_invoke_proc_block: reduce recursion卜部昌平2020-06-031-4/+8
| | | | | According to nobu recursion can be longer than my expectation. Limit them here.
* vm_call_symbol: check stack overflow卜部昌平2020-06-031-0/+1
| | | | | | | | | VM stack could overflow here. The condition is when a symbol is passed to a block-taking method via &variable, and that symbol has never been used for actual method names (thus yielding that results in calling method_missing), and the VM stack is full (no single word left). This is a once-in-a-blue-moon event. Yet there is a very tiny room of stack overflow. We need to check that.
* vm_invoke_block: remove auto qualifier卜部昌平2020-06-031-3/+3
| | | | Was (harmless but) redundant.
* add benchmark for different block handlers卜部昌平2020-06-031-0/+27
|
* vm_insnhelper.c: add space [ci skip]卜部昌平2020-06-031-0/+6
| | | | Just cosmetic change to improve readability.
* vm_invoke_symbol_block: reduce MEMCPY卜部昌平2020-06-031-59/+84
| | | | | | | | | | | | | | | | | | This commit changes the number of calls of MEMCPY from... | send | &:sym -------------------------|-------|------- Symbol already interned | once | twice Symbol not pinned yet | none | once to: | send | &:sym -------------------------|-------|------- Symbol already interned | once | none Symbol not pinned yet | twice | once So it sacrifices exceptional situation for normal path.
* vm_invoke_symbol_block: call vm_call_opt_send卜部昌平2020-06-031-8/+33
| | | | | | Symbol#to_proc and Object#send are closely related each other. Why not share their implementations. By doing so we can skip recursive call of vm_exec(), which could benefit for speed.
* vm_invoke_block: force indirect jump卜部昌平2020-06-031-11/+11
| | | | | | | | | | | | | | This changeset slightly speeds up on my machine. Calculating ------------------------------------- before after Optcarrot Lan_Master.nes 38.33488426546287 40.89825082589147 fps 40.91288557922081 41.48687465359386 40.96591995270991 41.98499064664184 41.20461943032173 43.67314690779162 42.38344888176518 44.02777536251875 43.43563728880915 44.88695892714136 43.88082889062643 45.11226186242523
* vm_invoke_block: insertion of unused args卜部昌平2020-06-031-7/+7
| | | | | | | This makes it possible for vm_invoke_block to pass its passed arguments verbatimly to calling functions. Because they are tail-called the function calls can be strength-recuced into indirect jumps, which is a huge win.
* vm_invoke_block: eliminate goto卜部昌平2020-06-031-10/+16
| | | | Use recursion for better readability.
* vm_invoke_block: move logics around卜部昌平2020-06-031-12/+9
| | | | | Moved block handler -> captured block conversion from vm_invokeblock to each vm_invoke_*_block functions.
* * 2020-06-03 [ci skip]git2020-06-031-1/+1
|
* [ci skip] Enhanced Rdoc for Hash (#3162)Burdette Lamar2020-06-021-135/+254
| | | | | * Enhanced Rdoc for Hash * Enhanced Rdoc for Hash
* Add a spec for the new NoMethodError display of the receiverJean Boussier2020-06-021-0/+18
|
* Fixed `defined?` against protected method callNobuyoshi Nakada2020-06-022-1/+2
| | | | | | Protected methods are restricted to be called according to the class/module in where it is defined, not the actual receiver's class. [Bug #16931]
* Split test_defined_methodNobuyoshi Nakada2020-06-021-1/+22
|
* run lldb to investigate the stuck process.Koichi Sasada2020-06-021-2/+10
| | | | | | | Before sending signals (ABRT, KILL), use lldb to show the backtrace of a stuck process. This commit also reverts recent changes for terminate().
* vm_insnhelper.c: merge opt_eq_func / opt_eql_func卜部昌平2020-06-022-78/+48
| | | | | | | | These two function were almost identical, except in case of T_STRING/T_FLOAT. Why not merge them into one, and let the difference be handled in normal method calls (slowpath). This does not improve runtime performance for me, but at least reduces for instance rb_eql_opt from 653 bytes to 86 bytes on my machine, according to nm(1).
* Include the entire lambda expression in lambda ruleNobuyoshi Nakada2020-06-021-25/+6
|
* * 2020-06-02 [ci skip]git2020-06-021-1/+1
|
* Update extension.rdoc for Ruby 3 keyword argument separation [ci skip]Jeremy Evans2020-06-011-26/+0
| | | | This removes the discussion of behavior removed in Ruby 3.
* Extracted `excessed_comma` to unify ripper and make the order stableNobuyoshi Nakada2020-06-011-7/+14
|
* add more 2 sec.Koichi Sasada2020-06-011-1/+1
| | | | | | After sending SEGV signal, but no response. Try to add 2 more seconds. If we can not have a detailed log, we need to use gdb/lldb to show the backtrace.
* send SEGV to show backtrace.Koichi Sasada2020-06-011-1/+1
| | | | | send SEGV to terminate the remaining process before sending ABRT and KILL to show the backtrace.
* [DOC] relative filename `Kernel#.require` and `Kernel#.load` [ci skip]MSP-Greg2020-06-011-0/+2
|
* fix typo in Hash#delete docsS-H-GAMELINKS2020-06-011-1/+1
|
* Make sure rb_enc_str_new_static() is used when enc is NULLBenoit Daloze2020-06-011-2/+7
| | | | | | * The definition of the rb_enc_str_new_cstr macro depends on HAVE_BUILTIN___BUILTIN_CONSTANT_P. * It SEGV on mswin otherwise.
* * 2020-06-01 [ci skip]git2020-06-011-2/+2
|
* Update to ruby/spec@4e486faBenoit Daloze2020-05-3146-99/+634
|
* Update to ruby/mspec@e3abf6bBenoit Daloze2020-05-318-38/+97
|
* Fix error raised by Net::HTTPResponse#inflater if the block raisesBenoit Daloze2020-05-312-2/+70
| | | | * See https://bugs.ruby-lang.org/issues/13882#note-6
* Fix spec description for Net::HTTP.getBenoit Daloze2020-05-311-1/+1
|
* * 2020-05-31 [ci skip]git2020-05-311-1/+1
|
* compile.c: Mark cursor in debug listNobuyoshi Nakada2020-05-311-5/+5
|
* compile.c: Removed wrong conversionNobuyoshi Nakada2020-05-311-1/+1
|
* [DOC] refined `Kernel#.require` and `Kernel#.load` [ci skip]Nobuyoshi Nakada2020-05-301-6/+6
|
* Adjusted an indentNobuyoshi Nakada2020-05-301-1/+1
|
* Update NEWS / documentation with GC.start(compact:true)Aaron Patterson2020-05-292-0/+9
|
* Convert ip addresses to canonical form in ↵Jeremy Evans2020-05-291-0/+1
| | | | | | | | | Resolv::DNS::Requester::UnconnectedUDP#sender Otherwise, if the IP address given is not in canonical form, it won't match, and Resolv will ignore it. Fixes [Bug #16439]
* Combine sweeping and movingAaron Patterson2020-05-292-15/+140
| | | | | | | | | | | | | | | | | | | This commit combines the sweep step with moving objects. With this commit, we can do: ```ruby GC.start(compact: true) ``` This code will do the following 3 steps: 1. Fully mark the heap 2. Sweep + Move objects 3. Update references By default, this will compact in order that heap pages are allocated. In other words, objects will be packed towards older heap pages (as opposed to heap pages with more pinned objects like `GC.compact` does).
* [ci skip] Enhanced Rdoc for Hash (#3155)Burdette Lamar2020-05-291-58/+96
| | | | | * Enhanced Rdoc for Hash * Respond to review
* spec: add wsl guardYusuke Endoh2020-05-302-2/+13
| | | | | | | | | | WSL 2 is officially released. It uses Linux kernel, so almost all specs for Linux work on WSL, except one: gethostbyaddr. I guess network resolution in WSL is based on Windows, so the behavior seems a bit different from normal Linux. This change adds `platform_is_not :wsl` guard, and guards out the test in question.
* runnable.rb: ignore broken symlink error on Windows [ci skip]Nobuyoshi Nakada2020-05-301-2/+6
|
* [DOC] mentioned "explicit relative path" [ci skip]Nobuyoshi Nakada2020-05-301-10/+14
| | | | | `Kernel#.require` and `Kernel#.load` do not search also "explicit relative path" files, not only absolute paths, in the load path.
* * 2020-05-30 [ci skip]git2020-05-301-1/+1
|
* test/ruby/test_process.rb: GID.from_name may raise Errno:ESRCHYusuke Endoh2020-05-301-3/+9
| | | | | | | | | | | | | getgrnam(3) says: ``` ERRORS 0 or ENOENT or ESRCH or EBADF or EPERM or ... The given name or gid was not found. ``` Process::GID.from_name raises an ArgumentError for 0, but Errno::ESRCH for ESRCH. Actually, WSL 2 raises Errno::ESRCH. This change accepts all exceptions above.