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

60383 Коммитов

Автор SHA1 Сообщение Дата
Takashi Kokubun 69f377a3d6
Internalize rb_mjit_unit definition again
Fixed a TODO in b9007b6c54
2020-02-26 00:27:29 -08:00
Takashi Kokubun daf7c48d88
Explain the situation of inner cc_entries [ci skip]
Add a little more details in 7ec2359374
2020-02-25 23:55:54 -08:00
Takashi Kokubun 55923ba883
Note a situation around xmalloc vs free in MJIT [ci skip]
shared by ko1
2020-02-25 23:48:49 -08:00
Nobuyoshi Nakada 8dab71b9d0
Simplified single script case
Simply use `File.basename` to remove the directory name (and
suffix), instead of `gsub` which can replace unintended parts.
2020-02-26 16:45:35 +09:00
Takashi Kokubun eb75f0d134
Remove an unused declaration
It was unnecessary in b9007b6c54
2020-02-25 23:24:25 -08:00
卜部昌平 fbd7f08e92 kill ST_DEBUG [Bug #16521]
This compile-time option has been broken for years (at least since
commit 4663c224fa, according to git
bisect). Let's delete codes that no longer work.
2020-02-26 16:00:57 +09:00
卜部昌平 62c2b8c74e kill USE_RGENGC=0
This compile-time option has been broken for years (at least since
commit 49369ef173, according to git
bisect).  Let's delete codes that no longer works.
2020-02-26 16:00:10 +09:00
卜部昌平 e7bcb416af avoid #if inside of rb_str_new_cstr
ISO/IEC 9899:1999 section 6.10.3 paragraph 11 explicitly states that
"If there are sequences of preprocessing tokens within the list of
arguments that would otherwise act as preprocessing directives, the
behavior is undefined."

rb_str_new_cstr is in fact a macro.  We cannot do this.
2020-02-26 16:00:10 +09:00
Vít Ondruch 9d6d531527 Cache destination dir.
It is not necessary to strip the `destdir` prefix every iteration, when
it can be done just once.
2020-02-26 11:04:52 +09:00
Vít Ondruch b8a8fdba63 Properly detect mode for binaries.
.gemspec files specifies not just `bin`, but also other directories.
2020-02-26 11:04:52 +09:00
Vít Ondruch e087b029e5 Use class variable `@src_dir` instead of local `path`.
The local `path` variable does not provide any additional value and was
kept around just for clarity for easier review of the `extrac_files`
method move.
2020-02-26 11:04:52 +09:00
Vít Ondruch c9fab1ac06 Use local `{dir,prog,data}_mode` variables instead of globals.
This just gets the `RbInstall::DirPackage` closer by functionality to
`Gem::Package`.
2020-02-26 11:04:52 +09:00
Vít Ondruch 6609940a5e Use `$script_mode` instead of `$prog_mode` for gem inistallation.
rbinstall is using `$script_mode` and `$prog_mode`. However, the
`$script_mode` fallbacks to `$prog_mode` if not provided.

However, RubyGems do not distinguish between `$script_mode` and
`$prog_mode`:

92892bbc3a/lib/rubygems/installer.rb (L196)
92892bbc3a/lib/rubygems/installer.rb (L515)
92892bbc3a/lib/rubygems/installer.rb (L543)

Comparing the usage of `$script_mode` and `$prog_mode`, it seems that
the `$script_mode` should be used where RubyGems expects `$prog_mode`.
2020-02-26 11:04:52 +09:00
Vít Ondruch e960ef6f18 Use `Gem::Package` like object instead of monkey patching.
1. This is similar to what RubyGems does and it is less magic [[1]].
2. It avoids deprecated code paths in RubyGems [[2]].

[1]: 92892bbc3a/lib/rubygems/installer.rb (L151)
[2]: 92892bbc3a/lib/rubygems/installer.rb (L187)
2020-02-26 11:04:52 +09:00
Nobuyoshi Nakada 0686e4181d
Fixed for older versions
Fix up 66d1900423, `RubyVM::MJIT` is
available since ruby 2.6.
2020-02-26 10:16:32 +09:00
Chelsea Corvus (Battell) 672213ef1c
Document that Array#index and find_index are aliases [ci skip] 2020-02-25 13:43:17 -05:00
git 6c66761c1f * 2020-02-26 [ci skip] 2020-02-26 02:27:54 +09:00
Takashi Kokubun 66d1900423
Increase timeout for CSV test with --jit-wait
To prevent CI failures like
http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2739995
2020-02-25 09:27:24 -08:00
Nobuyoshi Nakada 55bf0ef1aa Share extracted bundled gems with gems for bundler
Extract bundled gems under ".bundle/gems" and get rid of
duplication which cause constant redefinition warnings at
`test-all` after `extract-gems` and `test-bundler`.
2020-02-25 20:40:36 +09:00
Nobuyoshi Nakada a504535dd4
Prefer dedicated assertion method 2020-02-25 17:47:17 +09:00
卜部昌平 0febd07c69 ext/-test-/cxxanyargs: use try_link instead
We would like to skip this extension library when libstdc++ is missing.
To avoid such situation let's use try_link instead of try_compile.
2020-02-25 13:39:46 +09:00
Koichi Sasada 84d1a99a3f should be initialize jit_unit->cc_entries.
GC can invoke just after allocation of jit_unit->cc_entries so
it should be zero-cleared.
2020-02-25 13:37:52 +09:00
Koichi Sasada 670b7be6c5 should count only string.
This code can generate CC objects so we only need to count
existing String objects.
2020-02-25 13:12:53 +09:00
Koichi Sasada 7ec2359374 prevent GC from mjit worker.
ALLOC_N() can causes GC. Sometimes `mjit_copy_job_handler()`
can be called by mjit_worker thread which is not a Ruby thread,
so we need to prevent GC in this function. This patch has some
issues, but I introduce it to pass the tests.
2020-02-25 12:57:10 +09:00
git 82d27604ad * 2020-02-25 [ci skip] 2020-02-25 12:53:56 +09:00
Masataka Pocke Kuwabara fa1ec60424 Fix wrong documentation for return value of Pathname#fnmatch 2020-02-25 16:53:35 +13:00
Nobuyoshi Nakada 8b6e2685a4
Fixed symbol misused as ID
`rb_funcallv_public` and `rb_respond_to` require an `ID`, not a
`Symbol`.  [Bug #16649]
2020-02-24 15:37:52 +09:00
Nobuyoshi Nakada f8401732de
Try with and without "v" prefix for numeric tag 2020-02-24 12:40:34 +09:00
Nobuyoshi Nakada 116b9e6a16
Retry checking out the version
rss 0.2.9 is tagged without the "v" prefix.
2020-02-24 12:33:16 +09:00
Nobuyoshi Nakada 6f92c62084
Update bundled gems 2020-02-24 12:27:36 +09:00
git f88d209bb7 * 2020-02-24 [ci skip] 2020-02-24 00:28:34 +09:00
zverok 281b350058 Add pattern matching documentation
Add separate doc/syntax/pattern_matching.rdoc, add
link to control_expressions.rdoc.

The documentation is "reverse-engineered" from Ruby 2.7
behavior and early preview presentations, and corrected
by pattern-matching feature author @k-tsj.
2020-02-24 00:28:13 +09:00
Nobuyoshi Nakada 8a7e0aaaef
Warn non-nil `$/` [Feature #14240] 2020-02-23 13:37:40 +09:00
Nobuyoshi Nakada 6298ec2875
Warn non-nil `$\` [Feature #14240] 2020-02-23 13:37:40 +09:00
Nobuyoshi Nakada 588a86e32c
Warn non-nil `$,` in `IO#print` too 2020-02-23 13:37:40 +09:00
Nobuyoshi Nakada 0ed3384fd4
Revert "Prefer `exe/ruby` to execute from it"
This reverts commit c7b71af9e2, as
an example in bundler expects untouch PATH.
2020-02-23 13:31:56 +09:00
git f85ca4c840 * 2020-02-23 [ci skip] 2020-02-23 00:38:29 +09:00
Marcus Stollsteimer 77dcc2c822 hash.c: [DOC] fix examples for ENV.merge! 2020-02-22 16:32:37 +01:00
Benoit Daloze 4aebb49153 Expand Symbol#to_proc specs to be clearer 2020-02-22 14:43:52 +01:00
Nobuyoshi Nakada c7b71af9e2
Prefer `exe/ruby` to execute from it 2020-02-22 16:01:38 +09:00
Koichi Sasada f744d80106 check USE_MJIT
iseq->body->jit_unit is not available if USE_MJIT==0 .
2020-02-22 11:54:19 +09:00
Nobuyoshi Nakada 5b29ea0845
Proc from Symbol needs a receiver
So its arity should be -2 instead of -1.

[Bug #16640]
https://bugs.ruby-lang.org/issues/16640#change-84337
2020-02-22 10:49:59 +09:00
Koichi Sasada 31748e69c8 CI can be NULL.
Unused CI (introduced from peephole optimization, etc) can be NULL
so introduce NULL check.
2020-02-22 10:27:44 +09:00
Burdette Lamar af12e38675
More ENV rdoc [ci skip] 2020-02-22 10:25:54 +09:00
MSP-Greg da31035687 test/readline - allow ENV control of test class creation
In ruby/ruby, the tests run on both readline & reline by creating four test classes:
```
TestReadline
TestReadlineHistory

TestRelineAsReadline
TestRelineAsReadlineHistory
```

Reline inports the test files and uses them in its CI.  Adding the ENV control allows it to only run the `TestRelineAsReadline` classes.
2020-02-22 10:01:09 +09:00
git d7984d0f54 * remove trailing spaces. [ci skip] 2020-02-22 09:59:23 +09:00
Koichi Sasada b9007b6c54 Introduce disposable call-cache.
This patch contains several ideas:

(1) Disposable inline method cache (IMC) for race-free inline method cache
    * Making call-cache (CC) as a RVALUE (GC target object) and allocate new
      CC on cache miss.
    * This technique allows race-free access from parallel processing
      elements like RCU.
(2) Introduce per-Class method cache (pCMC)
    * Instead of fixed-size global method cache (GMC), pCMC allows flexible
      cache size.
    * Caching CCs reduces CC allocation and allow sharing CC's fast-path
      between same call-info (CI) call-sites.
(3) Invalidate an inline method cache by invalidating corresponding method
    entries (MEs)
    * Instead of using class serials, we set "invalidated" flag for method
      entry itself to represent cache invalidation.
    * Compare with using class serials, the impact of method modification
      (add/overwrite/delete) is small.
    * Updating class serials invalidate all method caches of the class and
      sub-classes.
    * Proposed approach only invalidate the method cache of only one ME.

See [Feature #16614] for more details.
2020-02-22 09:58:59 +09:00
Koichi Sasada f2286925f0 VALUE size packed callinfo (ci).
Now, rb_call_info contains how to call the method with tuple of
(mid, orig_argc, flags, kwarg). Most of cases, kwarg == NULL and
mid+argc+flags only requires 64bits. So this patch packed
rb_call_info to VALUE (1 word) on such cases. If we can not
represent it in VALUE, then use imemo_callinfo which contains
conventional callinfo (rb_callinfo, renamed from rb_call_info).

iseq->body->ci_kw_size is removed because all of callinfo is VALUE
size (packed ci or a pointer to imemo_callinfo).

To access ci information, we need to use these functions:
vm_ci_mid(ci), _flag(ci), _argc(ci), _kwarg(ci).

struct rb_call_info_kw_arg is renamed to rb_callinfo_kwarg.

rb_funcallv_with_cc() and rb_method_basic_definition_p_with_cc()
is temporary removed because cd->ci should be marked.
2020-02-22 09:58:59 +09:00
Koichi Sasada a1eb1fabef use RUBY_FUNCTION_NAME_STRING instead of __func__ for rp() 2020-02-22 02:59:46 +09:00
git 5a89c05773 * 2020-02-22 [ci skip] 2020-02-22 00:45:33 +09:00