comparison src/share/vm/runtime/os.hpp @ 1078:8e7adf982378

6896043: first round of zero fixes Reviewed-by: kvn Contributed-by: Gary Benson <gbenson@redhat.com>
author twisti
date Fri, 27 Nov 2009 07:56:58 -0800
parents 956304450e80
children 167c2986d91b
comparison
equal deleted inserted replaced
1073:de44705e6b33 1078:8e7adf982378
292 get_serialize_page_mask(); 292 get_serialize_page_mask();
293 *(volatile int32_t *)((uintptr_t)_mem_serialize_page+page_offset) = 1; 293 *(volatile int32_t *)((uintptr_t)_mem_serialize_page+page_offset) = 1;
294 } 294 }
295 295
296 static bool is_memory_serialize_page(JavaThread *thread, address addr) { 296 static bool is_memory_serialize_page(JavaThread *thread, address addr) {
297 address thr_addr;
298 if (UseMembar) return false; 297 if (UseMembar) return false;
299 // Calculate thread specific address 298 // Previously this function calculated the exact address of this
299 // thread's serialize page, and checked if the faulting address
300 // was equal. However, some platforms mask off faulting addresses
301 // to the page size, so now we just check that the address is
302 // within the page. This makes the thread argument unnecessary,
303 // but we retain the NULL check to preserve existing behaviour.
300 if (thread == NULL) return false; 304 if (thread == NULL) return false;
301 // TODO-FIXME: some platforms mask off faulting addresses to the base pagesize. 305 address page = (address) _mem_serialize_page;
302 // Instead of using a test for equality we should probably use something 306 return addr >= page && addr < (page + os::vm_page_size());
303 // of the form:
304 // return ((_mem_serialize_page ^ addr) & -pagesize) == 0
305 //
306 thr_addr = (address)(((uintptr_t)thread >>
307 get_serialize_page_shift_count()) &
308 get_serialize_page_mask()) + (uintptr_t)_mem_serialize_page;
309 return (thr_addr == addr);
310 } 307 }
311 308
312 static void block_on_serialize_page_trap(); 309 static void block_on_serialize_page_trap();
313 310
314 // threads 311 // threads