Mercurial > hg > graal-compiler
diff src/os_cpu/linux_x86/vm/threadLS_linux_x86.cpp @ 3798:65dba8692db7
7061197: ThreadLocalStorage sp map table should be optional
Reviewed-by: dholmes, never, jwilhelm, kvn
author | jcoomes |
---|---|
date | Wed, 06 Jul 2011 12:22:29 -0700 |
parents | f95d63e2154a |
children | f34d701e952e |
line wrap: on
line diff
--- a/src/os_cpu/linux_x86/vm/threadLS_linux_x86.cpp Wed Jul 06 12:17:44 2011 -0700 +++ b/src/os_cpu/linux_x86/vm/threadLS_linux_x86.cpp Wed Jul 06 12:22:29 2011 -0700 @@ -52,25 +52,20 @@ // MADV_DONTNEED on Linux keeps the virtual memory mapping, but zaps the // physical memory page (i.e. similar to MADV_FREE on Solaris). -#ifndef AMD64 +#if !defined(AMD64) && !defined(MINIMIZE_RAM_USAGE) Thread* ThreadLocalStorage::_sp_map[1UL << (SP_BITLENGTH - PAGE_SHIFT)]; -#endif // !AMD64 void ThreadLocalStorage::generate_code_for_get_thread() { // nothing we can do here for user-level thread } void ThreadLocalStorage::pd_init() { -#ifndef AMD64 assert(align_size_down(os::vm_page_size(), PAGE_SIZE) == os::vm_page_size(), "page size must be multiple of PAGE_SIZE"); -#endif // !AMD64 } void ThreadLocalStorage::pd_set_thread(Thread* thread) { os::thread_local_storage_at_put(ThreadLocalStorage::thread_index(), thread); - -#ifndef AMD64 address stack_top = os::current_stack_base(); size_t stack_size = os::current_stack_size(); @@ -88,5 +83,17 @@ "thread exited without detaching from VM??"); _sp_map[(uintptr_t)p >> PAGE_SHIFT] = thread; } -#endif // !AMD64 +} +#else + +void ThreadLocalStorage::generate_code_for_get_thread() { + // nothing we can do here for user-level thread } + +void ThreadLocalStorage::pd_init() { +} + +void ThreadLocalStorage::pd_set_thread(Thread* thread) { + os::thread_local_storage_at_put(ThreadLocalStorage::thread_index(), thread); +} +#endif // !AMD64 && !MINIMIZE_RAM_USAGE