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

359 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada ffdef3674a
Warn instance variable `E`
It is not dumped, as it is a short alias for `:encoding`.
2019-08-10 13:18:41 +09:00
卜部昌平 5d33f78716 fix tracepoint + backtrace SEGV
PC modification in gc_event_hook_body was careless.  There are (so
to say) abnormal iseqs stored in the cfp.  We have to check sanity
before we touch the PC.

This has not been fixed because there was no way to (ab)use the
setup from pure-Ruby.  However by using our official C APIs it is
possible to touch such frame(s), resulting in SEGV.

Fixes [Bug #14834].
2019-08-01 16:00:59 +09:00
Nobuyoshi Nakada 99dc885974
Fixed inadvertent ID creation in rb_iv_get 2019-07-01 13:56:55 +09:00
Nobuyoshi Nakada 75129c62eb
Suppress "statement not reached" warning 2019-06-30 11:53:02 +09:00
Nobuyoshi Nakada 4a063546e7
Suppress unused literal warnings in verbose mode 2019-06-30 11:49:40 +09:00
Nobuyoshi Nakada 5331932cd2
Removed unused variables 2019-06-28 17:08:21 +09:00
John Hawthorn 04bc4c0662 Resize capacity for fstring
When a string is #frozen, it's capacity is resized to fit (if it is much
larger), since we know it will no longer be mutated.

    > puts ObjectSpace.dump(String.new("a"*30, capacity: 1000))
    {"type":"STRING", "class":"0x7feaf00b7bf0", "bytesize":30, "capacity":1000, "value":"...
    > puts ObjectSpace.dump(String.new("a"*30, capacity: 1000).freeze)
    {"type":"STRING", "class":"0x7feaf00b7bf0", "frozen":true, "bytesize":30, "value":"...

(ObjectSpace.dump doesn't show capacity if capacity is equal to bytesize)

Previously, if we dedup into an fstring, using String#-@, capacity would
not be reduced.

    > puts ObjectSpace.dump(-String.new("a"*30, capacity: 1000))
    {"type":"STRING", "class":"0x7feaf00b7bf0", "frozen":true, "fstring":true, "bytesize":30, "capacity":1000, "value":"...

This commit makes rb_fstring call rb_str_resize, the same as
rb_str_freeze does.

Closes: https://github.com/ruby/ruby/pull/2256
2019-06-26 15:01:48 +09:00
Nobuyoshi Nakada 3840791b7e
Get rid of error with frozen string literal
[Bug #14194]
2019-06-23 07:56:43 +09:00
Hiroshi SHIBATA 464e55f1d0
Ignore warnings about argument prefix with operator symbol. 2019-06-01 15:20:21 +03:00
Nobuyoshi Nakada dc65e75101
Adjust indent 2019-05-10 22:00:22 +09:00
Alan Wu c06ddfee87
str_duplicate: Don't share with a frozen shared string
This is a follow up for 3f9562015e.
Before this commit, it was possible to create a shared string which
shares with another shared string by passing a frozen shared string
to `str_duplicate`.

Such string looks like:

```
 --------                    -----------------
 | root | ------ owns -----> | root's buffer |
 --------                    -----------------
     ^                             ^   ^
 -----------                       |   |
 | shared1 | ------ references -----   |
 -----------                           |
     ^                                 |
 -----------                           |
 | shared2 | ------ references ---------
 -----------
```

This is bad news because `rb_fstring(shared2)` can make `shared1`
independent, which severs the reference from `shared1` to `root`:

```c
/* from fstr_update_callback() */
str = str_new_frozen(rb_cString, shared2);  /* can return shared1 */
if (STR_SHARED_P(str)) { /* shared1 is also a shared string */
    str_make_independent(str);  /* no frozen check */
}
```

If `shared1` was the only reference to `root`, then `root` can be
reclaimed by the GC, leaving `shared2` in a corrupted state:

```
 -----------                         --------------------
 | shared1 | -------- owns --------> | shared1's buffer |
 -----------                         --------------------
      ^
      |
 -----------                         -------------------------
 | shared2 | ------ references ----> | root's buffer (freed) |
 -----------                         -------------------------
```

Here is a reproduction script for the situation this commit fixes.

```ruby
a = ('a' * 24).strip.freeze.strip
-a
p a
4.times { GC.start }
p a
```

 - string.c (str_duplicate): always share with the root string when
   the original is a shared string.
 - test_rb_str_dup.rb: specifically test `rb_str_dup` to make
   sure it does not try to share with a shared string.

[Bug #15792]

Closes: https://github.com/ruby/ruby/pull/2159
2019-05-09 10:04:19 +09:00
mame 76fc1ce0a7 The combination of non-Symbol keys and Symbol keys is now allowed again
Revert r64358.  [Bug #15658]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-11 12:48:33 +00:00
nobu e5f01dab9d numeric.c: fix infinite loop
* numeric.c (int_pow): fix infinite loop in the case of y equal 1
  and power of x does not overflow.
  [ruby-core:91734] [Bug #15651]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-11 01:37:16 +00:00
nobu 1598b5e7b3 Symbol creation is not a problem now unless pinned down
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-03-06 11:49:53 +00:00
normal 23444302d9 introduce rb_nogvl C-API to mark ubf as async-signal-safe
zlib and bignum both contain unblocking functions which are
async-signal-safe and do not require spawning additional
threads.

We can execute those functions directly in signal handlers
without incurring overhead of extra threads, so provide C-API
users the ability to deal with that.  Other C-API users may
have similar need.

This flexible API can supercede existing uses of
rb_thread_call_without_gvl and rb_thread_call_without_gvl2 by
introducing a flags argument to control behavior.

Note: this API is NOT finalized.  It needs approval from other
committers.  I prefer shorter name than previous
rb_thread_call_without_gvl* functions because my eyes requires
big fonts.

[Bug #15499]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-04 13:14:11 +00:00
k0kubun f9dc0fb649 test_iseq_load.rb: increase timeout for stressful roundtrip
Even 60s is short for our CI environments:
https://rubyci.org/logs/rubyci.s3.amazonaws.com/amazon/ruby-trunk/log/20181228T153002Z.fail.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-29 01:53:10 +00:00
k0kubun 6e85a0ea7e test_iseq_load.rb: increase timeout for RubyCI
https://rubyci.org/logs/rubyci.s3.amazonaws.com/arch/ruby-trunk/log/20181228T090001Z.fail.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-28 13:20:38 +00:00
mrkn 68bdef0041 Add test cases of rb_arithmetic_sequence_extract
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-12 21:17:04 +00:00
nobu 98ff2bbd7a Show diff in failure messages
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-06 05:29:07 +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 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
svn 02cb9c932a * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-21 06:41:09 +00:00
ko1 ac4b2d990c escape all env properly.
* vm_backtrace.c (rb_debug_inspector_open): escape all env using
  `rb_vm_stack_to_heap()` before making bindings.
  [Bug #15105]

  There is a complicated story of this issue:
  Without this patch, IFUNC frame does not escaped. A IFUNC frame
  points to CFUNC ep as previous ep. However, CFUNC ep can be escaped
  because of making bindings of Ruby level frames.
  IFUNC's ep can points to invalidated ep and `rb_iter_break()` will
  fail. This is why `any?` fails.

* test/-ext-/debug/test_debug.rb: add a test.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-09-21 06:41:07 +00:00
kazu b8eb530979 Add more assertions for NotImplementedError of instance method
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-21 14:57:56 +00:00
nobu 37279d1546 non-symbol keys in kwargs
* class.c (separate_symbol): [EXPERIMENTAL] non-symbol key in keyword
  arguments hash causes an exception now.
  c.f. https://twitter.com/yukihiro_matz/status/1022287578995646464

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-14 11:58:17 +00:00
usa f0d20684d2 Add some tests for *method_defined?
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-13 14:29:21 +00:00
kazu 0381ec5164 Fix test bug
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64344 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-13 13:50:48 +00:00
kazu 984ba3da62 Add test for method_defined?(notimplement)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-13 13:27:49 +00:00
k0kubun 8ef27ac192 test_iseq_load.rb: reduce timeout of test_stressful_roundtrip
We should increase RUBY_TEST_SUBPROCESS_TIMEOUT_SCALE for slow
environments, and we configured some CI machines.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-11 13:31:10 +00:00
k0kubun 886bed6eb8 test_iseq_load.rb: increase timeout
It's timed out on CI like this
https://gist.github.com/ko1/33df53d78fbec9e4156c017eeae023bb.

I'm not sure how long it would take (it finishes immediately on my machine),
so I chose 600s because r64271 says it took 635s on mswinci. (probably
it's improved by the commit, though.)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-10 23:32:32 +00:00
naruse d561eb665d Use assert_separately in TestIseqLoad#test_stressful_roundtrip
It takes 635 seconds on mswinci
http://mswinci.japaneast.cloudapp.azure.com/vc12-x64/ruby-trunk/log/20180810T061315Z.log.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-10 09:22:13 +00:00
normal 8f78430da6 test/-ext-/gvl/test_last_thread.rb: skip under MJIT
Spurious wakeup is unavoidable with MJIT; and any real
code must be able to deal with spurious wakeup anyways.

[ruby-core:87882] https://bugs.ruby-lang.org/issues/14901

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64005 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-20 22:30:39 +00:00
tenderlove 7aab72f736 Fix crash when loading iseq from an array
Objects loaded during iseq deserialization using arrays need to be added
to the compile time mark array so that they stay alive until iseqs
finish loading.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-09 17:47:37 +00:00
yui-knk 9e1bb6ed5a Move a test file
* test/-ext-/ast/test_ast.rb: This test file
  has not depended C extension since r63534,
  so move to 'test/ruby/'.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-05 00:18:29 +00:00
yui-knk 46463af983 Define AST module under RubyVM [experimental]
* ext/-test-/ast/ast.c: Rename to ast.c
  and define AST module under RubyVM.
* common.mk: compile ast.c.
* ext/-test-/ast/extconf.rb: Don't need this file anymore.
* inits.c (rb_call_inits): Call Init_ast to setup AST module.
* test/-ext-/ast/test_ast.rb: Follow up the namespace change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-31 06:13:06 +00:00
normal b6f9a60586 test_wait_for_single_fd.rb: remove with_pipe helper
IO.pipe natively accepts a block, nowadays.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-14 23:51:39 +00:00
normal 863e24b2b1 test_wait_for_single_fd: ensure this works with kqueue
Regardless of future features, this needs to work with
kqueue descriptors across platforms.

Today this will be useful for 3rd-party libraries using
kqueue.  In the future, Ruby may use kqueue natively
and we shall ensure we can wait on it.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-14 23:51:35 +00:00
normal baaf3ba189 test_wait_for_single_fd.rb: relax test for newer FreeBSD
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-14 23:42:10 +00:00
k0kubun acacd7a1d3 test_bug_reporter.rb: make it work with --jit
test_rubyoptions.rb: replace gsub with sub because it's suboptimal for
this

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-28 09:02:56 +00:00
tenderlove c03f86b389 Revert "Fix use of `rb_profile_frames` start parameter"
This reverts commit r63265.

ko1 said I should not have committed this! I'm sorry!

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-27 00:13:51 +00:00
tenderlove d676ad1050 Fix use of `rb_profile_frames` start parameter
rb_profile_frames was always behaving as if the value given for the
start parameter was 0.

The reason for this was that it would check if (start > 0) { then
continue without updating the control frame pointer or anything other
than decrementing start.

[ruby-core:86147] [Bug #14607]

Co-authored-by: Dylan Thacker-Smith <Dylan.Smith@shopify.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-26 22:49:00 +00:00
nobu c05fa459bb quote symbols
* sprintf.c (ruby__sfvextra): quote symbols as identifiers.

* string.c (rb_id_quote_unprintable): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-14 02:35:51 +00:00
nobu dd3851d278 Rename test classes to allow stable test count when running test-all -j
[Fix GH-1763]

From: MSP-Greg <MSP-Greg@users.noreply.github.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-13 06:29:02 +00:00
k0kubun ed935aa5be mjit_compile.c: merge initial JIT compiler
which has been developed by Takashi Kokubun <takashikkbn@gmail> as
YARV-MJIT. Many of its bugs are fixed by wanabe <s.wanabe@gmail.com>.

This JIT compiler is designed to be a safe migration path to introduce
JIT compiler to MRI. So this commit does not include any bytecode
changes or dynamic instruction modifications, which are done in original
MJIT.

This commit even strips off some aggressive optimizations from
YARV-MJIT, and thus it's slower than YARV-MJIT too. But it's still
fairly faster than Ruby 2.5 in some benchmarks (attached below).

Note that this JIT compiler passes `make test`, `make test-all`, `make
test-spec` without JIT, and even with JIT. Not only it's perfectly safe
with JIT disabled because it does not replace VM instructions unlike
MJIT, but also with JIT enabled it stably runs Ruby applications
including Rails applications.

I'm expecting this version as just "initial" JIT compiler. I have many
optimization ideas which are skipped for initial merging, and you may
easily replace this JIT compiler with a faster one by just replacing
mjit_compile.c. `mjit_compile` interface is designed for the purpose.

common.mk: update dependencies for mjit_compile.c.

internal.h: declare `rb_vm_insn_addr2insn` for MJIT.

vm.c: exclude some definitions if `-DMJIT_HEADER` is provided to
compiler. This avoids to include some functions which take a long time
to compile, e.g. vm_exec_core. Some of the purpose is achieved in
transform_mjit_header.rb (see `IGNORED_FUNCTIONS`) but others are
manually resolved for now. Load mjit_helper.h for MJIT header.
mjit_helper.h: New. This is a file used only by JIT-ed code. I'll
refactor `mjit_call_cfunc` later.
vm_eval.c: add some #ifdef switches to skip compiling some functions
like Init_vm_eval.

win32/mkexports.rb: export thread/ec functions, which are used by MJIT.

include/ruby/defines.h: add MJIT_FUNC_EXPORTED macro alis to clarify
that a function is exported only for MJIT.

array.c: export a function used by MJIT.
bignum.c: ditto.
class.c: ditto.
compile.c: ditto.
error.c: ditto.
gc.c: ditto.
hash.c: ditto.
iseq.c: ditto.
numeric.c: ditto.
object.c: ditto.
proc.c: ditto.
re.c: ditto.
st.c: ditto.
string.c: ditto.
thread.c: ditto.
variable.c: ditto.
vm_backtrace.c: ditto.
vm_insnhelper.c: ditto.
vm_method.c: ditto.

I would like to improve maintainability of function exports, but I
believe this way is acceptable as initial merging if we clarify the
new exports are for MJIT (so that we can use them as TODO list to fix)
and add unit tests to detect unresolved symbols.
I'll add unit tests of JIT compilations in succeeding commits.

Author: Takashi Kokubun <takashikkbn@gmail.com>
Contributor: wanabe <s.wanabe@gmail.com>

Part of [Feature #14235]

---

* Known issues
  * Code generated by gcc is faster than clang. The benchmark may be worse
    in macOS. Following benchmark result is provided by gcc w/ Linux.
  * Performance is decreased when Google Chrome is running
  * JIT can work on MinGW, but it doesn't improve performance at least
    in short running benchmark.
  * Currently it doesn't perform well with Rails. We'll try to fix this
    before release.

---

* Benchmark reslts

Benchmarked with:
Intel 4.0GHz i7-4790K with 16GB memory under x86-64 Ubuntu 8 Cores

- 2.0.0-p0: Ruby 2.0.0-p0
- r62186: Ruby trunk (early 2.6.0), before MJIT changes
- JIT off: On this commit, but without `--jit` option
- JIT on: On this commit, and with `--jit` option

** Optcarrot fps

Benchmark: https://github.com/mame/optcarrot

|         |2.0.0-p0 |r62186   |JIT off  |JIT on   |
|:--------|:--------|:--------|:--------|:--------|
|fps      |37.32    |51.46    |51.31    |58.88    |
|vs 2.0.0 |1.00x    |1.38x    |1.37x    |1.58x    |

** MJIT benchmarks

Benchmark: https://github.com/benchmark-driver/mjit-benchmarks
(Original: https://github.com/vnmakarov/ruby/tree/rtl_mjit_branch/MJIT-benchmarks)

|           |2.0.0-p0 |r62186   |JIT off  |JIT on   |
|:----------|:--------|:--------|:--------|:--------|
|aread      |1.00     |1.09     |1.07     |2.19     |
|aref       |1.00     |1.13     |1.11     |2.22     |
|aset       |1.00     |1.50     |1.45     |2.64     |
|awrite     |1.00     |1.17     |1.13     |2.20     |
|call       |1.00     |1.29     |1.26     |2.02     |
|const2     |1.00     |1.10     |1.10     |2.19     |
|const      |1.00     |1.11     |1.10     |2.19     |
|fannk      |1.00     |1.04     |1.02     |1.00     |
|fib        |1.00     |1.32     |1.31     |1.84     |
|ivread     |1.00     |1.13     |1.12     |2.43     |
|ivwrite    |1.00     |1.23     |1.21     |2.40     |
|mandelbrot |1.00     |1.13     |1.16     |1.28     |
|meteor     |1.00     |2.97     |2.92     |3.17     |
|nbody      |1.00     |1.17     |1.15     |1.49     |
|nest-ntimes|1.00     |1.22     |1.20     |1.39     |
|nest-while |1.00     |1.10     |1.10     |1.37     |
|norm       |1.00     |1.18     |1.16     |1.24     |
|nsvb       |1.00     |1.16     |1.16     |1.17     |
|red-black  |1.00     |1.02     |0.99     |1.12     |
|sieve      |1.00     |1.30     |1.28     |1.62     |
|trees      |1.00     |1.14     |1.13     |1.19     |
|while      |1.00     |1.12     |1.11     |2.41     |

** Discourse's script/bench.rb

Benchmark: https://github.com/discourse/discourse/blob/v1.8.7/script/bench.rb

NOTE: Rails performance was somehow a little degraded with JIT for now.
We should fix this.
(At least I know opt_aref is performing badly in JIT and I have an idea
 to fix it. Please wait for the fix.)

*** JIT off
Your Results: (note for timings- percentile is first, duration is second in millisecs)

categories_admin:
  50: 17
  75: 18
  90: 22
  99: 29
home_admin:
  50: 21
  75: 21
  90: 27
  99: 40
topic_admin:
  50: 17
  75: 18
  90: 22
  99: 32
categories:
  50: 35
  75: 41
  90: 43
  99: 77
home:
  50: 39
  75: 46
  90: 49
  99: 95
topic:
  50: 46
  75: 52
  90: 56
  99: 101

*** JIT on
Your Results: (note for timings- percentile is first, duration is second in millisecs)

categories_admin:
  50: 19
  75: 21
  90: 25
  99: 33
home_admin:
  50: 24
  75: 26
  90: 30
  99: 35
topic_admin:
  50: 19
  75: 20
  90: 25
  99: 30
categories:
  50: 40
  75: 44
  90: 48
  99: 76
home:
  50: 42
  75: 48
  90: 51
  99: 89
topic:
  50: 49
  75: 55
  90: 58
  99: 99

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-02-04 11:22:28 +00:00
normal 3ce9a14040 ruby.h: relax rb_funcall check on extra args for clang
clang 5.+ (tested clang 7.0.0) seems to be attempting division-by-zero
and giving a very large number for static args to rb_funcall.

* include/ruby/ruby.h (rb_varargs_bad_length): relax check for clang
* ext/-test-/funcall/funcall.c: renamed from passing_block.c
  define extra_args_name function
* test/-ext-/funcall/test_funcall.rb: new test
  [ruby-core:85266] [Bug #14425]

From: Eric Wong <e@80x24.org>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-30 23:55:49 +00:00
nobu e6883ef688 parse.y: fix overflow
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-18 03:29:12 +00:00
nobu 2f5a20ce0d test_ast.rb: no base directory name
* test/-ext-/ast/test_ast.rb: exclude base directory name from
  test method names.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-17 06:38:08 +00:00
yui-knk 0f3dcbdf38 Add tests for Node code locations
* test/-ext-/ast/test_ast.rb: Add tests for Node
  code locations. This file tests

  1. There are no Node whose code location is default
     value (#test_not_cared)

  2. There are no Node whose children's code locations
     exceed parent's code location (#test_ranges)

* ext/-test-/ast/ast.c, ext/-test-/ast/extconf.rb:
  Define AST module to help tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-15 23:43:17 +00:00