Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
63330ae
Change ROBJECT_TRANSIENT_FLAG to use FL_USER2
jemmaissroff May 26, 2022
382cde9
[rubygems/rubygems] Bump rb-sys
dependabot[bot] Jul 25, 2022
43c11f6
For rdoc, copy doc/rdoc to doc/ (#6181)
BurdetteLamar Jul 25, 2022
8fa6646
Fix sync_default_gems.rb to use absolute path
peterzhu2118 Jul 25, 2022
ba098fa
Sync RDoc
peterzhu2118 Jul 25, 2022
d7868c7
* append newline at EOF. [ci skip]
matzbot Jul 25, 2022
cc29b43
[ruby/rdoc] Move section Directives into section Blocks (https://gith…
BurdetteLamar Jul 25, 2022
649bfbe
Fix `rb_profile_frames` output includes dummy main thread frame
ivoanjo Jul 11, 2022
b404a5f
8fa66467de is broken with rubygems/rubygems and flori/json.
hsbt Jul 26, 2022
9e6d07f
Merge rubygems/bundler HEAD
hsbt Jul 26, 2022
9a8f6e3
Cheaply derive code range for String#b return value
nirvdrum Jul 26, 2022
2d1cf65
Adjust indent [ci skip]
nobu Jul 26, 2022
456e1d1
Try the tag without "v" prefix to checkout upstream repositories
nobu Jul 26, 2022
3f70aa6
Remove ary_discard
peterzhu2118 Jul 25, 2022
efb91ff
Rename rb_ary_tmp_new to rb_ary_hidden_new
peterzhu2118 Jul 25, 2022
4325e90
Use rb_ary_hidden_new for rb_ary_hidden_new_fill
peterzhu2118 Jul 25, 2022
163e3f0
[rubygems/rubygems] Use main as default branch for Bundler specs
deivid-rodriguez Jul 25, 2022
457170e
* 2022-07-27 [ci skip]
matzbot Jul 26, 2022
33f9e8f
Add doc/rdoc directory to .document
peterzhu2118 Jul 26, 2022
36d0c71
Refactored poisoning and unpoisoning freelist to simpler API
jemmaissroff May 25, 2022
3b1ed03
* expand tabs. [ci skip]
matzbot Jul 26, 2022
6a69807
[rubygems/rubygems] Completely drop base parameter from index
deivid-rodriguez Nov 17, 2021
b4ae144
[rubygems/rubygems] Don't use Pathname for creating extension dir
deivid-rodriguez Jul 23, 2022
64f9f7d
[ruby/rdoc] [DOC] Clarifications for directives (https://github.com/r…
BurdetteLamar Jul 26, 2022
c3d9849
[rubygems/rubygems] Add ignore_funding_requests config flag
m-o-e Jul 25, 2022
8154b17
Manually sync with https://github.com/ruby/date/pull/64
hsbt Jul 27, 2022
464f73a
Do not load library files from repository only for test
nobu Jul 27, 2022
852ac26
Make indents and newlines consistent [ci skip]
nobu Jul 27, 2022
8b9d4b2
Append semicolons [ci skip]
nobu Jul 27, 2022
f42230f
Adjust styles [ci skip]
nobu Jul 27, 2022
64c8291
[ruby/pathname] Fix `autoload` of `FileUtils`
nobu Jul 27, 2022
70a9328
[ci-skip]Document how to run an individual bootstrap test
eightbitraptor Jul 27, 2022
44f4241
Update to ruby/mspec@290e36a
eregon Jul 27, 2022
6582df2
Update to ruby/spec@cbfaf51
eregon Jul 27, 2022
708d06f
* 2022-07-28 [ci skip]
matzbot Jul 27, 2022
4ad6989
Fix documentation for ARGF.inplace_mode{,=}
jeremyevans Jul 27, 2022
431fdc9
[DOC] Cross references for `ARGF`
nobu Jul 28, 2022
5d5c1d0
Suppress use-after-free warning by gcc-12
nobu Jul 27, 2022
bee5089
Try reproducing the MinGW hang on time command (#6168)
k0kubun Jul 28, 2022
2b93747
`RUBY_DEBUG_LOG2` should filter against the given `file`
nobu Jul 28, 2022
98e01c9
Also skip the failing test similar with a343952d195a324dd4563318d8f88…
hsbt Jul 28, 2022
202ce7d
test_io_console.rbL399 is also randomly failing same as bfc697f1e26f1…
hsbt Jul 28, 2022
d448ecc
Fix the missing brackets
hsbt Jul 28, 2022
3eade59
Skip randomly failing tests with FreeBSD 12
hsbt Jul 28, 2022
2375afb
Refactor gc_ref_update_array
peterzhu2118 Jul 27, 2022
1c16645
Make array slices views rather than copies
peterzhu2118 Jul 27, 2022
229cf26
Lock the VM for rb_gc_writebarrier_unprotect
peterzhu2118 Jul 27, 2022
c38ad2a
Fix format specifier for `rb_ractor_id()`
nobu Jul 27, 2022
94c3d52
Fix conversion of `rb_ractor_id()`
nobu Jul 27, 2022
90cf767
Fix format-pedantic warnings
nobu Jul 28, 2022
18b1e5e
[ruby/rdoc] [DOC] Add some links in intro; delimit rendered HTML outp…
BurdetteLamar Jul 28, 2022
ab08a43
YJIT: Teach getblockparamproxy to handle the no-block case without ex…
matthewd Jul 28, 2022
68655c6
* 2022-07-29 [ci skip]
matzbot Jul 28, 2022
c56e957
[ruby/rdoc] Link from RDoc::Markup to RDoc::MarkupReference (https://…
BurdetteLamar Jul 28, 2022
c348f5a
[ruby/date] [DOC] Enhanced RDoc for <=> (https://github.com/ruby/date…
BurdetteLamar Jul 28, 2022
0d68286
Revert "Try reproducing the MinGW hang on time command (#6168)"
k0kubun Jul 28, 2022
f29f1d2
[ruby/rdoc] Fix formatting blockquote in verbatim
nobu Jul 29, 2022
bfd09b1
Merge rubygems master from https://github.com/rubygems/rubygems/commi…
hsbt Jul 29, 2022
def1d44
[rubygems/rubygems] Add package/pack aliases to man pages for cache
tnir Jul 28, 2022
d1e726c
[rubygems/rubygems] Fix dead links to deprecated bundle-package(1) wi…
tnir Jul 28, 2022
3725454
Merge ruby/fileutils from https://github.com/ruby/fileutils/commit/33…
hsbt Jul 29, 2022
419ad1e
[ruby/optparse] Also accept '-' as an optional argument (https://gith…
konsolebox Jun 9, 2022
4bf97a8
fix typo in Time#xmlschema documentation
lukad May 22, 2022
66b52f0
[flori/json] Stop including the parser source __LINE__ in exceptions
byroot May 20, 2021
b2cc74a
[flori/json] test parsing of unicode, mixing literal characters with …
notEthan Oct 20, 2021
4e886d2
Update parser-text.rb with https://github.com/ruby/racc/commit/4ecc13…
hsbt Jul 29, 2022
62849b3
Keep gitignore for libyaml source with psych
hsbt Jul 29, 2022
f78e46d
[ruby/rdoc] Add block quotes (https://github.com/ruby/rdoc/pull/907)
BurdetteLamar Jul 29, 2022
b515fdc
[rubygems/rubygems] No need to set anything at all unless standalone …
deivid-rodriguez Jul 24, 2022
030050c
[rubygems/rubygems] Make `--standalone` play nice with `--local`
deivid-rodriguez Jul 24, 2022
2346f3b
* 2022-07-30 [ci skip]
matzbot Jul 29, 2022
5317564
[ruby/date] [DOC] Enhanced RDoc (https://github.com/ruby/date/pull/66)
BurdetteLamar Jul 29, 2022
fbd2479
Add --enable-yjit=stats configure option
jhawthorn Jul 7, 2022
0e85586
Add --enable-yjit=dev_nodebug configure option
jhawthorn Jul 29, 2022
af265d7
[ruby/rdoc] Fix blockquote with word in verbatim
nobu Jul 29, 2022
48b09aa
[ruby/digest] Revert tab-expansion in external files
nobu Jul 30, 2022
8a65cf3
* expand tabs. [ci skip]
matzbot Jul 30, 2022
39dc9f9
Revert "* expand tabs. [ci skip]"
hsbt Jul 30, 2022
1bebf21
Update .git-blame-ignore-revs [ci skip]
nobu Jul 30, 2022
f28287d
[ruby/io-nonblock] Revert tab expansion
nobu Jul 30, 2022
c258fb2
Update .git-blame-ignore-revs [ci skip]
nobu Jul 30, 2022
0d842fe
* expand tabs. [ci skip]
matzbot Jul 30, 2022
4ba2c66
Revert "* expand tabs. [ci skip]"
nobu Jul 30, 2022
2338845
Update .git-blame-ignore-revs [ci skip]
nobu Jul 30, 2022
1a73a6c
Implement Enumerator::Product and Enumerator.product [Feature #18685]
knu Jul 29, 2022
d050f16
Mention Enumerator.product/Enumerator::Product in the NEWS.md
knu Jul 29, 2022
4efbeb1
[ruby/date] Enhanced RDoc (https://github.com/ruby/date/pull/67)
BurdetteLamar Jul 30, 2022
118368c
* 2022-07-31 [ci skip]
matzbot Jul 30, 2022
b0e6d07
[rubygems/rubygems] Update bundle-platform(1) man
tnir Jul 31, 2022
3b8279e
* 2022-08-01 [ci skip]
matzbot Jul 31, 2022
c69ad73
Initialize node_id
graywolf Jul 29, 2022
1520936
Fix a link [ci skip]
znz Aug 1, 2022
5bbba76
respect current frame of `rb_eval_string`
ko1 Jul 29, 2022
5c13adb
[rubygems/rubygems] Fix comment incorrectly copied from another spec
deivid-rodriguez Aug 1, 2022
13305bf
[rubygems/rubygems] Fix crash when running `bundle outdated` in debug…
deivid-rodriguez Aug 1, 2022
25022ba
[rubygems/rubygems] Bump rb-sys
dependabot[bot] Aug 1, 2022
00777a9
* 2022-08-02 [ci skip]
matzbot Aug 1, 2022
24204d5
[rubygems/rubygems] Bump rb-sys in /test/rubygems/test_gem_ext_cargo_…
dependabot[bot] Aug 1, 2022
6ec8f68
[rubygems/rubygems] Move some logic to `LazySpecification#__materiali…
deivid-rodriguez Jul 14, 2022
7cc5a65
[rubygems/rubygems] Remove unnecessary special case for Bundler
deivid-rodriguez Jul 23, 2022
ed9bbfd
[rubygems/rubygems] Fix incorrect force_ruby_platform propagation
deivid-rodriguez Jul 23, 2022
35e508d
[rubygems/rubygems] Refactor materialization conditions
deivid-rodriguez Jul 23, 2022
91b9bd6
[rubygems/rubygems] This should go through the standard source search…
deivid-rodriguez Jul 25, 2022
bc0de1e
[rubygems/rubygems] Only need to filter platforms when materializatio…
deivid-rodriguez Jul 23, 2022
5487e76
[rubygems/rubygems] Prefer reverse+find to select+last
deivid-rodriguez Jul 29, 2022
8c98f7b
[rubygems/rubygems] Remove unnecessary local variable
deivid-rodriguez Jul 29, 2022
9189c2d
[rubygems/rubygems] Materializing for resolution already filters plat…
deivid-rodriguez Jul 29, 2022
f4f6814
[rubygems/rubygems] Don't discard candidates matching ruby metadata
deivid-rodriguez Jul 23, 2022
bc90090
[rubygems/rubygems] Check for errors in error stream
deivid-rodriguez Jul 30, 2022
3e4fedc
[rubygems/rubygems] Preserve the previous behavior of raising an erro…
deivid-rodriguez Jul 30, 2022
ec3f593
[Bug #17767] Now `ENV.clone` raises `TypeError` as well as `ENV.dup`
nobu Jul 20, 2022
e3aabe9
Implement Queue#pop(timeout: sec)
byroot Jul 26, 2022
b81858c
[rubygems/rubygems] Fix arguments for bundle-config(1) docs
tnir Aug 2, 2022
f70b26a
[rubygems/rubygems] Array is already uniq, no need to deduplicate it
deivid-rodriguez Aug 2, 2022
da00243
[DOC] Specify ways to run bootstrap tests
peterzhu2118 Jul 31, 2022
e4e054e
Speed up setting the backref match object
tenderlove Aug 1, 2022
4ba611a
* 2022-08-03 [ci skip]
matzbot Aug 2, 2022
d8ea3a2
[ruby/date] [DOC] Enhanced RDoc for parser methods (https://github.co…
BurdetteLamar Aug 2, 2022
eaf6189
[ruby/date] Enhanced RDoc (https://github.com/ruby/date/pull/69)
BurdetteLamar Aug 2, 2022
20936eb
[rubygems/rubygems] Warn (rather than crash) when setting `nil` speci…
deivid-rodriguez Aug 1, 2022
4f00ee8
[rubygems/rubygems] fix platform matching for index specs
Ilushkanama Aug 1, 2022
f33b2ae
Updated to use multiple licenses
TWinsnes Aug 2, 2022
8a1be43
[ruby/bigdecimal] Updated to use the correct spec for muilti license
TWinsnes Aug 2, 2022
71794a7
Merge rubygems/bundler HEAD
hsbt Aug 3, 2022
35c65e7
[rubygems/rubygems] Fix conservative updates regardless of `--strict`
deivid-rodriguez Aug 1, 2022
851b3aa
[rubygems/rubygems] Fix `bundle outdated --strict`
deivid-rodriguez Aug 1, 2022
4406cb1
Harden Queue#pop timeout tests
byroot Aug 3, 2022
b54f26b
[ruby/irb] shortcut colorize_code to speedup pretty_print
tompng Aug 1, 2022
3944862
* 2022-08-04 [ci skip]
matzbot Aug 3, 2022
0591780
[rubygems/rubygems] Extract entry.full_name to a variable
deivid-rodriguez Aug 2, 2022
542040f
[rubygems/rubygems] Warn dangling symlinks
deivid-rodriguez Aug 2, 2022
50d81bf
Link ext bundles with bundle loader option for newer ld64
kateinoigakukun Jul 28, 2022
c69582a
Quote $(BUILTRUBY) so paths with spaces work
XrXr Jul 29, 2022
e5a3f23
Use $(bindir) for path to executable in mkmf
XrXr Jul 29, 2022
6d8b9a9
Resolve abi symbol references from miniruby to avoid circular deps
kateinoigakukun Jul 30, 2022
184fd94
Resolve abi symbols from libruby.dylib when available
kateinoigakukun Jul 30, 2022
00f411c
Add `-bundle_loader` to mjit compilation args on macOS
kateinoigakukun Jul 30, 2022
6b2fc33
thread_sync.c: pass proper argument to queue_sleep in rb_szqueue_push
byroot Aug 4, 2022
c84d053
[rubygems/rubygems] Fix unused variable warning
deivid-rodriguez Aug 4, 2022
8bab099
* 2022-08-05 [ci skip]
matzbot Aug 4, 2022
7f5f9d1
YJIT: Add known_* helpers for Type (#6208)
jhawthorn Aug 4, 2022
1e7a241
YJIT: Allow str-concat arg to be any string subtype, not just rb_cStr…
noahgibbs Aug 4, 2022
859c887
Merge remote-tracking branch 'upstream_ruby/master' into yjit_backend_ir
maximecb Aug 4, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .document
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pack.rb
ractor.rb
string.rb
timev.rb
thread_sync.rb
trace_point.rb
warning.rb

Expand Down
10 changes: 10 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,13 @@

# Enable Style/StringLiterals cop for RubyGems/Bundler
d7ffd3fea402239b16833cc434404a7af82d44f3

# [ruby/digest] Revert tab-expansion in external files
48b09aae7ec5632209229dcc294dd0d75a93a17f
8a65cf3b61c60e4cb886f59a73ff6db44364bfa9
39dc9f9093901d40d2998653948d5da38b18ee2c

# [ruby/io-nonblock] Revert tab expansion
f28287d34c03f472ffe90ea262bdde9affd4b965
0d842fecb4f75ab3b1d4097ebdb8e88f51558041
4ba2c66761d6a293abdfba409241d31063cefd62
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ Note that each entry is kept to a minimum, see links for details.

Note: We're only listing outstanding class updates.

* Enumerator
* Enumerator.product has been added. Enumerator::Product is the implementation. [[Feature #18685]]

* Hash
* Hash#shift now always returns nil if the hash is
empty, instead of returning the default value or
Expand Down Expand Up @@ -268,5 +271,6 @@ The following deprecated APIs are removed.
[Feature #18598]: https://bugs.ruby-lang.org/issues/18598
[Bug #18625]: https://bugs.ruby-lang.org/issues/18625
[Bug #18633]: https://bugs.ruby-lang.org/issues/18633
[Feature #18685]: https://bugs.ruby-lang.org/issues/18685
[Bug #18782]: https://bugs.ruby-lang.org/issues/18782
[Feature #18788]: https://bugs.ruby-lang.org/issues/18788
63 changes: 35 additions & 28 deletions array.c
Original file line number Diff line number Diff line change
Expand Up @@ -967,20 +967,19 @@ rb_ec_ary_new_from_values(rb_execution_context_t *ec, long n, const VALUE *elts)
}

VALUE
rb_ary_tmp_new(long capa)
rb_ary_hidden_new(long capa)
{
VALUE ary = ary_new(0, capa);
rb_ary_transient_heap_evacuate(ary, TRUE);
return ary;
}

VALUE
rb_ary_tmp_new_fill(long capa)
rb_ary_hidden_new_fill(long capa)
{
VALUE ary = ary_new(0, capa);
VALUE ary = rb_ary_hidden_new(capa);
ary_memfill(ary, 0, capa, Qnil);
ARY_SET_LEN(ary, capa);
rb_ary_transient_heap_evacuate(ary, TRUE);
return ary;
}

Expand Down Expand Up @@ -1025,18 +1024,10 @@ rb_ary_memsize(VALUE ary)
}
}

static inline void
ary_discard(VALUE ary)
{
rb_ary_free(ary);
RBASIC(ary)->flags |= RARRAY_EMBED_FLAG;
RBASIC(ary)->flags &= ~(RARRAY_EMBED_LEN_MASK | RARRAY_TRANSIENT_FLAG);
}

static VALUE
ary_make_shared(VALUE ary)
{
assert(!ARY_EMBED_P(ary));
assert(USE_RVARGC || !ARY_EMBED_P(ary));
ary_verify(ary);

if (ARY_SHARED_P(ary)) {
Expand All @@ -1046,21 +1037,38 @@ ary_make_shared(VALUE ary)
return ary;
}
else if (OBJ_FROZEN(ary)) {
rb_ary_transient_heap_evacuate(ary, TRUE);
ary_shrink_capa(ary);
if (!ARY_EMBED_P(ary)) {
rb_ary_transient_heap_evacuate(ary, TRUE);
ary_shrink_capa(ary);
}
return ary;
}
else {
long capa = ARY_CAPA(ary), len = RARRAY_LEN(ary);
const VALUE *ptr;
rb_ary_transient_heap_evacuate(ary, TRUE);

long capa = ARY_CAPA(ary);
long len = RARRAY_LEN(ary);

/* Shared roots cannot be embedded because the reference count
* (refcnt) is stored in as.heap.aux.capa. */
VALUE shared = ary_alloc_heap(0);

rb_ary_transient_heap_evacuate(ary, TRUE);
ptr = ARY_HEAP_PTR(ary);
if (ARY_EMBED_P(ary)) {
/* Cannot use ary_heap_alloc because we don't want to allocate
* on the transient heap. */
VALUE *ptr = ALLOC_N(VALUE, capa);
ARY_SET_PTR(shared, ptr);
ary_memcpy(shared, 0, len, RARRAY_PTR(ary));

FL_UNSET_EMBED(ary);
ARY_SET_HEAP_LEN(ary, len);
ARY_SET_PTR(ary, ptr);
}
else {
ARY_SET_PTR(shared, RARRAY_PTR(ary));
}

FL_UNSET_EMBED(shared);
ARY_SET_LEN(shared, capa);
ARY_SET_PTR(shared, ptr);
ary_mem_clear(shared, len, capa - len);
FL_SET_SHARED_ROOT(shared);
ARY_SET_SHARED_ROOT_REFCNT(shared, 1);
Expand Down Expand Up @@ -1327,7 +1335,9 @@ ary_make_partial(VALUE ary, VALUE klass, long offset, long len)
assert(len >= 0);
assert(offset+len <= RARRAY_LEN(ary));

if (ary_embeddable_p(len)) {
const size_t rarray_embed_capa_max = (sizeof(struct RArray) - offsetof(struct RArray, as.ary)) / sizeof(VALUE);

if ((size_t)len <= rarray_embed_capa_max && ary_embeddable_p(len)) {
VALUE result = ary_alloc_embed(klass, len);
ary_memcpy(result, 0, len, RARRAY_CONST_PTR_TRANSIENT(ary) + offset);
ARY_SET_EMBED_LEN(result, len);
Expand Down Expand Up @@ -5109,7 +5119,7 @@ rb_ary_concat_multi(int argc, VALUE *argv, VALUE ary)
}
else if (argc > 1) {
int i;
VALUE args = rb_ary_tmp_new(argc);
VALUE args = rb_ary_hidden_new(argc);
for (i = 0; i < argc; i++) {
rb_ary_concat(args, argv[i]);
}
Expand Down Expand Up @@ -6937,9 +6947,6 @@ rb_ary_cycle(int argc, VALUE *argv, VALUE ary)
return Qnil;
}

#define tmpary(n) rb_ary_tmp_new(n)
#define tmpary_discard(a) (ary_discard(a), RBASIC_SET_CLASS_RAW(a, rb_cArray))

/*
* Build a ruby array of the corresponding values and yield it to the
* associated block.
Expand Down Expand Up @@ -7634,7 +7641,7 @@ static VALUE
rb_ary_product(int argc, VALUE *argv, VALUE ary)
{
int n = argc+1; /* How many arrays we're operating on */
volatile VALUE t0 = tmpary(n);
volatile VALUE t0 = rb_ary_hidden_new(n);
volatile VALUE t1 = Qundef;
VALUE *arrays = RARRAY_PTR(t0); /* The arrays we're computing the product of */
int *counters = ALLOCV_N(int, t1, n); /* The current position in each one */
Expand Down Expand Up @@ -7711,8 +7718,8 @@ rb_ary_product(int argc, VALUE *argv, VALUE ary)
counters[m]++;
}
}

done:
tmpary_discard(t0);
ALLOCV_END(t1);

return NIL_P(result) ? ary : result;
Expand Down
1 change: 1 addition & 0 deletions bootstraptest/test_io.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/freebsd/ =~ RUBY_PLATFORM or
assert_finish 5, %q{
r, w = IO.pipe
t1 = Thread.new { r.sysread(1) }
Expand Down
13 changes: 13 additions & 0 deletions bootstraptest/test_yjit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1224,6 +1224,19 @@ def foo(&block)
[foo {1}, foo {2}, foo {42}]
}

# test calling without block param
assert_equal '[1, false, 2, false]', %q{
def bar
block_given? && yield
end

def foo(&block)
bar(&block)
end

[foo { 1 }, foo, foo { 2 }, foo]
}

# test calling block param failing
assert_equal '42', %q{
def foo(&block)
Expand Down
6 changes: 3 additions & 3 deletions class.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ rb_mod_init_copy(VALUE clone, VALUE orig)
VALUE p = RCLASS_SUPER(orig);
VALUE orig_origin = RCLASS_ORIGIN(orig);
VALUE prev_clone_p = clone;
VALUE origin_stack = rb_ary_tmp_new(2);
VALUE origin_stack = rb_ary_hidden_new(2);
VALUE origin[2];
VALUE clone_p = 0;
long origin_len;
Expand Down Expand Up @@ -1250,7 +1250,7 @@ do_include_modules_at(const VALUE klass, VALUE c, VALUE module, int search_super
RCLASS_SET_INCLUDER(iclass, klass);
add_subclass = TRUE;
if (module != RCLASS_ORIGIN(module)) {
if (!origin_stack) origin_stack = rb_ary_tmp_new(2);
if (!origin_stack) origin_stack = rb_ary_hidden_new(2);
VALUE origin[2] = {iclass, RCLASS_ORIGIN(module)};
rb_ary_cat(origin_stack, origin, 2);
}
Expand Down Expand Up @@ -2310,7 +2310,7 @@ rb_get_kwargs(VALUE keyword_hash, const ID *table, int required, int optional, V
continue;
}
}
if (NIL_P(missing)) missing = rb_ary_tmp_new(1);
if (NIL_P(missing)) missing = rb_ary_hidden_new(1);
rb_ary_push(missing, keyword);
}
if (!NIL_P(missing)) {
Expand Down
5 changes: 5 additions & 0 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,7 @@ BUILTIN_RB_SRCS = \
$(srcdir)/kernel.rb \
$(srcdir)/ractor.rb \
$(srcdir)/timev.rb \
$(srcdir)/thread_sync.rb \
$(srcdir)/nilclass.rb \
$(srcdir)/prelude.rb \
$(srcdir)/gem_prelude.rb \
Expand Down Expand Up @@ -9447,6 +9448,7 @@ miniinit.$(OBJEXT): {$(VPATH)}st.h
miniinit.$(OBJEXT): {$(VPATH)}subst.h
miniinit.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
miniinit.$(OBJEXT): {$(VPATH)}thread_native.h
miniinit.$(OBJEXT): {$(VPATH)}thread_sync.rb
miniinit.$(OBJEXT): {$(VPATH)}timev.rb
miniinit.$(OBJEXT): {$(VPATH)}trace_point.rb
miniinit.$(OBJEXT): {$(VPATH)}vm_core.h
Expand Down Expand Up @@ -15230,6 +15232,7 @@ thread.$(OBJEXT): {$(VPATH)}backward/2/limits.h
thread.$(OBJEXT): {$(VPATH)}backward/2/long_long.h
thread.$(OBJEXT): {$(VPATH)}backward/2/stdalign.h
thread.$(OBJEXT): {$(VPATH)}backward/2/stdarg.h
thread.$(OBJEXT): {$(VPATH)}builtin.h
thread.$(OBJEXT): {$(VPATH)}config.h
thread.$(OBJEXT): {$(VPATH)}debug.h
thread.$(OBJEXT): {$(VPATH)}debug_counter.h
Expand Down Expand Up @@ -15412,6 +15415,8 @@ thread.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).c
thread.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
thread.$(OBJEXT): {$(VPATH)}thread_native.h
thread.$(OBJEXT): {$(VPATH)}thread_sync.c
thread.$(OBJEXT): {$(VPATH)}thread_sync.rb
thread.$(OBJEXT): {$(VPATH)}thread_sync.rbinc
thread.$(OBJEXT): {$(VPATH)}timev.h
thread.$(OBJEXT): {$(VPATH)}vm_core.h
thread.$(OBJEXT): {$(VPATH)}vm_debug.h
Expand Down
25 changes: 13 additions & 12 deletions compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ static void iseq_add_setlocal(rb_iseq_t *iseq, LINK_ANCHOR *const seq, const NOD
LABEL_REF(le); \
LABEL_REF(lc); \
if (NIL_P(ISEQ_COMPILE_DATA(iseq)->catch_table_ary)) \
RB_OBJ_WRITE(iseq, &ISEQ_COMPILE_DATA(iseq)->catch_table_ary, rb_ary_tmp_new(3)); \
RB_OBJ_WRITE(iseq, &ISEQ_COMPILE_DATA(iseq)->catch_table_ary, rb_ary_hidden_new(3)); \
rb_ary_push(ISEQ_COMPILE_DATA(iseq)->catch_table_ary, freeze_hide_obj(_e)); \
} while (0)

Expand Down Expand Up @@ -627,7 +627,7 @@ decl_branch_base(rb_iseq_t *iseq, const NODE *node, const char *type)
VALUE branches;

if (NIL_P(branch_base)) {
branch_base = rb_ary_tmp_new(6);
branch_base = rb_ary_hidden_new(6);
rb_hash_aset(structure, key, branch_base);
rb_ary_push(branch_base, ID2SYM(rb_intern(type)));
rb_ary_push(branch_base, INT2FIX(first_lineno));
Expand Down Expand Up @@ -675,7 +675,7 @@ add_trace_branch_coverage(rb_iseq_t *iseq, LINK_ANCHOR *const seq, const NODE *n
long counter_idx;

if (NIL_P(branch)) {
branch = rb_ary_tmp_new(6);
branch = rb_ary_hidden_new(6);
rb_hash_aset(branches, key, branch);
rb_ary_push(branch, ID2SYM(rb_intern(type)));
rb_ary_push(branch, INT2FIX(first_lineno));
Expand Down Expand Up @@ -1743,7 +1743,7 @@ iseq_set_arguments_keywords(rb_iseq_t *iseq, LINK_ANCHOR *const optargs,
const NODE *node = args->kw_args;
struct rb_iseq_constant_body *const body = ISEQ_BODY(iseq);
struct rb_iseq_param_keyword *keyword;
const VALUE default_values = rb_ary_tmp_new(1);
const VALUE default_values = rb_ary_hidden_new(1);
const VALUE complex_mark = rb_str_tmp_new(0);
int kw = 0, rkw = 0, di = 0, i;

Expand Down Expand Up @@ -1847,7 +1847,7 @@ iseq_set_arguments(rb_iseq_t *iseq, LINK_ANCHOR *const optargs, const NODE *cons
if (args->opt_args) {
const NODE *node = args->opt_args;
LABEL *label;
VALUE labels = rb_ary_tmp_new(1);
VALUE labels = rb_ary_hidden_new(1);
VALUE *opt_table;
int i = 0, j;

Expand Down Expand Up @@ -4369,7 +4369,7 @@ compile_array(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, int pop

if ((first_chunk && stack_len == 0 && !node_tmp) || count >= min_tmp_ary_len) {
/* The literal contains only optimizable elements, or the subarray is long enough */
VALUE ary = rb_ary_tmp_new(count);
VALUE ary = rb_ary_hidden_new(count);

/* Create a hidden array */
for (; count; count--, node = node->nd_next)
Expand Down Expand Up @@ -4420,7 +4420,7 @@ static int
compile_array_1(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node)
{
if (static_literal_node_p(node, iseq)) {
VALUE ary = rb_ary_tmp_new(1);
VALUE ary = rb_ary_hidden_new(1);
rb_ary_push(ary, static_literal_value(node, iseq));
OBJ_FREEZE(ary);

Expand Down Expand Up @@ -4517,7 +4517,7 @@ compile_hash(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, int meth

if ((first_chunk && stack_len == 0 && !node_tmp) || count >= min_tmp_hash_len) {
/* The literal contains only optimizable elements, or the subsequence is long enough */
VALUE ary = rb_ary_tmp_new(count);
VALUE ary = rb_ary_hidden_new(count);

/* Create a hidden hash */
for (; count; count--, node = node->nd_next->nd_next) {
Expand Down Expand Up @@ -4837,7 +4837,8 @@ struct masgn_state {
};

static int
add_masgn_lhs_node(struct masgn_state *state, int lhs_pos, const NODE *line_node, int argc, INSN *before_insn) {
add_masgn_lhs_node(struct masgn_state *state, int lhs_pos, const NODE *line_node, int argc, INSN *before_insn)
{
if (!state) {
rb_bug("no masgn_state");
}
Expand Down Expand Up @@ -12077,7 +12078,7 @@ ibf_dump_iseq_list_i(st_data_t key, st_data_t val, st_data_t ptr)
static void
ibf_dump_iseq_list(struct ibf_dump *dump, struct ibf_header *header)
{
VALUE offset_list = rb_ary_tmp_new(dump->iseq_table->num_entries);
VALUE offset_list = rb_ary_hidden_new(dump->iseq_table->num_entries);

struct ibf_dump_iseq_list_arg args;
args.dump = dump;
Expand Down Expand Up @@ -12349,7 +12350,7 @@ ibf_load_object_array(const struct ibf_load *load, const struct ibf_object_heade

const long len = (long)ibf_load_small_value(load, &reading_pos);

VALUE ary = header->internal ? rb_ary_tmp_new(len) : rb_ary_new_capa(len);
VALUE ary = header->internal ? rb_ary_hidden_new(len) : rb_ary_new_capa(len);
int i;

for (i=0; i<len; i++) {
Expand Down Expand Up @@ -12744,7 +12745,7 @@ static void
ibf_dump_object_list(struct ibf_dump *dump, ibf_offset_t *obj_list_offset, unsigned int *obj_list_size)
{
st_table *obj_table = dump->current_buffer->obj_table;
VALUE offset_list = rb_ary_tmp_new(obj_table->num_entries);
VALUE offset_list = rb_ary_hidden_new(obj_table->num_entries);

struct ibf_dump_object_list_arg args;
args.dump = dump;
Expand Down
Loading