aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Show the class of the receiver [Feature #15231]nobu2018-12-061-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* should not use Microsoft Internet Controllersuke2018-12-061-5/+5
| | | | | | | | * spec/ruby/library/win32ole/win32ole_method/helpcontext_spec.rb: Use FileSystemObject. Microsoft Internet Explorer is not available in some environment. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * expand tabs.svn2018-12-061-5/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Speed up hash literals by dupingtenderlove2018-12-063-16/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit replaces the `newhashfromarray` instruction with a `duphash` instruction. Instead of allocating a new hash from an array stored in the Instruction Sequences, store a hash directly in the instruction sequences and dup it on execution. == Instruction sequence changes == ```ruby code = <<-eorby { "foo" => "bar", "baz" => "lol" } eorby insns = RubyVM::InstructionSequence.compile(code, __FILE__, nil, 0, frozen_string_literal: true) puts insns.disasm ``` On Ruby 2.5: ``` == disasm: #<ISeq:<compiled>@test.rb:0 (0,0)-(0,36)>==================== 0000 putobject "foo" 0002 putobject "bar" 0004 putobject "baz" 0006 putobject "lol" 0008 newhash 4 0010 leave ``` Ruby 2.6@r66174 3b6321083a2e3525da3b34d08a0b68bac094bd7f: ``` $ ./ruby test.rb == disasm: #<ISeq:<compiled>@test.rb:0 (0,0)-(0,36)> (catch: FALSE) 0000 newhashfromarray 2, ["foo", "bar", "baz", "lol"] 0003 leave ``` Ruby 2.6 + This commit: ``` $ ./ruby test.rb == disasm: #<ISeq:<compiled>@test.rb:0 (0,0)-(0,36)> (catch: FALSE) 0000 duphash {"foo"=>"bar", "baz"=>"lol"} 0002 leave ``` == Benchmark Results == Compared to 2.5.3: ``` $ make benchmark ITEM=hash_literal_small COMPARE_RUBY=/Users/aaron/.rbenv/versions/2.5.3/bin/ruby generating known_errors.inc known_errors.inc unchanged ./revision.h unchanged /Users/aaron/.rbenv/shims/ruby --disable=gems -rrubygems -I./benchmark/lib ./benchmark/benchmark-driver/exe/benchmark-driver \ --executables="compare-ruby::/Users/aaron/.rbenv/versions/2.5.3/bin/ruby -I.ext/common --disable-gem" \ --executables="built-ruby::./miniruby -I./lib -I. -I.ext/common -r./prelude --disable-gem" \ $(find ./benchmark -maxdepth 1 -name '*hash_literal_small*.yml' -o -name '*hash_literal_small*.rb' | sort) Calculating ------------------------------------- compare-ruby built-ruby hash_literal_small2 1.498 1.877 i/s - 1.000 times in 0.667581s 0.532656s hash_literal_small4 1.197 1.642 i/s - 1.000 times in 0.835375s 0.609160s hash_literal_small8 0.620 1.215 i/s - 1.000 times in 1.611638s 0.823090s Comparison: hash_literal_small2 built-ruby: 1.9 i/s compare-ruby: 1.5 i/s - 1.25x slower hash_literal_small4 built-ruby: 1.6 i/s compare-ruby: 1.2 i/s - 1.37x slower hash_literal_small8 built-ruby: 1.2 i/s compare-ruby: 0.6 i/s - 1.96x slower ``` Compared to r66255 ``` $ make benchmark ITEM=hash_literal_small COMPARE_RUBY=/Users/aaron/.rbenv/versions/ruby-trunk/bin/ruby generating known_errors.inc known_errors.inc unchanged ./revision.h unchanged /Users/aaron/.rbenv/shims/ruby --disable=gems -rrubygems -I./benchmark/lib ./benchmark/benchmark-driver/exe/benchmark-driver \ --executables="compare-ruby::/Users/aaron/.rbenv/versions/ruby-trunk/bin/ruby -I.ext/common --disable-gem" \ --executables="built-ruby::./miniruby -I./lib -I. -I.ext/common -r./prelude --disable-gem" \ $(find ./benchmark -maxdepth 1 -name '*hash_literal_small*.yml' -o -name '*hash_literal_small*.rb' | sort) Calculating ------------------------------------- compare-ruby built-ruby hash_literal_small2 1.567 1.831 i/s - 1.000 times in 0.638056s 0.546039s hash_literal_small4 1.298 1.652 i/s - 1.000 times in 0.770214s 0.605182s hash_literal_small8 0.873 1.216 i/s - 1.000 times in 1.145304s 0.822047s Comparison: hash_literal_small2 built-ruby: 1.8 i/s compare-ruby: 1.6 i/s - 1.17x slower hash_literal_small4 built-ruby: 1.7 i/s compare-ruby: 1.3 i/s - 1.27x slower hash_literal_small8 built-ruby: 1.2 i/s compare-ruby: 0.9 i/s - 1.39x slower ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * properties.svn2018-12-060-0/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add benchmark for hash small literalstenderlove2018-12-063-0/+9
| | | | | | Co-Authored-By: Krzysztof Rybka <krzysztof.rybka@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2018-12-07svn2018-12-061-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add missing declaration to exportnaruse2018-12-061-0/+1
| | | | | | | Additional fix for r66200: https://rubyci.org/logs/rubyci.s3.amazonaws.com/icc-x64/ruby-trunk/log/20181206T130002Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add NEWS entries about script_compiled eventko12018-12-061-0/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add tests for script_compiled TP event.ko12018-12-061-0/+31
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * expand tabs.svn2018-12-061-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* `script_compiled` TracePoint event [Feature #15287]ko12018-12-065-1/+87
| | | | | | | | | | | | | | | | | * vm_trace.c: add `script_compiled` event. This event invoked after script compiling and before evaluating compiled script. Also the following methods are added: `TracePoint#compiled_instruction_sequence` method to get compiled `RubyVM::InstructionSequence` instance. `TracePoint#compiled_eval_script` method to get compiled script (String) by *eval methods (return nil if compiling by file). * vm_trace.c (tracepoint_attr_raised_exception): git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Added News entries about RubyGems and Bundler.hsbt2018-12-061-1/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Should be true fix for r66200naruse2018-12-062-5/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Return same ISeq object for one src.ko12018-12-066-42/+87
| | | | | | | | | | | | | | | | | | | | | * iseq.c: before this patch, RubyVM::InstructionSequence.of(src) (ISeq in short) returns different ISeq (wrapper) objects point to one ISeq internal object. This patch changes this behavior to cache created ISeq (wrapper) objects and return same ISeq object for an internal ISeq object. * iseq.h (ISEQ_EXECUTABLE_P): introduced to check executable ISeq objects. * iseq.h (ISEQ_COMPILE_DATA_ALLOC): reordr setting flag line to avoid ISEQ_USE_COMPILE_DATA but compiled_data == NULL case. * vm_core.h (rb_iseq_t): introduce `rb_iseq_t::wrapper` and `rb_iseq_t::aux::exec`. Move `rb_iseq_t::local_hooks` to `rb_iseq_t::aux::exec::local_hooks`. * test/ruby/test_iseq.rb: add ISeq.of() tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* suppress warning: unused variable 'vbits'naruse2018-12-061-1/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (io_fflush): eliminate redundant rb_io_check_closednormal2018-12-061-1/+0
| | | | | | | There is no need to call this function twice in a row since thread switching won't happen in-between calls to it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* NEWS: fix typo (maesured => measured) [ci skip]normal2018-12-061-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (io_write_nonblock): add RB_GC_GUARD, io_fflush may switch threadsnormal2018-12-061-0/+1
| | | | | | | | Since io_fflush may block on mutex or rb_io_wait_readable and switch threads, we need to ensure the `str' VALUE returned by `rb_obj_as_string` is visible to GC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* refix of r66200naruse2018-12-062-1/+5
| | | | | | | Though internal.h has the prototype, it still shows symbol lookup error... https://rubyci.org/logs/rubyci.s3.amazonaws.com/icc-x64/ruby-trunk/log/20181206T050002Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove an unused variableduerst2018-12-061-2/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* make sure all nodes are freed on error in node_extended_grapheme_cluster()duerst2018-12-061-36/+37
| | | | | | | | | regparse.c: In function node_extended_grapheme_cluster(), use function-global array node_common and use it for list and alternate construction. This is done so that in case of error, all nodes that have already been constructed can be correctly freed in a single for loop. Document the layout structure. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Prefer rb_check_arity when 0 or 1 argumentsnobu2018-12-0618-139/+72
| | | | | | | Especially over checking argc then calling rb_scan_args just to raise an ArgumentError. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* load.c (RubyVM.resolve_feature_path): New method. [Feature #15230]mame2018-12-063-0/+47
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Show diff in failure messagesnobu2018-12-061-22/+23
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add separator for test/-ext-nobu2018-12-061-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove code duplication and streamline identifiersduerst2018-12-061-58/+37
| | | | | | | | | | | | | | | | In regparse.c: * Reduce coode duplication by merging the almost identical functions create_sequence_node and create_alternate_node into a new function create_node_from_array, adding a parameter that distinguishes between creating a list and creating an alternative. * Streamline variable/function naming. Unicode UAX #29 uses 'sequence', but the regular expression library uses 'list' for the same concept. Keep 'sequence' in the ccmments that are taken from UAX #29, but use 'list' in variable names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix r66200 againnaruse2018-12-061-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove obsolete data from unicode.cduerst2018-12-062-30/+0
| | | | | | | | | | * unicode.c: Remove the arrays onigenc_unicode_GCB_ranges_GAZ, onigenc_unicode_GCB_ranges_E_Base, and onigenc_unicode_GCB_ranges_Emoji, because they are not needed anymore for Unicode 11.0.0. * regparse.c: Remove external declarations for above arrays. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "fix typoe of r66200"normal2018-12-051-1/+1
| | | | | | | | | This reverts r66229 (commit e941daa6dd114b52356a63d3c3db5684e6c66717) Many CI failures on this: http://ci.rvm.jp/results/trunk-jemalloc@silicon-docker/1497858 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread_sync.c (mutex_ptr): handle mutexes held by parent threads in childrennormal2018-12-052-0/+32
| | | | | | | | | | | | Mutexes may be held by threads which only exist in the parent process, so their waitqueues may be populated with references to other dead threads. We must reset them at fork. I am a moron for introducing this bug :< [ruby-core:90312] [Bug #15383] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix typoe of r66200naruse2018-12-051-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Introduce "COLDFUNC" function attribute.ko12018-12-053-3/+13
| | | | | | | | | | | * include/ruby/defines.h: introduce "COLDFUNC" function attribute on several compilers for called unlikely functions. Apply to rb_memerror, rb_warn and rb_bug. A patch form methodmissing <lourens@bearmetal.eu>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2018-12-06svn2018-12-051-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix C90 error.ko12018-12-051-1/+2
| | | | | | | | * configure.ac (check broken_backtrace code): fix decl. position error because of `-Werror=declaration-after-statement`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* NEWS: update about bigdecimal [ci skip]mrkn2018-12-051-0/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * properties.svn2018-12-050-0/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Import bigdecimal 1.4.0.pre.20181205amrkn2018-12-0517-343/+590
| | | | | | * https://github.com/ruby/bigdecimal/compare/74d25ef..v1.4.0.pre.20181205a git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * properties.svn2018-12-050-0/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "Remove `libexec/bundle_ruby`"hsbt2018-12-051-0/+60
| | | | | | This reverts commit 3f708604920f2fd7a105d5f092240737add15ef1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Remove `libexec/bundle_ruby`kazu2018-12-051-60/+0
| | | | | | | see r65979 [Bug #15291][ruby-dev:50663] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove unused variables in node_extended_grapheme_cluster()duerst2018-12-051-8/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* tweak/remove comments [ci skip]duerst2018-12-051-10/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add update to Unicode 11.0.0 to NEWS [ci skip]duerst2018-12-051-0/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/monitor.rb: prevent to initialize MonitorMixin twicekazu2018-12-051-1/+5
| | | | | | | | and allow to initialize again when obj.dup. Suggested by Benoit Daloze. [ruby-core:88504] [Feature #15000] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* adjust some comments in node_extended_grapheme_cluster() [ci skip]duerst2018-12-051-13/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update to Unicode 11.0.0 (main step, not complete yet)duerst2018-12-056-407/+47704
| | | | | | | | | | | | | | - common.mk: Change Unicode version to 11.0.0, and Emoji version to 11.0 - test/ruby/enc/test_emoji_breaks.rb: update hard-coded Emoji version - enc/unicode/11.0.0, enc/unicode/11.0.0/casefold.h, enc/unicode/name2ctype.h: Add generated files. Files for Unicode 10.0.0 will be removed once we are sure 11.0.0 works. - lib/unicode_normalize/tables.rb: Updated table. - regparse.c: Almost completely reimplement grapheme cluster detection in function node_extended_grapheme_cluster(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* implement Array-specific #all?, #none?, #one?nobu2018-12-051-0/+121
| | | | | | | | | | | | | | | Before this patch Array#all? was not implemented in Array class and alternatively Enumerable#all? was used, while #any? has its own method entry in Array class. Similarly, Array#none? and #one? also lacks its own implementation. This patch provides Array-specific implementations for above three methods to enable faster method lookup. [Fix GH-2041] From: Koji Onishi <fursich0@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * properties.svn2018-12-050-0/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert bigdecimal 1.4.0 related commitsmrkn2018-12-0517-591/+343
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Revert "Remove unnecessary linker flags" This reverts commit 49efa01579272d52d28bd361c498d96ca92e986e. * Revert "Move dependency on gemspec" This reverts commit bfb64d476578eadd61a738149726da37840f068d. * Revert "Remove unnecessary directory listing" This reverts commit 86661b5c60b8da6e5641c9c772b57857a1f988f4. * Revert "* expand tabs." This reverts commit 35ada33f8386b56611f10b1a0a4e5667e9b08071. * Revert "Import bigdecimal-1.4.0.pre-20181204a" This reverts commit 8891bb3bd602bdbabd24260cf1e431475dc027c8. * Revert "ext/bigdecimal/bigdecimal.c: drop unused function" This reverts commit 5ceeea4da1179193c2c7ddcebfd67019128473e3. * Revert "* expand tabs." This reverts commit e021386e905b6d6799a84dfbc2f0592e42626366. * Revert "Import bigdecimal-1.4.0.pre-20181130a" This reverts commit a0e438cd3c28d2eaf4efa18243d5b6edafa14d88. * Revert "NEWS: write about bigdecimal updates" This reverts commit 89455ff2ba973f2a9ee7b79657e0e6f1f31501f9. * Revert "Fix rubyspec of bigdecimal for ruby <2.6" This reverts commit 4bcdeeb65e57de4da306d347652898c767162e74. * Revert "Fix rubyspec against bigdecimal updates" This reverts commit c8fb30fc9e0ee14e87be1e231869a12aaef1eedf. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e