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

11239 Коммитов

Автор SHA1 Сообщение Дата
ko1 8f675cdd00 support theap for T_HASH. [Feature #14989]
* hash.c, internal.h: support theap for small Hash.
  Introduce RHASH_ARRAY (li_table) besides st_table and small Hash
  (<=8 entries) are managed by an array data structure.
  This array data can be managed by theap.
  If st_table is needed, then converting array data to st_table data.

  For st_table using code, we prepare "stlike" APIs which accepts hash value
  and are very similar to st_ APIs.

  This work is based on the GSoC achievement
  by tacinight <tacingiht@gmail.com> and refined by ko1.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-30 22:11:51 +00:00
ko1 312b105d0e introduce TransientHeap. [Bug #14858]
* transient_heap.c, transient_heap.h: implement TransientHeap (theap).
  theap is designed for Ruby's object system. theap is like Eden heap
  on generational GC terminology. theap allocation is very fast because
  it only needs to bump up pointer and deallocation is also fast because
  we don't do anything. However we need to evacuate (Copy GC terminology)
  if theap memory is long-lived. Evacuation logic is needed for each type.

  See [Bug #14858] for details.

* array.c: Now, theap for T_ARRAY is supported.

  ary_heap_alloc() tries to allocate memory area from theap. If this trial
  sccesses, this array has theap ptr and RARRAY_TRANSIENT_FLAG is turned on.
  We don't need to free theap ptr.

* ruby.h: RARRAY_CONST_PTR() returns malloc'ed memory area. It menas that
  if ary is allocated at theap, force evacuation to malloc'ed memory.
  It makes programs slow, but very compatible with current code because
  theap memory can be evacuated (theap memory will be recycled).

  If you want to get transient heap ptr, use RARRAY_CONST_PTR_TRANSIENT()
  instead of RARRAY_CONST_PTR(). If you can't understand when evacuation
  will occur, use RARRAY_CONST_PTR().

(re-commit of r65444)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-30 21:53:56 +00:00
ko1 7d359f9b69 revert r65444 and r65446 because of commit miss
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-30 21:01:55 +00:00
ko1 90ac549fa6 introduce TransientHeap. [Bug #14858]
* transient_heap.c, transient_heap.h: implement TransientHeap (theap).
  theap is designed for Ruby's object system. theap is like Eden heap
  on generational GC terminology. theap allocation is very fast because
  it only needs to bump up pointer and deallocation is also fast because
  we don't do anything. However we need to evacuate (Copy GC terminology)
  if theap memory is long-lived. Evacuation logic is needed for each type.

  See [Bug #14858] for details.

* array.c: Now, theap for T_ARRAY is supported.

  ary_heap_alloc() tries to allocate memory area from theap. If this trial
  sccesses, this array has theap ptr and RARRAY_TRANSIENT_FLAG is turned on.
  We don't need to free theap ptr.

* ruby.h: RARRAY_CONST_PTR() returns malloc'ed memory area. It menas that
  if ary is allocated at theap, force evacuation to malloc'ed memory.
  It makes programs slow, but very compatible with current code because
  theap memory can be evacuated (theap memory will be recycled).

  If you want to get transient heap ptr, use RARRAY_CONST_PTR_TRANSIENT()
  instead of RARRAY_CONST_PTR(). If you can't understand when evacuation
  will occur, use RARRAY_CONST_PTR().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-30 20:46:24 +00:00
nobu b9ca9169ba Mark up code inside link text as <code>
Merged https://github.com/ruby/rdoc/pull/660

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-29 06:23:21 +00:00
naruse 437dd8815b Revert "Add test for cause on pty"
This reverts commit r65422.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-28 17:03:36 +00:00
naruse 80001cc8c4 Add test for cause on pty
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-28 16:06:56 +00:00
nobu b361c8e3d5 time.c: added Time::TM#+ and Time::TM#-
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-28 12:05:19 +00:00
nobu 8586f021f8 rdoc/parser/c.rb: ignore dynamically added methods
* lib/rdoc/parser/c.rb (RDoc::Parser::C#deduplicate_call_seq):
  skip dynamically added methods at runtime, because the class
  name is unknown and the defined methods are not accessible from
  that class.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-28 01:56:28 +00:00
naruse 5eab7d7d55 fix test
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-27 23:15:43 +00:00
naruse 48af6fd544 Print exception's cause like Java
Print `cause` of the exception if the exception is not caught and printed
its backtraces and error message [Feature #8257]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-27 21:45:30 +00:00
k0kubun 35e3e13ce7 test_io.rb: skip busy wait test again
which I tried to avoid skipping this in r65311, but the test seems not
working under some high load of ci.rvm.jp.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-27 05:14:46 +00:00
normal 1e83e15ab5 hash.c: aset deduplicates un-tainted string
We revisit [Bug #9188] since st.c is much improved since then,
and benchmarks against so_k_nucleotide seem to indicate little
or no performance change compared to before.

[ruby-core:89555] [Feature #15251]

From: Anmol Chopra <chopraanmol1@gmail.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-26 05:32:47 +00:00
mame c9d720b873 parse.y: remove "shadowing outer local variable" warning
You can now write the following without warning.

    user = User.all.find {|user| cond(user) }

Fixes [Feature #12490].
A patch from Soutaro Matsumoto <matsumoto@soutaro.com>.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-26 03:10:02 +00:00
mame b171d92046 Revert "parse.y: remove "shadowing outer local variable" warning"
I forgot to add the copyright of the patch...

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-26 03:08:10 +00:00
mame 7f69d4e41f parse.y: remove "shadowing outer local variable" warning
You can now write the following without warning.

  user = User.all.find {|user| cond(user) }

Fixes [Feature #12490].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-26 02:54:01 +00:00
nobu e71ca6cdcf Update for tzdata-2018f
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-26 01:47:09 +00:00
k0kubun 97f3e426a1 _mjit_compile_ivar.erb: cancel on undefined ivar
I assumed somehow this check was not needed, but it did need.
By canceling this instead of just warning here, we didn't lose the
current performance so much.

test_jit.rb: test the case that reproduces SEGV by that.

TestGemStreamUI.rb: delete. This test on --jit-wait is fixed.

=== Optcarrot Benchmark ===

$ benchmark-driver benchmark.yml --rbenv 'before::before --disable-gems --jit;after::after --disable-gems --jit' -v --repeat-count 24
before: ruby 2.6.0dev (2018-10-24 trunk 65355) +JIT [x86_64-linux]
after: ruby 2.6.0dev (2018-10-24 trunk 65355) +JIT [x86_64-linux]
last_commit=_mjit_compile_ivar.erb: cancel on undefined ivar
Calculating -------------------------------------
                             before       after
Optcarrot Lan_Master.nes     85.344      84.849 fps

Comparison:
             Optcarrot Lan_Master.nes
                  before:        85.3 fps
                   after:        84.8 fps - 1.01x  slower

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-24 15:41:14 +00:00
k0kubun 593b58534f test_jit.rb: test newhashfromarray
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-24 14:24:34 +00:00
k0kubun 20d74be832 test/excludes/_wercker: skip tests
which are under investigation. I'm debugging it right now, but let's
make it green to stop bothering other development.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-24 12:13:28 +00:00
nobu 71b0d20f7e compile.c: fix peephole optimization
* compile.c (iseq_peephole_optimize): should `pop` before jump
  instruction which succeeds to `newarray` of a literal object,
  not after.  [ruby-core:89536] [Bug #15245]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-24 10:38:39 +00:00
k0kubun 4b0273886a wercker.yml: skip TestParallel::TestParallel#test_separate
for now. It's randomly failing on test-mjit-wait.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-24 10:29:39 +00:00
k0kubun e3bd6ef7c4 wercker.yml: skip test_queue_with_trap on -wait as well
It randomly failed.
https://app.wercker.com/ruby/ruby/runs/test-mjit-wait/5bcfd19aa9806e000655c598?step=5bcfd1d5acc4510006e00f77

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-24 03:05:43 +00:00
k0kubun 9641ff43d1 wercker.yml: skip #test_queue_with_trap for now
only on --jit CI. This test doesn't work on AppVeyor mswin either.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-23 22:51:28 +00:00
kazu 8adefd4cf2 Skip BUGs on Solaris
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-23 15:05:09 +00:00
nobu 95256bcf97 test/unit.rb: glob w/o prefix/suffix
* test/lib/test/unit.rb (Test::Unit::GlobOption#non_options): glob
  the given pattern as-is under the TESTSDIR without the prefix
  nor the suffix, when it has separator(s) but does not end with a
  separator nor is not a directory.  e.g.:

      make test-all TESTS='ruby/test_time*'

  runs `ruby/test_time.rb` and `ruby/test_time_tz.rb` only, like
  as the following:

      make test-all TESTS='$(TESTSDIR)/ruby/test_time*'

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-23 14:26:23 +00:00
nobu f7add52f8f test/unit.rb: fixed wrong method name
* test/lib/test/unit.rb (Test::Unit::Parallel#deal): fixed wrong
  method name at r36388.

* test/testunit/test_parallel.rb (TestParallel::TestParallel#test_separate):
  refine the pattern to process IDs but not backtrace lines, and
  add a better message.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-23 14:17:16 +00:00
k0kubun 1d6c1e27d4 test/lib/test/unit/assertions.rb: skip memory leak check
for all test cases on MJIT. In addition to those 2 tests,
TestAutoload#test_no_leak newly failed and most of assert_no_memory_leak
usages are likely to randomly fail.

Let me just skip all of them but let's revisit this to check it properly later.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-23 01:13:38 +00:00
k0kubun e38a0b4606 revisit more MJIT test skips
r65308 passed both trunk-mjit and trunk-mjit-wait CIs. MJIT copy job
looks working fine. Then this commit skips 5 more tests. Some of them
were skipped in a very early stage and may still need to be skipped, but
I want to confirm them since they haven't been changed for a long time.

And this prefers having inline information on `RubyVM::MJIT.enabled?`.
This commit makes it easier to confirm whether there's suspicious test
skip by RubyVM::MJIT.enabled? or not.

After this commit, tentatively we're not skipping tests for MJIT other
than `assert_no_memory_leak` ones.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-22 15:49:22 +00:00
k0kubun 584638a5f5 test/ruby/test_string.rb: skip test_crypt for MJIT again
Partially reverting r65285. Actually this one is failing due to memory
consumption on MJIT, so this seems not catching the bug of MJIT.

test/ruby/test_io.rb: unify the skip message with it

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-22 15:19:34 +00:00
k0kubun 9fc84833a2 revert r65292 and r65297
now mjit CIs are stable. Let me try this to confirm if it's fixed or
not.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-22 14:26:47 +00:00
kazu f289e3994b Add debug option to check ci failures on solaris
failed to start extserv?:
- https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11s/ruby-trunk/log/20181020T132506Z.fail.html.gz

BUG in sysread of OpenSSL:
- https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-trunk/log/20181020T132408Z.fail.html.gz
- https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable10x/ruby-trunk/log/20181020T131807Z.fail.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-22 12:21:19 +00:00
knu 8717f0787d Set the size of a new enumerator created by Enumerator#each with arguments to nil
When each() takes arguments, it is never safe to assume that the iteration
would repeat the same number of times as with each() without any
argument.  Actually, there is no way to get the exact number, so the
size should be set to nil to denote that.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-22 11:23:56 +00:00
k0kubun 93e780e03b test_thread.rb: another temporary skip for MJIT
to make trunk-mjit-wait CI green for now. I'll take a look at this
later.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-22 03:31:13 +00:00
nobu 8747974d4b time.c: optional arguments of Time::TM#initialize
* time.c (tm_initialize): arguments other than year are optional
  now as Time.new.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-22 01:25:29 +00:00
hsbt 615ac35934 Merge rubygems master branch from github.com/rubygems/rubygems.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-22 00:27:02 +00:00
nobu ff31b35f6a test_time_tz.rb: refactor dummy TZ tests and add another timezone
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-21 23:53:39 +00:00
k0kubun c657e57343 skip 2 tests for MJIT for now
These tests seem to be broken by r65275.
Let me skip this to confirm if other things are fine or not.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-21 23:53:24 +00:00
k0kubun e91be25644 revert revert of r65285
because CI was actually hitting another one.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-21 23:20:32 +00:00
k0kubun cfa7e2707e revert r65285
because it didn't work. Partially leaving "sometimes fail" tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-21 23:07:18 +00:00
k0kubun e6202c41b5 try to remove some test skips for MJIT
Eric Wong made some effort to keep compatibility around fd with MJIT.
Also I'm hoping r65279 (and r65280) eliminates major MJIT bugs, so I
want to start solely testing MJIT. Other test skips branched by MJIT
enablement seemed reasonable to me.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-21 15:54:50 +00:00
nobu bf26f847fa Exclude CI platform specific failures by --excludes option
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-21 03:38:52 +00:00
k0kubun 40d070843d skip tests broken with OpenSSL 1.1.1 on Travis osx
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-21 02:28:43 +00:00
suke 2afc2a0581 Merge branch 'modify_test_win32ole' into trunk
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20 14:34:30 +00:00
suke 4e3e0ac4df refactoring. suppress warning.
* test/win32ole/test_win32ole_record.rb: refactoring. suppress warning.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20 13:16:25 +00:00
kazu 4757c7eead Run background threads while testing drb
Do not start background thread on load test/drb/drbtest.rb,
and stop threads on each test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20 13:14:02 +00:00
suke d02a7ac01c use System Monitor Control to test win32ole
* test/win32ole/test_win32ole_method_event.rb: use System Monitor
  Control to test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20 12:21:30 +00:00
suke 2fe69b221c refactoring define AvailableOLE.sysmon_available?
* test/win32ole/test_win32ole_type_event.rb: refactoring. use
  AvailableOLE.sysmon_available?

* test/win32ole/available_ole.rb: define AvailableOLE.sysmon_available?

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20 11:54:09 +00:00
aycabta 39a840d084 Document File.{setuid?,setgid?,sticky?} support for IO objects [Bug #13972]
* file.c (rb_file_setuid_p): rdoc for IO object support
  (rb_file_sgid_p): ditto (rb_file_sticky_p): ditto
* NEWS: inform users of new feature
* test/file/test_file_exhaustive.rb (io_open): wrapper for bare IO
  object (test_suid): test for bare IO support (test_sgid): ditto
  (test_sticky): ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20 11:47:45 +00:00
ko1 7eecc7b8b4 require 'rbconifg' earlier.
* test/lib/jit_support.rb: require rbconfig here.

* test/ruby/test_jit.rb: rbconfig should be required before.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-10-20 08:47:26 +00:00