Граф коммитов

61717 Коммитов

Автор SHA1 Сообщение Дата
卜部昌平 de5e0f7c06 vm_invoke_proc_block: reduce recursion
According to nobu recursion can be longer than my expectation.  Limit
them here.
2020-06-03 16:13:47 +09:00
卜部昌平 b61e82eac9 vm_call_symbol: check stack overflow
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.
2020-06-03 16:13:47 +09:00
卜部昌平 ba20e6080d vm_invoke_block: remove auto qualifier
Was (harmless but) redundant.
2020-06-03 16:13:47 +09:00
卜部昌平 d4015cfee3 add benchmark for different block handlers 2020-06-03 16:13:47 +09:00
卜部昌平 6302b96368 vm_insnhelper.c: add space [ci skip]
Just cosmetic change to improve readability.
2020-06-03 16:13:47 +09:00
卜部昌平 054c2fdfdf vm_invoke_symbol_block: reduce MEMCPY
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.
2020-06-03 16:13:47 +09:00
卜部昌平 36322942db vm_invoke_symbol_block: call vm_call_opt_send
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.
2020-06-03 16:13:47 +09:00
卜部昌平 973883aaa1 vm_invoke_block: force indirect jump
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
2020-06-03 16:13:47 +09:00
卜部昌平 796f9edae0 vm_invoke_block: insertion of unused args
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.
2020-06-03 16:13:47 +09:00
卜部昌平 ec87a58d55 vm_invoke_block: eliminate goto
Use recursion for better readability.
2020-06-03 16:13:47 +09:00
卜部昌平 11c70b3162 vm_invoke_block: move logics around
Moved block handler -> captured block conversion from vm_invokeblock to
each vm_invoke_*_block functions.
2020-06-03 16:13:47 +09:00
git 87bc95e7c7 * 2020-06-03 [ci skip] 2020-06-03 00:53:44 +09:00
Burdette Lamar afefcade98
[ci skip] Enhanced Rdoc for Hash (#3162)
* Enhanced Rdoc for Hash

* Enhanced Rdoc for Hash
2020-06-02 10:53:25 -05:00
Jean Boussier ae8362fdc8 Add a spec for the new NoMethodError display of the receiver 2020-06-02 16:57:32 +02:00
Nobuyoshi Nakada d05f04d27d
Fixed `defined?` against protected method call
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]
2020-06-02 19:01:56 +09:00
Nobuyoshi Nakada c53aebb1d2
Split test_defined_method 2020-06-02 18:58:31 +09:00
Koichi Sasada 56ca006784 run lldb to investigate the stuck process.
Before sending signals (ABRT, KILL), use lldb to show the
backtrace of a stuck process.

