comparison src/os_cpu/linux_x86/vm/assembler_linux_x86_64.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 d1605aabd0a1
children
comparison
equal deleted inserted replaced
235:9c2ecc2ffb12 237:1fdb98a17101
63 if (thread != rax) { 63 if (thread != rax) {
64 movq(thread, rax); 64 movq(thread, rax);
65 popq(rax); 65 popq(rax);
66 } 66 }
67 } 67 }
68
69 bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
70 // Exception handler checks the nmethod's implicit null checks table
71 // only when this method returns false.
72 if (UseCompressedOops) {
73 // The first page after heap_base is unmapped and
74 // the 'offset' is equal to [heap_base + offset] for
75 // narrow oop implicit null checks.
76 uintptr_t heap_base = (uintptr_t)Universe::heap_base();
77 if ((uintptr_t)offset >= heap_base) {
78 // Normalize offset for the next check.
79 offset = (intptr_t)(pointer_delta((void*)offset, (void*)heap_base, 1));
80 }
81 }
82 // Linux kernel guarantees that the first page is always unmapped. Don't
83 // assume anything more than that.
84 bool offset_in_first_page = 0 <= offset && offset < os::vm_page_size();
85 return !offset_in_first_page;
86 }