Mercurial > hg > truffle
comparison src/os_cpu/solaris_x86/vm/assembler_solaris_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 |
---|---|
83 popq(thread); // load return value | 83 popq(thread); // load return value |
84 if (thread != rax) { | 84 if (thread != rax) { |
85 popq(rax); | 85 popq(rax); |
86 } | 86 } |
87 } | 87 } |
88 | |
89 bool MacroAssembler::needs_explicit_null_check(intptr_t offset) { | |
90 // Identical to Sparc/Solaris code | |
91 | |
92 // Exception handler checks the nmethod's implicit null checks table | |
93 // only when this method returns false. | |
94 if (UseCompressedOops) { | |
95 // The first page after heap_base is unmapped and | |
96 // the 'offset' is equal to [heap_base + offset] for | |
97 // narrow oop implicit null checks. | |
98 uintptr_t heap_base = (uintptr_t)Universe::heap_base(); | |
99 if ((uintptr_t)offset >= heap_base) { | |
100 // Normalize offset for the next check. | |
101 offset = (intptr_t)(pointer_delta((void*)offset, (void*)heap_base, 1)); | |
102 } | |
103 } | |
104 bool offset_in_first_page = 0 <= offset && offset < os::vm_page_size(); | |
105 return !offset_in_first_page; | |
106 } |