1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
Commit graph

56434 commits

Author SHA1 Message Date
Hiroshi SHIBATA
463092b84d
Update rake-12.3.3. 2019-07-22 11:05:34 +09:00
git
f6a7b10afa * 2019-07-22 2019-07-22 10:10:51 +09:00
Nobuyoshi Nakada
28ae30b6ac
Run test-tool in the order of the tests 2019-07-22 10:10:28 +09:00
Yusuke Endoh
08ea924043 common.mk: make check now includes make test-tool
And `make test-tool` includes `make test-testframework`.

This change may be arguable because I'm unsure who is an intended user
of `make check`: a normal user, or Ruby-core developer.  Normal users
don't have to run `make test-tool` for testing their installation, but
Ruby committers should run it before they commit anything.

In this case, I'd be conservative; `make check` includes `test-tool`.
If normal users often report a failure of `make test-tool`, then we can
consider to split `make check` for two sets of target users.
2019-07-21 22:30:15 +09:00
Yusuke Endoh
24712eeec3 tool/test/runner.rb: support --test-target-dir option
tool/test/runner.rb had been copied from test/runner.rb.
test/runner.rb was for `make test-all`, and tool/test/runner.rb was for
`make test-testframework` and `make test-tool`.
But I want to avoid the code clones.

This change makes tool/test/runner.rb support --test-target-dir option
which allows tool/test/runner.rb to run `make test-all`.
Now we can remove test/runner.rb.
2019-07-21 19:19:08 +09:00
git
523fec8a4b * 2019-07-21 2019-07-21 09:47:57 +09:00
Hiroshi SHIBATA
d285579ea7
Update simplecov and doclie to the latest version. 2019-07-21 09:46:49 +09:00
Samuel Williams
c584dd8460
Move travis coroutine check to cron only. 2019-07-20 19:44:49 +12:00
Takashi Kokubun
e7b5b9144a
--debug was not functional either
Even after 19d592dc82, the retry seems not
functional. Let's just add --debug from the beginning because an output
of each step is collapsed and we don't see `make up` output so often.
2019-07-20 15:45:34 +09:00
Yusuke Endoh
81fc3becc7 file.c: add a NORETURN declaration for statx_notimplement
clang complains the lack.
2019-07-20 15:43:42 +09:00
Takashi Kokubun
1392b821b9
Explain what's benchmark/lib/load.rb [ci skip]
I'm actually not using this, but ko1 is.
2019-07-20 15:33:55 +09:00
Takashi Kokubun
56b957e88a
Upgrade benchmark-driver.gem again
because v0.14.18 was actually not working with `make run`.
In `make run`, `Gem` is defined but `Gem::Version` isn't.
v0.14.19 checks `defined?(Gem::Version)` instead of `defined?(Gem)`.
2019-07-20 15:27:58 +09:00
Takashi Kokubun
8a38eff2bd
Upgrade benchmark-driver.gem version
This is to make `make run` with benchmark/lib/load.rb work for ko1
https://github.com/benchmark-driver/benchmark-driver/compare/v0.14.17...v0.14.18
2019-07-20 15:13:03 +09:00
Yusuke Endoh
77bb79b8cf array.c: factor out a complex condition of assert
ARY_SHARED_P and ARY_EMBED_P included:

   assert(!FL_TEST((ary), ELTS_SHARED) || !FL_TEST((ary), RARRAY_EMBED_FLAG)),

The two predicate macros are used in many other assert conditions,
which caused memory bloat during C compilation.
This change factors out the assertion above to a function.
Now gcc consumes 160 MB instead of 250 MB to compile array.c.
2019-07-20 09:08:34 +09:00
Aaron Patterson
d304f77c58
Only disable GC around reference updating
This is the only place that can change the size of the object id tables
and cause a GC.
2019-07-19 15:12:50 -07:00
Jeremy Evans
c945d115a5 Document use of ensure and else at method level [ci skip] 2019-07-19 11:39:05 -07:00
Jeremy Evans
ceeb1535dd Remove section on performance advantage of not using a block parameter [ci skip]
Improvements in Ruby 2.5 and 2.6 make this section no longer
accurate.
2019-07-19 11:38:49 -07:00
Jeremy Evans
7e2677675d Remove mention of Proc.new with implicit block [ci skip]
This support is now deprecated and will be removed in Ruby 3.
2019-07-19 11:38:49 -07:00
Jeremy Evans
bf2f84b2ff Document evaluation order of arguments [ci skip]
Fixes [Misc ]
2019-07-19 11:38:49 -07:00
Jeremy Evans
71d21f3c75 Document required keyword argument syntax [ci skip]
Fixes [Bug ]
2019-07-19 11:38:42 -07:00
git
57b7bfad9e * 2019-07-20 2019-07-20 02:54:41 +09:00
aycabta
de18328192 Some keywords, "true", "false", and "nil" should be treated as a variable 2019-07-20 02:53:47 +09:00
Yusuke Endoh
0a16ff9f83 array.c: use assert in macro instead of in a function
The old code lost information of lineno.  Now, an assertion error will
output a correct lineno (but now gcc 8 requires 250 MB, unfortunately).
2019-07-19 23:50:30 +09:00
Yusuke Endoh
3e8d4ff3e5 array.c: factor out assert(RB_TYPE_P(ary, T_ARRAY)) to a function
The assertion blows up gcc 8 by consuming approx. 1.8 GB memory.
This change reduces the amount of memory required to about 200 MB.

