summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-06-02* 2017-06-03svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-02common.mk: show localenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59000 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-02test_require.rb: assert_require_insecure_pathnobu
* 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
2017-06-02test_require.rb: fallback encodingnobu
* 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
2017-06-02test_require.rb: filesystem encodingnobu
* 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
2017-06-02file.c: preserve encodingnobu
* 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
2017-06-01Fix DRb.start_service to use any available porteregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-01Remove bad spec which cannot behave nicely in a multi-process environmenteregon
* 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
2017-06-01Remove empty files in drb specseregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-01Create the file in the File::TMPFILE spec in its own directoryeregon
* 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
2017-06-01Open files in binary modes for copying in MSpec's #cperegon
* 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
2017-06-01make Dir object WB protected.ko1
* 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-01* 2017-06-02svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-01make Binding object WB protected.ko1
* 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
2017-06-01load.c: convert by rb_get_path_checknobu
* 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
2017-06-01file.c: rb_check_funcall_default for fallback valuenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-01vm_eval.c: fix rb_check_funcall_defaultnobu
* 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
2017-06-01vm_eval.c: fix for rb_check_funcall_defaultnobu
* 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
2017-06-01fix failure on r58981ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-01debug.c: more enumsnobu
* 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
2017-06-01improve English for a warning messageduerst
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-01* 2017-06-01svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-01rename absolute_path to realpath internally and introduce pathobj.ko1
* 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
2017-05-31Improve performance of implicit type conversionwatson1978
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
2017-05-31add debug counters for local variable (lavr) access.ko1
* 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
2017-05-31Makefile.sub: set ENABLE_SHARED [ci skip]nobu
* 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
2017-05-31common.mk: lldb [ci skip]nobu
* 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
2017-05-31lldb_cruby.py: eval outside framesnobu
* 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-30* 2017-05-31svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-30object.c: improve docsstomar
* 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
2017-05-30enum.c: check if reenterednobu
* 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
2017-05-30enum.c: rb_check_funcall_default for fallback valuenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-30test_rubyoptions.rb: ruby-runner sets $0 to install name nownobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-30Improve performance of Enumerable#{sort_by,min_by,max_by,minmax_by}watson1978
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
2017-05-30add parameter names.ko1
* 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
2017-05-30Solaris 10 x86 raseis SEGVnaruse
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
2017-05-30Change max byte length of UTF-8 to 4 bytesduerst
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
2017-05-30Improve performance of Range#{min,max}watson1978
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
2017-05-29* properties.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29Clean up a bit the Process.setpriority specseregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29Enable Process.setpriority for a single process on more platforms.eregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29* 2017-05-30svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29Run in separate process/pgrp [Bug #13609]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29Simplify, avoid extra exceptions and add test for concurrent mspec mkdir_peregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29rubyspec: Fix method redefinition warningk0kubun
ruby/spec/rubyspec/library/erb/run_spec.rb:63: warning: method redefined; discarding old main ruby/spec/rubyspec/library/erb/result_spec.rb:53: warning: previous definition of main was here ruby/spec/rubyspec/library/erb/run_spec.rb:76: warning: method redefined; discarding old main1 ruby/spec/rubyspec/library/erb/result_spec.rb:67: warning: previous definition of main1 was here ruby/spec/rubyspec/library/erb/run_spec.rb:81: warning: method redefined; discarding old main2 ruby/spec/rubyspec/library/erb/result_spec.rb:72: warning: previous definition of main2 was here git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29test/erb/test_erb.rb: Fix unused variable warningk0kubun
ruby/test/erb/test_erb.rb:575: warning: assigned but unused variable - foo git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29revert r58954 temporarilyduerst
Revert change to maximum of 4 bytes for UTF-8 characters at r58954 temporarily. This failed spec at https://travis-ci.org/ruby/ruby/builds/237086017, but it is totally unclear why. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29Change max byte length of UTF-8 to 4 bytesduerst
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29fix up r58952nobu
* spec/mspec/lib/mspec/helpers/fs.rb (Object#mkdir_p): rescue File.stat when the target does not exist. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-29fix race conditionnobu
* spec/mspec/lib/mspec/helpers/fs.rb (Object#mkdir_p): fix race condition when multi_exec. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e