comparison src/os_cpu/linux_x86/vm/assembler_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 cd3d6a6b95d9
comparison
equal deleted inserted replaced
3797:eb94b7226b7a 3798:65dba8692db7
31 #ifndef _LP64 31 #ifndef _LP64
32 void MacroAssembler::int3() { 32 void MacroAssembler::int3() {
33 call(RuntimeAddress(CAST_FROM_FN_PTR(address, os::breakpoint))); 33 call(RuntimeAddress(CAST_FROM_FN_PTR(address, os::breakpoint)));
34 } 34 }
35 35
36 #ifdef MINIMIZE_RAM_USAGE
37
38 void MacroAssembler::get_thread(Register thread) {
39 // call pthread_getspecific
40 // void * pthread_getspecific(pthread_key_t key);
41 if (thread != rax) push(rax);
42 push(rcx);
43 push(rdx);
44
45 push(ThreadLocalStorage::thread_index());
46 call(RuntimeAddress(CAST_FROM_FN_PTR(address, pthread_getspecific)));
47 increment(rsp, wordSize);
48
49 pop(rdx);
50 pop(rcx);
51 if (thread != rax) {
52 mov(thread, rax);
53 pop(rax);
54 }
55 }
56
57 #else
36 void MacroAssembler::get_thread(Register thread) { 58 void MacroAssembler::get_thread(Register thread) {
37 movl(thread, rsp); 59 movl(thread, rsp);
38 shrl(thread, PAGE_SHIFT); 60 shrl(thread, PAGE_SHIFT);
39 61
40 ExternalAddress tls_base((address)ThreadLocalStorage::sp_map_addr()); 62 ExternalAddress tls_base((address)ThreadLocalStorage::sp_map_addr());
41 Address index(noreg, thread, Address::times_4); 63 Address index(noreg, thread, Address::times_4);
42 ArrayAddress tls(tls_base, index); 64 ArrayAddress tls(tls_base, index);
43 65
44 movptr(thread, tls); 66 movptr(thread, tls);
45 } 67 }
68 #endif // MINIMIZE_RAM_USAGE
46 #else 69 #else
47 void MacroAssembler::int3() { 70 void MacroAssembler::int3() {
48 call(RuntimeAddress(CAST_FROM_FN_PTR(address, os::breakpoint))); 71 call(RuntimeAddress(CAST_FROM_FN_PTR(address, os::breakpoint)));
49 } 72 }
50 73