Age | Commit message (Collapse) | Author |
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4909
|
|
This commit removes T_PAYLOAD since the new VWA implementation no longer
requires T_PAYLOAD types.
Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
Notes:
Merged: https://github.com/ruby/ruby/pull/4773
|
|
This reverts commits 48ff7a9f3e47bffb3e4d067a12ba9b936261caa0
and b2e2cf2dedd104acad8610721db5e4d341f135ef because it is causing
crashes in SPARC solaris and i386 debian.
Notes:
Merged: https://github.com/ruby/ruby/pull/4764
|
|
This commit removes T_PAYLOAD since the new VWA implementation no longer
requires T_PAYLOAD types.
Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
Notes:
Merged: https://github.com/ruby/ruby/pull/4680
|
|
per guidance in doc/extension.rdoc, these classes now undefine their
alloc functions:
- ObjectSpace::InternalObjectWrapper
- Socket::Ifaddr
Notes:
Merged: https://github.com/ruby/ruby/pull/4604
|
|
... to disable a "method redefined" warning.
http://rubyci.s3.amazonaws.com/solaris11-gcc/ruby-master/log/20210514T050008Z.fail.html.gz
```
1) Failure:
TestObjSpace#test_objspace_trace [/export/home/chkbuild/chkbuild-gcc/tmp/build/20210514T050008Z/ruby/test/objspace/test_objspace.rb:621]:
<["objspace/trace is enabled"]> expected but was
<["/export/home/chkbuild/chkbuild-gcc/tmp/build/20210514T050008Z/ruby/.ext/common/objspace/trace.rb:29: warning: method redefined; discarding old p",
"objspace/trace is enabled"]>.
```
|
|
This file, when require'ed, starts tracing the object allocations, and
redefines `Kernel#p` to show the allocation site.
This commit is experimental; the library name and APIs may change.
[Feature #17762]
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4391
|
|
Example:
```
In file included from ../../../include/ruby/defines.h:72,
from ../../../include/ruby/ruby.h:23,
from ../../../gc.h:3,
from ../../../ext/objspace/objspace_dump.c:15:
../../../ext/objspace/objspace_dump.c: In function ‘dump_append_ld’:
../../../ext/objspace/objspace_dump.c:95:26: warning: comparison of integer expressions of different signedness: ‘long unsigned int’ and ‘int’ [-Wsign-compare]
95 | RUBY_ASSERT(required <= width);
| ^~
```
Notes:
Merged: https://github.com/ruby/ruby/pull/4417
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4371
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4104
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4078
|
|
constant cache `IC` is accessed by non-atomic manner and there are
thread-safety issues, so Ruby 3.0 disables to use const cache on
non-main ractors.
This patch enables it by introducing `imemo_constcache` and allocates
it by every re-fill of const cache like `imemo_callcache`.
[Bug #17510]
Now `IC` only has one entry `IC::entry` and it points to
`iseq_inline_constant_cache_entry`, managed by T_IMEMO object.
`IC` is atomic data structure so `rb_mjit_before_vm_ic_update()` and
`rb_mjit_after_vm_ic_update()` is not needed.
Notes:
Merged: https://github.com/ruby/ruby/pull/4022
|
|
Now we need atomic operations, which are lighter than mutex, more
widely for extension libraries because of Ractor.
Notes:
Merged: https://github.com/ruby/ruby/pull/3983
|
|
This iterator uses an st_table, but if objects move the references in
the st table won't be updated. This patch just changes the st table to
an identity hash.
Notes:
Merged: https://github.com/ruby/ruby/pull/3634
|
|
RDoc says `ObjectSpace.dump(obj, output: :stdout) # => nil`,
but it returns STDOUT since fbba6bd4e3dff7a61965208fecae908f10c4edbe.
I think it is unintentional change.
Notes:
Merged: https://github.com/ruby/ruby/pull/3620
|
|
|
|
We have code common to all heap iteration paths in this file. Refactor
such that we keep ASAN checks and flags checks in one place
Notes:
Merged: https://github.com/ruby/ruby/pull/3592
|
|
Again, this code is walking the heap. Empty slots can be poisoned, so
we need to unpoison before checking the type
Notes:
Merged: https://github.com/ruby/ruby/pull/3592
|
|
ext/objspace iterates over the heap, but some slots in the heap are
poisoned, so we need to take care of that when running with ASAN
Notes:
Merged: https://github.com/ruby/ruby/pull/3592
|
|
The added test case crashes the interpreter because it makes
ObjectSpace.internal_class_of return the second VALUE slot of an AST
imemo object. The second VALUE slot of `struct rb_ast_struct` is
not a VALUE and not a pointer to a Ruby object.
Notes:
Merged: https://github.com/ruby/ruby/pull/3503
|
|
[Feature #17045] ObjectSpace.dump_all should allocate as little as possible in the GC heap
Up until this commit ObjectSpace.dump_all allocates two Hash because of `rb_scan_args`.
It also can allocate a `File` because of `rb_io_get_write_io`.
These allocations are problematic because `dump_all` dumps the Ruby
heap, so it should try modify as little as possible what it is
observing.
Notes:
Merged: https://github.com/ruby/ruby/pull/3530
|
|
pointed out by Coverity Scan
|
|
The two main optimization are:
- buffer writes for improved performance
- avoid formatting functions when possible
```
| |compare-ruby|built-ruby|
|:------------------|-----------:|---------:|
|dump_all_string | 1.038| 195.925|
| | -| 188.77x|
|dump_all_file | 33.453| 139.645|
| | -| 4.17x|
|dump_all_dev_null | 44.030| 278.552|
| | -| 6.33x|
```
Notes:
Merged: https://github.com/ruby/ruby/pull/3420
|
|
This is useful to see what a block of code allocated, e.g.
```
GC.start
GC.disable
ObjectSpace.trace_object_allocations do
# run some code
end
gc_gen = GC.count
allocations = ObjectSpace.dump_all(output: :file, since: gc_gen)
GC.enable
GC.start
retentions = ObjectSpace.dump_all(output: :file, since: gc_gen)
```
Notes:
Merged: https://github.com/ruby/ruby/pull/3368
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3347
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3346
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3338
|
|
were not initialized
Notes:
Merged: https://github.com/ruby/ruby/pull/3001
|
|
It seems almost no internal codes use RHASH_TBL any longer. Why not
just eliminate it entirely, so that the macro can be purely ext-only.
Notes:
Merged: https://github.com/ruby/ruby/pull/3426
|
|
The allocation tracing code keeps essentially a weak reference to
objects that have been allocated (storing the allocation information
along with the weak ref). Compacting the heap would break references in
this weak map, so the wrong values could be returned.
This commit just updates the values in the weak ref in order to fix the
allocation tracing book keeping
Notes:
Merged: https://github.com/ruby/ruby/pull/3429
|
|
It's possible to define methods with any name, even if the parser
doesn't support it and it can only be used with ex. send.
This fixes an issue where invalid JSON was output from ObjectSpace.dump
when a method name needed escaping.
Notes:
Merged: https://github.com/ruby/ruby/pull/3383
|
|
|
|
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3308
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/3349
|
|
imemo_callcache and imemo_callinfo were not handled by the `objspace`
module and were showing up as "unknown" in the dump. Extract the code for
naming imemos and use that in both the GC and the `objspace` module.
Notes:
Merged: https://github.com/ruby/ruby/pull/3304
|
|
|
|
To fix build failures.
Notes:
Merged: https://github.com/ruby/ruby/pull/3079
|
|
This shall fix compile errors.
Notes:
Merged: https://github.com/ruby/ruby/pull/3079
|
|
|
|
|
|
Split ruby.h
Notes:
Merged-By: shyouhei <shyouhei@ruby-lang.org>
|
|
Hidden object (T_CLASS) can be exposed (BUG).
Also rename rb_mInternalObjectWrapper to rb_cInternalObjectWrapper
because it is a class.
|
|
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.
Notes:
Merged: https://github.com/ruby/ruby/pull/2888
|
|
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.
Notes:
Merged: https://github.com/ruby/ruby/pull/2888
|
|
Needed for `UNALIGNED_MEMBER_ACCESS` using `COMPILER_WARNING_`*
macros.
Notes:
Merged: https://github.com/ruby/ruby/pull/2799
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/2711
|
|
Saves comitters' daily life by avoid #include-ing everything from
internal.h to make each file do so instead. This would significantly
speed up incremental builds.
We take the following inclusion order in this changeset:
1. "ruby/config.h", where _GNU_SOURCE is defined (must be the very
first thing among everything).
2. RUBY_EXTCONF_H if any.
3. Standard C headers, sorted alphabetically.
4. Other system headers, maybe guarded by #ifdef
5. Everything else, sorted alphabetically.
Exceptions are those win32-related headers, which tend not be self-
containing (headers have inclusion order dependencies).
Notes:
Merged: https://github.com/ruby/ruby/pull/2711
|
|
|