summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Break lines in LEGAL texts [ci skip]nobu2018-12-091-53/+51
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* delete Unicode 10.0.0 related files, no longer needed [#14802]duerst2018-12-092-45436/+0
| | | | | | | | | This line, and those below, will be ignored-- D enc/unicode/10.0.0 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Blockquote LEGAL [ci skip]nobu2018-12-091-22/+59
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* raise instead of rb_bugnobu2018-12-091-4/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Removed never-happening casenobu2018-12-091-5/+0
| | | | | | | get_uniq_filename never returns NULL but raises an exception on failure. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "thread_pthread.c: fix memory leak from fork loop leapfrog (v2)"normal2018-12-081-9/+7
| | | | | | | | | This reverts r66290 / commit 043047a8fd5315d98eac38ddbd04ebe8db361817. Still fails on CI, and I'm not able to reproduce the failure, either :< http://ci.rvm.jp/results/trunk-test@ruby-sky1/1508228 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread_pthread.c: fix memory leak from fork loop leapfrog (v2)normal2018-12-081-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Constantly forking a single-threaded process in a loop leads to a memory leak when using POSIX timers. v2: disarm before timer_delete ==> fork_leapfrog.rb <== require 'io/wait' Dir.chdir '/proc' prev = 0 loop do pid = fork exit!(0) if pid # show the number of 4K pages used (Linux-only) n = File.read("#$$/statm").split(-' ')[1].to_i if n > prev puts "#{prev} => #{n}" prev = n end # since Ctrl-C from a terminal can't stop this loop, # allow the user to just hit any key to stop break if STDIN.wait(0) end git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert "thread_pthread.c: fix memory leak from fork loop leapfrog"normal2018-12-081-8/+7
| | | | | | | | Oops, CI failures... This reverts r66288 / commit 2b1dcc1dd1eb260fd20ff1e6e0dfb0e5624a3cc6. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread_pthread.c: fix memory leak from fork loop leapfrognormal2018-12-081-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Constantly forking a single-threaded process in a loop leads to a memory leak when using POSIX timers. ==> fork_leapfrog.rb <== require 'io/wait' Dir.chdir '/proc' prev = 0 loop do pid = fork exit!(0) if pid # show the number of 4K pages used (Linux-only) n = File.read("#$$/statm").split(-' ')[1].to_i if n > prev puts "#{prev} => #{n}" prev = n end # since Ctrl-C from a terminal can't stop this loop, # allow the user to just hit any key to stop break if STDIN.wait(0) end git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2018-12-09svn2018-12-081-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge RDoc 6.1.0.beta3 from upstreamaycabta2018-12-088-67/+96
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Duplicate header name only if foundnobu2018-12-081-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix compile error at r66280nobu2018-12-082-5/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Honor configured ruby header locations as the MJIT header pathnobu2018-12-081-0/+12
| | | | | | [Bug #15391] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Removed unnecessary dependency on mjit_config.hnobu2018-12-081-1/+1
| | | | | | | MJIT_MIN_HEADER is passed via a command line option for mjit_build_dir.so. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Give the MJIT header path namenobu2018-12-083-42/+33
| | | | | | | | Give the whole MJIT header path name by preloaded shared library mjit_build_dir.so, than building the path from a given directory name and the embedded base name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use BUILDDIR in ruby-runner.h from config.statusnobu2018-12-084-8/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2018-12-08svn2018-12-071-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix memory leak when failed to build pch pathnobu2018-12-071-1/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Array#any? just returns true/falsenobu2018-12-071-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* should not use Internet Explorersuke2018-12-072-12/+15
| | | | | | | | | | | * spec/ruby/library/win32ole/fixtures/classes.rb: add SYSTEM_MONITOR_CONTROL_AVAILABLE. * spec/ruby/library/win32ole/win32ole_method/event_spec.rb: Internet Explorer is not available in some environment. Instead, try to use System Monitor Control. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Adjust reserved hash valuesnobu2018-12-073-2/+19
| | | | | | | The reserved hash values in hash.c must be consistend with st.c. [ruby-core:90356] [Bug #15389] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Should use the proper constantnobu2018-12-071-5/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Bump rake-12.3.2 on bundled gems.hsbt2018-12-071-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* replace hardcoded emoji version by RbConfig::CONFIG['UNICODE_EMOJI_VERSION']duerst2018-12-071-2/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add UNICODE_EMOJI_VERSION to RbConfig [Feature #15341]nobu2018-12-072-0/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* convert check for array length to assertion and comment outduerst2018-12-071-1/+1
| | | | | | | | | | In regparse.c, in function node_extended_grapheme_cluster, we used a raw if() with exit(1) as a cross-check for our length calculations for the common node array. Convert this to an assertion and comment it out because it is not needed for active code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* zlib (gzfile_write_raw): do not resize string after .write callnormal2018-12-072-1/+17
| | | | | | | | | | | | | | | | | | | | | | Apparently, a component of Rails implements a buffering .write method which keeps the String buffer around and makes it unsafe for us to clear it after calling .write. This caused Rack::Deflater to give empty results when enabled. Fortunately, per r61631 / a55abcc0ca6f628fc05304f81e5a044d65ab4a68, this misguided optimization was only worth a small (0.5MB) savings and we still benefit from the majority of the memory savings in that change. Thanks to zunda for the bug report. [ruby-core:90133] [Bug #15356] Fixes: r61631 (commit a55abcc0ca6f628fc05304f81e5a044d65ab4a68) ("zlib: reduce garbage on gzip writes (deflate)") git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove code duplication and put everything into forward orderduerst2018-12-071-158/+143
| | | | | | | | | | | | 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
* Dump the tested timestamp itselfnobu2018-12-071-3/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Dump more timestampsnobu2018-12-061-12/+16
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* accept_loop_spec.rb: avoid random hangk0kubun2018-12-061-2/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_gem_package_task.rb: suppress random failurek0kubun2018-12-061-1/+2
| | | | | | | | 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
* Warn redefinitions of some methods on Objectnobu2018-12-064-3/+11
| | | | | | [Bug #5473] [Bug #14670] [Bug #15382] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* 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