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

54412 Коммитов

Автор SHA1 Сообщение Дата
ko1 e8e1f72d8f remove redundant check.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-20 20:37:03 +00:00
ko1 df2af1147f fix a type error with a cast for clang.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-20 20:26:21 +00:00
svn 02df0f38df * 2019-03-21
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-20 19:57:44 +00:00
svn 5c439ebfb0 * expand tabs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-20 19:57:43 +00:00
ko1 24e03d7e26 optimize method dispatch for lead/opt params.
There is a special optimization for "only lead parameters"
method dispatch using specialized dispatcher functions
`vm_call_iseq_setup_normal_0start...`.
Other cases (opt, rest, post, ...) we don't use specialized
dispatcher and call with `setup_parameters_complex` to
satisfy Ruby's complex parameter specification.

This commit introduce a specialize dispatcher for
methods which use only lead and optional parameters.

Two step improvements:
(1) prepare "lead/opt" only check pass.
    It is to skip the `setup_parameters_complex` function.
(2) introduce specialized dispatcher for only "lead/opt"
    parameters methods (vm_call_iseq_setup_normal_opt_start).

With these improvements, we achieved good micro-benchmark
results:
  With a method: `def opt2 a, b=nil; end`
  With the following binaries:
    clean-miniruby: unmodified trunk.
    opt_miniruby: apply step (1).
    opt_cc_miniruby: apply step (2).
  Result with benchmark-driver:

                        opt2(1)
   opt_cc_miniruby:  42269409.1 i/s
      opt_miniruby:  36304428.3 i/s - 1.16x  slower
    clean-miniruby:  25897409.5 i/s - 1.63x  slower

                     opt2(1, 2)
   opt_cc_miniruby:  45935145.7 i/s
      opt_miniruby:  40513196.9 i/s - 1.13x  slower
    clean-miniruby:  29976057.6 i/s - 1.53x  slower