A follow-up of ae750799c1.
2019-07-19 23:41:24 +09:00
Samuel Williams
0a7093a8e9
Add documentation to fiber_pool_allocate_memory. 2019-07-19 20:18:42 +12:00
Samuel Williams
517f7f9b57
Fix 32-bit build and typo.
"Therefore, `fiber_pool_stack_free(&vacancy->stack)` can do the wrong
thing..." should be "... `fiber_pool_stack_free(stack)` ...".
2019-07-19 20:09:03 +12:00
Samuel Williams
e004afd46d
Ensure that madvise does not clobber vacancy data.
After calling `fiber_pool_vacancy_reset`, `vacancy->stack` and `stack` are
no longer in sync. Therefore, `fiber_pool_stack_free(&vacancy->stack)` can
do the wrong thing and clobber the vacancy data.

Additionally, when testing using VM_CHECK_MODE > 0, use MADV_DONTNEED if
possible, to catch issues w.r.t. clobbered vacancy data earlier.
2019-07-19 19:42:09 +12:00
Koichi Sasada
fba3e76e3f fix debug counter for Hash counts.
Change debug_counters for Hash object counts:

* obj_hash_under4 (1-3) -> obj_hash_1_4 (1-4)
* obj_hash_ge4 (4-7)    -> obj_hash_5_8 (5-8)
* obj_hash_ge8 (>=8)    -> obj_hash_g8  (> 8)

For example on rdoc benchmark:

[RUBY_DEBUG_COUNTER]    obj_hash_empty                         554,900
[RUBY_DEBUG_COUNTER]    obj_hash_under4                        572,998
[RUBY_DEBUG_COUNTER]    obj_hash_ge4                             1,825
[RUBY_DEBUG_COUNTER]    obj_hash_ge8                             2,344
[RUBY_DEBUG_COUNTER]    obj_hash_empty                         553,097
[RUBY_DEBUG_COUNTER]    obj_hash_1_4                           571,880
[RUBY_DEBUG_COUNTER]    obj_hash_5_8                               982
[RUBY_DEBUG_COUNTER]    obj_hash_g8                              2,189
2019-07-19 16:24:14 +09:00
Koichi Sasada
ae750799c1 Use FL_TEST_RAW() to check flags.
FL_TEST() uses FL_ABLE() which test data types. However,
in array.c we don't need to check it (all of them should be
T_ARRAY), so I changed from FL_TEST() to FL_TEST_RAW() which
does not check FL_ABLE(). Instead of FL_ABLE(), add assertion
to check given object is a T_ARRAY object.

For example, rb_ary_free() becomes slim:

