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

322 Коммитов

Автор SHA1 Сообщение Дата
Aaron Patterson c5fc1ce975 Emit special instruction for array literal + .(hash|min|max)
This commit introduces a new instruction `opt_newarray_send` which is
used when there is an array literal followed by either the `hash`,
`min`, or `max` method.

```
[a, b, c].hash
```

Will emit an `opt_newarray_send` instruction.  This instruction falls
back to a method call if the "interested" method has been monkey
patched.

Here are some examples of the instructions generated:

```
$ ./miniruby --dump=insns -e '[@a, @b].max'
== disasm: #<ISeq:<main>@-e:1 (1,0)-(1,12)> (catch: FALSE)
0000 getinstancevariable                    :@a, <is:0>               (   1)[Li]
0003 getinstancevariable                    :@b, <is:1>
0006 opt_newarray_send                      2, :max
0009 leave
$ ./miniruby --dump=insns -e '[@a, @b].min'
== disasm: #<ISeq:<main>@-e:1 (1,0)-(1,12)> (catch: FALSE)
0000 getinstancevariable                    :@a, <is:0>               (   1)[Li]
0003 getinstancevariable                    :@b, <is:1>
0006 opt_newarray_send                      2, :min
0009 leave
$ ./miniruby --dump=insns -e '[@a, @b].hash'
== disasm: #<ISeq:<main>@-e:1 (1,0)-(1,13)> (catch: FALSE)
0000 getinstancevariable                    :@a, <is:0>               (   1)[Li]
0003 getinstancevariable                    :@b, <is:1>
0006 opt_newarray_send                      2, :hash
0009 leave
```

