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

347 Коммитов

Автор SHA1 Сообщение Дата
Randy Stauner acbb8d4fb5 Expand opt_newarray_send to support Array#pack with buffer keyword arg
Use an enum for the method arg instead of needing to add an id
that doesn't map to an actual method name.

$ ruby --dump=insns -e 'b = "x"; [v].pack("E*", buffer: b)'

before:

```
== disasm: #<ISeq:<main>@-e:1 (1,0)-(1,34)>
local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1])
[ 1] b@0
0000 putchilledstring                       "x"                       (   1)[Li]
0002 setlocal_WC_0                          b@0
0004 putself
0005 opt_send_without_block                 <calldata!mid:v, argc:0, FCALL|VCALL|ARGS_SIMPLE>
0007 newarray                               1
0009 putchilledstring                       "E*"
0011 getlocal_WC_0                          b@0
0013 opt_send_without_block                 <calldata!mid:pack, argc:2, kw:[#<Symbol:0x000000000023110c>], KWARG>
0015 leave
```

after:

```
== disasm: #<ISeq:<main>@-e:1 (1,0)-(1,34)>
local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1])
[ 1] b@0
0000 putchilledstring                       "x"                       (   1)[Li]
0002 setlocal_WC_0                          b@0
0004 putself
0005 opt_send_without_block                 <calldata!mid:v, argc:0, FCALL|VCALL|ARGS_SIMPLE>
0007 putchilledstring                       "E*"
0009 getlocal                               b@0, 0
0012 opt_newarray_send                      3, 5
0015 leave
```
2024-07-29 16:26:58 -04:00
Burdette Lamar 8627225704
Add/revise Errno descriptions (#10897) 2024-06-04 15:19:50 +00:00
Nobuyoshi Nakada 0d44e23831
Prevent test-bundled-gems outputs from mixing
Run test-bundled-gems-run and test-bundled-gems-spec sequentially.
2024-05-26 22:17:57 +09:00
Nobuyoshi Nakada 49fcd33e13 Introduce a specialize instruction for Array#pack
Instructions for this code:

```ruby
  # frozen_string_literal: true

[a].pack("C")
```

Before this commit:

```
== disasm: #<ISeq:<main>@test.rb:1 (1,0)-(3,13)>
0000 putself                                                          (   3)[Li]
0001 opt_send_without_block                 <calldata!mid:a, argc:0, FCALL|VCALL|ARGS_SIMPLE>
0003 newarray                               1
0005 putobject                              "C"
0007 opt_send_without_block                 <calldata!mid:pack, argc:1, ARGS_SIMPLE>
0009 leave
```

After this commit:

```
== disasm: #<ISeq:<main>@test.rb:1 (1,0)-(3,13)>
0000 putself                                                          (   3)[Li]
0001 opt_send_without_block                 <calldata!mid:a, argc:0, FCALL|VCALL|ARGS_SIMPLE>
0003 putobject                              "C"
0005 opt_newarray_send                      2, :pack
0008 leave
```

Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2024-05-23 12:11:50 -07:00
Nobuyoshi Nakada e937878883
Revert "Update revision.h if branch unmatch not only revision"
This reverts commit 5a332940ed.
Something does not work well on Github Actions.
2024-05-09 01:02:59 +09:00
Nobuyoshi Nakada 5a332940ed
Update revision.h if branch unmatch not only revision [ci skip] 2024-05-08 21:39:32 +09:00
Nobuyoshi Nakada 3169c15863
Fix rubyspec-capiext dependency
Not to build the rubyspec-capiext extension libraries again on the
next build after the build all extensions get built, ensure these
extensions are up to date when recursively building from exts.mk.
2024-04-19 14:12:41 +09:00
Nobuyoshi Nakada 53a8ad151b
Escape colons in pre-commit dependency [ci skip]
Colons are special in Makefiles.
2024-04-16 15:09:56 +09:00
Nobuyoshi Nakada 0fb39ab1b9
Clean intermediate files and debug info for each target
By replacing `ALLOBJS` suffix with intermediate file suffixes instead
of roughly removing by wildcards.  Made `cleanlibs` append `.dSYM`
suffix for each word in `TARGET_SO`, not the end of the entire list.
2024-03-10 22:12:00 +09:00
Nobuyoshi Nakada 2c787bf90f
Run POSTLINK for rubyspec CAPIEXT objects 2024-03-04 23:25:51 +09:00
Nobuyoshi Nakada 573bfb3a14
[DOC] Add known_errors documents
Incorporate from The Open Group.
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/errno.h.html
2024-01-13 11:08:03 +09:00
Nobuyoshi Nakada 9cf1c2bb0c
Refresh NEWS.md at starting new development [ci skip] 2023-12-25 20:10:37 +09:00
Kazuhiro NISHIYAMA 0fb10074e1 Fix error when gems/src is read-only
When I shared srcdir as read-only in lima-vm,
`make install` causes following error:

```
Update rbs to 33813a60752624d58dfe5ae770b39bfaf29fbaf1
error: cannot open .git/FETCH_HEAD: Read-only file system
```

I cannot find any ignore option for `git checkout --detach`
when already checked out. So I add `if`.
2023-10-11 13:32:54 +09:00
Nobuyoshi Nakada 1527246a7e
Download Unicode files once [ci skip] 2023-09-26 02:09:57 +09:00
Nobuyoshi Nakada 2b41df2477 `.NOTPARALLEL` with prerequisites needs recent GNU Make
GNU Make prior to 4.4 just ignores the prerequisites, and runs
everything in serial.
2023-09-21 12:18:41 +09:00
Nobuyoshi Nakada e22086bb6a
Enable `.NOTPARALLEL` on `ripper_srcs`
And add special treats only for old GNU make.
2023-09-13 12:11:43 +09:00
Nobuyoshi Nakada 2cc32ad67c
Split commit recipe and pass more macros 2023-09-11 11:04:33 +09:00
Nobuyoshi Nakada f339937abb RJIT: Remove macros inherited from MJIT but no longer used 2023-08-17 08:33:52 +09:00
Nobuyoshi Nakada b76c2ec005
Use `::` form workflow commands 2023-08-15 23:30:40 +09:00
Nobuyoshi Nakada 2a3acbc420
Fix test and precheck order for old GNU Make 2023-08-14 11:30:05 +09:00
Nobuyoshi Nakada 907560f5dc
Fix test-bundler dependencies 2023-08-11 15:23:48 +09:00
Nobuyoshi Nakada 8fbb79f49e
Fix order of test-syntax-suggest-prepare for old GNU Make 2023-08-11 14:47:20 +09:00
Nobuyoshi Nakada 52722ea37b
Extract common variables 2023-07-30 19:38:18 +09:00
Nobuyoshi Nakada d516910b61
Serially update only the ripper source, even with old GNU make 2023-07-10 16:36:03 +09:00
Yuichiro Kaneko a1b01e7701
Use Lrama LALR parser generator instead of Bison
https://bugs.ruby-lang.org/issues/19637

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2023-05-12 18:25:10 +09:00
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