Mercurial > hg > graal-jvmci-8
comparison src/share/vm/asm/assembler.cpp @ 237:1fdb98a17101
6716785: implicit null checks not triggering with CompressedOops
Summary: 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
author | coleenp |
---|---|
date | Sat, 19 Jul 2008 17:38:22 -0400 |
parents | a61af66fc99e |
children | 9ee9cf798b59 36ccc817fca4 |
comparison
equal
deleted
inserted
replaced
235:9c2ecc2ffb12 | 237:1fdb98a17101 |
---|---|
244 if (sect() == CodeBuffer::SECT_INSTS) { | 244 if (sect() == CodeBuffer::SECT_INSTS) { |
245 code_section()->outer()->block_comment(offset(), comment); | 245 code_section()->outer()->block_comment(offset(), comment); |
246 } | 246 } |
247 } | 247 } |
248 | 248 |
249 bool MacroAssembler::needs_explicit_null_check(intptr_t offset) { | |
250 // Exception handler checks the nmethod's implicit null checks table | |
251 // only when this method returns false. | |
252 #ifndef SPARC | |
253 // Sparc does not have based addressing | |
254 if (UseCompressedOops) { | |
255 // The first page after heap_base is unmapped and | |
256 // the 'offset' is equal to [heap_base + offset] for | |
257 // narrow oop implicit null checks. | |
258 uintptr_t heap_base = (uintptr_t)Universe::heap_base(); | |
259 if ((uintptr_t)offset >= heap_base) { | |
260 // Normalize offset for the next check. | |
261 offset = (intptr_t)(pointer_delta((void*)offset, (void*)heap_base, 1)); | |
262 } | |
263 } | |
264 #endif // SPARC | |
265 return offset < 0 || os::vm_page_size() <= offset; | |
266 } | |
249 | 267 |
250 #ifndef PRODUCT | 268 #ifndef PRODUCT |
251 void Label::print_instructions(MacroAssembler* masm) const { | 269 void Label::print_instructions(MacroAssembler* masm) const { |
252 CodeBuffer* cb = masm->code(); | 270 CodeBuffer* cb = masm->code(); |
253 for (int i = 0; i < _patch_index; ++i) { | 271 for (int i = 0; i < _patch_index; ++i) { |