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

1486 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada 86431f5075
Remove rubyspec temporary directories 2020-04-28 19:00:33 +09:00
Nobuyoshi Nakada 3497152515
Remove rubyspec temporary directory 2020-04-28 15:05:59 +09:00
Nobuyoshi Nakada a217d3cedc
check: compare with right upstream 2020-04-27 01:04:05 +09:00
Nobuyoshi Nakada d6ec8da689
Update benchmark-driver version 2020-04-22 16:13:42 +09:00
Nobuyoshi Nakada 5ce7835520
Update benchmark-driver version 2020-04-22 10:01:11 +09:00
Nobuyoshi Nakada 00d9278387
fileutils now depends on rbconfig.rb due to JRuby support 2020-04-17 14:07:14 +09:00
Nobuyoshi Nakada 9fa24018b7
Make y.output in ripper unlocalized [ci skip]
Often it is easy to search, grep, etc from command line, for
debugging purpose.
2020-04-14 13:10:28 +09:00
卜部昌平 c37a357c13 include what you use.
This reverts commit 443389effc.
This reverts commit d94960f22e.

Inclusion of header files must be explicit.  Every file shall directly
include what is necessary.

https://github.com/include-what-you-use/include-what-you-use says:

> When every file includes what it uses, then it is possible to edit any
> file and remove unused headers, without fear of accidentally breaking
> the upwards dependencies of that file. It also becomes easy to
> automatically track and update dependencies in the source code.

Though we don't use iwyu itself, the principle quoted above is a good
thing that we can agree.