with FL_TEST():
0000000000006a30 <rb_ary_free>:
    6a30:       40 f6 c7 07             test   $0x7,%dil
    6a34:       48 8b 07                mov    (%rdi),%rax
    6a37:       75 09                   jne    6a42 <rb_ary_free+0x12>
    6a39:       48 f7 c7 f7 ff ff ff    test   $0xfffffffffffffff7,%rdi
    6a40:       75 1e                   jne    6a60 <rb_ary_free+0x30>
    6a42:       a9 00 00 00 02          test   $0x2000000,%eax
    6a47:       74 07                   je     6a50 <rb_ary_free+0x20>
    6a49:       f3 c3                   repz retq
    6a4b:       0f 1f 44 00 00          nopl   0x0(%rax,%rax,1)
    6a50:       48 8b 7f 20             mov    0x20(%rdi),%rdi
    6a54:       e9 00 00 00 00          jmpq   6a59 <rb_ary_free+0x29>
    6a59:       0f 1f 80 00 00 00 00    nopl   0x0(%rax)
    6a60:       89 c2                   mov    %eax,%edx
    6a62:       83 e2 1f                and    $0x1f,%edx
    6a65:       83 fa 1b                cmp    $0x1b,%edx
    6a68:       74 d8                   je     6a42 <rb_ary_free+0x12>
    6a6a:       f6 c4 60                test   $0x60,%ah
    6a6d:       74 d3                   je     6a42 <rb_ary_free+0x12>
    6a6f:       eb d8                   jmp    6a49 <rb_ary_free+0x19>```

with FL_TEST_RAW():
0000000000006a30 <rb_ary_free>:
    6a30:       48 f7 07 00 60 00 02    testq  $0x2006000,(%rdi)
    6a37:       74 07                   je     6a40 <rb_ary_free+0x10>
    6a39:       f3 c3                   repz retq
    6a3b:       0f 1f 44 00 00          nopl   0x0(%rax,%rax,1)
    6a40:       48 8b 7f 20             mov    0x20(%rdi),%rdi
    6a44:       e9 00 00 00 00          jmpq   6a49 <rb_ary_free+0x19>
2019-07-19 14:41:36 +09:00
git
a44ad9a145 * expand tabs. 2019-07-19 13:10:08 +09:00
Koichi Sasada
182ae1407b fix shared array terminology.
Shared arrays created by Array#dup and so on points
a shared_root object to manage lifetime of Array buffer.
However, sometimes shared_root is called only shared so
it is confusing. So I fixed these wording "shared" to "shared_root".

* RArray::heap::aux::shared -> RArray::heap::aux::shared_root
* ARY_SHARED() -> ARY_SHARED_ROOT()
* ARY_SHARED_NUM() -> ARY_SHARED_ROOT_REFCNT()

Also, add some debug_counters to count shared array objects.

* ary_shared_create: shared ary by Array#dup and so on.
* ary_shared: finished in shard.
* ary_shared_root_occupied: shared_root but has only 1 refcnt.
  The number (ary_shared - ary_shared_root_occupied) is meaningful.
2019-07-19 13:07:59 +09:00
Samuel Williams
547f574b63
In some situations, vm_stack can be NULL, but cfp is valid. 2019-07-19 16:03:47 +12:00
Samuel Williams
e14f5762c5
Add assertions to coroutine_initialize_main. 2019-07-19 15:55:34 +12:00
Samuel Williams
dd0e33f083
Split assertions to check which one fails. 2019-07-19 15:53:47 +12:00
Samuel Williams
cf93f98a60
Better usage of rb_ec_clear_vm_stack to maintain invariants. 2019-07-19 15:46:56 +12:00
Samuel Williams
6eef80d824
Improve ec assertions. 2019-07-19 15:46:56 +12:00
Koichi Sasada
63160a84b4 respect NDEBUG.
ruby/ruby.h includes ruby/assert.h, and RUBY_NDEBUG is defined
by checking NDEBUG. In other words, NDEBUG is only seen just
after ruby/ruby.h. This patch also cheks NDEBUG just after
including ruby_assert.h.

Without this patch, assertions in array.c are always enabled.
2019-07-19 12:04:32 +09:00
Kazuhiro NISHIYAMA
e644e2de85
Remove doc/etc.rd.ja [ci skip]
[Feature ] [ruby-dev:50814]
2019-07-19 09:01:53 +09:00
Koichi Sasada
4ec5b39ce8 initialize only Fiber's cfp.
fiber->cont.saved_ec.cfp should be initialized by NULL
because no vm_stack is allocated. However, cont_init()
captures current Fiber's cfp for continuation, so it should
only initialize fibers.
2019-07-19 08:53:19 +09:00
Samuel Williams
8ca32020b0
Revert "Ensure cfp is initialized to NULL."
This reverts commit d7fdf45a4a.
2019-07-19 11:32:40 +12:00
aycabta
c8ee44f44c Fix showing doc of "nil.to_s", nil doesn't have #name 2019-07-19 08:23:41 +09:00
Samuel Williams
d7fdf45a4a
Ensure cfp is initialized to NULL.
`cont_init` didn't initialize `cont->saved_ec.cfp`. Calling `cont_mark`
would result in an invalid `cfp` in `rb_execution_context_mark`. Because
fibers lazy-initialize the stack, fibers that are created but not resumed
could cause this problem to occur.
2019-07-19 11:10:01 +12:00
Samuel Williams
9dda0a03cc
Remove rb_vm_push_frame as it is no longer used. 2019-07-19 11:10:01 +12:00
Nobuyoshi Nakada
fd461dea06
Ripper#validate_object: check if the object is hidden 2019-07-19 07:57:17 +09:00
Nobuyoshi Nakada
0b826418af
Update before commit 2019-07-19 07:51:48 +09:00
Nobuyoshi Nakada
59d6ce4f4b
Moved RIPPER_DEBUG methods to Ripper from Kernel 2019-07-19 07:50:32 +09:00
Nobuyoshi Nakada
18bce998dd
Fixed build error with RIPPER_DEBUG 2019-07-19 07:50:32 +09:00
git
d4c4029597 * 2019-07-19 2019-07-19 06:40:24 +09:00
Nobuyoshi Nakada
a036a8a038
Adjust styles and indents 2019-07-19 06:35:15 +09:00
Nobuyoshi Nakada
a027c4b5b0
Use Qnull instead of 0 and Qundef 2019-07-19 06:23:19 +09:00