summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-12-07remove code duplication and put everything into forward orderduerst
In file regparse.c, in function node_extended_grapheme_cluster(), eliminate code duplication of CRLF and '.' (any character). This uses the fact that both for Unicode encodings and for non-Unicode encodings, the first alternative is CRLF, and the last alternative is '.' (any character). This puts all of the pieces into forward order (the order of the code follows the order of the syntax definition). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-07Dump the tested timestamp itselfnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06Dump more timestampsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06accept_loop_spec.rb: avoid random hangk0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06test_gem_package_task.rb: suppress random failurek0kubun
by Bundler. http://ci.rvm.jp/results/trunk-vm-asserts@silicon-docker/1500762 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06Warn redefinitions of some methods on Objectnobu
[Bug #5473] [Bug #14670] [Bug #15382] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06Show the class of the receiver [Feature #15231]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06should not use Microsoft Internet Controllersuke
* 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
2018-12-06* expand tabs.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06Speed up hash literals by dupingtenderlove
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
2018-12-06* properties.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06Add benchmark for hash small literalstenderlove
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-06* 2018-12-07svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06Add missing declaration to exportnaruse
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
2018-12-06add NEWS entries about script_compiled eventko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06add tests for script_compiled TP event.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06* expand tabs.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06`script_compiled` TracePoint event [Feature #15287]ko1
* 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
2018-12-06Added News entries about RubyGems and Bundler.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06Should be true fix for r66200naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06Return same ISeq object for one src.ko1
* 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
2018-12-06suppress warning: unused variable 'vbits'naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06io.c (io_fflush): eliminate redundant rb_io_check_closednormal
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
2018-12-06NEWS: fix typo (maesured => measured) [ci skip]normal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06io.c (io_write_nonblock): add RB_GC_GUARD, io_fflush may switch threadsnormal
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
2018-12-06refix of r66200naruse
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
2018-12-06remove an unused variableduerst
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06make sure all nodes are freed on error in node_extended_grapheme_cluster()duerst
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
2018-12-06Prefer rb_check_arity when 0 or 1 argumentsnobu
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
2018-12-06load.c (RubyVM.resolve_feature_path): New method. [Feature #15230]mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06Show diff in failure messagesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06Add separator for test/-ext-nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06remove code duplication and streamline identifiersduerst
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
2018-12-06fix r66200 againnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06remove obsolete data from unicode.cduerst
* 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
2018-12-05Revert "fix typoe of r66200"normal
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
2018-12-05thread_sync.c (mutex_ptr): handle mutexes held by parent threads in childrennormal
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
2018-12-05fix typoe of r66200naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-05Introduce "COLDFUNC" function attribute.ko1
* 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-05* 2018-12-06svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-05fix C90 error.ko1
* 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
2018-12-05NEWS: update about bigdecimal [ci skip]mrkn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-05* properties.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-05Import bigdecimal 1.4.0.pre.20181205amrkn
* 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
2018-12-05* properties.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-05Revert "Remove `libexec/bundle_ruby`"hsbt
This reverts commit 3f708604920f2fd7a105d5f092240737add15ef1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-05Remove `libexec/bundle_ruby`kazu
see r65979 [Bug #15291][ruby-dev:50663] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-05remove unused variables in node_extended_grapheme_cluster()duerst
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-05tweak/remove comments [ci skip]duerst
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-05add update to Unicode 11.0.0 to NEWS [ci skip]duerst
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e