mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
6716785: implicit null checks not triggering with CompressedOops
Allocate alignment-sized page(s) below java heap so that memory accesses at heap_base+1page give signal and cause an implicit null check Reviewed-by: kvn, jmasa, phh, jcoomes
This commit is contained in:
parent
575988272e
commit
20dba03e99
23 changed files with 197 additions and 133 deletions
|
@ -246,6 +246,24 @@ void AbstractAssembler::block_comment(const char* comment) {
|
|||
}
|
||||
}
|
||||
|
||||
bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
|
||||
// Exception handler checks the nmethod's implicit null checks table
|
||||
// only when this method returns false.
|
||||
#ifndef SPARC
|
||||
// Sparc does not have based addressing
|
||||
if (UseCompressedOops) {
|
||||
// The first page after heap_base is unmapped and
|
||||
// the 'offset' is equal to [heap_base + offset] for
|
||||
// narrow oop implicit null checks.
|
||||
uintptr_t heap_base = (uintptr_t)Universe::heap_base();
|
||||
if ((uintptr_t)offset >= heap_base) {
|
||||
// Normalize offset for the next check.
|
||||
offset = (intptr_t)(pointer_delta((void*)offset, (void*)heap_base, 1));
|
||||
}
|
||||
}
|
||||
#endif // SPARC
|
||||
return offset < 0 || os::vm_page_size() <= offset;
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
void Label::print_instructions(MacroAssembler* masm) const {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue