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

59633 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada 7fd6077d98 [ruby/reline] Consider Reline::ANSI.input at prep
https://github.com/ruby/reline/commit/b111cde3c3
2019-12-22 01:57:35 +09:00
Alan Wu 85a337f986 Kernel#lambda: return forwarded block as non-lambda proc
Before this commit, Kernel#lambda can't tell the difference between a
directly passed literal block and one passed with an ampersand.

A block passed with an ampersand is semantically speaking already a
non-lambda proc. When Kernel#lambda receives a non-lambda proc, it
should simply return it.

Implementation wise, when the VM calls a method with a literal block, it
places the code for the block on the calling control frame and passes a
pointer (block handler) to the callee. Before this commit, the VM
forwards block arguments by simply forwarding the block handler, which
leaves the slot for block code unused when a control frame forwards its
block argument. I use the vacant space to indicate that a frame has
forwarded its block argument and inspect that in Kernel#lambda to detect
forwarded blocks.

This is a very ad-hoc solution and relies *heavily* on the way block
passing works in the VM. However, it's the most self-contained solution
I have.

[Bug #15620]
2019-12-21 09:08:52 -05:00
Alan Wu ddb6023d64 Add spec for capturing Kernel#lambda with Kernel#method 2019-12-21 09:08:52 -05:00
Alan Wu e0b336c8ce Add specs for calling into Kernel#lambda with super 2019-12-21 09:08:52 -05:00
Yusuke Endoh ea405ee8ed test/ruby/test_pattern_matching.rb: suppress "unused variable" warning 2019-12-21 10:06:14 +09:00
Jeremy Evans 9eded02446 Add Array#minmax, Range#minmax, and Proc#ruby2_keywords to NEWS 2019-12-20 10:47:56 -08:00
git 63ce77929a * 2019-12-21 [ci skip] 2019-12-21 00:07:13 +09:00
Nobuyoshi Nakada 484c1be895
Added `-W:experimental` command line option
[Feature #16420]
2019-12-20 23:51:17 +09:00
Nobuyoshi Nakada 07e595fdbd
Added `experimental` warning category
[Feature #16420]
2019-12-20 23:48:15 +09:00
Nobuyoshi Nakada dd7f0c87c9
Hoisted out new_case3 2019-12-20 23:43:38 +09:00
Nobuyoshi Nakada a84ad24386
Added -W: command line option
To manage `Warning[category]` flags.  Only `-W:deprecated` and
`-W:no-deprecated` are available now.  [Feature #16345]
2019-12-20 23:05:22 +09:00
Nobuyoshi Nakada 6876aa38f6
Added `FEATURE_SET_RESTORE` macro 2019-12-20 22:58:09 +09:00
Yusuke Endoh 1fea3a7636 NEWS: Update the explanation of pattern matching
Add an example of "<expr> in <pattern>", an example of
NoMatchingPatternError, and mention that the slides are slightly
obsolete.
2019-12-20 21:37:46 +09:00
Yusuke Endoh f7aee58498 vm_args.c: rephrase the warning message of keyword argument separation
(old)
test.rb:4: warning: The last argument is used as the keyword parameter
test.rb:1: warning: for `foo' defined here; maybe ** should be added to the call?

(new)
test.rb:4: warning: The last argument is used as keyword parameters; maybe ** should be added to the call
test.rb:1: warning: The called method `foo' is defined here
2019-12-20 19:41:15 +09:00
Nobuyoshi Nakada 2b2030f265
Refined the warning message for $, and $;
[Bug #16438]
2019-12-20 15:09:23 +09:00
Nobuyoshi Nakada 7a94225e7d
Refined the warning message for numbered-parameter like variables
[Bug #16438]
2019-12-20 14:58:51 +09:00
Nobuyoshi Nakada a8bddb3a18
Refined the warning message for numbered-parameter like variables
[Bug #16438]
2019-12-20 14:34:32 +09:00
Nobuyoshi Nakada 435a4ca2a3
Makes the receiver to FrozenError.new a keyword parameter
[Feature #16419]
2019-12-20 14:18:20 +09:00
NARUSE, Yui 216b62aa87 use UTC to use previous day in midnight 2019-12-20 14:10:57 +09:00
Nobuyoshi Nakada e68999c82c
Fixed misspellings
Fixed misspellings reported at [Bug #16437], for default gems.
2019-12-20 12:19:45 +09:00
Hiroshi SHIBATA e672494cd7
Merge RubyGems 3.1.2 2019-12-20 11:50:32 +09:00
Nobuyoshi Nakada fac60be324
shell.rb is no longer bundled [ci skip] 2019-12-20 09:40:06 +09:00
Nobuyoshi Nakada db16629008
Fixed misspellings
Fixed misspellings reported at [Bug #16437], only in ruby and rubyspec.
2019-12-20 09:32:42 +09:00
Nobuyoshi Nakada 2898367b3a
Warn also numbered parameter like methods 2019-12-20 08:18:19 +09:00
Kazuhiro NISHIYAMA 3816cd945d
Add `URI#open` to warning message 2019-12-20 01:40:00 +09:00
git 844f1fada6 * 2019-12-20 [ci skip] 2019-12-20 01:37:11 +09:00
Nobuyoshi Nakada 27ddb6e998
Warn also numbered parameter like parameters
[Feature #16433]
2019-12-20 01:25:34 +09:00
Nobuyoshi Nakada c6c67254fb
Added rb_warn_deprecated 2019-12-19 09:52:17 +09:00
Nobuyoshi Nakada 7aa8a78674
Manage deprecation warnings about keyword argument 2019-12-19 09:52:17 +09:00
Nobuyoshi Nakada 9bf9de3d9d
Made the warning for deprecated constants follow the category flag 2019-12-19 09:52:16 +09:00
Nobuyoshi Nakada 76035e5bb6
Adjusted the format 2019-12-19 09:52:16 +09:00
git e732e0074e * 2019-12-19 [ci skip] 2019-12-19 02:08:51 +09:00
Aaron Patterson 1e88f6eb95
Refactor free page insertion
I am trying to fix this error:

  http://ci.rvm.jp/results/trunk-gc_compact@silicon-docker/2491596

Somehow we have a page in the `free_pages` list that is full.  This
commit refactors the code so that any time we add a page to the
`free_pages` list, we do it via `heap_add_freepage`.  That function then
asserts that the free slots on that page are not 0.
2019-12-18 09:08:25 -08:00
Hiroshi SHIBATA efbc0d499c
Merge bundler-2.1.1 from bundler/bundler 2019-12-18 14:53:19 +09:00
卜部昌平 fa7fa5c86b delete rb_vm_call()
Nobody uses it any longer.
2019-12-18 14:14:51 +09:00
卜部昌平 dcb603bbdb describe mc_miss_reuse_call [ci skip] 2019-12-18 14:14:51 +09:00
Nobuyoshi Nakada fcd8bafd08
Use a temporary file for chown test
Errno::EROFS may occur when the source tree is placed in a
read-only filesystem.
2019-12-18 13:35:58 +09:00
Nobuyoshi Nakada c147eeff7c [ruby/io-console] Skip Interrupt test on Linux
Hangs up only in ruby/ruby on Travis-CI.

https://github.com/ruby/io-console/commit/de39aa6dd6
2019-12-18 13:30:52 +09:00
卜部昌平 f054f11a38 per-method serial number
Methods and their definitions can be allocated/deallocated on-the-fly.
One pathological situation is when a method is deallocated then another
one is allocated immediately after that.  Address of those old/new method
entries/definitions can be the same then, depending on underlying
malloc/free implementation.

So pointer comparison is insufficient.  We have to check the contents.
To do so we introduce def->method_serial, which is an integer unique to
that specific method definition.

PS: Note that method_serial being uintptr_t rather than rb_serial_t is
intentional.  This is because rb_serial_t can be bigger than a pointer
on a 32bit system (rb_serial_t is at least 64bit).  In order to preserve
old packing of struct rb_call_cache, rb_serial_t is inappropriate.
2019-12-18 12:52:28 +09:00
Nobuyoshi Nakada 77e3078ede [ruby/io-console] Set raw mode strictly same as cfmakeraw
* Default VMIN and VTIME to minimum input.
* Disable parity check bits explicitly.
* Disable all bits for flow control on input.

Co-Authored-By: NARUSE, Yui <naruse@airemix.jp>

https://github.com/ruby/io-console/commit/5ce201a686
2019-12-18 10:33:05 +09:00
John Hawthorn 254477248c Skip optimized method check for most method IDs
Previously every time a method was defined on a module, we would
recursively walk all subclasses to see if the module was included in a
class which the VM optimizes for (such as Integer#+).

For most method definitions we can tell immediately that this won't be
the case based on the method's name. To do this we just keep a hash with
method IDs of optimized methods and if our new method isn't in that list
we don't need to check subclasses at all.
2019-12-17 09:19:00 -08:00
John Hawthorn 9245462499 Replace debug test with assertion
It's a Ruby bug if this ever happens check it as an assertion instead of
paying the cost of the check every time.
2019-12-17 09:19:00 -08:00
John Hawthorn a01d22b8c1 Check type with BUILTIN_TYPE in method cache clear
We know that this is a heap-allocated object (a CLASS, MODULE, or
ICLASS) so we don't need to check if it is an immediate value. This
should be very slightly faster.
2019-12-17 09:19:00 -08:00
John Hawthorn 8e56d3a6ab Define PREV_CLASS_SERIAL
Avoids genereating a "throwaway" sentinel class serial. There wasn't any
read harm in doing so (we're at no risk of exhaustion and there'd be no
measurable performance impact), but if feels cleaner that all class
serials actually end up assigned and used (especially now that we won't
overwrite them in a single method definition).
2019-12-17 09:19:00 -08:00
John Hawthorn d7a50a5cc6 Avoid revisiting seen nodes clearing method cache
rb_clear_method_cache_by_class calls rb_class_clear_method_cache
recursively on subclasses, where it will bump the class serial and clear
some other data (callable_m_tbl, and some mjit data).

Previously this could end up taking a long time to clear all the classes
if the module was included a few levels deep and especially if there
were multiple paths to it in the dependency tree (ie. a class includes
two modules which both include the same other module) as we end up
revisiting class/iclass/module objects multiple times.

This commit avoids revisiting the same object, by short circuiting when
revisit the same object. We can check this efficiently by comparing the
class serial of each object we visit with the next class serial at the
start. We know that any objects with a higher class serial have already
been visited.
2019-12-17 09:19:00 -08:00
git 8a40dce0ff * 2019-12-18 [ci skip] 2019-12-18 00:08:43 +09:00
Nobuyoshi Nakada bcec03af05
Revert "Skip interruptible raw mode test on Travis-CI"
This reverts commit 65731a1330.
2019-12-18 00:08:21 +09:00
Nobuyoshi Nakada 07ed8f2f91 [ruby/io-console] Skip interrupt
https://github.com/ruby/io-console/commit/8ed5a2bcc3
2019-12-18 00:08:04 +09:00
Nobuyoshi Nakada 905a926ea8 [ruby/io-console] Timeout in the child process
https://github.com/ruby/io-console/commit/b8411689a5
2019-12-17 23:55:24 +09:00
Nobuyoshi Nakada 4b7d27ca0d [ruby/io-console] Use IO.console instead of STDIN
https://github.com/ruby/io-console/commit/9e3ec5b936
2019-12-17 23:55:22 +09:00