Now that include guards were added to every and all of the headers
inside of our project this changeset does not increase compile time, at
least on my machine.
2020-04-13 16:06:00 +09:00
Koichi Sasada d94960f22e update dependencies 2020-04-10 14:53:25 +09:00
卜部昌平 9e6e39c351
Merge pull request #2991 from shyouhei/ruby.h
Split ruby.h
2020-04-08 13:28:13 +09:00
Nobuyoshi Nakada 310054b240 Moved `Dir.open` and `Dir#initialize` to dir.rb 2020-04-06 22:22:25 +09:00
Nobuyoshi Nakada 21d0b40de2 Added tooldir variable 2020-04-05 09:26:57 +09:00
Nobuyoshi Nakada f2807f4ec0
Refresh revision.h by after-update 2020-03-30 16:03:38 +09:00
Kazuhiro NISHIYAMA 930b012ad9
Add rexml to fix rss of test-bundled-gems (#2976) 2020-03-24 15:36:53 +09:00
Takashi Kokubun 5c4847f191
Use miniruby to run tool/mjit_tabs.rb
hoping to fix https://github.com/ruby/actions/runs/527422022
2020-03-23 22:44:57 -07:00
Takashi Kokubun 5b3157a511
Make file names and variable names consistent 2020-03-23 22:33:01 -07:00
Nobuyoshi Nakada 6ab3664635
Moved MJIT_WITHOUT_TABS default to configure.ac
And then the environment variable.
2020-03-24 13:46:00 +09:00
Takashi Kokubun 13e9551b97
Change the filename like make variable
for consistency
2020-03-22 23:15:50 -07:00
Takashi Kokubun 3bd7d5617f
Make the first argument slightly more robust 2020-03-22 23:14:32 -07:00
Takashi Kokubun d578f1d3ea
Change the run_without_tabs switching to dedicated
variable of make instead of d059714746 as requested.

You can disable this like `make MJIT_WITHOUT_TABS=false` or
`export MJIT_WITHOUT_TABS=false`.
2020-03-22 23:12:54 -07:00
Takashi Kokubun d059714746
Disable run_without_tabs when there's no -ggdb3
in debugflags, as requested by nobu

I actually wanted to check debugflags directly rather than MJIT_DEBUGFLAGS
because debugflags is always used but MJIT_DEBUGFLAGS may not be always used.
But I couldn't find a better way to check debugflags.
2020-03-22 20:20:27 -07:00
Takashi Kokubun 9ebf74fd78
Expand tabs for rb_mjit_header.h (#2975)
This is necessary to avoid converting a hard tab to just 1 space in
preprocessor to generate rb_mjit_header.h, which is helpful when using
gdb or perf report.

See also: [Misc #16112]

This reverts commit 91acdd17c4.
Fixed permission failure on Travis, encoding, and added SKIPPED_FILES.
2020-03-22 11:50:45 -07:00
Takashi Kokubun 91acdd17c4
Revert "Expand tabs for rb_mjit_header.h"
This reverts commit 57119dd561.

Temporarily reverting for Travis failures
2020-03-22 00:53:05 -07:00
Takashi Kokubun 57119dd561
Expand tabs for rb_mjit_header.h
I can't live without this when using gdb or perf report.

See also: [Misc #16112]
2020-03-22 00:37:31 -07:00
S.H 290d608637
support builtin for Kernel#clone 2020-03-17 19:37:07 +09:00
Takashi Kokubun 6e405b2611
Use a human-readable funcname with --jit-debug
for perf output like:

Samples: 100K of event 'cycles:ppp', Event count (approx.): 1007750000
  Children      Self  Command  Shared Object             Symbol
+   81.58%     1.47%  ruby     ruby                      [.] rb_vm_exec
+   81.06%     7.61%  ruby     ruby                      [.] vm_exec_core
+   80.16%     0.00%  ruby     ruby                      [.] vm_sendish (inlined)
+   75.03%     0.00%  ruby     ruby                      [.] mjit_exec (inlined)
+   74.37%     0.00%  ruby     ruby                      [.] mjit_exec (inlined)
+   73.42%     0.22%  ruby     _ruby_mjit_p11277u42.so   [.] _mjit42_rack_method_override_rb_call
+   73.25%     0.10%  ruby     _ruby_mjit_p11277u41.so   [.] _mjit41_sinatra_show_exceptions_rb_call
+   73.19%     0.22%  ruby     _ruby_mjit_p11277u44.so   [.] _mjit44_rack_head_rb_call
+   73.03%     0.15%  ruby     _ruby_mjit_p11277u45.so   [.] _mjit45_sinatra_base_rb_call
+   72.87%     0.26%  ruby     _ruby_mjit_p11277u49.so   [.] _mjit49_rack_logger_rb_call
+   70.56%     0.11%  ruby     _ruby_mjit_p11277u40.so   [.] _mjit40_sinatra_base_rb_call
+   68.70%     0.11%  ruby     _ruby_mjit_p11277u39.so   [.] _mjit39_sinatra_base_rb_call
+   68.39%     0.29%  ruby     _ruby_mjit_p11277u56.so   [.] _mjit56_rack_protection_frame_options_rb_call
+   67.89%     0.18%  ruby     _ruby_mjit_p11277u37.so   [.] _mjit37_sinatra_base_rb_block_in_call
+   67.04%     0.16%  ruby     _ruby_mjit_p11277u34.so   [.] _mjit34_sinatra_base_rb_synchronize

Reverting deb1c7b97d, fixing `sprint_funcname`'s argument in `compact_all_jit_code`.
Also updating common.mk.
2020-03-14 21:02:09 -07:00
David Rodríguez 459670d47f Fix bundled gems installation on a fresh clone 2020-03-14 18:16:47 +09:00
Nobuyoshi Nakada 88f4ebac83
Update and extract for each gem 2020-03-13 15:34:50 +09:00
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
Nobuyoshi Nakada fcf37ca2fe Fix builtin scirpt paths
Do not search builtin scripts by using VPATH, to get rid of weird
nmake VPATH.
2019-11-09 21:16:05 +09:00
Nobuyoshi Nakada 4dd1caa129
Updated miniprelude.o dependency 2019-11-09 20:08:01 +09:00
Nobuyoshi Nakada dfaac2b372
Embed builtin ruby scripts in miniprelude.c
Instead of reading from the files by the full-path at runtime.  As
rbinc files need to be included in distributed tarballs, the
full-paths at the packaging are unavailable at compilation times.
2019-11-09 19:28:45 +09:00
Nobuyoshi Nakada 579aa4dc52
Fixed the dependency 2019-11-09 00:03:29 +09:00
Nobuyoshi Nakada 248d0008db
Added pack.rb to BUILTIN_RB_SRCS 2019-11-08 23:59:22 +09:00
Yusuke Endoh a3141e3c76 Rubified the APIs of pack.c 2019-11-08 23:51:51 +09:00
Nobuyoshi Nakada ff2d99406d
Update builtin include files 2019-11-08 22:31:44 +09:00
Nobuyoshi Nakada 20971799f2
Renamed `load_*.inc` as `*.rbinc` to utilize a suffix rule 2019-11-08 16:30:28 +09:00
Koichi Sasada 8fa41971c2 use builtins for GC.
Define a part of GC in gc.rb.
2019-11-08 15:29:02 +09:00
Koichi Sasada 365557f111 Define IO#read/write_nonblock with builtins.
IO#read/write_nonblock methods are defined in prelude.rb with
special private method __read/write_nonblock to reduce keyword
parameters overhead. We can move them into io.rb with builtin
functions.
2019-11-08 10:03:19 +09:00
Koichi Sasada a47d058ebf use builtin for RubyVM::AbstractSyntaxTree.
Define RubyVM::AbstractSyntaxTree in ast.rb
with __builtin functions.
2019-11-08 09:09:29 +09:00
Koichi Sasada e2a45cb984 use builtin for TracePoint.
Define TracePoint in trace_point.rb and use __builtin_ syntax.
2019-11-08 09:09:29 +09:00
Koichi Sasada 46acd0075d support builtin features with Ruby and C.
Support loading builtin features written in Ruby, which implement
with C builtin functions.
[Feature #16254]

Several features:

(1) Load .rb file at boottime with native binary.

Now, prelude.rb is loaded at boottime. However, this file is contained
into the interpreter as a text format and we need to compile it.
This patch contains a feature to load from binary format.

(2) __builtin_func() in Ruby call func() written in C.

In Ruby file, we can write `__builtin_func()` like method call.
However this is not a method call, but special syntax to call
a function `func()` written in C. C functions should be defined
in a file (same compile unit) which load this .rb file.

Functions (`func` in above example) should be defined with
  (a) 1st parameter: rb_execution_context_t *ec
  (b) rest parameters (0 to 15).
  (c) VALUE return type.
This is very similar requirements for functions used by
rb_define_method(), however `rb_execution_context_t *ec`
is new requirement.

(3) automatic C code generation from .rb files.

tool/mk_builtin_loader.rb creates a C code to load .rb files
needed by miniruby and ruby command. This script is run by
BASERUBY, so *.rb should be written in BASERUBY compatbile
syntax. This script load a .rb file and find all of __builtin_
prefix method calls, and generate a part of C code to export
functions.

tool/mk_builtin_binary.rb creates a C code which contains
binary compiled Ruby files needed by ruby command.
2019-11-08 09:09:29 +09:00
Nobuyoshi Nakada c7632fa80c Do not occupy `ARGV` by XRUBY command
Instead run test-bundled-gems.rb by `ENV['RUBY']`, which should be
set by runruby.rb.
2019-11-05 08:45:19 +09:00
Nobuyoshi Nakada 4e8336bae8
Share test-bundled-gems-run in common.mk 2019-11-05 00:05:38 +09:00
Martin Dürst c54635c08b Update Unicode Emoji version from 12.0 to 12.1.
This update does not add any new codepoint assignments, it just
expands the range of emoji codepoint sequences recommended for
public interchange.

Depending on how emoji data files are cached, this commit may
require manual intervention in some build environments
(including some CI systems).
2019-10-30 08:25:45 +09:00
Alan Wu 89e7997622 Combine call info and cache to speed up method invocation
To perform a regular method call, the VM needs two structs,
`rb_call_info` and `rb_call_cache`. At the moment, we allocate these two
structures in separate buffers. In the worst case, the CPU needs to read
4 cache lines to complete a method call. Putting the two structures
together reduces the maximum number of cache line reads to 2.

Combining the structures also saves 8 bytes per call site as the current
layout uses separate two pointers for the call info and the call cache.
This saves about 2 MiB on Discourse.

This change improves the Optcarrot benchmark at least 3%. For more
details, see attached bugs.ruby-lang.org ticket.

Complications:
 - A new instruction attribute `comptime_sp_inc` is introduced to
 calculate SP increase at compile time without using call caches. At
 compile time, a `TS_CALLDATA` operand points to a call info struct, but
 at runtime, the same operand points to a call data struct. Instruction
 that explicitly define `sp_inc` also need to define `comptime_sp_inc`.
 - MJIT code for copying call cache becomes slightly more complicated.
 - This changes the bytecode format, which might break existing tools.

[Misc #16258]
2019-10-24 18:03:42 +09:00
Nobuyoshi Nakada f1d4216bd9
Added refresh-gems
Refreshes bundled gems to the latest version, and extracts them.
2019-10-24 01:42:48 +09:00
Nobuyoshi Nakada 67f010af9b
name2ctype.h depends on also Emoji data 2019-10-23 15:11:52 +09:00
Nobuyoshi Nakada 929d5fd3b9 Comparable#clamp with a range [Feature #14784] 2019-10-16 01:42:34 +09:00
卜部昌平 f1ce4897f2 make rb_raise a GVL-only function again
Requested by ko1 that ability of calling rb_raise from anywhere
outside of GVL is "too much".  Give up that part, move the GVL
aquisition routine into gc.c, and make our new gc_raise().
2019-10-10 17:10:21 +09:00
Nobuyoshi Nakada 495ebd6e95
Now error.o needs thread.h 2019-10-10 14:21:29 +09:00
卜部昌平 9c3153e0da allow rb_raise from outside of GVL
Now that allocation routines like ALLOC_N() can raise exceptions
on integer overflows.  This is a problem when the calling thread
has no GVL.  Memory allocations has been allowed without it, but
can still fail.

Let's just relax rb_raise's restriction so that we can call it
with or without GVL.  With GVL the behaviour is unchanged.  With
no GVL, wait for it.

Also, integer overflows can theoretically occur during GC when
we expand the object space.  We cannot do so much then.  Call
rb_memerror and let that routine abort the process.
2019-10-10 12:07:38 +09:00
Nobuyoshi Nakada 212da9a6ae
Added dependencies on prerequisite makefiles 2019-10-05 11:04:23 +09:00
Takashi Kokubun 6045ff64e3
Use benchmark-driver v0.15.6
to fix another keyword argument warning which was added recently.
2019-09-19 18:04:47 +09:00
Takashi Kokubun bcd49a4669
Upgrade benchmark_driver to v0.15.5
Fixed new Struct-related keyword argument warnings
2019-09-13 00:34:54 +09:00
Nobuyoshi Nakada 8bfc46a9a3
Fixed wrong usage of file2lastrev.rb 2019-09-07 11:59:19 +09:00
Takashi Kokubun 9c0626fa90
Upgrade benchmark-driver to v0.15.4
Fixing a bug on Windows introduced in v0.15.0
2019-09-07 09:14:33 +09:00
Takashi Kokubun bb53ddfe0e
Upgrade benchmark-driver to v0.15.3
It got some nice features for better support of
benchmark_driver-output-charty, Windows, ridk, and rbenv.
2019-09-07 00:43:38 +09:00
Takashi Kokubun e13da00824
Explain how to run an individual btest in help 2019-09-03 01:25:59 +09:00
Takashi Kokubun 04c3e34456
Upgrade benchmark-driver for keyword args warnings 2019-09-01 19:26:23 +09:00
Kazuhiro NISHIYAMA 972222c039
Show MFLAGS to check `Set ENV` in .github/workflows/ubuntu.yml 2019-08-26 17:45:18 +09:00
Nobuyoshi Nakada 44bead391f
CPPFLAGS is not needed for link 2019-08-26 16:54:10 +09:00
Nobuyoshi Nakada 2614653622
Moved INCFLAGS to XCFLAGS from CPPFLAGS as well as mswin
Rules which have used CPPFLAGS will need XCFLAGS or INCFLAGS now.
2019-08-26 16:54:10 +09:00
Nobuyoshi Nakada fafabe2f43
Add INCFLAGS for fake.rb
INCFLAGS is not included in CPPFLAGS on mswin, not to be exported
to rbconfig.rb.
2019-08-26 16:11:53 +09:00
Nobuyoshi Nakada b4d6d9c167
Removed unnecessary flags for fake.rb
Flags for ruby core such as warning and `_FORTIFY_SOURCE` macro
are not necessary to make fake.rb, except for `RUBY_EXPORT` macro
which prevents to include ruby/backward.h.
2019-08-26 13:14:01 +09:00
Hiroshi SHIBATA 1940347fdf
Use () instead of {} for nmake 2019-08-22 08:21:43 +10:00
Hiroshi SHIBATA 2d8d6345ff
`--fomart progress` is default. It's duplicated. 2019-08-22 08:03:54 +10:00
Hiroshi SHIBATA 0b0fedad70
Introduce test-bundler-parallel task. 2019-08-22 08:02:48 +10:00
David Rodríguez 5a384e2c08 Fix some bundler specs (#2380)
* These seem to consistenly pass already

* Show actual command when running `make test-bundler`

Current the setup command that installs the necessary gems for testing
bundler was printed, but not the actual command that runs the tests.
That was a bit confusing.

* Borrow trick from setproctitle specs

* A title that long doesn't get set sometimes

No idea why, but the test doesn't need that the title is that long.

* Fix most gem helper spec ruby-core failures

* Fix the rest of the gem helper failures

* Fix version spec by improving the assertion

* Remove unnecessary `BUNDLE_RUBY` environment var

We can use `RUBY` when necessary, and `BUNDLE_RUBY` is not a good name
because bundler considers `BUNDLE_*` variables as settings.

* Rename `BUNDLE_GEM` to `GEM_COMMAND`

This is more descriptive I think, and also friendlier for bundler
because `BUNDLE_` env variables are interpreted by bundler as settings,
and this is not a bundler setting.

This fixes one bundler spec failure in config specs against ruby-core.

* Fix quality spec when run in core

Use the proper path helper.

* Fix dummy lib builder to never load default gems

If a dummy library is named as a default gem, when requiring the library
from its executable, the default gem would be loaded when running from
core, because in core all default gems share path with bundler, and thus
they are always in the $LOAD_PATH. We fix the issue by loading lib
relatively inside dummy lib executables.

* More exact assertions

Sometimes I have the problem that I do some "print debugging" inside
specs, and suddently the spec passes. This happens when the assertion is
too relaxed, and the things I print make it match, specially when they
are simple strings like "1.0" than can be easily be part of gem paths
that I print for debugging.

I fix this by making a more exact assertion.

* Detect the correct shebang when ENV["RUBY"] is set

* Relax assertion

So that the spec passes even if another paths containing "ext" are in
the load path. This works to fix a ruby-core issue, but it's a better
assertion in general. We just want to know that the extension path was
added.

* Use folder structure independent path helper

It should fix this spec for ruby-core.

* Fix the last failing spec on ruby-core

* Skip `bundle open <default_gem>` spec when no default gems
2019-08-20 09:46:31 +09:00
Nobuyoshi Nakada 7bb0a7d7cb
Prefer exact ITEM to benchmark 2019-08-18 00:34:12 +09:00
Koichi Sasada 3b39cc6b03 gc.h is required on mswin build.
thread.c requires gc.h on mswin build. Sorry.
2019-08-09 14:11:24 +09:00
Koichi Sasada 6bf8db9a07 add rp() and bp() in internal.h.
debug utility macro rp() (rp_m()) and bp() are introduced.
* rp(obj) shows obj information w/o any side-effect to STDERR.
* rp_m(m, obj) is similar to rp(obj), but show m before.
* bp() is alias of ruby_debug_breakpoint(), which is registered
  as a breakpoint in run.gdb (used by `make gdb` or make gdb-ruby`).
2019-08-09 14:01:15 +09:00
Koichi Sasada 37eefb11fb remove useless include and dependency 2019-08-09 13:08:01 +09:00
Takashi Kokubun 0176e74d6c
Add missing dependency
just fix CI failure
https://travis-ci.org/ruby/ruby/jobs/569625233
2019-08-09 11:39:24 +09:00
Takashi Kokubun 0d2aa6fec9
Upgrade benchmark-driver version
as I already started to use --runner=block introduced in v0.14.20 like:
https://github.com/ruby/ruby/pull/2321#issuecomment-518638663
2019-08-07 22:11:53 +09:00
Nobuyoshi Nakada ceb9e276b9
Shorten dependency hint [ci skip] 2019-07-30 21:16:30 +09:00
Nobuyoshi Nakada e25088488b
Hint for the dependency update [Bug #16000] 2019-07-30 17:23:42 +09:00
Nobuyoshi Nakada 8e53d18e67
Separated tool/test/runner.rb and test/runner.rb
As `make test-tool` does not use gems, and no Rubygems stuffs is
needed, so moved such things to test/runner.rb.  Also no longer
nees `--test-target-dir` option.
2019-07-25 16:57:38 +09:00
Nobuyoshi Nakada 0338c44bde
Retry to update Unicode timestamp 2019-07-23 17:39:03 +09:00
Nobuyoshi Nakada f6461fa890
Only the first argument can be --test-target-dir option
Raise the proper exception when that option is not given but
non-option argument is.
2019-07-22 13:07:03 +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
Hiroshi SHIBATA d285579ea7
Update simplecov and doclie to the latest version. 2019-07-21 09:46:49 +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
Samuel Williams 7291fef55c
Improve build process and coroutine implementation selection. 2019-07-18 20:54:54 +12:00
Nobuyoshi Nakada 8e37ef76f6
Fixed the library path for tools 2019-07-16 08:46:38 +09:00
Hiroshi SHIBATA d02f2fc3e2
Added help message for test-tool target. 2019-07-15 11:19:13 +09:00
Hiroshi SHIBATA ac6d137157
Added test-tool target for the test suite of tool/test files. 2019-07-15 11:16:29 +09:00
Takashi Kokubun 0a417248a0
Fix unaligned help output
1f99274ccf was indenting details with a
hard tab, but other lines are using spaces.
2019-07-15 08:38:09 +09:00
Takashi Kokubun 02c4ed4a7f
Stop consuming 2 entries for goruby
similar to 364f43ab7f and
13cb9e6bd2
2019-07-15 08:36:53 +09:00
Hiroshi SHIBATA 1f99274ccf
Added the bundled gems target to make help. 2019-07-15 08:19:56 +09:00
Yusuke Endoh 13cb9e6bd2 common.mk: remove "make exam" from help
Currently it is completely the same as "make check".
I think it is not worth mentioning now.
2019-07-15 08:19:21 +09:00
Takashi Kokubun ea71128573
Unify documentations of `make benchmark` 2019-07-15 06:22:23 +09:00
Takashi Kokubun e8b6f63039
Drop `make change` and tool/change_maker.rb
because we're not writing ChangeLog anymore.
2019-07-15 06:17:31 +09:00
Takashi Kokubun 364f43ab7f
Reduce the number of make help entries
We've added some more things recently. It seems not worth having almost
the same two entries there anymore.
2019-07-15 06:11:47 +09:00
Takashi Kokubun 0ee105f3f0
Mention SPECOPTS variable in make help 2019-07-15 06:08:55 +09:00
Nobuyoshi Nakada 715955ff27
Include ruby/assert.h in ruby/ruby.h so that assertions can be there 2019-07-14 17:58:03 +09:00
Nobuyoshi Nakada 32f0135144
Split RUBY_ASSERT and so on under include/ruby 2019-07-14 17:45:21 +09:00
Nobuyoshi Nakada b1be349bfb
Make symlink to "ruby" only from the install-name 2019-07-09 21:22:07 +09:00
Nobuyoshi Nakada eb043c8888
${} does not work with nmake.exe 2019-07-02 11:46:58 +09:00