309 }
310
311 bool MacroAssembler::uses_implicit_null_check(void* address) {
312 // Exception handler checks the nmethod's implicit null checks table
313 // only when this method returns false.
314 intptr_t int_address = reinterpret_cast<intptr_t>(address);
315 intptr_t cell_header_size = Universe::heap()->cell_header_size();
316 size_t region_size = os::vm_page_size() + cell_header_size;
317 #ifdef _LP64
318 if (UseCompressedOops && Universe::narrow_oop_base() != NULL) {
319 // The first page after heap_base is unmapped and
320 // the 'offset' is equal to [heap_base + offset] for
321 // narrow oop implicit null checks.
322 intptr_t start = ((intptr_t)Universe::narrow_oop_base()) - cell_header_size;
323 intptr_t end = start + region_size;
324 if (int_address >= start && int_address < end) {
325 return true;
326 }
327 }
328 #endif
329 intptr_t start = (intptr_t)-cell_header_size;
330 intptr_t end = start + region_size;
331 return int_address >= start && int_address < end;
332 }
333
334 bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
335 // Check if offset is outside of [-cell_header_size, os::vm_page_size)
336 return offset < -Universe::heap()->cell_header_size() ||
337 offset >= os::vm_page_size();
338 }
|
309 }
310
311 bool MacroAssembler::uses_implicit_null_check(void* address) {
312 // Exception handler checks the nmethod's implicit null checks table
313 // only when this method returns false.
314 intptr_t int_address = reinterpret_cast<intptr_t>(address);
315 intptr_t cell_header_size = Universe::heap()->cell_header_size();
316 size_t region_size = os::vm_page_size() + cell_header_size;
317 #ifdef _LP64
318 if (UseCompressedOops && Universe::narrow_oop_base() != NULL) {
319 // The first page after heap_base is unmapped and
320 // the 'offset' is equal to [heap_base + offset] for
321 // narrow oop implicit null checks.
322 intptr_t start = ((intptr_t)Universe::narrow_oop_base()) - cell_header_size;
323 intptr_t end = start + region_size;
324 if (int_address >= start && int_address < end) {
325 return true;
326 }
327 }
328 #endif
329 intptr_t start = -cell_header_size;
330 intptr_t end = start + region_size;
331 return int_address >= start && int_address < end;
332 }
333
334 bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
335 // Check if offset is outside of [-cell_header_size, os::vm_page_size)
336 return offset < -Universe::heap()->cell_header_size() ||
337 offset >= os::vm_page_size();
338 }
|