Mercurial > hg > truffle
comparison src/os_cpu/linux_x86/vm/assembler_linux_x86_64.cpp @ 168:7793bd37a336
6705887: Compressed Oops: generate x64 addressing and implicit null checks with narrow oops
Summary: Generate addresses and implicit null checks with narrow oops to avoid decoding.
Reviewed-by: jrose, never
author | kvn |
---|---|
date | Thu, 29 May 2008 12:04:14 -0700 |
parents | a61af66fc99e |
children | d1605aabd0a1 |
comparison
equal
deleted
inserted
replaced
167:feeb96a45707 | 168:7793bd37a336 |
---|---|
64 movq(thread, rax); | 64 movq(thread, rax); |
65 popq(rax); | 65 popq(rax); |
66 } | 66 } |
67 } | 67 } |
68 | 68 |
69 // NOTE: since the linux kernel resides at the low end of | 69 bool MacroAssembler::needs_explicit_null_check(intptr_t offset) { |
70 // user address space, no null pointer check is needed. | 70 // Exception handler checks the nmethod's implicit null checks table |
71 bool MacroAssembler::needs_explicit_null_check(int offset) { | 71 // only when this method returns false. |
72 return offset < 0 || offset >= 0x100000; | 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; | |
73 } | 86 } |