aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Improve docs for URI librarystomar2018-04-219-373/+344
| | | | | | | | | | | | | | | | | | | * lib/uri/generic.rb: [DOC] fix invalid example code to make it syntax highlighted; drop unnecessary `puts', `p'; adapt to current inspect format without Object id; do not display unnecessary return values in examples; fix or prevent unintended description lists; fix broken RDoc; fix grammar and typos. * lib/uri.rb: ditto. * lib/uri/common.rb: ditto. * lib/uri/file.rb: ditto. * lib/uri/ftp.rb: ditto. * lib/uri/http.rb: ditto. * lib/uri/ldap.rb: ditto. * lib/uri/mailto.rb: ditto. * lib/uri/rfc2396_parser.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_jit.rb: follow the change of instructionk0kubun2018-04-211-1/+1
| | | | | | | | in r63225. Not strictly needed but to avoid confusion. The JIT compiler itself seems working fine. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: optimize checktypenobu2018-04-211-0/+98
| | | | | | | * compile.c (optimize_checktype): optimize `checktype` instruction on a literal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* insns.def: checktypenobu2018-04-213-16/+13
| | | | | | | * insns.def (checktype): split branchiftype to checktype and branchif, to make branch condition negation possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* compile.c: renamed macro argumentsnobu2018-04-211-6/+6
| | | | | | | * compile.c (INSERT_BEFORE_INSN, INSERT_BEFORE_INSN1): rename argument `prev` as `next`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: Enable more testskou2018-04-211-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: Fix XPath concat() implementationkou2018-04-212-3/+6
| | | | | | | | | * lib/rexml/functions.rb (REXML::Functions.concat): Implement. * test/rexml/test_jaxen.rb: Enable one more test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: Fix XPath string() implementationkou2018-04-212-31/+29
| | | | | | | | | | | | | * lib/rexml/functions.rb( REXML::Functions.string): * Support context node. * Fix implementation for document node to remove out of root nodes. * Support processing instruction node. * Improve implementation for integer to omit decimals. * test/rexml/test_jaxen.rb: Enable processing instruction test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: Make more readablekou2018-04-211-2/+2
| | | | | | | test/rexml/test_jaxen.rb: Use more meaningful name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: Fix a test bugkou2018-04-211-1/+1
| | | | | | | | test/rexml/test_jaxen.rb: Fix wrong assert_raise usage. Note that this code isn't used yet. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: Make more readablekou2018-04-211-1/+6
| | | | | | | test/rexml/xpath/test_base.rb: Use here document for readability. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_io.rb: add closing recycled FD testnormal2018-04-211-0/+32
| | | | | | Followup-to: r63216 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c: do not use rb_notify_fd_close close on recycled FDnormal2018-04-212-21/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is unsafe to release GVL and call rb_notify_fd_close after close(2) on any given FD. FDs (file descriptor) may be recycled in other threads immediately after close() to point to a different file description. Note the distinction between "file description" and "file descriptor". th-1 | th-2 -------------------------------+--------------------------------------- io_close_fptr | rb_notify_fd_close(fd) | fptr_finalize_flush | close(fd) | rb_thread_schedule | | fd reused (via pipe/open/socket/etc) rb_notify_fd_close(fd) | | sees "stream closed" exception | for DIFFERENT file description * thread.c (rb_thread_io_blocking_region): adjust comment for list_del * thread.c (rb_notify_fd_close): give busy list to caller * thread.c (rb_thread_fd_close): loop on busy list * io.c (io_close_fptr): do not call rb_thread_fd_close on invalid FD * io.c (io_reopen): use rb_thread_fd_close Fixes: r57422 ("io.c: close before wait") git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread_sync: redo r62934 to use fork_gennormal2018-04-202-63/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of maintaining linked-lists to store all rb_queue/rb_szqueue/rb_condvar structs; store only a fork_gen serial number to simplify management of these items. This reduces initialization costs and avoids the up-front cost of resetting all Queue/SizedQueue/ConditionVariable objects at fork while saving 8 bytes per-structure on 64-bit. There are no savings on 32-bit. * thread.c (rb_thread_atfork_internal): remove rb_thread_sync_reset_all call * thread_sync.c (rb_thread_sync_reset_all): remove * thread_sync.c (queue_live): remove * thread_sync.c (queue_free): remove * thread_sync.c (struct rb_queue): s/live/fork_gen/ * thread_sync.c (queue_data_type): use default free * thread_sync.c (queue_alloc): remove list_add * thread_sync.c (queue_fork_check): new function * thread_sync.c (queue_ptr): call queue_fork_check * thread_sync.c (szqueue_free): remove * thread_sync.c (szqueue_data_type): use default free * thread_sync.c (szqueue_alloc): remove list_add * thread_sync.c (szqueue_ptr): check fork_gen via queue_fork_check * thread_sync.c (struct rb_condvar): s/live/fork_gen/ * thread_sync.c (condvar_free): remove * thread_sync.c (cv_data_type): use default free * thread_sync.c (condvar_ptr): check fork_gen * thread_sync.c (condvar_alloc): remove list_add [ruby-core:86316] [Bug #14634] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2018-04-21svn2018-04-201-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* simplify altstack and enable reuse with thread cachenormal2018-04-207-38/+20
| | | | | | | | | | | | | | Instead of allocating and registering the altstack in different places, do it together to reduce code and improve readability. When thread cache is enabled, storing altstack in rb_thread_t is wasteful and we may reuse altstack in the same pthread. This also lets us clearly allow use of xmalloc to allow GC to recover from ENOMEM. [ruby-core:85621] [Feature #14487] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* _mjit_compile_send.erb: inline attr_reader callk0kubun2018-04-204-7/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | _mjit_compile_send_guard.erb: carve out the shared logic to invalidate inlined method call common.mk: update dependency for this change test_jit.rb: add test for attr_reader optimization * Benchmark ``` require 'benchmark_driver' Benchmark.driver do |x| x.prelude %{ class C attr_reader :a def initialize @a = 1 end end o = C.new def l o i = 0 while i < 1000000 o.a i += 1 end end } x.report 'aread', %{ l o } x.loop_count 1000 x.rbenv 'before', 'before,--jit', 'after,--jit' x.verbose end ``` ``` before: ruby 2.6.0dev (2018-04-20 trunk 63211) [x86_64-linux] before,--jit: ruby 2.6.0dev (2018-04-20 trunk 63211) +JIT [x86_64-linux] after,--jit: ruby 2.6.0dev (2018-04-20 trunk 63211) +JIT [x86_64-linux] last_commit=_mjit_compile_send.erb: inline attr_reader call Calculating ------------------------------------- before before,--jit after,--jit aread 54.597 122.894 218.574 i/s - 1.000k times in 18.316102s 8.137089s 4.575106s Comparison: aread after,--jit: 218.6 i/s before,--jit: 122.9 i/s - 1.78x slower before: 54.6 i/s - 4.00x slower ``` * Optcarrot A little made faster? fps: 71.35 -> 72.11 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Update latest bundled gems:hsbt2018-04-201-2/+2
| | | | | | | did_you_mean: 1.2.1 rake: 12.3.1 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: fix thread + fork errors in autoloadnormal2018-04-204-9/+51
| | | | | | | | | | | | | | | | | | | | | | | This is fairly non-intrusive bugfix to prevent children from trying to reach into thread stacks of the parent. I will probably reuse this idea and redo r62934, too (same bug). * vm_core.h (typedef struct rb_vm_struct): add fork_gen counter * thread.c (rb_thread_atfork_internal): increment fork_gen * variable.c (struct autoload_data_i): store fork_gen * variable.c (check_autoload_data): remove (replaced with get_...) * variable.c (get_autoload_data): check fork_gen when retrieving * variable.c (check_autoload_required): use get_autoload_data * variable.c (rb_autoloading_value): ditto * variable.c (rb_autoload_p): ditto * variable.c (current_autoload_data): ditto * variable.c (autoload_reset): reset fork_gen, adjust indent * variable.c (rb_autoload_load): set fork_gen when setting state * test/ruby/test_autoload.rb (test_autoload_fork): new test [ruby-core:86410] [Bug #14634] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_core.h: adjust indent [ci skip]nobu2018-04-201-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* range.c: step in bignumnobu2018-04-202-2/+5
| | | | | | | * range.c (range_step): honor step in bignum addition. [Feature #12912] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* range.c: fix fixnum loop conditionnobu2018-04-202-4/+9
| | | | | | | * range.c (range_step): FIXABLE + FIXABLE never overflow, but may not be FIXABLE. [Feature #12912] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fiddle/test_import.rb: fix warnings by rubygemsnobu2018-04-191-1/+1
| | | | | | [Bug #14686] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fiddle/import.rb: suppress warningnobu2018-04-192-1/+6
| | | | | | | * ext/fiddle/lib/fiddle/import.rb: suppress exception report when $DEBUG is enabled. [ruby-core:86536] [Bug #14686] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: Fix a XPath bug that white spaces aren't ignoredkou2018-04-192-44/+58
| | | | | | | | | | | lib/rexml/parsers/xpathparser.rb: Ignore white spaces in relative location path. test/rexml/xpath/test_base.rb: Add more test patterns and use more debug friendly assertion style. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: Fix wrong assertionkou2018-04-191-1/+1
| | | | | | | test/rexml/xpath/test_base.rb: Use constant value for the expected value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: Use more debug friendly assertion stylekou2018-04-191-5/+3
| | | | | | | | test/rexml/xpath/test_base.rb: Expand loop assertion and stop to checking just the first value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: Use more debug friendly assertion stylekou2018-04-191-5/+4
| | | | | | | | test/rexml/xpath/test_base.rb: Stop to use separated assertions for checking array value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rexml: Make more readablekou2018-04-191-6/+25
| | | | | | | test/rexml/xpath/test_base.rb: Use here document for XML. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* _mjit_compile_send.erb: simplify control flowk0kubun2018-04-192-12/+10
| | | | | | | | | | | to introduce additional optimization for another `cc->me->def->type` later. I carved out the `cc->me->def->type == VM_METHOD_TYPE_ISEQ` part because I wanted to check other types as well. mjit_compile.c: drop get_iseq_if_available and define simplified version of it, has_valid_method_type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* internal.h: use the same declaration as definitionk0kubun2018-04-192-4/+4
| | | | | | | | | | | | range.c: cast the function type to meet the declaration This change is for fixing build error on AppVeyor: https://ci.appveyor.com/project/ruby/ruby/build/1.0.8177 string.c ../string.c(4330) : error C4028: formal parameter 2 different from declaration git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Adds "endless range" to NEWSmame2018-04-191-0/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Prefer CONST_ID to static global IDsmame2018-04-191-8/+10
| | | | | | Just refactoring. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* range.c: Make Range#bsearch support endless rangesmame2018-04-192-46/+74
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Make Range#min, max, include?, cover?, and === to support endless rangemame2018-04-192-5/+40
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2018-04-20svn2018-04-191-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Introduce endless range [Feature#12912]mame2018-04-197-29/+208
| | | | | | | | | | Typical usages: ``` p ary[1..] # drop the first element; identical to ary[1..-1] (1..).each {|n|...} # iterate forever from 1; identical to 1.step{...} ``` git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* pack/unpack M only handles LF line breaks [Feature #14352]naruse2018-04-191-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* dir.c: warning for NULnobu2018-04-194-5/+19
| | | | | | | * dir.c (rb_push_glob): warn NUL-separated glob patterns. [Feature #14643] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2018-04-19svn2018-04-191-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add slice method to ENV like Hash#slicenobu2018-04-192-0/+41
| | | | | | | | [Feature #14559] From: Benoit Tigeot <benoit@hopsandfork.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32.c: fix CSI sequences to deletenobu2018-04-181-8/+8
| | | | | | | | | | * win32/win32.c (constat_apply): CSI 'J' and 'K' are defaulted to 1, not 0. [ruby-core:86560] [Bug #14691] * win32/win32.c (constat_apply): "delete before cursor" sequences include the cursor position. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/uri/generic.rb: fix error in docs for URI::Generic#opaquestomar2018-04-171-3/+4
| | | | | | | | * lib/uri/generic.rb: [DOC] fix description of URI::Generic#opaque, and add an example. According to RFC2396, opaque path components do not use the slash "/" character, as opposed to hierarchical path components. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/uri/ldap.rb: fix errors in docs for URI::LDAPstomar2018-04-171-3/+3
| | | | | | | * lib/uri/ldap.rb: [DOC] fix errors in example code for URI::LDAP.build and URI::LDAP.new. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/uri/file.rb: fix errors in docs for URI::File.buildstomar2018-04-171-4/+1
| | | | | | | | * lib/uri/file.rb: [DOC] fix description and example for URI::File.build; for file URIs the path component must be absolute, escaping of absolute paths is only done for URI::FTP. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2018-04-18svn2018-04-171-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/uri/file.rb: improve docs for URI::Filestomar2018-04-171-9/+11
| | | | | | | | * lib/uri/file.rb: [DOC] fix invalid example code for URI::File.build to make it syntax highlighted; drop unnecessary `puts'; fix unintended description list; fix typos. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_super.rb: Remove unused assertionsmame2018-04-171-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* The test for TracePoint with thread had never worked correctlymame2018-04-171-2/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* The test for TracePoint#raised_exception had never worked correctlymame2018-04-171-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e