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

46269 Коммитов

Автор SHA1 Сообщение Дата
svn 581c447ff9 * 2017-04-22
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58436 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 15:00:31 +00:00
ko1 5f5bc068ed insert WB correctly.
* hash.c (hash_insert_raw): should insert WB.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 15:00:30 +00:00
ko1 a7db632088 mark created frozen strings.
* hash.c (rb_hash_new_from_values_with_klass): before this fix,
  only a st table are filled with passed values. However, newly
  created frozen strings are not marked correctly only reference
  from st table. This patch marks such created frozen strings
  by Hash object which refers to the st table.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 11:02:10 +00:00
kazu 34f1488895 Remove empty directories
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 11:00:10 +00:00
hsbt 7a856b11c8 Removed mathn.rb from stdlib. It's deprecated from Ruby 2.2.
[Feature #10169][[ruby-core:64553]]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 06:16:11 +00:00
nobu 20d81b4287 test_framework.rb: for case-sensitive filesystem
* test/mkmf/test_framework.rb (test_single_framework): fix header
  file name for case-sensitive filesystem.  it may not be same as
  the framework name, but should be the actual file name.
  [ruby-dev:50093] [Bug #13489]

* test/mkmf/test_framework.rb (test_multi_frameworks): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 06:12:27 +00:00
rhe 70c9bb4b81 Remove missing/strtol.c
It is never used. We don't need it anyway as it's part of C89 which is
our current minimum requirement.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 06:03:12 +00:00
shyouhei 16ffd47639 NEWS entry for [Feature #13302]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 05:35:34 +00:00
shyouhei 0c082fe658 typo fix (sorry!)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 04:42:09 +00:00
shyouhei 4ee09d914d refactor hash literal
Same as rb_ary_tmp_new_from_values(), it reduces vm_exec_core binary
size from 26,176 bytes to 26,080 bytes.  But this time, also with a
bit of optimizations:

  - Because we are allocating a new hash and no back references are
    introduced at all, we can safely skip write barriers.

  - Also, the iteration never recurs.  We can avoid complicated
    function callbacks by using st_insert instead of st_update.

----

	* hash.c (rb_hash_new_from_values): refactor
          extract the bulk insert into a function.

	* hash.c (rb_hash_new_from_object): also refactor.

	* hash.c (rb_hash_s_create): use the new functions.

	* insns.def (newhash): ditto.

	* vm.c (core_hash_from_ary): ditto.

	* iternal.h: export the new function.

-----------------------------------------------------------
benchmark results:
minimum results in each 7 measurements.
Execution time (sec)
name    before  after
loop_whileloop2  0.135  0.134
vm2_bighash*     1.236  0.687

Speedup ratio: compare with the result of `before' (greater is better)
name    after
loop_whileloop2 1.008
vm2_bighash*    1.798


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 04:21:14 +00:00
nobu bdc6d41640 ext/extmk.rb: colorize notes [Feature #13302]
* common.mk (build-ext): pass variables to colorize.

* ext/extmk.rb: colorize notes with tool/colorize.rb.

* tool/colorize.rb: extract from tool/generic_erb.rb.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 03:01:12 +00:00
nobu 3ca61bb04e exts.mk: refine notes [Feature #13302]
* ext/extmk.rb: split notes into header and footer, which are
  common, from bodies which are unique for each extensions.

* template/exts.mk.tmpl: now each notes are not one line, should
  not unique.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 02:43:25 +00:00
nobu 5651313b85 vm_dump.c: non-scalar thread_id
* vm_dump.c (rb_vmdebug_stack_dump_all_threads): fix for
  non-scalar thread_id platforms.  c.f. [Bug #9884]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 00:53:26 +00:00
nobu c483ae6572 Suppress a warning in ruby/win32.h [Fix GH-1591]
Fix a warning in ruby/win32.h which can cause failures with mkmf

The return value is implicit type casted from 'long double' to 'double', currently.
This causes a gcc warning like this:

```
In file included from C:\Ruby24-x64\include\ruby-2.4.0/ruby/defines.h:243:0,
                 from C:\Ruby24-x64\include\ruby-2.4.0/ruby/ruby.h:36,
                 from C:\Ruby24-x64\include\ruby-2.4.0/ruby.h:33,
                 from conftest.c:1:
C:\Ruby24-x64\include\ruby-2.4.0/ruby/win32.h: In function 'rb_w32_pow':
C:\Ruby24-x64\include\ruby-2.4.0/ruby/win32.h:786:12: warning: conversion to 'double' from 'long double' may alter its value [-Wfloat-conversion]
     return powl(x, y);
            ^~~~~~~~~~
```

This is fixed by the attached explicit type cast.

Moreover when CFLAGS is set to '-Wconversion', it prevents the compiler from
building. This is the case at the nokogiri gem.

The original issue arose at RubyInstaller2: 576a0eb70a

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21 00:11:56 +00:00
ko1 8b31febd15 use correct synchronization.
* test/ruby/test_thread.rb (make_handle_interrupt_test_thread1): use Queue
  to use correct synchronization.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-20 22:52:57 +00:00
ko1 8934082ec4 * vm_dump.c (rb_vmdebug_stack_dump_all_threads): cast to `void*`.
Pointed out at
  <fbc1deca89 (commitcomment-21839826)>


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-20 15:58:35 +00:00
svn df53b325b0 * 2017-04-21
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-20 15:02:56 +00:00
ko1 1721dfa0ea release monitor correctly.
* lib/rubygems/core_ext/kernel_require.rb: sometimes
  `Kernel.send(:gem, spec.name)` can raise some errors
  (Gem::MissingSpecError I observed) and this method
  doesn't release RUBYGEMS_ACTIVATION_MONITOR correctly.
  This patch fix this problem.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-20 15:02:55 +00:00
nobu f14f0d3464 ruby-lex.rb: fix continued line conditions
* lib/irb/ruby-lex.rb (RubyLex#lex): fix conditions for continued
  line; empty lines, a semicolon, first line in `begin` block,
  just after `else` are not continued.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-20 11:07:02 +00:00
nobu 716ce65138 ruby-lex.rb: merge regexps
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-20 11:07:00 +00:00
shyouhei 5069122ab6 refactor torexp to use routine in array.c
Found a part where copy&paste can be eliminated.  Reduces vm_exec_core
from 26,228 bytes to 26,176 bytes in size on my machine. I believe it
does not affect any runtime performance.

----

	* array.c (rb_ary_tmp_new_from_values): extend existing
          rb_ary_new_from_values function so that it can take
          additional value for klass.
	* array.c (rb_ary_new_from_values): use the new function.
	* insns.def (toregexp): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-20 10:32:08 +00:00
hsbt 6a08beef51 Removed math mode from irb.
mathn is deprecated from Ruby 2.2.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-20 09:11:36 +00:00
nobu 23e481e390 common.mk: separate note
* common.mk (build-ext): separate note from building extensions,
  not to be intermingled.  [ruby-core:80759] [Feature #13302]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-20 08:31:20 +00:00
hsbt 7b3ac07781 Removed deprecated extensions of mathn.
* ext/mathn/{complex,rational}: Removed from ruby core.
    [fix GH-1542][Feature #13334][ruby-core:80247]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-20 08:21:24 +00:00
nobu b58a30e1c1 extmk.rb: fail for mandatory libraries
* ext/extmk.rb: fail if a mandatory extension library failed to
  configure.  [ruby-core:80759] [Feature #13302]

* template/exts.mk.tmpl: move `exit` at the end.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-20 08:13:16 +00:00
stomar cafa438f80 improve man pages
* man/ruby.1, man/erb.1, man/goruby.1, man/irb.1:
  fix document title formatting and volume name,
  improve "REPORTING BUGS" section: fix mdoc formatting error
  (wrong macro for bullet list items), small rewordings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-20 07:46:22 +00:00
stomar 760472349d ri.1: rewrite ri man page
* man/ri.1: update the (very outdated) ri man page:
  * update document date
  * fix document title formatting and volume name
  * update descriptions and options to current ri --help text
  * fix some mdoc formatting errors (missing escaping of `\',
    wrong macro for bullet list items)
  * various rewordings and other improvements

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-20 07:44:54 +00:00
stomar 3d709948f7 ri.1: fix errors in ri man page
* man/ri.1: fix some errors in ri man page (add missing options,
  remove options that do not exist, fix formatter list).

  Reported by Josh Cheek.  [ruby-core:68065] [Bug #10838]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-20 07:44:01 +00:00
ko1 fbc1deca89 add a debug function.
* vm_dump.c (rb_vmdebug_stack_dump_all_threads): dump stack dump
  for all living threads.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-20 04:50:53 +00:00
usa abbabbf8c8 Move test_extlibs.rb because it's not the test of ruby itself
* test/test_extlibs.rb: moved from test/ruby.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-20 01:36:11 +00:00
svn edd063ab1a * 2017-04-20
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-19 15:14:04 +00:00
nobu f0e5e05609 fix infinite recursion
* vm_insnhelper.c (vm_once_dispatch): no guarantee that tail call
  is always optimized away.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-19 15:14:03 +00:00
rhe 826f16d465 extmk.rb: improve message printed when configuring extensions fails
Point to the mkmf.log if configuring an extension fails so that people
can find and fix the culprit easily.  [ruby-core:80131] [Feature #13302]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-19 14:05:26 +00:00
hsbt cd8f990442 Rervert r58304. Because Rubygems have specialized finder for default gems.
We need to list library entries for default gems.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-19 11:50:03 +00:00
shyouhei 524fb0138b refactor extract binop dispatcher
Those opt_something instructions are worth refactoring. They tend to
have similar ways of executions.  By extracting the common part,
generated vm_exec_core function shrinks from 26,816 bytes to 26,256
bytes (according to nm(1)).

This changeset introduces negligible performance impact.  3 repeated
runs of optcarrot benchmark on my machine resulted in:

   before this: 28.813363684823557, 27.523907198440366, 27.292766121965400
   after  this: 28.174038497265080, 28.999513875020405, 29.621399800428065

in fps (greater==faster).

----

	* vm_insnhelper.c (vm_opt_binop_dispatch): new function.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-19 07:27:03 +00:00
svn 0848b68a9b * 2017-04-19
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-19 01:08:17 +00:00
normal c32fc82d0e socket: avoid fcntl for read/write_nonblock on Linux
On platforms where MSG_DONTWAIT works reliably on all sockets
(so far, I know of Linux), we can avoid fcntl syscalls and
implement IO#write_nonblock and IO#read_nonblock in terms of the
socket-specific send and recv family of syscalls.

This avoids side effects on the socket, and also encourages
generic code to be written in cases where IO wrappers like
OpenSSL::SSL::SSLSocket are used.

Perhaps in the future, side-effect-free non-blocking I/O can
be standard on all files and OSes: https://cr.yp.to/unix/nonblock.html

* ext/socket/lib/socket.rb (read_nonblock, write_nonblock):
  Linux-specific wrapper without side effects
  [ruby-core:80780] [Feature #13362]
* test/socket/test_basicsocket.rb (test_read_write_nonblock):
  new test

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-19 01:08:16 +00:00
nobu 0013fdaaa5 fixup! vm_insnhelper.c: adjust indent [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-18 13:14:08 +00:00
nobu 5cc56f0d9b compile.c: wrong optimization
* compile.c (compile_branch_condition): expression which has side
  effects should not be eliminated.
  [ruby-core:80740] [Bug #13444]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-18 13:14:06 +00:00
nobu d939fdc119 vm_insnhelper.c: adjust indent [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-18 13:14:05 +00:00
shyouhei 93b1b04a20 typo fix (sorry!) [ci skip]
Surprisingly this was not a syntax error on my machine.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-18 13:05:38 +00:00
nobu 89b13fd364 test_optimization.rb: heredoc code style
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-18 13:02:56 +00:00
ko1 37d2f9724c fix compile error.
* insns.def (trace): use cast `flag` to pass compilation with clang on MacOSX.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-18 12:30:59 +00:00
hsbt 97a114de44 Fix heading of README.
[Fix GH-1586] Patch by @jbampton

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-18 11:55:44 +00:00
shyouhei 4a8c235fed tabify (sorry!) [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-18 11:06:58 +00:00
svn ee4ce52d01 * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-18 10:58:50 +00:00
shyouhei 4d21d1f04b split insns.def into functions
Contemporary C compilers are good at function inlining.  They fold
multiple functions into one.  However they are not yet smart enough to
unfold a function into several ones.  So generally speaking, it is
wiser for a C programmer to manually split C functions whenever
possible.  That should make rooms for compilers to optimize at will.

Before this changeset insns.def was converted into single HUGE
function called vm_exec_core().  By moving each instruction's core
into individual functions, generated C source code is reduced from
3,428 lines to 2,847 lines.  Looking at the generated assembly
however, it seems my compiler (gcc 6.2) is extraordinary smart so that
it inlines almost all functions I introduced in this changeset back
into that vm_exec_core.  On my machine compiled machine binary of the
function does not shrink very much in size (28,432 bytes to 26,816
bytes, according to nm(1)).

I believe this change is zero-cost.  Several benchmarks I exercised
showed no significant difference beyond error mergin.  For instance
3 repeated runs of optcarrot benchmark on my machine resulted in:

   before this: 28.330329285707490, 27.513378371065920, 29.40420215754537
   after  this: 27.107195867280414, 25.549324021385907, 30.31581919050884

in fps (greater==faster).

----

	* internal.h (rb_obj_not_equal): used from vm_insnhelper.c
	* insns.def: move vast majority of lines into vm_insnhelper.c
	* vm_insnhelper.c: moved here.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-18 10:58:49 +00:00
nobu d9ea26de88 eval.c: fix exit inside TAG
* eval.c (setup_exception): do not exit by goto inside
  PUSH_TAG/POP_TAG.  it causes an infinite loop.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-18 08:34:40 +00:00
nobu a8faecc1e6 configure.in: honor GIT env
* configure.in (--with-git): honor environment variable GIT if
  set.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-18 05:56:34 +00:00
nobu 2103197cce vcs.rb: env for command
* tool/vcs.rb (VCS::SVN::COMMAND, VCS::GIT::COMMAND): customize
  command paths by environment variables.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-18 02:58:45 +00:00