Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8276842 G1: Only calculate size in bytes from words when needed #6305

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -41,7 +41,7 @@ class RemoveSelfForwardPtrObjClosure: public ObjectClosure {
G1CollectedHeap* _g1h;
G1ConcurrentMark* _cm;
HeapRegion* _hr;
size_t _marked_bytes;
size_t _marked_words;
bool _during_concurrent_start;
uint _worker_id;
HeapWord* _last_forwarded_object_end;
@@ -53,12 +53,12 @@ class RemoveSelfForwardPtrObjClosure: public ObjectClosure {
_g1h(G1CollectedHeap::heap()),
_cm(_g1h->concurrent_mark()),
_hr(hr),
_marked_bytes(0),
_marked_words(0),
_during_concurrent_start(during_concurrent_start),
_worker_id(worker_id),
_last_forwarded_object_end(hr->bottom()) { }

size_t marked_bytes() { return _marked_bytes; }
size_t marked_bytes() { return _marked_words * HeapWordSize; }

// Iterate over the live objects in the region to find self-forwarded objects
// that need to be kept live. We need to update the remembered sets of these
@@ -96,7 +96,7 @@ class RemoveSelfForwardPtrObjClosure: public ObjectClosure {
}
size_t obj_size = obj->size();

_marked_bytes += (obj_size * HeapWordSize);
_marked_words += obj_size;
PreservedMarks::init_forwarded_mark(obj);

HeapWord* obj_end = obj_addr + obj_size;