[Feature #18897] [ruby-core:109147]

Co-authored-by: John Hawthorn <jhawthorn@github.com>
2023-04-18 17:16:22 -07:00
Nobuyoshi Nakada a4cc3fcbd2
Replace arch_flags for universal build [ci skip] 2023-04-08 20:31:51 +09:00
Hiroshi SHIBATA 59905883c4 BundledGem.dummy_spec needs to checkout revision after cloning repository.
The current BundledGem.dummy_spec always called from master branch.
  It caused to CI faiulres like
  http://rubyci.s3.amazonaws.com/ubuntu/ruby-master/log/20230305T001003Z.fail.html.gz
2023-03-08 17:48:43 +09:00
Takashi Kokubun 2e875549a9 s/MJIT/RJIT/ 2023-03-06 23:44:01 -08:00
Takashi Kokubun 31f4b2d86b
Drop obsoleted MJIT header (#7458)
RJIT doesn't need this.
2023-03-06 21:41:48 -08:00
Nobuyoshi Nakada 241c4cfdd4 Move dummy gemspec file creation for extract-gems-sequential 2023-02-22 02:07:59 +09:00
Nobuyoshi Nakada 0a9efe8701 Use git directories instead of gemspec files as dependency
Minitest repository does not commit its gemspec file.
2023-02-22 02:07:59 +09:00
Yusuke Endoh 8eaa346620 No validation for bundled gems
https://github.com/mame/ruby/actions/runs/4208869556/jobs/7305356097
```
WARNING:  open-ended dependency on irb (>= 1.5.0) is not recommended
  if irb is semantically versioned, use:
    add_runtime_dependency 'irb', '~> 1.5', '>= 1.5.0'
WARNING:  open-ended dependency on reline (>= 0.3.1) is not recommended
  if reline is semantically versioned, use:
    add_runtime_dependency 'reline', '~> 0.3', '>= 0.3.1'
WARNING:  See http://guides.rubygems.org/specification-reference/ for help
/usr/lib/ruby/2.7.0/rubygems/specification_policy.rb:418:in `error': specification has warnings (Gem::InvalidSpecificationException)
```
2023-02-19 21:06:13 +09:00
Jean Boussier 1a4b4cd7f8 Move `attached_object` into `rb_classext_struct`
Given that signleton classes don't have an allocator,
we can re-use these bytes to store the attached object
in `rb_classext_struct` without making it larger.
2023-02-16 08:14:44 +01:00
Nobuyoshi Nakada 9821f6d0e5
Override release date in Makefile if possible 2023-02-13 15:12:54 +09:00
Nobuyoshi Nakada 63e1769b16
Add TAGS rule [ci skip] 2023-02-08 18:00:05 +09:00
Nobuyoshi Nakada 9794e49c88 Link RUBYSPEC_CAPIEXT against the built library 2023-01-26 16:31:08 +09:00
Nobuyoshi Nakada be6a347ace Need gemspec files instead of cloned directories 2023-01-26 12:50:39 +09:00
Hiroshi SHIBATA 7eef4547b1 Fixed clone name 2023-01-26 12:50:39 +09:00
Nobuyoshi Nakada 7a4f7fc14d Use timestamp files to track test revision of bundled gems 2023-01-26 12:50:39 +09:00
Nobuyoshi Nakada 17f5631c6e [Bug #19340] Fix bundle gems with test revision
Build temporary gem package from cloned repository if test revision is
set.
2023-01-26 12:50:39 +09:00
Nobuyoshi Nakada 569fbf229b
Run `after-update` in the same main make process [ci skip] 2023-01-20 00:21:53 +09:00
Nobuyoshi Nakada ee6e4d63df
Extract only one revision in header [ci skip]
Both of `$(srcdir)/revision.h` and `revision.h` exist because they are
the same file when in-place build.
2023-01-05 15:16:29 +09:00
Nobuyoshi Nakada c6c7f5900f Test bundler and bundled gems by exam 2022-12-28 09:15:31 +09:00
Nobuyoshi Nakada 84a4f1b3b2 Order test-bundler-parallel dependency 2022-12-28 09:15:31 +09:00
Nobuyoshi Nakada b466f1a5fb Reset ABI version [ci skip] 2022-12-26 17:11:57 +09:00
Nobuyoshi Nakada 324656e5a5 make matz [ci skip] 2022-12-26 17:11:57 +09:00
Nobuyoshi Nakada 18c1ca8f4c
Fix test-syntax-suggest order
Prepare for test-syntax-suggest after other tests finished.
2022-12-24 20:18:10 +09:00
Nobuyoshi Nakada cae5384273 Test syntax_suggest by `make check` 2022-12-23 20:33:27 +09:00
John Hawthorn fbaa5db44a Use a BOP for Hash#default
On a hash miss we need to call default if it is redefined in order to
return the default value to be used. Previously we checked this with
rb_method_basic_definition_p, which avoids the method call but requires
a method lookup.

This commit replaces the previous check with BASIC_OP_UNREDEFINED_P and
a new BOP_DEFAULT. We still need to fall back to
rb_method_basic_definition_p when called on a subclasss of hash.

    |                |compare-ruby|built-ruby|
    |:---------------|-----------:|---------:|
    |hash_aref_miss  |       2.692|     3.531|
    |                |           -|     1.31x|

Co-authored-by: Daniel Colson <danieljamescolson@gmail.com>
Co-authored-by: "Ian C. Anderson" <ian@iancanderson.com>
Co-authored-by: Jack McCracken <me@jackmc.xyz>
2022-12-17 14:51:49 -08:00
Nobuyoshi Nakada 7055574cf9 [Bug #19182] Unicode updating targets do not need to run for each files 2022-12-11 11:55:28 +09:00
Nobuyoshi Nakada 7a976c1060
[Bug #19181] Separate the rule for unicode_normalize/tables.rb timestamp
It should depends on only existing data files (except for the tools),
unless `ALWAYS_UPDATE_UNICODE=yes`.
2022-12-10 13:58:20 +09:00
Samuel Williams 6fd5d2dc00
Introduce `IO.new(..., path:)` and promote `File#path` to `IO#path`. (#6867) 2022-12-08 18:19:53 +13:00
Nobuyoshi Nakada 8e3ac264df
Fix dependencies of outdate-bundled-gems
Extract new gems then remove outdated gem directories.
2022-11-29 18:12:43 +09:00
Nobuyoshi Nakada aacaa2ec5e
Refine outdate-bundled-gems 2022-11-29 18:12:43 +09:00
Nobuyoshi Nakada 2f7d2662dd
Control non-parallel parts with `.WAIT` if available 2022-11-13 23:54:43 +09:00
Nobuyoshi Nakada 66529eef88
Force to update revision.h when commits differ 2022-11-13 17:38:44 +09:00
卜部昌平 45741918e1 reserved_word: just use gperf 3.1 declaration
The reason why this was commented out was because of gperf 3.0 vs 3.1
differences (see [Feature #13883]).  Five years passed, I am pretty
confident that we can drop support of old versions here.

Ditto for uniname2ctype_p(), onig_jis_property(), and zonetab().
2022-09-21 11:44:09 +09:00
Takashi Kokubun 39f91bc24b
Always generate non-empty revision.h
Non-GNU make seems to generate empty revision.h, but it doesn't make
sense since https://github.com/ruby/ruby/pull/6382.

Also the $(HAVE_BASERUBY:yes=tmp) hack doesn't seem to be working on
OpenBSD. I'll remove it to focus on fixing RubyCI first, and then deal
with baseruby-missing environments. At least a snapshot should have
revision.h and it might work fine though.
2022-09-17 23:44:14 +09:00
Nobuyoshi Nakada 9205b8c801 Revert "defs/gmake.mk: no _FORTIFY_SOURCE unless optimization"
This reverts commit b8c376cb9d, as it
seems no longer needed probably.
2022-09-12 07:47:45 +09:00
Nobuyoshi Nakada a977c66312
Generate token ID indexes in id.def
Separate the logic accross the tables from the template view for
id.h.
2022-09-08 18:18:56 +09:00
Nobuyoshi Nakada 22542a6fb0
SCRIPTBINDIR is ok if it just exists [ci skip] 2022-08-31 15:31:48 +09:00
Nobuyoshi Nakada dc66f7246a
Scripts under libexec may not be considered to be placed in bin 2022-08-31 15:31:48 +09:00
Hiroshi SHIBATA d0b17a4d20
Adjust space-width for help message 2022-08-22 12:23:38 +09:00
Nobuyoshi Nakada fbaa2f0b3b
Suppress detached head warnings [ci skip]
Check out the revisions for testing as "detached" from the beginning.
2022-08-18 11:05:34 +09:00
Nobuyoshi Nakada 2f0d9e74c8 Get rid of `-C` option for very old `git` 2022-08-05 20:46:53 +09:00
Nobuyoshi Nakada 73f0573cb3
Ignore revision to test unless HAVE_GIT 2022-08-05 09:55:49 +09:00
Nobuyoshi Nakada 8fae120912
Clone upstream gem repositories for test 2022-08-05 09:53:18 +09:00
Nobuyoshi Nakada 661536ab16
Copy from cloned gem sources in parallel 2022-08-05 09:52:12 +09:00
Nobuyoshi Nakada 44a0a66559
Move to tool/lib/bundled_gem.rb 2022-08-05 09:44:18 +09:00
Nobuyoshi Nakada 6a8f1a9e5c
Copy from bundled gem source for test 2022-08-05 09:44:18 +09:00
Nobuyoshi Nakada 87d8d25796
Use configured GIT 2022-08-05 09:39:47 +09:00
Nobuyoshi Nakada 64cff78005 `Gem.unpack` extracts gems so able to execute
Creates simple bin stubs to load the extracted executable files.
After only extracted under `gems` directory, the gems are considered
installed but the executable scripts are not found.
Also the second argument is now the parent of the previous second and
third arguments.
2022-07-17 19:57:48 +09:00
Nobuyoshi Nakada d4f5c01262
Set `SDKROOT` to empty value [ci skip]
So `RbConfig::CONFIG["includedir"]` does not start with double slash.
2022-07-06 00:32:26 +09:00
Nobuyoshi Nakada 6ba52647c3
mac: Remove debug option fro MJIT_DEBUGFLAGS
Not to generate .dSYM directories by MJIT runs, which are left in
large numbers after each test.
2022-06-27 17:38:07 +09:00