| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
This reverts commit 712c027524e3a03500b3098d950fc2f0608ce897.
|
|
|
|
|
|
|
|
| |
GC.verify_internal_consistency() checks health of each RVALUE with
check_rvalue_consistency(). However, this function is enabled
only on debug environment (RGENGC_CHECK_MODE>1). So introduce
new function check_rvalue_consistency_force() and use it
in GC.verify_internal_consistency.
|
|
|
|
|
|
| |
is_pointer_to_heap() checks if it is in valid pointer to the
RVALUE in any heap_page_body. However, it returns true if it
points tomb pages. This patch check it points to eden pages.
|
| |
|
|
|
|
|
| |
for debugging
http://ci.rvm.jp/results/trunk-mjit-wait@silicon-docker/2048247
|
| |
|
|
|
|
| |
requested by Ko1.
|
|
|
|
|
|
| |
Caller of gc_pin() should check it is a mark-able object.
So gc_pin() doesn't need to check it. With this fix,
we can refactoring around it.
|
|
|
|
| |
rb_gc() no longer invokes finalizers, so there are T_ZOMBE objects.
|
|
|
|
|
| |
Objects pointed by "maybe" pointers because of conservative marking
should be pinned down.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
rb_gc() kicks gc_finalize_deferred(), which invokes finalizers.
This means that any Ruby program can be run this point and
it may be thread switching points and so on.
However, it is difficult to think it invokes any Ruby programs.
For example, `GC.compact` use `rb_gc()` to implement it, howver,
any Ruby program must not be run on this timing.
For this reason (it is difficult to image it run any Ruby program),
I removed `gc_finalize_deferred()` line in rb_gc().
This patch solves GC.compact issue.
[Bug #15809] and re-enable GC.compact test.
|
| |
|
|
|
|
|
| |
* gc.c (rb_raw_obj_info): new string objects cannot allocate to
create new class path name during GC.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* variable.c: make the hidden ivars `classpath` and `tmp_classpath` the source
of truth for module and constant names. Assign to them when modules are bind
to constants.
* variable.c: remove references to module name cache, as what used to be the cache
is now the source of truth. Remove rb_class_path_no_cache().
* variable.c: remove the hidden ivar `classid`. This existed for the purposes of
module name search, which is now replaced. Also, remove the associated
rb_name_class().
* class.c: use rb_set_class_path_string to set the name of Object during boot.
Must use a fstring as this runs before rb_cString is initialized and
creating a normal string leads to a VALUE without a class.
* spec/ruby/core/module/name_spec.rb: add a few specs to specify what happens
to Module#name across multiple operations. These specs pass without other
code changes in this commit.
[Feature #15765]
|
| |
|
| |
|
| |
|
|
|
|
|
| |
The function will return new or existing locations depending on whether
or not the object actually moved, so give it a more appropriate name.
|
| |
|
|
|
|
|
|
|
|
| |
If a dynamic symbol has been converted to a static symbol, it gets added
to the global ID list and should no longer move. C extensions can pass
symbols to rb_sym2id and those symbols should no longer be movable.
When the symbol is passed to rb_sym2id, the `id` member is set, so we
can use its existence to prevent movement.
|
|
|
|
|
|
|
|
| |
`transient_heap_evacuate()` disables GC using `rb_gc_disable()`
to prohibt GC invocation because of new allocation for evacuated
memory. However, `rb_gc_disable()` sweep all rest of unswept pages.
We don't need to cancel lazy sweep so this patch introduce
`rb_gc_disable_no_rest()` which doesn't cancel lazy sweep.
|
| |
|
| |
|
|
|
|
|
| |
because @ko1 said "gc_finish" is confusing like a finish of entire GC
process
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This commit adds an alternative packing strategy for compaction.
Instead of packing towards "most pinned" pages, we can pack towards
"most empty" pages. The idea is that we can double the heap size, then
pack all objects towards the empty side of the heap. This will ensure
maximum chaos for testing / verification.
|
|
|
|
|
| |
This function is used for marking / pinning vm stack values, so it
should have "vm" in the function name to be more clear.
|
| |
|
|
|
|
|
|
| |
GC is required for pinning / marking objects. If the compactor runs
without pinning everything, then it will blow up, so just return early
if the GC is disabled.
|
| |
|
|
|
|
|
|
| |
Objects in the finalizer table stay pinned for now. In some cases, the
key could move which would cause a miss when removing the object from
the table (leading to a T_MOVED reference staying in the table).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`obj_info` will look at references of objects in some cases (for example
it will try to access path information on ISeq objects). But during the
sweep phase, if the referenced object is collected before `obj_info` is
called, then it could be a bad ref and a segv will occur.
For example:
A -> B
Sweep phase:
1. obj_info(B)
2. Sweep and free B
3. obj_info(A); A tries to read B
4. SEGV
This commit simply removes the call to `obj_info` during the sweep
phase.
|
|
|
|
|
|
| |
pattern matches are less than or equal to 4 results
Closes: https://github.com/ruby/ruby/pull/2135
|
|
|
|
|
| |
is_pointer_to_heap() is used for conservative marking. To analyze
this function's behavior, introduce some debug_counters.
|
|
|
|
|
|
|
|
|
| |
`GC::Profiler.enable; GC::Profiler.clear` tries to clear
objspace->profile.records but it has never been allocated before.
Thus the MEMCPY took NULL argument before this changeset.
The objspace->profile.records is allocated appropriately elsewhere.
Why not juts free it if any? That should work.
|
|
|
|
|
|
| |
Depending on architectures, setjmp might not fully fill a jmp_buf.
On such machines the union can contain wobbly bits. They are then
scanned during mark_locations_array(). This is bad.
|
|
|
|
|
|
|
|
| |
These assertions check if a newly allocated object (which is marked
as an uninitialized memory region in MSAN) is in fact a T_NONE.
Thus they intentionally read uninitialized memory regions, which do
not interface well with MSAN. Just disalbe them.
|
|
|
|
| |
[Bug #15784]
|
|
|
|
| |
[Bug #15784]
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before this commit, classes and modules would be registered with the
VM's `defined_module_hash`. The key was the ID of the class, but that
meant that it was possible for hash collisions to occur. The compactor
doesn't allow classes in the `defined_module_hash` to move, but if there
is a conflict, then it's possible a class would be removed from the hash
and not get pined.
This commit changes the key / value of the hash just to be the class
itself, thus preventing movement.
|
|
|
|
| |
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
Remembered objects can move between pages, so we need to make sure the
flags on the page are set correctly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
We should always pin stack zombies and moved
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
| |
🙏
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
|
|
|
|
|
| |
Some classes don't have a superclass, so we should check to see if it's
there before marking.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|