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

8270540 G1: Refactor range checking in G1BlockOffsetTablePart::block_start* to asserts #4794

Closed
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
@@ -32,22 +32,16 @@
#include "runtime/atomic.hpp"

inline HeapWord* G1BlockOffsetTablePart::block_start(const void* addr) {
if (addr >= _hr->bottom() && addr < _hr->end()) {
HeapWord* q = block_at_or_preceding(addr);
return forward_to_block_containing_addr(q, addr);
} else {
return NULL;
}
assert(addr >= _hr->bottom() && addr < _hr->top(), "invalid address");
HeapWord* q = block_at_or_preceding(addr);
return forward_to_block_containing_addr(q, addr);
}

inline HeapWord* G1BlockOffsetTablePart::block_start_const(const void* addr) const {
if (addr >= _hr->bottom() && addr < _hr->end()) {
HeapWord* q = block_at_or_preceding(addr);
HeapWord* n = q + block_size(q);
return forward_to_block_containing_addr_const(q, n, addr);
} else {
return NULL;
}
assert(addr >= _hr->bottom() && addr < _hr->top(), "invalid address");
HeapWord* q = block_at_or_preceding(addr);
HeapWord* n = q + block_size(q);
return forward_to_block_containing_addr_const(q, n, addr);
}

u_char G1BlockOffsetTable::offset_array(size_t index) const {