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

1358 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada 289bdb64d9
Add prepare-gems to download and extract bundled gems 2020-03-12 22:58:04 +09:00
Takashi Kokubun adcf0316d1
Prevent unloading methods used in root_fiber while calling another Fiber (#2939)
Fixing SEGVs like:
http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2744905
http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2744420
http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2741400
2020-02-28 23:58:33 -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 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 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
Nobuyoshi Nakada c7b71af9e2
Prefer `exe/ruby` to execute from it 2020-02-22 16:01:38 +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
Hiroshi SHIBATA 05485868cb Workaround for bison provided by scoop on mswin environment 2020-02-15 21:20:25 +09:00
Nobuyoshi Nakada 985d1b9ec4
Fixed a potential memory leak
`rb_str_new_cstr` can raise a `NoMemoryError`.
2020-02-12 11:58:56 +09:00
Nobuyoshi Nakada e3e96e3faa
Check if bindable against the refined target [Bug #16617] 2020-02-09 20:13:49 +09:00
Alan Wu 7d02441f0d Fix file dependency in make 2020-01-28 16:11:53 -05:00
Nobuyoshi Nakada e710e9e886
Fixed missing dependency on array.rb 2020-01-27 10:07:46 +09:00
Nobuyoshi Nakada 29eb1b1602
Moved Array#shuffle and Array#shuffle! to rbinc 2020-01-26 19:40:34 +09:00
Jeremy Evans e91c39f1c0 Remove special handling of $SAFE and related C-APIs
These were all deprecated in Ruby 2.7.
2020-01-22 09:09:47 -08:00
Koichi Sasada 8113f3fee4 add default break points 2020-01-21 16:58:00 +09:00
Nobuyoshi Nakada 93a51c15d9
Update clean-local [ci skip]
* Remove builtin_binary.inc which is generated for each time
  miniruby is built.

* dSYM is a directory, not a file.
2020-01-18 16:47:53 +09:00
Nobuyoshi Nakada f9788ca7fe
Update dependencies
internal/rational.h needs internal/warnings.h with Apple clang,
for `UNALIGNED_MEMBER_ACCESS`.
2020-01-17 16:41:46 +09:00
Kazuhiro NISHIYAMA 4e6bcac23e
Update dependencies in makefiles again
patch from https://travis-ci.org/ruby/ruby/jobs/638231960
2020-01-17 11:19:01 +09:00
Kazuhiro NISHIYAMA 73618d84e8
Update dependencies in makefiles
patch from https://travis-ci.org/ruby/ruby/jobs/638226493
2020-01-17 10:25:00 +09:00
Nobuyoshi Nakada e288632f22
Clean generated ChangeLog [ci skip] 2020-01-12 19:54:59 +09:00
Nobuyoshi Nakada 8afd304f41
Ignore existing ChangeLog file and generate always [ci skip] 2020-01-12 19:52:35 +09:00
Nobuyoshi Nakada cccfc66760
Added make target to export the ChangeLog file 2020-01-12 19:39:00 +09:00
Lourens Naudé 40c57ad4a1 Let execution context local storage be an ID table 2020-01-11 14:40:36 +13:00
Nobuyoshi Nakada 54e31f4a5f
Update dependencies for c6b26f5ccf 2020-01-10 09:09:51 +09:00
Lourens Naudé 8ba261c754 Bump benchmark-driver to v0.15.7 (#2811) 2020-01-02 14:26:20 -08:00
Koichi Sasada 9f460e017b move internal/debug.h definitions to internal.h
Debug utilities should be accessible from any internal code.
2020-01-03 04:46:51 +09:00
Nobuyoshi Nakada 179e402d8a
Updated dependencies on internal/warnings.h
Needed for `UNALIGNED_MEMBER_ACCESS` using `COMPILER_WARNING_`*
macros.
2019-12-31 11:14:19 +09:00
卜部昌平 0c2d731ef2 update dependencies 2019-12-26 20:45:12 +09:00
Nobuyoshi Nakada eb3f19b9b8
update-bundled_gems: drop branch name on github [ci skip] 2019-12-25 11:20:07 +09:00
Nobuyoshi Nakada f3b1b645ed Create backtrace location array directly 2019-12-13 20:47:07 +09:00
Nobuyoshi Nakada 0b5268afbc Moved Kernel#warn to warning.rb 2019-12-13 20:47:07 +09:00
Koichi Sasada fe8caf0ab9 add depenency pointed by update-deps 2019-12-11 13:37:00 +09:00
git 86e2c013d7 * remove trailing spaces. [ci skip] 2019-12-11 11:25:00 +09:00
Koichi Sasada 40026a408d support cross-compilation.
On cross-compilation, compiled binary can no be created because
compiled binary should be created by same interpreter (on cross-
compilation, host ruby is used to build ruby (BASERUBY)).
So that cross-compilation system loads required scripts in text.
It is same as miniruby.
2019-12-11 11:24:42 +09:00
Koichi Sasada 9c2807b2df remove prelude.c
prelude.c is an automatically generated file by template/prelude.c.tmpl.
However it does not contain any required functions. So remove it from
dependency.

Also miniprelude.c is included by mini_builtin.c and does not need
to make miniprelude.o.
2019-12-11 11:24:42 +09:00
Koichi Sasada 2c5c60754c use compiled binary for gem_prelude.rb.
`gem_prelude.rb` is not compiled yet. This patch compile it to
compiled binary.
2019-12-11 11:24:42 +09:00
Takashi Kokubun fa1db8f938
Add missing dependency
https://travis-ci.org/ruby/ruby/jobs/620972117
2019-12-04 22:25:12 -08:00
Nobuyoshi Nakada 9afaf139f2
Revert "builtin_binary.inc needs miniruby itself for RubyVM.each_builtin"
This reverts commit 2615030c52,
which doesn't work when cross compiling, except for mingw.
2019-12-02 14:15:42 +09:00
Nobuyoshi Nakada 2615030c52
builtin_binary.inc needs miniruby itself for RubyVM.each_builtin 2019-12-02 14:03:57 +09:00
Koichi Sasada dd723771c1 fastpath for ivar read of FL_EXIVAR objects.
vm_getivar() provides fastpath for T_OBJECT by caching an index
of ivar. This patch also provides fastpath for FL_EXIVAR objects.
FL_EXIVAR objects have an each ivar array and index can be cached
as T_OBJECT. To access this ivar array, generic_iv_tbl is exposed
by rb_ivar_generic_ivtbl() (declared in variable.h which is newly
introduced).

Benchmark script:

Benchmark.driver(repeat_count: 3){|x|
  x.executable name: 'clean', command: %w'../clean/miniruby'
  x.executable name: 'trunk', command: %w'./miniruby'

  objs = [Object.new, 'str', {a: 1, b: 2}, [1, 2]]

  objs.each.with_index{|obj, i|
    rep = obj.inspect
    rep = 'Object.new' if /\#/ =~ rep
    x.prelude str = %Q{
      v#{i} = #{rep}
      def v#{i}.foo
        @iv # ivar access method (attr_reader)
      end
      v#{i}.instance_variable_set(:@iv, :iv)
    }
    puts str
    x.report %Q{
      v#{i}.foo
    }
  }
}

Result:

      v0.foo # T_OBJECT

               clean:  85387141.8 i/s
               trunk:  85249373.6 i/s - 1.00x  slower

      v1.foo # T_STRING

               trunk:  57894407.5 i/s
               clean:  39957178.6 i/s - 1.45x  slower

      v2.foo # T_HASH

               trunk:  56629413.2 i/s
               clean:  39227088.9 i/s - 1.44x  slower

      v3.foo # T_ARRAY

               trunk:  55797530.2 i/s
               clean:  38263572.9 i/s - 1.46x  slower
2019-11-29 03:11:04 +09:00
Nobuyoshi Nakada b563439274
Show include directive differences only when under git
When building from tarballs, the source directory is not a git
repository.
2019-11-23 16:06:30 +09:00
Nobuyoshi Nakada e1b2341488
Update dependencies 2019-11-18 23:16:22 +09:00
Koichi Sasada 93ce4f1cd7 update deps.
https://travis-ci.org/ruby/ruby/jobs/613242256#L2205
2019-11-18 10:16:11 +09:00
Koichi Sasada 9c1abe2a6c load prelude.rb by builtin features.
The script in prelude.rb was embed in MRI to load it (eval this
script at everyboot).
This commit change the loading process of prelude.rb. MRI doesn't
eval a script, but load from compiled binary with builtin feature.

So that Init_prelude() does not load `prelude.rb` now.
2019-11-15 03:55:46 +09:00
Kazuhiro NISHIYAMA 63f363b70d
Update dependencies
patch from https://travis-ci.org/ruby/ruby/jobs/611152175#L2204
2019-11-13 10:31:42 +09:00
Nobuyoshi Nakada fb02e3192c
Create `RUBYCOMMONDIR` directory in advance
As well as the directory per architecture.

Closes https://github.com/ruby/ruby/pull/2669
2019-11-12 16:36:56 +09:00
Koichi Sasada 05a5c69e1a add deps for miniprelude.c 2019-11-11 16:47:50 +09:00
Nobuyoshi Nakada 31ee6f6f5d
Extract gem files after update
So that test/optparse/test_did_you_mean.rb can find did_you_mean.rb.
2019-11-11 13:10:55 +09:00
Nobuyoshi Nakada faa4f4f23f
Get rid of FreeBSD make incompatibility [Bug #16331]
FreeBSD make works differently with `-j` option.

> -j	max_jobs
> 	Specify the maximum number of jobs that `make` may have running
>	at any one time.  The value is saved in `.MAKE.JOBS.` Turns
>	compatibility mode off, unless the `B` flag is also specified.
>	When compatibility mode is off, all commands associated with a
>	target are executed in a single shell invocation as opposed to
>	the traditional one shell invocation per line.  This can break
>	traditional scripts which change directories on each command
>	invocation and then expect to start with a fresh environment on
>	the next line.  It is more efficient to correct the scripts
>	rather than turn backwards compatibility on.

Stop using exit, cd, exec in middle of commands.
2019-11-10 09:26:19 +09:00