This improvement may be trivial (difficult to improve practical
cases). However, this is enough small patch so I decide to
introduce it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-20 19:57:39 +00:00
nobu 139634a16f vm_trace.c: [DOC] remove the trick [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-20 04:24:42 +00:00
hsbt b55586902d Improve TracePoint docs.
* Mention new :script_compiled event;
  * Deduplicate __enable/enable methods;
  * Document target: and target_line: arguments.

  [Bug #15484][ruby-core:90801]

  Co-authored-by: zverok <zverok.offline@gmail.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-20 02:08:34 +00:00
nobu 46968fab0a string.c: [DOC] fix reference to sprintf [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-20 01:35:27 +00:00
nobu 8b49e5b47d string.c: [DOC] remove unnecessary markups [ci skip]
* string.c: remove <code> markups, which are not only unnecessary
  but also prevented cross-references.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-20 01:31:44 +00:00
nobu a265141c84 string.c: [DOC] fix indent [ci skip]
* string.c (rb_str_crypt): fix indent not to make the whole list
  verbatim entirely.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-20 01:17:16 +00:00
svn eee58ca611 * 2019-03-20
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-20 00:31:13 +00:00
nobu 740248425c parse.y: make tNUMPARAM id
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-20 00:31:02 +00:00
nobu afa1505ca8 parse.y: removed redundant number_arg parser event
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-19 06:23:36 +00:00
nobu fa66569afa parse.y: fix var_ref of numbered param in ripper
* parse.y (string_dvar, user_variable): register numbered
  parameter in ripper for var_ref.
  [ruby-core:91867] [Bug #15673]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-19 06:01:21 +00:00
nobu e39f7e64b7 parse.y: fix segv with Ripper#yydebug
* parse.y (parser_token_value_print): in ripper, ID values are
  wrapped in NODE_RIPPER at set_yylval_name(), so print the Symbol
  wrapped together.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-19 02:35:50 +00:00
nobu ae5d9a7664 Added Ripper#debug_output
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-19 02:25:15 +00:00
k0kubun 92b0331bcf Use designated initializers for compile_status
to make it easier to understand what values are grouped.
Just cosmetic changes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67302 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-18 17:45:10 +00:00
k0kubun 8b1241d877 Use alloca for stack_size_for_pos as well
to eliminate necessity of error check and `free`

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-18 17:28:23 +00:00
k0kubun a75ae6faa9 Use alloca again instead of malloc and free
by changing interface of `mjit_copy_cache_from_main_thread`.

This is also fixing deadlock introduced by r67299.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-18 17:20:21 +00:00
k0kubun 4d426e28d2 Resurrect r67287 and r67288
I noticed that r67287 was illegal because memory allocated by `alloca`
was used after the stack is expired.

So I just replaced that with `malloc` and `free` for now.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-18 16:32:48 +00:00
svn 08e9c58d51 * 2019-03-19
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-18 16:14:59 +00:00
k0kubun 78e87b7d4f Revert "Eliminate mjit_copy_job_t reference from mjit_worker"
This reverts commit ba51ae0109.

CI is failing again...

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-18 16:14:57 +00:00
k0kubun ba51ae0109 Eliminate mjit_copy_job_t reference from mjit_worker
Take 2 of r67287.

For some reasons, passing pointer of pointer on stack to a function
and assigning an addresse to a pointer dereferenced from the pointer
seems not working on mswin.

So I achieved to return multiple values by returning struct instead of
taking pointers.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-18 14:01:52 +00:00
nobu 964bbc1686 parse.y: numbered parameter in lambda
* parse.y (lambda): support numbered parameters, only when no
  argument list including empty parentheses, like empty vertical
  bars.  [ruby-core:91859] [Bug #15672]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-18 12:48:18 +00:00
k0kubun f9e5b8d09c Revert "Try disabling Travis cache on darwin"
This reverts commit 6b136a0442.

This does not seem to work:
https://travis-ci.org/ruby/ruby/jobs/507646193#L2478

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-18 12:07:21 +00:00
k0kubun c1dce92373 Merge https://github.com/rubygems/rubygems/pull/2684
to make CI stable. See the PR for details.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-18 11:46:21 +00:00
nobu 17018d4c31 parse.y: continue after invalid name
* parse.y (set_yylval_noname): continue after an invalid global,
  instance, class variable name, without "unexpected end-of-file"
  error.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-18 06:42:19 +00:00
k0kubun 908b530112 Revert "Request inline cache values from mjit_compile"
This reverts commit 4161674b2f.

Revert "Eliminate mjit_copy_job_t reference from mjit_worker"

This reverts commit d86a1aa045.

Reverting them because of CI failures

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-18 01:52:45 +00:00
nobu ba03222da8 Pack rb_iseq_constant_body from 296 to 288 bytes
[Fix GH-2099]

From: Lourens Naudé <lourens@bearmetal.eu>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-18 01:42:20 +00:00
nobu d0e25ed277 parse.y: parser_numbered_param
* parse.y (parser_numbered_param): hoisted out the contextual
  check for numbered parameters.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-18 01:18:25 +00:00
k0kubun 4161674b2f Request inline cache values from mjit_compile
rather than preparing beforehand.

By having this change, implementing inlining by calling
`mjit_copy_cache_from_main_thread` for inlined methods was made
possible.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-17 18:29:30 +00:00
k0kubun d86a1aa045 Eliminate mjit_copy_job_t reference from mjit_worker
and make `copy_cache_from_main_thread` easier to use.

For implementing inlining later, I'll use `copy_cache_from_main_thread`
inside `mjit_compile`.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-17 18:07:06 +00:00
k0kubun 3fc26f6013 Drop rb_mjit_unit from mjit_copy_job
and guard iseq from GC by marking iseq in mjit_copy_job.

This is a refactoring for implementing inlining later and
should not be fixing or introducing any bugs.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-17 17:12:47 +00:00
kazu cebc640790 Fix a typo [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-17 16:35:20 +00:00
svn 5bd1060341 * 2019-03-18
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-17 16:32:51 +00:00
kazu dfb9907cd3 Fix typos [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-17 16:32:49 +00:00
kazu a72bc2e716 Fix a typo [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-17 13:51:30 +00:00
k0kubun 6b136a0442 Try disabling Travis cache on darwin
to check if it resolves "Permission denied" problem.
https://travis-ci.org/ruby/ruby/jobs/507381339
https://travis-ci.org/ruby/ruby/jobs/507392198

TBH I'm not exactly sure why it happens, but I don't have infinite time
to understand this. It would be appreciated to identify the root cause
and remove `DISABLE_CACHE` again if you're sure your patch fixes the problem.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-17 06:20:01 +00:00
k0kubun d4b6198d8f Roughly increase Azure Pipelines fetch depth
because --depth=1 may randomly break checkout:
https://dev.azure.com/rubylang/ruby/_build/results?buildId=208&view=logs&jobId=7ded14dc-7a77-59da-f40a-71e137ad96c0&taskId=2045950f-1dcd-54a4-4c23-fae2521239c1&lineStart=1554&lineEnd=1555&colStart=1&colEnd=1

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-17 05:32:53 +00:00
k0kubun 46f5eb5b48 Update NEWS for --jit option changes [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-17 05:28:54 +00:00
nobu 12acc751e3 Numbered parameters [Feature #4475]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-17 05:21:18 +00:00
k0kubun 0fa4a6a618 Change defaults of --jit options
* --jit-min-calls: 5 -> 10000

--jit-min-calls=5 obviously can compile non hotspot. This was not a
problem for MJIT-benchmarks and Optcarrot because the former has very
few hot optimiziable methods and the latter is likely to trigger
compilation of hotspot by its intensive calls to optimizable hotspot
methods and has a very short window to allow limited compilations.

In real-world applications, it has more time to compile more methods and
it pressures computer's limited resources like icache. We should avoid
compiling too many methods. Also compiling many methods exhausts time
budget for compilation in one ruby process lifetime and delays the "JIT
compaction" of Ruby 2.6.

JVM is known to use 1,500 for C1 (client) compiler and 10,000 for C2
(server) compiler for -XX:CompileThreshold by default.
https://docs.oracle.com/javase/8/embedded/develop-apps-platforms/codecache.htm

When things are called X,000 times, requiring 10,000 can eliminate
compilation of methods which are called only once in these X,000
iterations and obviously not hotspot. And in fact things like
unicorn-worker-killer restarts unicorn process every 4096 requests.
So I felt 10,000 is good for such an environment.

* --jit-max-cache: 1000 -> 100

By the same reason stated above, we should not allow compiling many
methods especially on MJIT which has a larger overhead due to poor code
locality by dlopen and whose code is also likely to be bigger by just
inlining many VM instructions with -O3 rather than directly generating
low-level code.

In JVM -XX:ReservedCodeCacheSize is 32M for reserved and 48M for maximum.
--jit-max-cache=1,000 could be closer to it, but in this case MJIT's
compilation is slow due to data synchronization between threads (to be
improved in Ruby 2.7 though) and we do not want to delay the "JIT
compaction" for a long time.

So I chose a really conservative number for this, but by having method
inlining in the future, wider range could be optimized even with this
value.

* Optcarrot

--disable-gems, --benchmark Lan_Master.nes 12 attempts.
No significant impact.

| r67276             | r67276 --jit      | after --jit       |
|:-------------------|:------------------|:------------------|
| 50.44369263063978  | 72.87390680773056 | 73.47873485047297 |
| 50.58788746124193  | 78.06820808947026 | 78.29723420171945 |
| 50.77509250801378  | 80.29010348842613 | 78.94689404460769 |
| 50.935361702064405 | 80.42796829926374 | 80.39539527351525 |
| 51.27352672981195  | 81.98758158033202 | 81.6754198664817  |
| 51.720715743242124 | 82.00118535811626 | 82.22960569251283 |
| 51.89643169822524  | 82.2290091613556  | 82.5013636146388  |
| 51.95895898113868  | 82.37318990939565 | 82.74002377794454 |
| 52.10124886807968  | 82.48796686037502 | 83.23354941183932 |
| 52.292280637519376 | 83.0265226541066  | 84.01552618012572 |
| 52.51856237784144  | 83.8797360318052  | 84.8588319093393  |
| 52.65076845986818  | 84.80037351256634 | 85.13577756273656 |

* Railsbench

`WARMUP=20000 BENCHMARK=1000 bin/bench` of https://github.com/k0kubun/railsbench.
It gets closer to --disable=jit.

|           | r67276 | r67276 | after  |
|           |        | --jit  | --jit  |
|:----------|:-------|:-------|:-------|
| req/s     | 891.3  | 742.2  | 841.5  |
|:----------|:-------|:-------|:-------|
| 50%ile ms | 1.00   | 1.21   | 1.08   |
| 66%ile ms | 1.02   | 1.24   | 1.09   |
| 75%ile ms | 1.03   | 1.28   | 1.10   |
| 80%ile ms | 1.03   | 1.30   | 1.11   |
| 90%ile ms | 1.09   | 1.42   | 1.15   |
| 95%ile ms | 1.32   | 1.65   | 1.27   |
| 98%ile ms | 4.79   | 2.23   | 1.81   |
| 99%ile ms | 5.68   | 7.52   | 6.64   |
|100%ile ms | 6.52   | 9.69   | 8.59   |

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-17 05:13:38 +00:00
k0kubun 407cd5cc54 Drop invalid trailing comma in JSON object
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-17 04:13:13 +00:00
k0kubun 7fe77cbca9 Ignore test-bundled-gems failure on CI for now
ktsj-san recognizes this issue and it's intentionally left failing now.
As failure notification of this task is NOT indicating ruby is broken,
let's stop notifying the failure fo rnow.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-16 16:53:55 +00:00
svn 5b0bcb0b22 * 2019-03-17
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-16 16:26:46 +00:00
k0kubun 46a3b440fd Do not build Azure Pipelines on Pull Request
For 2 reasons:

* bundled_gems tend to be left broken (like now)
* We don't want Slack notification for pull request and it can't be
  disabled on Azure Pipelines

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-16 16:26:44 +00:00
k0kubun 8ce6748fc8 Notify AppVeyor results to multiple channels
and simplified config by using dedicated webhook URL.
Sadly AppVeyor YAML does not support alias and so we need to copy-paste
the request body.

memo:
https://slack-files2.s3-us-west-2.amazonaws.com/bot_icons/2018-02-10/314363543719_48.png
is the URL used by `provider: Slack`

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-16 04:11:54 +00:00
svn f044cc1042 * 2019-03-16
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-16 04:00:30 +00:00
ktsj 7006fdecf2 dsym should be treated as string [ruby-core:91852] [Bug #15670]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-16 04:00:14 +00:00
k0kubun e4c184c6ae Increase the number of curl retries
Because retrying 5 times failed.
https://ci.appveyor.com/project/ruby/ruby/builds/23063048/job/k9lykaagfaex74gg

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-15 13:25:06 +00:00