This commit also reverts recent changes for terminate().
2020-06-02 17:21:03 +09:00
卜部昌平 40ced763b4 vm_insnhelper.c: merge opt_eq_func / opt_eql_func
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).
2020-06-02 12:38:01 +09:00
Nobuyoshi Nakada 27bef64862
Include the entire lambda expression in lambda rule 2020-06-02 09:06:49 +09:00
git 79a8ed0765 * 2020-06-02 [ci skip] 2020-06-02 07:21:23 +09:00
Jeremy Evans d2c48705ae Update extension.rdoc for Ruby 3 keyword argument separation [ci skip]
This removes the discussion of behavior removed in Ruby 3.
2020-06-01 15:18:50 -07:00
Nobuyoshi Nakada cadd2245f7
Extracted `excessed_comma` to unify ripper and make the order stable 2020-06-01 18:26:34 +09:00
Koichi Sasada 7b9527ce74 add more 2 sec.
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.
2020-06-01 17:03:27 +09:00
Koichi Sasada 3591703b31 send SEGV to show backtrace.
send SEGV to terminate the remaining process before sending
ABRT and KILL to show the backtrace.
2020-06-01 10:15:03 +09:00
MSP-Greg 4cb8b49d41 [DOC] relative filename `Kernel#.require` and `Kernel#.load` [ci skip] 2020-06-01 09:20:57 +09:00
S-H-GAMELINKS 6a0405def2 fix typo in Hash#delete docs 2020-06-01 08:11:05 +09:00
Benoit Daloze b7e1de117e Make sure rb_enc_str_new_static() is used when enc is NULL
* 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 00:30:41 +02:00
git bb966b5dee * 2020-06-01 [ci skip] 2020-06-01 01:23:43 +09:00
Benoit Daloze 34776105c8 Update to ruby/spec@4e486fa 2020-05-31 18:22:49 +02:00
Benoit Daloze f4502b001a Update to ruby/mspec@e3abf6b 2020-05-31 18:22:47 +02:00
Benoit Daloze 5a79d8e050 Fix error raised by Net::HTTPResponse#inflater if the block raises
* See https://bugs.ruby-lang.org/issues/13882#note-6
2020-05-31 12:48:14 +02:00
Benoit Daloze 5b4b82b712 Fix spec description for Net::HTTP.get 2020-05-31 12:48:14 +02:00
git d6f8bdc055 * 2020-05-31 [ci skip] 2020-05-31 03:19:58 +09:00
Nobuyoshi Nakada 6dcd10ce56
compile.c: Mark cursor in debug list 2020-05-31 03:07:30 +09:00
Nobuyoshi Nakada 2c711273bb
compile.c: Removed wrong conversion 2020-05-31 03:05:10 +09:00
Nobuyoshi Nakada e10798b3a3
[DOC] refined `Kernel#.require` and `Kernel#.load` [ci skip] 2020-05-30 22:04:49 +09:00
Nobuyoshi Nakada 57fd44d374
Adjusted an indent 2020-05-30 21:20:50 +09:00
Aaron Patterson 9b8825b6f9
Update NEWS / documentation with GC.start(compact:true) 2020-05-29 15:59:42 -07:00
Jeremy Evans 04b5203a03 Convert ip addresses to canonical form in 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]
2020-05-29 15:59:27 -07:00
Aaron Patterson 02b216e5a7
Combine sweeping and moving
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).
2020-05-29 15:24:32 -07:00
Burdette Lamar c1f6552b58
[ci skip] Enhanced Rdoc for Hash (#3155)
* Enhanced Rdoc for Hash

* Respond to review
2020-05-29 13:53:11 -05:00
Yusuke Endoh e73e504e2f spec: add wsl guard
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.
2020-05-30 01:52:38 +09:00
Nobuyoshi Nakada 0d1f0cd9cc
runnable.rb: ignore broken symlink error on Windows [ci skip] 2020-05-30 01:15:23 +09:00
Nobuyoshi Nakada 0d30f42813
[DOC] mentioned "explicit relative path" [ci skip]
`Kernel#.require` and `Kernel#.load` do not search also "explicit
relative path" files, not only absolute paths, in the load path.
2020-05-30 01:09:16 +09:00
git 2c8821c0d2 * 2020-05-30 [ci skip] 2020-05-30 00:17:02 +09:00
Yusuke Endoh 58bc97628c test/ruby/test_process.rb: GID.from_name may raise Errno:ESRCH
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.
2020-05-30 00:16:44 +09:00
Nobuyoshi Nakada 3ed79a97b0
doc/contributing.rdoc: Removed obsolete platforms [ci skip] 2020-05-29 23:49:15 +09:00
Jeremy Evans 2ecfb88ee5 Correctly remove temporary directory if path yielded is mutated
Another approach would be to freeze the string, but that could
cause backwards compatibility issues.

Fixes [Bug #16918]
2020-05-29 07:06:46 -07:00
Takashi Kokubun 0bd025ad69
Add a debug_counter for JIT cancel on leave 2020-05-28 22:45:35 -07:00
Koichi Sasada d300a73441 RUBY_ASSERT_NOASSUME
If __builtin_assume() is enables and RUBY_DEBUG=0, RUBY_ASSERT(expr)
will be compiled to __builtin_assume(expr) and compiler can assume
expr is true and apply aggressive optimizations. However we observed
doubtful behavior because of compiler optimizations, we introduce
new macro RUBY_ASSERT_NOASSUME to disable __builtin_assume().
With this macro, we can try without __builtin_assume().
2020-05-29 13:50:58 +09:00