Граф коммитов

40693 Коммитов

Автор SHA1 Сообщение Дата
nobu 563127d710 dir.c: give pathlen from callers
* dir.c (glob_helper): move pathlen to argument which is known in
  the callers almost.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-30 08:12:14 +00:00
nobu ae739c75f8 vm_args.c: optimize symbol block passing
* vm_args.c (vm_caller_setup_arg_block): bypass Symbol#to_proc
  call to optimize symbol block passing.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-30 06:47:18 +00:00
nobu 66296d3774 proc.c: include symbol name
* proc.c (proc_to_s): include the original symbol name in string
  form.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-30 06:36:11 +00:00
nobu c2310baf9a parse.y: reorder conditions
* parse.y (token_info_pop): scan lex buffer only when token info
  is enabled.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-29 16:47:13 +00:00
nobu aad3a8679f parse.y: token length
* parse.y (token_info_push, token_info_push): add token length
  parameter instead of strlen.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-29 16:38:02 +00:00
svn e1c189bef3 * 2015-09-30
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-29 16:36:57 +00:00
nobu 17ff3b9b85 parse.y: fix memory leak
* parse.y (parser_free): fix memory leak at syntax error when
  warn-indent is enabled.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-29 16:34:37 +00:00
eregon b881747bbd * parse.y: fix minor typo. [ci skip][fix GH-1038].
Patch by @ltratt.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-29 13:29:44 +00:00
nobu 13d53f9ae9 parse.y: mark
* parse.y (parser_mark): mark compile option hash.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-29 12:13:30 +00:00
nobu ecefee85b7 bm_vm3_gc.rb: no shebang
* benchmark/bm_vm3_gc.rb: remove unnecessary shebang line.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-29 08:03:12 +00:00
nobu a136301dea unicode_norm_gen.tmpl: end marker
* template/unicode_norm_gen.tmpl: pragma needs the end marker too,
  not only the beginning marker.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-29 08:00:36 +00:00
