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

64266 Коммитов

Автор SHA1 Сообщение Дата
Koichi Sasada 98dca85573 tuning vm_setivar_slowpath() more.
specify inline/noinline code for is_attr condition.
2020-12-16 14:20:20 +09:00
Kenta Murata 1bafb3cb47
[memory_view] Make MemoryView API Ractor-safe (#3911)
* memory_view.c: make Ractor-safe

* test/ruby/test_memory_view.rb: Add test_ractor

* memory_view: fix typo

* memory_view.c: Use st_update in unregster_exported_object

* memory_view: update dependency
2020-12-16 13:43:56 +09:00
Koichi Sasada 1e11c12a06 remove unused function 2020-12-16 13:30:34 +09:00
Koichi Sasada 5499651ee7 tuning ivar set
* make rb_init_iv_list() simple
* introduce vm_setivar_slowpath() for cache miss cases

../clean/miniruby is 647ee6f091.

Calculating -------------------------------------
                      ./miniruby  ../clean/miniruby  ../ruby_2_7/miniruby
         vm_ivar_init     7.388M             6.814M                5.771M i/s -     30.000M times in 4.060420s 4.402534s 5.198781s
vm_ivar_init_subclass     2.158M             2.147M                1.974M i/s -      3.000M times in 1.390328s 1.397587s 1.519951s
          vm_ivar_set   128.607M            97.931M              140.668M i/s -     30.000M times in 0.233269s 0.306338s 0.213268s
              vm_ivar   144.315M           151.722M              117.734M i/s -     30.000M times in 0.207879s 0.197730s 0.254811s

Comparison:
                      vm_ivar_init
           ./miniruby:   7388398.8 i/s
    ../clean/miniruby:   6814257.1 i/s - 1.08x  slower
 ../ruby_2_7/miniruby:   5770583.9 i/s - 1.28x  slower

             vm_ivar_init_subclass
           ./miniruby:   2157763.6 i/s
    ../clean/miniruby:   2146557.0 i/s - 1.01x  slower
 ../ruby_2_7/miniruby:   1973747.9 i/s - 1.09x  slower

                       vm_ivar_set
 ../ruby_2_7/miniruby: 140668063.8 i/s
           ./miniruby: 128606912.1 i/s - 1.09x  slower
    ../clean/miniruby:  97931027.8 i/s - 1.44x  slower

                           vm_ivar
    ../clean/miniruby: 151722121.9 i/s
           ./miniruby: 144314526.5 i/s - 1.05x  slower
 ../ruby_2_7/miniruby: 117734305.5 i/s - 1.29x  slower
2020-12-16 13:06:13 +09:00
Nobuyoshi Nakada ad8e82f708
Fixed marshal compatibility of Process::Status 2020-12-16 12:31:40 +09:00
Nobuyoshi Nakada b30d7fea56
Removed leading spaces [ci skip] 2020-12-16 12:14:30 +09:00
Hiroshi SHIBATA cfefd1e524
Added entry for webrick changes at Ruby 3.0 to NEWS 2020-12-16 11:26:26 +09:00
Koichi Sasada 0b678cc9e5 add vm_sync debug counters
* vm_sync_lock
* vm_sync_lock_enter
* vm_sync_lock_enter_nb
* vm_sync_lock_enter_cr
* vm_sync_barrier
2020-12-16 10:38:12 +09:00
Koichi Sasada 171f0431e7 fix typo 2020-12-16 10:36:23 +09:00
Koichi Sasada dff67c809f fix duplicated name 2020-12-16 10:29:48 +09:00
卜部昌平 ccc828f499 configure.ac: avoid squashing CXX=g++
We are discussing this issue at [Bug #17337] but in the meantime, leave
this questionable autoconf glitch as-is to save sassc and eventmachine.
2020-12-16 08:47:49 +09:00
Marc-Andre Lafortune 8558d5e480 Document Hash#transform_keys with hash. Amend NEWS [DOC] [ci skip] 2020-12-15 17:09:01 -05:00
Marc-Andre Lafortune d5f0d338c7 Optimize `Enumerable#grep{_v}`
[Bug #17030]
2020-12-15 12:54:45 -05:00
Nobuyoshi Nakada a039dc018c
[DOC] Described "numeric representation" more precisely [ci skip]
[Bug #17395]
2020-12-16 00:07:37 +09:00
git efc6a4e580 * 2020-12-16 [ci skip] 2020-12-16 00:04:59 +09:00
Nobuyoshi Nakada 289d42c932
Removed unneeded cast and use the real name 2020-12-15 23:43:08 +09:00
Zoltán Mizsei 8f6cb5b70b
TEST: multiarch support for Haiku 2020-12-15 23:13:24 +09:00
Zoltán Mizsei 9542321584
Haiku: disable stack-protector 2020-12-15 23:12:31 +09:00
Zoltán Mizsei 4d43ac2fb9
Add Haiku to the context support list 2020-12-15 23:12:28 +09:00
Nobuyoshi Nakada e0bdd54348 Ripper: Refined error callbacks [Bug #17345] 2020-12-15 21:36:23 +09:00
Junichi Ito 2e436982ee Fix typo in NEWS.md 2020-12-15 21:00:10 +09:00
Hiroshi SHIBATA 151ff609e5
Added updated versions of the default gems on NEWS 2020-12-15 20:06:42 +09:00
Hiroshi SHIBATA ad3e3bd65a
Bump version to json-2.4.0 2020-12-15 19:54:58 +09:00
Takashi Kokubun 5463eff5f6
Lock only active_units references
556a728508 was not good maybe because it
wasn't using list_for_each_safe. If list_for_each_safe is safe for
list_del for any nodes (is that true?), this should be fine.
2020-12-14 23:35:45 -08:00
Nobuyoshi Nakada ce6fafb8cc
Cache warning category IDs 2020-12-15 15:19:23 +09:00
Kenta Murata a86c147579
Import bigdecimal 2.0.2 (#3905)
* remove duplicated include

* Make BigDecimal#round with argument < 1 return Integer

Fixes [Bug #12780]

* Use a higher default precision for BigDecimal#power and #**

When a fractional power is given, increase the precision if the
precision isn't specified via power's second argument:

Float: increase by 15 (rough number of decimal precision in float)
BigDecimal: increase by adding similar precision modifier as done to
            calculate the base precision.
Rational: double the precision, since a BigDecimal is created, but
          the created BigDecimal uses the same precision.

Increasing the precision for these power calculations has the obvious
tradeoff of making the calculations slower.

Fixes Ruby Bug #17264

* Use DBLE_FIG for a Float value

* Version 2.0.1

Co-authored-by: pavel <pavel.rosicky@easy.cz>
Co-authored-by: Jeremy Evans <code@jeremyevans.net>
2020-12-15 15:17:15 +09:00
Takashi Kokubun 9d85ed6cbb
Simplify positioning of '{' and '}'
and fix inconsistent indentation in mjit_compile.inc.erb
2020-12-14 21:07:41 -08:00
Koichi Sasada 72a73691bd add several debug counters
add cc_found_in_ccs (renamed from cc_found_ccs), cc_not_found_in_ccs,
call0_public, call0_other debug counters to measure more details.

also it contains several modification.
2020-12-15 13:29:30 +09:00
Koichi Sasada aa6287cd26 fix inline method cache sync bug
`cd` is passed to method call functions to method invocation
functions, but `cd` can be manipulated by other ractors simultaneously
so it contains thread-safety issue.

To solve this issue, this patch stores `ci` and found `cc` to `calling`
and stops to pass `cd`.
2020-12-15 13:29:30 +09:00
John Hawthorn 40b7358e93 Skip defined check in NODE_OP_ASGN_OR with ivar
Previously we would add code to check if an ivar was defined when using
`@foo ||= 123`, which was slower than `@foo || (@foo = 123)` when `@foo`
was already defined.

Recently 01b7d5acc7 made it so that
accessing an undefined variable no longer generates a warning, making
the defined check unnecessary and both statements exactly equal.

This commit avoids emitting the defined instruction when compiling
NODE_OP_ASGN_OR with a NODE_IVAR.

Before:

    $ ruby --dump=insn -e '@foo ||= 123'
    == disasm: #<ISeq:<main>@-e:1 (1,0)-(1,12)> (catch: FALSE)
    0000 putnil                                                           (   1)[Li]
    0001 defined                      instance-variable, :@foo, false
    0005 branchunless                 14
    0007 getinstancevariable          :@foo, <is:0>
    0010 dup
    0011 branchif                     20
    0013 pop
    0014 putobject                    123
    0016 dup
    0017 setinstancevariable          :@foo, <is:0>
    0020 leave

After:

    $ ./ruby --dump=insn -e '@foo ||= 123'
    == disasm: #<ISeq:<main>@-e:1 (1,0)-(1,12)> (catch: FALSE)
    0000 getinstancevariable                    :@foo, <is:0>             (   1)[Li]
    0003 dup
    0004 branchif                               13
    0006 pop
    0007 putobject                              123
    0009 dup
    0010 setinstancevariable                    :@foo, <is:0>
    0013 leave

This seems to be about 50% faster in this benchmark:

    require "benchmark/ips"

    class Foo
      def initialize
        @foo = nil
      end

      def test1
        @foo ||= 123
      end

      def test2
        @foo || (@foo = 123)
      end
    end

    FOO = Foo.new

    Benchmark.ips do |x|
      x.report("test1", "FOO.test1")
      x.report("test2", "FOO.test2")
    end

Before:

    $ ruby benchmark_ivar.rb
    Warming up --------------------------------------
                   test1     1.957M i/100ms
                   test2     3.125M i/100ms
    Calculating -------------------------------------
                   test1     20.030M (± 1.7%) i/s -    101.780M in   5.083040s
                   test2     31.227M (± 4.5%) i/s -    156.262M in   5.015936s

After:

    $ ./ruby benchmark_ivar.rb
    Warming up --------------------------------------
                   test1     3.205M i/100ms
                   test2     3.197M i/100ms
    Calculating -------------------------------------
                   test1     32.066M (± 1.1%) i/s -    163.440M in   5.097581s
                   test2     31.438M (± 4.9%) i/s -    159.860M in   5.098961s
2020-12-14 19:38:59 -08:00
Hiroshi SHIBATA 2fa9f3c032 Prepare to release rubygems-3.2.1 and bundler-2.2.1 2020-12-15 10:54:09 +09:00
Nobuyoshi Nakada 7898f4243f
ripper: return pushed new token instead of the token list 2020-12-15 10:26:50 +09:00
Alan Wu c59b9a8c0c Move docs for Integer#bit_length [ci skip] 2020-12-14 20:01:55 -05:00
Alan Wu befa24488c Help RDoc find Exception [ci skip]
This was on top of `Init_Exception()`.
2020-12-14 20:01:01 -05:00
Nobuyoshi Nakada 928cb6eeb6
NEWS: make links to label [ci skip] 2020-12-15 08:41:21 +09:00
Nobuyoshi Nakada 78fad67ce6
NEWS: make links to other document files [ci skip] 2020-12-15 08:41:21 +09:00
Alan Wu a5fd651575 Reword docs for Fiddle::Function#call [ci skip]
I'm using `<code>` instead of `+` since `+` only works when it encloses
a single word.
2020-12-14 18:26:32 -05:00
Alan Wu 25a48b703e Update dependencies 2020-12-14 17:56:42 -05:00
Benoit Daloze f5c89c1660 Deprecate Random::DEFAULT
* Closes [Feature #17351].
2020-12-14 20:29:50 +01:00
Benoit Daloze c183288754 Remove references to Random::DEFAULT in the documentation
* Random::DEFAULT is no longer a Random instance, and referencing it is
  more confusing than helpful. Related to [Feature #17351]
2020-12-14 20:13:48 +01:00
Nobuyoshi Nakada f7850bbea8
NEWS: get rid of unintended link [ci skip] 2020-12-15 00:06:39 +09:00
git 7ca82ff888 * 2020-12-15 [ci skip] 2020-12-15 00:05:38 +09:00
Nobuyoshi Nakada 6b3a808b84
Fix code block indents [ci skip]
RDoc::Markdown requires all block elements nested under bullet
list to be indended deeper than the first column of the list.
2020-12-15 00:03:17 +09:00
Yusuke Endoh b3e99b3676 Fix indent for rdoc's markdown
It seems that nested points need four spaces
2020-12-14 23:53:50 +09:00
Hiroshi SHIBATA c2a60fec2f
Merge Psych-3.2.1 from ruby/psych 2020-12-14 20:13:12 +09:00
Hiroshi SHIBATA 27520a1e1e
Fixed dst name for digest gem 2020-12-14 19:39:32 +09:00
Nobuyoshi Nakada 3323174727 Support shareable_constant_value: literal 2020-12-14 19:19:16 +09:00
Nobuyoshi Nakada 89e489d51d Make shareable_constant_value tri-state 2020-12-14 19:19:16 +09:00
Nobuyoshi Nakada 7060aeedbd shareable_constant_value: is effective only in comment-only line 2020-12-14 19:19:16 +09:00
Nobuyoshi Nakada 25cf1aca92 Added continued line case 2020-12-14 19:19:16 +09:00