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

48059 Коммитов

Автор SHA1 Сообщение Дата
nobu b0d93a9949 debug.c: RSymbol info
* debug.c (ruby_dummy_gdb_enums): force to include struct RSymbol
  info.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-25 00:33:29 +00:00
normal 95e1c87014 file.c: fix possible alignment bugs in r60386
* file.c (struct apply_filename): split out from struct apply_arg
* file.c (apply2files): use offsetof for flex array size calculation
* file.c (apply2files): avoid redundant marking with ALLOCV
  [ruby-core:83535]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 23:35:52 +00:00
nobu 3fc0c18193 debug.c: imemo_mask
* .gdbinit (rp, rp_imemo, rb_ps_thread): update imemo_mask.

* debug.c (ruby_dummy_gdb_enums): include imemo_types.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 23:19:57 +00:00
marcandre e565c838ce lib/ostruct.rb: Use frozen literals.
Patch adapted from Espartaco Palma. [GH-1714] [Bug #14000]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 18:08:15 +00:00
svn e077e7956a * 2017-10-25
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 18:08:01 +00:00
marcandre 013dcf08a1 lib/weakref: Remove incorrect example [DOC] [Bug #14031]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 18:08:00 +00:00
ko1 a0fc5fbfd2 add NEWS entry about [Feature #14045]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 13:59:59 +00:00
nobu 8fc8587e05 sysconfdir on Windows
* ext/etc/etc.c (etc_sysconfdir): mentioned special case on
  Windows.  [ruby-core:43110] [Bug #6121]

* ext/etc/extconf.rb: define SYSCONFDIR only if sysconfdir is set
  in RbConfig::CONFIG and not empty.

* win32/Makefile.sub (config.status): sysconfdir is not used on
  Windows.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 13:48:08 +00:00
kazu 9885c1c79f Update call-seq of ARGF.read_nonblock
ARGF.read_nonblock supports `exception: false' like IO#read_nonblock
since 2.3.0.
[Feature #11358]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 12:10:32 +00:00
nobu 177856b8a7 Test for r60396
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 11:24:19 +00:00
naruse 1333c0f0df Revert "sysconfdir on Windows"
This reverts commit r60279.
This breaks mswin build:
https://ci.appveyor.com/project/ruby/ruby/build/1.0.5571

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 11:15:20 +00:00
svn f18caee991 * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 11:13:50 +00:00
ko1 5ee9513a71 Lazy Proc allocation for block parameters
[Feature #14045]

* insns.def (getblockparam, setblockparam): add special access
  instructions for block parameters.
  getblockparam checks VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM and
  if it is not set this instruction creates a Proc object from
  a given blcok and set VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM.
  setblockparam is similar to setlocal, but set
  VM_FRAME_FLAG_MODIFIED_BLOCK_PARAM.

* compile.c: use get/setblockparm instead get/setlocal instructions.
  Note that they are used for method local block parameters (def m(&b)),
  not for block local method parameters (iter{|&b|).

* proc.c (get_local_variable_ptr): creates Proc object for
  Binding#local_variable_get/set.

* safe.c (safe_setter): we need to create Proc objects for postponed
  block parameters when $SAFE is changed.

* vm_args.c (args_setup_block_parameter): used only for block local blcok
  parameters.

* vm_args.c (vm_caller_setup_arg_block): if called with
  VM_CALL_ARGS_BLOCKARG_BLOCKPARAM flag then passed block values should be
  a block handler.

* test/ruby/test_optimization.rb: add tests.

* benchmark/bm_vm1_blockparam*: added.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 11:13:49 +00:00
nobu d0d32ba1e8 ruby.c: fix r60393
* ruby.c (load_file_internal): set loop options after parsing
  shebang line.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 11:09:41 +00:00
nobu 49b25aaa22 vm_eval.c: all value type cases
* vm_eval.c (rb_type_str): ensure all value types are covered.
  missed types would be warned by -Wswitch option of gcc.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 08:13:13 +00:00
nobu 2c786bf35d Removed NODE_OPT_N
* node.h (NODE_OPT_N): removed.

* parse.y (parser_append_options): expand -n option loop to while
  gets loop.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 08:00:36 +00:00
nobu 30f5c55890 parse.y: rb_parser_set_options
* parse.y (yycompile0): append top-level addenda before appending
  prelude nodes.

* parse.y (rb_parser_set_options): set top-level addendum options
  before parsing.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 07:41:48 +00:00
nobu 184845f2cd vm_eval.c: uncallable_object
* vm_eval.c (uncallable_object): extract error case as a no-return
  function.  split successive ?-marks not to get confused with a
  trigraph.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 07:17:36 +00:00
mame e1b6f0f529 Avoid many type casts
The idiom `rb_gc_force_recycle((VALUE)...)` was used heavily.
This change defines `rb_discard_nod(NODE*)` and allows C compiler to
typecheck.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 06:27:58 +00:00
mame ac3bad418c Remove dynamic NODE allocation out of parser
A temporary NODE object was allocated to create iseq.  Instead, this
patch allocates a dummy NODE as auto variable, and discard it soon.
This change is intended as a preparation to manage AST NODEs out of GC.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 06:16:31 +00:00
mame f70aa7637b Remove special handling for (NODE*)1
The magic number was used to mark NODE_ATTRASGN when its receiver is
self.  But the hack was refactored at r46366.  So the remaining code
fragments are no longer needed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 05:54:30 +00:00
normal 752faf4fb4 net/http: use require_relative to reduce syscalls
require_relative speeds up loading of files by reducing path
lookups.  On a clean install with RubyGems-enabled,
"ruby -rnet/http -e exit" shows a reduction in failed open(2)
syscalls from 410 to 350 (x86-64 GNU/Linux).

I could not measure a time difference on my Linux-based
machines, however this should be noticeable to users of other
kernels with worse syscall and VFS performance than Linux.

Further use of require_relative will reduce lookups in other
places.

* lib/net/http.rb: use require_relative
  [ruby-core:78285] [Feature #12973]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 01:22:08 +00:00
svn fe115fb84f * properties.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 01:20:05 +00:00
normal cb9c849af6 file.c: apply2files releases GVL
This means File.chmod, File.lchmod, File.chown, File.lchown,
File.unlink, and File.utime operations on slow filesystems
no longer hold up other threads.

The platform-specific utime_failed changes is compile-tested
using a new UTIME_EINVAL macro

This hurts performance on fast filesystem, but these methods
are unlikely to be performance bottlenecks and (IMHO) avoiding
pathological slowdowns and stalls are more important.

benchmark results:
minimum results in each 3 measurements.
Execution time (sec)
name	trunk	built
file_chmod	0.591	0.801

Speedup ratio: compare with the result of `trunk' (greater is better)
name	built
file_chmod	0.737

* file.c (UTIME_EINVAL): new macro to ease compile-testing
* file.c (struct apply_arg): new struct
* file.c (no_gvl_apply2files): new function
* file.c (apply2files): release GVL
* file.c (chmod_internal): adjust for apply2files changes
* file.c (lchmod_internal): ditto
* file.c (chown_internal): ditto
* file.c (lchown_internal): ditto
* file.c (utime_failed): ditto
* file.c (utime_internal): ditto
* file.c (unlink_internal): ditto
  [ruby-core:83200] [Feature #13996]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-24 01:20:04 +00:00
svn 74fa8c15f4 * 2017-10-24
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23 21:50:10 +00:00
normal 73c397acb5 thread_pthread: do not corrupt stack
This fixes stuck test/ruby/test_io.rb with FIBER_USE_NATIVE=0 on
GNU/Linux because linked-list pointers used by glibc get
corrupted when fiber stacks are copied.

Thanks to wanabe for finding the bug and original patch.

* thread_pthread (native_thread_init_stack): fix stack corruption
  [ruby-core:82737] [Bug #13387]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23 21:50:08 +00:00
nobu 30d23ec903 multiple arguments to write
Make write methods of IO-like objects accept multiple arguments,
as well as IO#write.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23 14:05:07 +00:00
yui-knk 8bbdbf9e75 Add test cases for branch coverage
* test/coverage/test_coverage.rb (test_branch_coverage_for_while_statement):
  Add test cases for modifier while/until.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23 13:25:59 +00:00
kazu 3ee8e906b8 Fix a typo [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23 12:59:05 +00:00
naruse 9ba147dce6 OpenSSL may show the different error message
d02211c9da (commitcomment-25119729)
From: MSP-Greg <MSP-Greg@users.noreply.github.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23 08:28:05 +00:00
nobu 585cbf6535 zlib.c: multiple arguments to write
* ext/zlib/zlib.c (rb_gzwriter_write): accepts multiple arguments.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23 07:06:12 +00:00
nobu cf4351f82a error.c: warning to write multiple arguments
* error.c (warning_write): accepts multiple arguments to merge
  multiple warning messages.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23 06:42:37 +00:00
nobu aeaeb4b068 stringio.c: write multiple arguments
* ext/stringio/stringio.c (strio_write_m): make StringIO#write
  accept multiple arguments, as well as IO#write.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23 06:25:39 +00:00
nobu 5682bc6ac5 NEWS: add [Feature #9323] [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23 06:05:46 +00:00
hsbt a866167de5 Removed empty dir.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23 05:58:59 +00:00
hsbt 0e2d2e6a79 Drop to support NaCl platform.
Because NaCl and PNaCl are already sunset status.
  see https://bugs.chromium.org/p/chromium/issues/detail?id=239656#c160

  configure.ac: Patch for this file was provided by @nobu.

  [Feature #14041][ruby-core:83497][fix GH-1726]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23 05:56:25 +00:00
nobu 08524bc594 io.c: fix infinite retry
* io.c (io_binwritev): fix infinite retry when flushing buffered
  data.  [Feature #9323]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23 05:28:12 +00:00
nobu 71a7ef31d7 io.c: fix buffered output
* io.c (io_binwritev): append to buffered data, not overwriting.
  [Feature #9323]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23 05:09:35 +00:00
nobu 92023a8f60 io.c: fix total
* io.c (io_writev): total may be a bignum.  [Feature #9323]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23 05:09:34 +00:00
nobu c0f40369b6 io.c: no restriction
* io.c (io_write_m): remove argc restriction upto IOV_MAX-1.
  [Feature #9323]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23 02:25:58 +00:00
sonots cb4a2a6113 common.mk: add install-capi to make help
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22 16:57:16 +00:00
svn d70189d973 * 2017-10-23
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22 16:03:58 +00:00
kou 5e64882123 rss itunes: fix a bug that <itunes:explicit> value isn't fully supported
Fix GH-1725

<itunes:explicit> accepts "explicit", "yes", "true", "clean", "no" and
"false" as valid values.

Here is the <itunes:explicit>'s description in
https://help.apple.com/itc/podcasts_connect/#/itcb54353390:

> The <itunes:explicit> tag indicates whether your podcast contains
> explicit material. You can specify the following values:
>
>   * Yes | Explicit | True. If you specify yes, explicit, or true,
>     indicating the presence of explicit content, the iTunes Store
>     displays an Explicit parental advisory graphic for your podcast.
>
>   * Clean | No | False. If you specify clean, no, or false, indicating
>     that none of your podcast episodes contain explicit language or
>     adult content, the iTunes Store displays a Clean parental
>     advisory graphic for your podcast.

I don't know whether <itunes:explicit> value is case sensitive or
insensitive. But the current implementation is case insensitive.

Reported by Valerie Woolard Srinivasan. Thanks!!!


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22 16:03:57 +00:00
yui-knk 588ac3ee1f Add test cases for branch coverage
* test/coverage/test_coverage.rb (test_branch_coverage_for_if_statement):
  Add a test case for ternary operator.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22 14:13:50 +00:00
yui-knk ef29f8db80 Add test cases for branch coverage
* test/coverage/test_coverage.rb (test_branch_coverage_for_if_statement):
  Add test cases for modifier if/unless.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22 13:58:55 +00:00
yui-knk ecdac92e50 Add test cases for branch coverage
* test/coverage/test_coverage.rb (test_branch_coverage_for_if_statement):
  Add test cases for if/unless without else clauses.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22 13:49:41 +00:00
yui-knk de482ab143 test/coverage/test_coverage.rb: Use `<<~` to ease to calculate column of target codes
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22 13:34:24 +00:00
yui-knk 755dd9f461 Add column numbers to branch coverage
* compile.c (DECL_BRANCH_BASE, ADD_TRACE_BRANCH_COVERAGE): Add
  column to arguments.

* compile.c (compile_if, compile_case, compile_when, compile_loop, iseq_compile_each0):
  Pass column numbers to macros.

* ext/coverage/coverage.c (branch_coverage): Add column numbers to
  a return value.

* test/coverage/test_coverage.rb: Follow-up these changes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22 13:18:40 +00:00
knu 47d939a7c0 Mention `Set#reset`
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22 12:26:21 +00:00
knu 8c90432af7 Add `Set#reset`
This method resets the internal state of a set after modification to
existing elements, reindexing and deduplicating them. [Feature #6589]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-22 12:25:34 +00:00