duerst 1fb502caca tool/unicode_norm_gen.tmpl, lib/unicode_normalize/tables.rb:
get rid of many .freeze commands by using frozen_string_literal
pragma.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-29 07:54:05 +00:00
nobu ed8b452e37 compile.c: fix performance of strconcat
* compile.c (compile_dstr_fragments): fix performance by omitting
  the first empty string only for keeping literal encoding if
  other literals are too.  [ruby-core:70930] [Bug #11556]
* string.c (rb_str_append_literal): append but keep encoding non
  US-ASCII.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-29 07:37:40 +00:00
nobu 06b3702753 bm_vm_symbol_block_pass.rb: rename
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-29 00:21:10 +00:00
nobu 7f99972869 benchmark for symbol block passing
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-28 18:10:16 +00:00
nobu 866952300d proc.c: fix GC guard location
* proc.c (proc_call): fix GC guard location after the use of its
  content.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-28 17:30:09 +00:00
svn ca264b0a88 * 2015-09-29
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-28 16:11:55 +00:00
nobu 8007168baf vsnprintf.c: constify
* vsnprintf.c (FILE::vextra): constify the return value.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-28 16:11:41 +00:00
shugo 275b38937e * lib/net/ftp.rb (mtime): use usec instead of fractions to parse
decimal fractions of a second correctly when the number of digits
  is not 6.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-28 08:43:44 +00:00
shugo 040ae91040 * lib/net/ftp.rb (mtime): parse decimal fractions of a second as
specified in RFC 3659.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-28 07:10:25 +00:00
nobu 4191a6b90d preserve encodings in error messages
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-28 02:40:46 +00:00
svn 7d49923e9e * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-28 01:33:00 +00:00
svn 8254862fa3 * 2015-09-28
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-28 01:31:33 +00:00
hsbt d92470bbc2 * test/test_forwardable.rb: Write basic tests for lib/forwardable.
[fix GH-1035] Patch by @kachick

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-28 01:31:17 +00:00
nobu eb47de3005 class.c: refine error messages
* class.c (rb_define_class, rb_define_class_id_under): refine
  error messages.
* class.c (rb_define_module, rb_define_module_id_under): ditto,
  and make consistent with class.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-27 14:32:50 +00:00
nobu dca6009c3e tkutil.c: use local variables
* ext/tk/tkutil/tkutil.c (cbsubst_table_setup): use local
  variables instead of repeating RARRAY_PTR.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-27 09:57:58 +00:00
hsbt 05b844723b * ChangeLog: removed duplicated message.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-27 09:44:50 +00:00
nobu 1fd890ea43 test_rubyoptions.rb: test combinations
* test/ruby/test_rubyoptions.rb (test_frozen_string_literal): test
  combinations of command line option and pragma.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-27 09:27:57 +00:00
nobu 832c74f428 ruby.c: frozen-string-literal option
* ruby.c (process_options): add an option to enable/disable
  frozen-string-literal.  [Feature #8976]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-27 06:47:00 +00:00
nobu 859337b17b fronzen-string-literal pragma
* compile.c (iseq_compile_each): override compile option by option
  given by pragma.
* iseq.c (rb_iseq_make_compile_option): extract a function to
  overwrite rb_compile_option_t.
* parse.y (parser_set_compile_option_flag): introduce pragma to
  override compile options.
* parse.y (magic_comments): new pragma "fronzen-string-literal".
  [Feature #8976]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-27 06:44:02 +00:00
nobu 71730b4243 test/unit/assertions.rb: all_assertions
* test/lib/test/unit/assertions.rb (all_assertions): try all
  assertions and check if all passed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-27 06:35:10 +00:00
nobu 6b52b88d46 ruby.c: abbreviated option name
* ruby.c (name_match_p): allow option argument names to be
  abbreviated for each words.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-27 05:47:24 +00:00
nobu 7f13f878cf id_table.c: fix prototype names
* id_table.c: fix prototype names, missing underscore prefixes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-27 00:23:18 +00:00
nobu 33ed298379 id_table.c: fix prototype names
* id_table.c: fix prototype names, missing underscore prefixes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-27 00:17:53 +00:00
nobu 6b64ffd225 id_table.c: suppress warnings
* id_table.c (UNUSED): mark implementation functions maybe-unused
  to suppress warnings by old gcc.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-27 00:10:47 +00:00
nobu b1cfb98e9e ostruct.rb: fix NameError
* lib/ostruct.rb (delete_field): do not raise NameError for
  existing keys.  [Fix GH-1033]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-26 23:16:37 +00:00
nobu 690f2c7230 common.mk: clear envs for GEM
* common.mk: clear environment variables for GEM paths to get rid
  of searching unexpected gems.  fix failures on travis-ci.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-26 17:52:46 +00:00
svn a0db078eae * 2015-09-27
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-26 16:06:12 +00:00
zzak 7fa2155805 * lib/ostruct.rb: Move method definitions for getter/setter to be lazy
Patch by @sferik in [GH-1033]: https://github.com/ruby/ruby/pull/1033

Instead of defining two methods -- a reader and writer -- for each
OpenStruct attribute when it is initialized, define them lazily, the
first time either one is called. This adheres to the principle of "pay for
use": methods that are never accessed are never defined. This optimization
makes initialization an order of magnitude faster for objects with 100
attributes. In the worst-case scenario, where every attribute is accessed,
performance is no worse than it is today.

Benchmark
---------
require 'benchmark/ips'
require 'ostruct'

N = 100
ATTRS = (:aa..:zz).take(N)
HASH = Hash[ATTRS.map { |x| [x, x] }]

def ostruct
  OpenStruct.new(HASH)
end

Benchmark.ips do |x|
  x.report('ostruct') { ostruct }
end

-------------------------------------------------
   before       2.279k (± 8.8%) i/s -     11.395k
   after       24.702k (±12.8%) i/s -    122.600k
-------------------------------------------------


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-26 16:05:52 +00:00
nobu 0d71c07d49 prelude.c.tmpl: workaround
* template/prelude.c.tmpl: prevent ruby-mode from confusion.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-26 13:33:17 +00:00
svn f836f11aa9 * 2015-09-26
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-26 13:18:25 +00:00
nobu 9c7d3c9d59 test_syntax.rb: split
* test/ruby/test_syntax.rb (test_keyword_splat): split duplicate
  keywords tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-26 13:17:30 +00:00
nobu 6b380a441e marshal.c: reduce arity checks
* marshal.c (rb_marshal_dump_limited): get rid of redundant arity
  check to dump object with limited nest level.

* marshal.c (rb_marshal_load_with_proc): get rid of redundant arity
  check to load object with hook proc.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-25 13:14:16 +00:00
nobu 1b9410083e marshal.c: reentrant checks
* marshal.c (dump_funcall, dump_check_funcall, load_funcall):
  function calls with reentrant check.  always show names
  corresponding to the called methods.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-25 12:45:10 +00:00
nobu 2c1aa2caab marshal.c: use STATIC_ASSERT
* marshal.c (MARSHAL_INFECTION): check size by STATIC_ASSERT.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-25 12:38:26 +00:00
nobu 460152ea73 parser.c: update
* ext/json/parser/parser.c: update to r51946.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-25 08:08:58 +00:00
nobu f12fccbec5 parser.rl: rb_scan_args
* ext/json/parser/parser.rl (cParser_initialize): use ':' in
  rb_scan_args.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-25 08:06:57 +00:00
nobu c416efa440 hash.c: GC guards
* hash.c (env_delete, env_aset): prevent environment variable
  names from GC while ruby_setenv.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-25 07:08:45 +00:00
hsbt 08b54fbd0d * lib/net/http.rb: removed unused variable. It's removed at r13648.
[fix GH-1022] Patch by @nkondratyev

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-25 01:07:30 +00:00
hsbt a45ec9c6e5 * gems/bundled_gems: upgrade to minitest-5.8.1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-25 00:48:49 +00:00