summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-12-14Skip defined check in NODE_OP_ASGN_OR with ivarJohn Hawthorn
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 01b7d5acc702df22d306ae95f1a9c3096e63e624 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 Notes: Merged: https://github.com/ruby/ruby/pull/3904
2020-12-15Prepare to release rubygems-3.2.1 and bundler-2.2.1Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/3901
2020-12-15ripper: return pushed new token instead of the token listNobuyoshi Nakada
2020-12-14Move docs for Integer#bit_length [ci skip]Alan Wu
2020-12-14Help RDoc find Exception [ci skip]Alan Wu
This was on top of `Init_Exception()`.
2020-12-15NEWS: make links to label [ci skip]Nobuyoshi Nakada
2020-12-15NEWS: make links to other document files [ci skip]Nobuyoshi Nakada
2020-12-14Reword docs for Fiddle::Function#call [ci skip]Alan Wu
I'm using `<code>` instead of `+` since `+` only works when it encloses a single word.
2020-12-14Update dependenciesAlan Wu
2020-12-14Deprecate Random::DEFAULTBenoit Daloze
* Closes [Feature #17351].
2020-12-14Remove references to Random::DEFAULT in the documentationBenoit Daloze
* Random::DEFAULT is no longer a Random instance, and referencing it is more confusing than helpful. Related to [Feature #17351]
2020-12-15NEWS: get rid of unintended link [ci skip]Nobuyoshi Nakada
2020-12-15* 2020-12-15 [ci skip]git
2020-12-15Fix code block indents [ci skip]Nobuyoshi Nakada
RDoc::Markdown requires all block elements nested under bullet list to be indended deeper than the first column of the list.
2020-12-14Fix indent for rdoc's markdownYusuke Endoh
It seems that nested points need four spaces
2020-12-14Merge Psych-3.2.1 from ruby/psychHiroshi SHIBATA
2020-12-14Fixed dst name for digest gemHiroshi SHIBATA
2020-12-14Support shareable_constant_value: literalNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3681
2020-12-14Make shareable_constant_value tri-stateNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3681
2020-12-14shareable_constant_value: is effective only in comment-only lineNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3681
2020-12-14Added continued line caseNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3681
2020-12-14Added false caseNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3681
2020-12-14Test by Ractor.shareable?Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3681
2020-12-14Make the value shareable deeplyNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3681
2020-12-14Save and pass lex_context wholelyNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3681
2020-12-14Determine shareable-ness after assignment operatorNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3681
2020-12-14Implemented shareable_constant_value op_asgnNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3681
2020-12-14Call FrozenCore.make_shareableNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3681
2020-12-14Implemented shareable_constant_valueNobuyoshi Nakada
It does shallow freeze only for now. Notes: Merged: https://github.com/ruby/ruby/pull/3681
2020-12-14Support shareable_constant_value pragmaNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3681
2020-12-14fix condition and add another debug counterKoichi Sasada
mc_inline_miss_same_def is added to check same method or not. Also the mc_inline_miss_same_cc calculation was fixed.
2020-12-14Add information to Caveats section in NEWS.mdJunichi Ito
Notes: Merged: https://github.com/ruby/ruby/pull/3896
2020-12-14add ccs_not_found debug counterKoichi Sasada
ccs_not_found to count not found in ccs table.
2020-12-14add debug counters to survey the IMC missKoichi Sasada
2020-12-13Debug the command used for gdb dumpTakashi Kokubun
It's not working http://ci.rvm.jp/results/trunk-mjit@phosphorus-docker/3288206. I'm debugging why.
2020-12-13@ruby is the target Ruby in bootstraptestTakashi Kokubun
2020-12-14test/ruby/test_method_cache.rb: suppress "assigned but unused variable"Yusuke Endoh
2020-12-14use method cache on Object#respond_to?Koichi Sasada
rb_method_boundp (method_boundp) searches method_entry, but this search did not use pCMC, so change to use it. Notes: Merged: https://github.com/ruby/ruby/pull/3899
2020-12-14add tests for method cache.Koichi Sasada
Notes: Merged: https://github.com/ruby/ruby/pull/3892
2020-12-14add cc_invalidate_negative debug counterKoichi Sasada
counts for invalidating negative cache. Notes: Merged: https://github.com/ruby/ruby/pull/3892
2020-12-14Introduce negative method cacheKoichi Sasada
pCMC doesn't have negative method cache so this patch implements it. Notes: Merged: https://github.com/ruby/ruby/pull/3892
2020-12-14create ccs with 0 capaKoichi Sasada
ccs is created with default 4 capa, but it is too much, so start with 0 and extend to 1, 2, 4, 8, ... Notes: Merged: https://github.com/ruby/ruby/pull/3892
2020-12-14Fix a typo [ci skip]Kazuhiro NISHIYAMA
2020-12-14* 2020-12-14 [ci skip]git
2020-12-14Remove "2.8" from NEWS.mdJunichi Ito
Notes: Merged: https://github.com/ruby/ruby/pull/3897
2020-12-13`ulimit` does not affect another shellKazuhiro NISHIYAMA
2020-12-13Sorted links by URLs and issue numbers [ci skip]Nobuyoshi Nakada
``` ruby -e 'puts readlines.sort_by {[_1[%r[(https?://.*?)(?:/\d+)?$],1], _1[/\d+$/].to_i]}' ```
2020-12-13Add NEWS about open-uri and Kernel#openJunichi Ito
There might be a lot of codes using redefined Kernel#open via open-uri, so it's worth mentioning that. Notes: Merged: https://github.com/ruby/ruby/pull/3894
2020-12-13Wait testing/helper threads to terminateNobuyoshi Nakada
2020-12-13Fixed a suspicious comparisonNobuyoshi Nakada