aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* load.c: encode to OS path outside PUSH_TAGnobu2017-06-041-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_require.rb: fix expected pathnobu2017-06-041-1/+1
| | | | | | | | | * test/ruby/test_require.rb (test_require_with_unc): remove extra slash. the result of File.expand_path has a slash just follows the drive letter. https://github.com/ruby/ruby/commit/4ef849bd9014746821402e21053a53ea61b3690d#commitcomment-22391133 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* array.c: docs for Array#{sort,sort!}stomar2017-06-031-4/+4
| | | | | | | | * array.c: [DOC] make example in the docs for Array#{sort,sort!} match the call-seq and description by using the same block vars. Based on a patch by Roque Pinel (repinel). [Fix GH-1628] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59011 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2017-06-04svn2017-06-031-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_require.rb: ignore EPERM at UNCnobu2017-06-031-7/+14
| | | | | | | | * test/ruby/test_require.rb (test_require_with_unc): ignore EPERM. GetFileAttributes and CreateFile with backup semantics fail at a symlink in a shared folder to another shared folder. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c: preserve encodingnobu2017-06-032-3/+6
| | | | | | | * file.c (path_check_0): preserve encoding of path name in warning message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby.c: dladdr_path is not used on cygwinnobu2017-06-031-1/+1
| | | | | | | * ruby.c (dladdr_path): dladdr is provided on recent cygwin, but GetModuleFileNameW is used instead of it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h: remove VM_FRAME_MAGIC_LAMBDA and introduceko12017-06-034-29/+21
| | | | | | | | | | VM_FRAME_FLAG_LAMBDA. So that lambda block frame is VM_FRAME_MAGIC_BLOCK | VM_FRAME_FLAG_LAMBDA. * vm_core.h: remvoe VM_FRAME_MAGIC_PROC because nobody uses it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby/test_require.rb: remove duplicate assertionnobu2017-06-031-7/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59005 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_require.rb: untouch default internal encodingnobu2017-06-031-2/+5
| | | | | | | | * test/ruby/test_require.rb (assert_require_insecure_path): get rid of setting Encoding.default_internal, which affects load path conversion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test: attempt to reduce failures in assert_cpu_usage_lownormal2017-06-032-2/+16
| | | | | | | | | | | | | | Try to make this test less fragile by taking into account the worst case kernel timing resolution. [ruby-core:81540] * test/lib/test/unit/assertions.rb (assert_cpu_usage_low): clamp measurement to minimum measurable time and warn about tests being too short to measure * test/ruby/test_io.rb (test_copy_stream_no_busy_wait): remove pct kwarg and rely on assert_cpu_usage_low defaults git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c: docs for String#splitstomar2017-06-021-4/+8
| | | | | | | | * string.c: [DOC] clarify docs for String#split when called with limit and capture groups. Reported by Cichol Tsai. [ruby-core:81505] [Bug #13621] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2017-06-03svn2017-06-021-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* common.mk: show localenobu2017-06-021-0/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_require.rb: assert_require_insecure_pathnobu2017-06-021-17/+48
| | | | | | | * test/ruby/test_require.rb (assert_require_insecure_path): more tests for loading insecure path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_require.rb: fallback encodingnobu2017-06-021-1/+2
| | | | | | | * test/ruby/test_require.rb (assert_require_nonascii_path): fallback when LANG=C. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_require.rb: filesystem encodingnobu2017-06-021-2/+2
| | | | | | | * test/ruby/test_require.rb (assert_require_nonascii_path): the path in error message is converted to filesystem encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c: preserve encodingnobu2017-06-022-3/+25
| | | | | | | * file.c (rb_find_file_safe): preserve encoding of path in SecurityError messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix DRb.start_service to use any available porteregon2017-06-011-17/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Remove bad spec which cannot behave nicely in a multi-process environmenteregon2017-06-011-25/+0
| | | | | | | * A system port might be taken by another process at any time. * There are no useful expectations in this spec. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Remove empty files in drb specseregon2017-06-0130-30/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Create the file in the File::TMPFILE spec in its own directoryeregon2017-06-011-3/+5
| | | | | | * Avoids failing the spec if rubyspec_temp is not empty. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Open files in binary modes for copying in MSpec's #cperegon2017-06-011-2/+2
| | | | | | | * See https://bugs.ruby-lang.org/issues/13570. * Found by MSP-Greg (Greg L). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* make Dir object WB protected.ko12017-06-011-5/+5
| | | | | | | | * dir.c (dir_data_type): set RUBY_TYPED_WB_PROTECTED. Insert WBs for dir_data::path. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2017-06-02svn2017-06-011-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* make Binding object WB protected.ko12017-06-014-43/+56
| | | | | | | | * proc.c (ruby_binding_data_type): set RUBY_TYPED_WB_PROTECTED. Insert write barriers (WBs) to all of writes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* load.c: convert by rb_get_path_checknobu2017-06-013-5/+6
| | | | | | | * load.c (rb_require_internal): convert to path name with the given safe level, without setting global safe level. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* file.c: rb_check_funcall_default for fallback valuenobu2017-06-011-4/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_eval.c: fix rb_check_funcall_defaultnobu2017-06-011-3/+5
| | | | | | | | | | * vm_eval.c (check_funcall_missing): revert r58984. should call method_missing if respond_to_missing is not redefined. * vm_eval.c (rb_check_funcall_default): return the default value if respond_to_missing and method_missing are not defined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_eval.c: fix for rb_check_funcall_defaultnobu2017-06-011-1/+1
| | | | | | | * vm_eval.c (check_funcall_missing): basic_obj_respond_to_missing returns Qundef if respond_to_missing is not redefined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix failure on r58981ko12017-06-011-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* debug.c: more enumsnobu2017-06-013-18/+8
| | | | | | | * debug.c (ruby_dummy_gdb_enums): add enums for RObject, RModule, RString, RArray. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* improve English for a warning messageduerst2017-06-011-1/+1
| | | | | | | | On DOSish systems, there is a warning message for \r\n line endings on shebang line. Improve this message from "shebang line ends with \r may cause a problem" to "shebang line ending with \r may cause problems". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2017-06-01svn2017-06-011-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rename absolute_path to realpath internally and introduce pathobj.ko12017-06-0113-117/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * vm_core.h: rename absolute_path to realpath because it is expected name. external APIs (#absolute_path methods) are remained. * vm_core.h: remove rb_iseq_location_struct::path and rb_iseq_location_struct::absolute_path and introduce pathobj. if given path equals to given absolute_path (and most of case it is true), pathobj is simply given path String. If it is not same, pathobj is Array and pathobj[0] is path and pathobj[1] is realpath. This size optimization reduce 8 bytes and sizeof(struct rb_iseq_constant_body) is 200 bytes -> 192 bytes on 64bit CPU. To support this change, the following functions are introduced: * pathobj_path() (defined in vm_core.h) * pathobj_realpath() (ditto) * rb_iseq_path() (decl. in vm_core.h) * rb_iseq_realpath() (ditto) * rb_iseq_pathobj_new() (ditto) * rb_iseq_pathobj_set() (ditto) * vm_core.h (rb_binding_t): use pathobj instead of path. If binding is given at eval methods, realpath (absolute_path) was caller's realpath. However, they should use binding's realpath. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Improve performance of implicit type conversionwatson19782017-05-3116-57/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To convert the object implicitly, it has had two parts in convert_type() which are 1. lookink up the method's id 2. calling the method Seems that strncmp() and strcmp() in convert_type() are slightly heavy to look up the method's id for type conversion. This patch will add and use internal APIs (rb_convert_type_with_id, rb_check_convert_type_with_id) to call the method without looking up the method's id when convert the object. Array#flatten -> 19 % up Array#+ -> 3 % up [ruby-dev:50024] [Bug #13341] [Fix GH-1537] ### Before Array#flatten 104.119k (± 1.1%) i/s - 525.690k in 5.049517s Array#+ 1.993M (± 1.8%) i/s - 10.010M in 5.024258s ### After Array#flatten 124.005k (± 1.0%) i/s - 624.240k in 5.034477s Array#+ 2.058M (± 4.8%) i/s - 10.302M in 5.019328s ### Test Code require 'benchmark/ips' class Foo def to_ary [1,2,3] end end Benchmark.ips do |x| ary = [] 100.times { |i| ary << i } array = [ary] x.report "Array#flatten" do |i| i.times { array.flatten } end x.report "Array#+" do |i| obj = Foo.new i.times { array + obj } end end git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add debug counters for local variable (lavr) access.ko12017-05-313-0/+15
| | | | | | | | | | | | * debug_counter.h: add the following counters: * lvar_get: counter for lvar get. * lvar_get_dynamic: counter for lvar get from upper frames. * lvar_set: coutner for lvar set. * lvar_set_dynamic: coutner for lvar set from upper frames. * lvar_set_slowpath: counter for lavr set using slowpath. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Makefile.sub: set ENABLE_SHARED [ci skip]nobu2017-05-312-1/+2
| | | | | | | * win32/Makefile.sub (LIBRUBY_LDSHARED): mswin build always enables shared. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* common.mk: lldb [ci skip]nobu2017-05-312-0/+10
| | | | | | * common.mk (lldb, lldb-ruby): add targets to debug with lldb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lldb_cruby.py: eval outside framesnobu2017-05-311-2/+9
| | | | | | | * misc/lldb_cruby.py (lldb_rp): evaluate without frames when no process is running, and show error messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2017-05-31svn2017-05-301-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* object.c: improve docsstomar2017-05-301-12/+13
| | | | | | | | | | | * object.c: [DOC] add an example for Object#yield_self that better illustrates its purpose; other small improvements. Reported by Vitaly Tatarintsev (ck3g). Patch by Marcus Stollsteimer. [Fix GH-1637] * object.c: [DOC] improve docs for Object#{itself,tap}. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* enum.c: check if reenterednobu2017-05-302-7/+28
| | | | | | | | | | * enum.c (cmpint_reenter_check): extract from nmin_cmp and nmin_block_cmp. * enum.c (nmin_cmp): check if reentered before rb_cmpint. [Feature #13437] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* enum.c: rb_check_funcall_default for fallback valuenobu2017-05-301-3/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_rubyoptions.rb: ruby-runner sets $0 to install name nownobu2017-05-302-4/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Improve performance of Enumerable#{sort_by,min_by,max_by,minmax_by}watson19782017-05-301-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is totally same approach with r58964. enum.c (sort_by_cmp): use OPTIMIZED_CMP() to compare the objects instead of `<=>' method dispatching for Fixnum/Float/String object. enum.c (nmin_cmp): ditto. enum.c (min_by_i): ditto. enum.c (max_by_i): ditto. enum.c (minmax_by_i_update): ditto. enum.c (minmax_by_i): ditto. Enumerable#sort_by -> 51 % up Enumerable#min_by(n) -> 34 % up Enumerable#min_by -> 37 % up Enumerable#max_by(n) -> 61 % up Enumerable#max_by -> 40 % up Enumerable#minmax_by -> 67 % up [ruby-core:80689] [Bug #13437] [Fix GH-1584] ### Before Enumerable#sort_by 5.692k (± 2.2%) i/s - 28.611k in 5.028861s Enumerable#min_by(n) 8.496k (± 0.5%) i/s - 43.146k in 5.078394s Enumerable#min_by 8.678k (± 0.5%) i/s - 43.911k in 5.060128s Enumerable#max_by(n) 3.306k (± 3.0%) i/s - 16.562k in 5.014727s Enumerable#max_by 8.322k (± 2.8%) i/s - 42.400k in 5.099400s Enumerable#minmax_by 6.769k (± 2.6%) i/s - 34.100k in 5.041354s ### After Enumerable#sort_by 8.591k (± 3.0%) i/s - 43.316k in 5.046836s Enumerable#min_by(n) 11.489k (± 1.2%) i/s - 57.732k in 5.025504s Enumerable#min_by 11.835k (± 2.7%) i/s - 60.150k in 5.086450s Enumerable#max_by(n) 5.322k (± 1.1%) i/s - 26.650k in 5.008289s Enumerable#max_by 11.705k (± 0.6%) i/s - 59.262k in 5.062997s Enumerable#minmax_by 11.323k (± 1.3%) i/s - 57.018k in 5.036565s ### Test code require 'benchmark/ips' Benchmark.ips do |x| enum = (1..1000).to_a.to_enum x.report "Enumerable#sort_by" do enum.sort_by { |a| a } end x.report "Enumerable#min_by(n)" do enum.min_by(2) { |a| a } end x.report "Enumerable#min_by" do enum.min_by { |a| a } end x.report "Enumerable#max_by(n)" do enum.max_by(2) { |a| a } end x.report "Enumerable#max_by" do enum.max_by { |a| a } end x.report "Enumerable#minmax_by" do enum.minmax_by { |a| a } end end git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add parameter names.ko12017-05-301-5/+5
| | | | | | | * vm_core.h: add parameter names for rb_iseq_new*. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Solaris 10 x86 raseis SEGVnaruse2017-05-301-2/+4
| | | | | | http://rubyci.s3.amazonaws.com/unstable10x/ruby-trunk/log/20170527T221806Z.diff.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Change max byte length of UTF-8 to 4 bytesduerst2017-05-301-1/+1
| | | | | | | | In enc/utf_8.c, change maximum byte length of UTF-8 to 4 bytes (from 6) to conform to definition of UTF-8. This closes issue #13590. (This is a retry of r58954, after issue #13590 has been addressed.) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Improve performance of Range#{min,max}watson19782017-05-301-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | range.c (range_min): use OPTIMIZED_CMP() to compare the objects instead of `<=>' method dispatching for Fixnum/Float/String object inside Range object. range.c (range_max): ditto. Range#min -> 34 % up Range#max -> 44 % up [ruby-core:80713] [Bug #13443] [Fix GH-1585] ### Before Range#min 8.428M (± 1.3%) i/s - 42.141M in 5.000952s Range#max 8.157M (± 1.3%) i/s - 40.852M in 5.009297s ### After Range#min 11.269M (± 1.2%) i/s - 56.388M in 5.004611s Range#max 11.764M (± 1.3%) i/s - 58.856M in 5.003820s ### Test code require 'benchmark/ips' Benchmark.ips do |x| x.report "Range#min" do |i| i.times { (1..100).min } end x.report "Range#max" do |i| i.times { (1..100).max } end end git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e