summaryrefslogtreecommitdiff
path: root/ChangeLog
AgeCommit message (Collapse)Author
2015-07-04fix typos [ci skip]kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-04* Add test case for empty array and first method with args.hsbt
Patch by @yui-knk [fix GH-955] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-04* Add test for `Enumerable#sort` with block. Patch by @yui-knkhsbt
[fix GH-954] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-04enum.c: remove volatile, use RB_GC_GUARDnormal
volatile appears unnecessary in most cases as the VALUEs are used as arguments of uninlined functions. Even worse, volatile can be insufficient in places where RB_GC_GUARD is necessary. * enum.c (zip_ary): remove volatile, use RB_GC_GUARD (zip_i): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-04test_case.rb: fix multiple loadnobu
* lib/rubygems/test_case.rb (teardown): do not delete features loaded from the original load paths, the same libraries should be loaded again when the same features are required. [ruby-dev:49031] [Bug #11222] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-04vm.c: reduce branches for always-set VM fieldsnormal
thgroup_default, mark_object_ary, load_path, load_path_snapshot, expanded_load_path, loaded_features, loaded_features_snapshot, top_self, defined_module_hash are always defined at process startup. This makes it wasteful to have extra branches in an an effort to skip the function call to `rb_gc_mark'. This reduces binary size a small amount on x86-64: text data bss dec hex filename 2830738 22672 71584 2924994 2ca1c2 ruby.orig 2830234 22672 71584 2924490 2c9fca ruby.after More similar changes coming when I'm bored enough to notice... * vm.c (rb_vm_mark): reduce branches for always-set VM fields (rb_vm_add_root_module): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-03* method.h: introduce rb_callable_method_entry_t to removeko1
rb_control_frame_t::klass. [Bug #11278], [Bug #11279] rb_method_entry_t data belong to modules/classes. rb_method_entry_t::owner points defined module or class. module M def foo; end end In this case, owner is M. rb_callable_method_entry_t data belong to only classes. For modules, MRI creates corresponding T_ICLASS internally. rb_callable_method_entry_t can also belong to T_ICLASS. rb_callable_method_entry_t::defined_class points T_CLASS or T_ICLASS. rb_method_entry_t data for classes (not for modules) are also rb_callable_method_entry_t data because it is completely same data. In this case, rb_method_entry_t::owner == rb_method_entry_t::defined_class. For example, there are classes C and D, and incldues M, class C; include M; end class D; include M; end then, two T_ICLASS objects for C's super class and D's super class will be created. When C.new.foo is called, then M#foo is searcheed and rb_callable_method_t data is used by VM to invoke M#foo. rb_method_entry_t data is only one for M#foo. However, rb_callable_method_entry_t data are two (and can be more). It is proportional to the number of including (and prepending) classes (the number of T_ICLASS which point to the module). Now, created rb_callable_method_entry_t are collected when the original module M was modified. We can think it is a cache. We need to select what kind of method entry data is needed. To operate definition, then you need to use rb_method_entry_t. You can access them by the following functions. * rb_method_entry(VALUE klass, ID id); * rb_method_entry_with_refinements(VALUE klass, ID id); * rb_method_entry_without_refinements(VALUE klass, ID id); * rb_resolve_refined_method(VALUE refinements, const rb_method_entry_t *me); To invoke methods, then you need to use rb_callable_method_entry_t which you can get by the following APIs corresponding to the above listed functions. * rb_callable_method_entry(VALUE klass, ID id); * rb_callable_method_entry_with_refinements(VALUE klass, ID id); * rb_callable_method_entry_without_refinements(VALUE klass, ID id); * rb_resolve_refined_method_callable(VALUE refinements, const rb_callable_method_entry_t *me); VM pushes rb_callable_method_entry_t, so that rb_vm_frame_method_entry() returns rb_callable_method_entry_t. You can check a super class of current method by rb_callable_method_entry_t::defined_class. * method.h: renamed from rb_method_entry_t::klass to rb_method_entry_t::owner. * internal.h: add rb_classext_struct::callable_m_tbl to cache rb_callable_method_entry_t data. We need to consider abotu this field again because it is only active for T_ICLASS. * class.c (method_entry_i): ditto. * class.c (rb_define_attr): rb_method_entry() does not takes defiend_class_ptr. * gc.c (mark_method_entry): mark RCLASS_CALLABLE_M_TBL() for T_ICLASS. * cont.c (fiber_init): rb_control_frame_t::klass is removed. * proc.c: fix `struct METHOD' data structure because rb_callable_method_t has all information. * vm_core.h: remove several fields. * rb_control_frame_t::klass. * rb_block_t::klass. And catch up changes. * eval.c: catch up changes. * gc.c: ditto. * insns.def: ditto. * vm.c: ditto. * vm_args.c: ditto. * vm_backtrace.c: ditto. * vm_dump.c: ditto. * vm_eval.c: ditto. * vm_insnhelper.c: ditto. * vm_method.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-03file.c: _wfreopen_s on mingwnobu
* win32/file.c: some mingw compilers need a tweek for the declarations of _wfreopen_s. [Bug #11320] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-03transcode.c: empty encoding namenobu
* transcode.c (rb_econv_set_replacement): target encoding name can be empty now. [ruby-core:69841] [Bug #11324] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-02delay `exception: false' checks for minor speedupnormal
Delay hash lookups until we are about to hit an exception. This gives a minor speedup ratio of 2-3% in the new bm_io_nonblock_noex benchmark as well as reducing code. * benchmark/bm_io_nonblock_noex.rb: new benchmark * ext/openssl/ossl_ssl.c (no_exception_p): new function (ossl_start_ssl): adjust for no_exception_p (ossl_ssl_connect): adjust ossl_start_ssl call (ossl_ssl_connect_nonblock): ditto (ossl_ssl_accept): ditto (ossl_ssl_accept_nonblock): ditto (ossl_ssl_read_internal): adjust for no_exception_p (ossl_ssl_write_internal): ditto (ossl_ssl_write): adjust ossl_write_internal call (ossl_ssl_write_nonblock): ditto * ext/stringio/stringio.c (strio_read_nonblock): delay exception check * io.c (no_exception_p): new function (io_getpartial): call no_exception_p (io_readpartial): adjust for io_getpartial (get_kwargs_exception): remove (io_read_nonblock): adjust for io_getpartial, check no_exception_p on EOF (io_write_nonblock): call no_exception_p (rb_io_write_nonblock): do not check `exception: false' (argf_getpartial): adjust for io_getpartial [ruby-core:69778] [Feature #11318] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-02dir.c: set errnonobu
* dir.c (replace_real_basename): Win32 API does not set errno, get the last error by GetLastError() and map to errno. [Bug #10015] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-02fix typos [ci skip]kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-02dir.c: show warningsnobu
* dir.c (replace_real_basename): show warnings at errors. [Bug #10015] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-02* gc.c: remove `#define RGENGC_OBJ_INFO 1' line introduced toko1
debug Bug #11244. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-02* gc.c (rb_raw_obj_info): separated from rb_obj_info().ko1
Fill internal object information into passed buffer. * gc.h: declare rb_raw_obj_info(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-02dir.c: update path typenobu
* dir.c (replace_real_basename): update path type by the target attributes if possible, to improve the performance. [Bug #10015] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-02* st.c: get rid of VC++'s warnings of C4700 (uninitialized localusa
variable used). I think that these are wrong, but should shut them up. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51105 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-02rubygems.rb: use @gem_prelude_indexnobu
* lib/rubygems.rb (Gem.load_path_insert_index): search @gem_prelude_index first. * lib/rubygems/test_case.rb (Gem::TestCase#setup): keep already expanded paths to prserve instance variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-02ruby.c: copy initial load path marksnobu
* ruby.c (process_options): also copy initial load path marks at setting load paths encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-02revert r51101nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-02skip test_dash_i_beats_gemsnobu
* test/rubygems/test_require.rb (test_dash_i_beats_gems): skip because the target feature just does not work. requiring a gem inserts its paths and its dependents' paths at the beginning of $LOAD_PATH, regardless -I options. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-02test_gem_server.rb: Don't specify port numbernobu
* test/rubygems/test_gem_server.rb (process_based_port): use dynamically chosen port numberss to get rid of conflicts. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-02* test/rubygems/test_gem_specification.rb: skip tests which theusa
platform does not permit the filename of its test file. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-02fix redefinitionsnobu
* test/rubygems/test_gem_resolver_git_specification.rb: require rubygems/installer.rb before Gem::TestCase#setup runs, otherwise as Gem::TestCase#teardown restores $LOADED_FEATURES to the state at that time, the requiring the file in GitSpecification#install method causes a lot of constant redefinitions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-02socket: memoize common socket families in fptr->modenormal
This provides a minor speedup by avoiding an extra syscall require 'socket' require 'benchmark' nr = 100000 msg = 'hello world' buf = '' size = msg.bytesize puts(Benchmark.measure do UNIXSocket.pair(:SEQPACKET) do |a, b| nr.times do a.sendmsg_nonblock(msg, 0, exception: false) b.recv(size, 0, buf) end end end) user system total real before: 0.330000 0.340000 0.670000 ( 0.678235) after: 0.290000 0.240000 0.530000 ( 0.534527) * ext/socket/rubysocket.h: flags for common socket families (rsock_getfamily): update signature * include/ruby/io.h: comment socket FMODE flags * ext/socket/init.c (rsock_getfamily): memoize family * ext/socket/basicsocket.c: adjust rsock_getfamily calls * ext/socket/ancdata.c: ditto [ruby-core:69713] [Feature #11298] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-02* lib/rubygems/resolver.rb: fixed NameError of Gem::Util::NULL_DEVICE.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-02* lib/rubygems/resolver.rb: fix error of null device reference with DOSISHhsbt
platform. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-01* lib/rubygems: Update to RubyGems HEAD(c202db2).hsbt
this version contains many enhancements see http://git.io/vtNwF * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-01fix a failure without zlibkazu
* test/net/http/test_httpresponse.rb (HTTPResponseTest#test_read_body_content_encoding_deflate_uppercase): fix failure without zlib. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-01* Add test for Enumerable#none? [fix GH-950] Patch by @yui-knkhsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-01struct.c: hide internal objectsnobu
* struct.c (struct_set_members): hide internal back_members object, and members object does not need to be duped as it should be frozen and hidden. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-01struct.c: fix implicit conversionsnobu
* struct.c (struct_member_pos): revert r51080 to fix other implicit conversions but cast the return value to fix the previous implicit conversion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-30* struct.c (struct_member_pos): avoid implicit conversion losesnaruse
integer precision: 'long' to 'int'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-30move RB_GC_GUARD responsibility to rb_add_method_iseqnormal
This simplifies all the callers and makes code easier to use and review. I was confused about the need for RB_GC_GUARD in define_{aset,aref}_method of struct.c without reading rb_add_method_iseq. Likewise, do the same for rb_iseq_clone, where the GC guard only seems neccesary iff RGenGC is disabled. * vm_method.c (rb_add_method_iseq): add RB_GC_GUARD * class.c (clone_method): remove RB_GC_GUARD * struct.c (define_aref_method): ditto (define_aset_method): ditto * vm.c (vm_define_method): * iseq.c (rb_iseq_clone): add RB_GC_GUARD git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-30struct.c: speedup for big structsnormal
use simple custom open-addressing hash for big structs. Original-patch-by: Sokolov Yura aka funny_falcon <funny.falcon@gmail.com> in https://bugs.ruby-lang.org/issues/10585 * struct.c (AREF_HASH_THRESHOLD): new macro (id_back_members): new ID (struct_member_pos_ideal): new function (struct_member_pos_probe): ditto (struct_set_members): ditto (struct_member_pos): ditto (rb_struct_getmember): use struct_member_pos for O(1) access (rb_struct_aref_sym): ditto (rb_struct_aset_sym): ditto (setup_struct): call struct_set_members (struct_define_without_accessor): ditto (Init_Struct): initialize __members_back__ [ruby-core:66851] [ruby-core:69705] [ruby-core:69821] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-30io.c: remove unnecessary sharednobu
* io.c (rb_io_reopen): FilePathValue() ensures the path NUL-terminated and frozen, so it is unnecessary to make it shared. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-30ensure paths NUL-terminatednobu
* dir.c (check_dirname): ensure path name NUL-terminated for SHARABLE_MIDDLE_SUBSTRING. * io.c (rb_sysopen): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-30* win32/file.c (rb_freopen): need to terminate by NUL.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-30io.c: reopen OS encoding pathnobu
* io.c (rb_io_reopen): freopen(3) with OS encoding path. [ruby-core:69780] [Bug #11320] * win32/file.c (rb_freopen): wrapper of wchar version freopen(3). use _wfreopen_s() if available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-29io.c: reopen stdio streams correctly when given "w+"normal
* io.c (rb_io_oflags_modestr): handle O_TRUNC correctly * test/ruby/test_io.rb (test_reopen_stdio): new test Patch-by: cremno phobia <cremno@mail.ru> [ruby-core:69779] [Bug #11319] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-29st.c: use ccan linked-list (try 3)normal
This improves the bm_vm2_bighash benchmark significantly by removing branches during insert, but slows down anything requiring iteration with the more complex loop termination checking. Speedup ratio of 1.10 - 1.20 is typical for the vm2_bighash benchmark. v3 - st_head calculates list_head address in two steps to avoid a bug in old gcc 4.4 (Debian 4.4.7-2) bug which incorrectly warned with: warning: dereferencing pointer ‘({anonymous})’ does break strict-aliasing rules * include/ruby/st.h (struct st_table): hide struct list_head * st.c (struct st_table_entry): adjust struct (head, tail): remove shortcut macros (st_head): new wrapper function (st_init_table_with_size): adjust to new struct and API (st_clear): ditto (add_direct): ditto (unpack_entries): ditto (rehash): ditto (st_copy): ditto (remove_entry): ditto (st_shift): ditto (st_foreach_check): ditto (st_foreach): ditto (get_keys): ditto (get_values): ditto (st_values_check): ditto (st_reverse_foreach_check): ditto (unused) (st_reverse_foreach): ditto (unused) [ruby-core:69726] [Misc #10278] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-29insns.def: no quotingnobu
* insns.def (defineclass): do not quote unprintable characters at raising an exception. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-29* lib/net/http/response.rb (inflater): CONTENT_ENCODING can be uppernaruse
case. [ruby-core:69670] [Bug #11285] patched by Andy Chu git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-29* eval.c (add_activated_refinement): should not include the originalshugo
class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-29* README.md: tweak styles. [fix GH-945][ci skip] Patch by @bryndymenthsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-28sizes.c.tmpl: extract RUBY_DEFINTnobu
* template/sizes.c.tmpl: extract RUBY_DEFINT to define sizes of types checked by configure.in, and fix size of intptr_t in universal binary. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-28insns.def: preserve encodingnobu
* insns.def (defineclass): preserve encoding of name in error messages for super class mismatch. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-28insns.def: preserve encodingnobu
* insns.def (defineclass): preserve encoding of name in error messages for non-class super. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-28insns.def: preserve encodingnobu
* insns.def (defineclass): preserve encoding of name in error messages when already defined but type mismatch. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-28class.c: TypeError when superclass mismatchnobu
* class.c (rb_define_class_id_under): raise TypeError exception same as ruby level class definition when superclass mismatch. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e