Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b04586c
[ruby/prism] Implement various string start/end events for ripper
Earlopain Mar 27, 2026
5eff7e0
[ruby/prism] Also handle string conversion in `Ripper.lex`
Earlopain Mar 27, 2026
851b8f8
Remove class alloc check
jhawthorn Mar 26, 2026
54d5890
ZJIT: Fix profile_stack to skip block arg for ARGS_BLOCKARG sends (#1…
k0kubun Mar 27, 2026
6b3cd48
ZJIT: Check native stack before compiling ISEQs (#16576)
k0kubun Mar 27, 2026
7b85b21
Bump irb version to fix a flaky test
k0kubun Mar 27, 2026
06f746f
ZJIT: Skip convert_no_profile_sends on the final ISEQ version
k0kubun Mar 27, 2026
d314472
ZJIT: Look up final version status dynamically
k0kubun Mar 27, 2026
f8a9d28
ZJIT: Restore test_recompile_no_profile_send test
k0kubun Mar 27, 2026
2e753bf
Move rb_class_allocate_instance into gc.c
jhawthorn Mar 24, 2026
8ea9f63
Revert "Exclude rbs tests which need updates for {Method,UnboundMetho…
eregon Mar 27, 2026
0ca6e5b
Revert "Update version guards in ruby/spec"
eregon Mar 27, 2026
9f25970
Revert "[Bug #21783] Fix documentation of {Method,UnboundMethod,Proc}…
eregon Mar 27, 2026
096213b
Revert "Reapply "[Feature #6012] Extend `source_location` for end pos…
eregon Mar 27, 2026
0e4c2a3
Revert "[DOC] Describe new return value of source_location"
eregon Mar 27, 2026
6035121
Fix NEWS entry about Array#pack
eregon Mar 27, 2026
400727a
[ruby/prism] Remove unused variable in tests
eregon Mar 27, 2026
93c6f97
[ruby/prism] Fix -Wconversion warnings from gcc 8.5.0
eregon Mar 27, 2026
ec2b2b7
ZJIT: Replace blockiseq: Option<IseqPtr> with block: Option<BlockHand…
k0kubun Mar 27, 2026
48b7e45
ZJIT: Add BlockHandler::BlockArg for &proc sends
k0kubun Mar 27, 2026
75ac1dd
ZJIT: Recompile sends with literal blocks via exit profiling
k0kubun Mar 27, 2026
ec2ff4f
Remove unnecessary begin/end in do/end block in _tmpdir.rb
k0kubun Mar 27, 2026
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
17 changes: 5 additions & 12 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ Note that each entry is kept to a minimum, see links for details.

Note: We're only listing outstanding class updates.

* Array

* `Array#pack` accepts a new format `R` and `r` for unpacking unsigned
and signed LEB128 encoded integers. [[Feature #21785]]

* ENV

* `ENV.fetch_values` is added. It returns an array of values for the
Expand All @@ -31,17 +36,6 @@ Note: We're only listing outstanding class updates.
* `MatchData#integer_at` is added. It converts the matched substring to
integer and return the result. [[Feature #21932]]

* Method

* `Method#source_location`, `Proc#source_location`, and
`UnboundMethod#source_location` now return extended location
information with 5 elements: `[path, start_line, start_column,
end_line, end_column]`. The previous 2-element format `[path,
line]` can still be obtained by calling `.take(2)` on the result.
[[Feature #6012]]
* `Array#pack` accepts a new format `R` and `r` for unpacking unsigned
and signed LEB128 encoded integers. [[Feature #21785]]

* Regexp

* All instances of `Regexp` are now frozen, not just literals.
Expand Down Expand Up @@ -145,7 +139,6 @@ A lot of work has gone into making Ractors more stable, performant, and usable.

## JIT

[Feature #6012]: https://bugs.ruby-lang.org/issues/6012
[Feature #8948]: https://bugs.ruby-lang.org/issues/8948
[Feature #15330]: https://bugs.ruby-lang.org/issues/15330
[Feature #21390]: https://bugs.ruby-lang.org/issues/21390
Expand Down
31 changes: 31 additions & 0 deletions gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,37 @@ rb_wb_protected_newobj_of(rb_execution_context_t *ec, VALUE klass, VALUE flags,
return newobj_of(rb_ec_ractor_ptr(ec), klass, flags, shape_id, TRUE, size);
}

VALUE
rb_class_allocate_instance(VALUE klass)
{
uint32_t index_tbl_num_entries = RCLASS_MAX_IV_COUNT(klass);

size_t size = rb_obj_embedded_size(index_tbl_num_entries);
if (!rb_gc_size_allocatable_p(size)) {
size = sizeof(struct RObject);
}

// There might be a NEWOBJ tracepoint callback, and it may set fields.
// So the shape must be passed to `NEWOBJ_OF`.
VALUE flags = T_OBJECT | (RGENGC_WB_PROTECTED_OBJECT ? FL_WB_PROTECTED : 0);
NEWOBJ_OF_WITH_SHAPE(o, struct RObject, klass, flags, rb_shape_root(rb_gc_heap_id_for_size(size)), size, 0);
VALUE obj = (VALUE)o;

#if RUBY_DEBUG
RUBY_ASSERT(!rb_shape_obj_too_complex_p(obj));
VALUE *ptr = ROBJECT_FIELDS(obj);
size_t fields_count = RSHAPE_LEN(RBASIC_SHAPE_ID(obj));
for (size_t i = fields_count; i < ROBJECT_FIELDS_CAPACITY(obj); i++) {
ptr[i] = Qundef;
}
if (rb_obj_class(obj) != rb_class_real(klass)) {
rb_bug("Expected rb_class_allocate_instance to set the class correctly");
}
#endif

return obj;
}

void
rb_gc_register_pinning_obj(VALUE obj)
{
Expand Down
2 changes: 1 addition & 1 deletion gems/bundled_gems
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ benchmark 0.5.0 https://github.com/ruby/benchmark
logger 1.7.0 https://github.com/ruby/logger
rdoc 7.2.0 https://github.com/ruby/rdoc 911b122a587e24f05434dbeb2c3e39cea607e21f
win32ole 1.9.3 https://github.com/ruby/win32ole
irb 1.17.0 https://github.com/ruby/irb
irb 1.17.0 https://github.com/ruby/irb cfd0b917d3feb01adb7d413b19faeb0309900599
reline 0.6.3 https://github.com/ruby/reline
readline 0.0.4 https://github.com/ruby/readline
fiddle 1.1.8 https://github.com/ruby/fiddle
Expand Down
8 changes: 7 additions & 1 deletion internal/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "ruby/ruby.h" /* for VALUE */

/* object.c */
size_t rb_obj_embedded_size(uint32_t fields_count);

VALUE rb_class_allocate_instance(VALUE klass);
VALUE rb_class_search_ancestor(VALUE klass, VALUE super);
NORETURN(void rb_undefined_alloc(VALUE klass));
Expand Down Expand Up @@ -60,4 +60,10 @@ RBASIC_SET_CLASS(VALUE obj, VALUE klass)
RBASIC_SET_CLASS_RAW(obj, klass);
RB_OBJ_WRITTEN(obj, oldv, klass);
}

static inline size_t
rb_obj_embedded_size(uint32_t fields_count)
{
return offsetof(struct RObject, as.ary) + (sizeof(VALUE) * fields_count);
}
#endif /* INTERNAL_OBJECT_H */
Loading