equal
deleted
inserted
replaced
83 // Warning: This routine must NEVER be inlined since we'd end up with |
83 // Warning: This routine must NEVER be inlined since we'd end up with |
84 // multiple offsets. |
84 // multiple offsets. |
85 // |
85 // |
86 volatile Thread* wrapperthread = thread; |
86 volatile Thread* wrapperthread = thread; |
87 |
87 |
88 if ( ThreadLocalStorage::get_thread_ptr_offset() == 0 ) { |
88 if (os::win32::get_thread_ptr_offset() == 0) { |
89 int thread_ptr_offset; |
89 int thread_ptr_offset; |
90 __asm { |
90 __asm { |
91 lea eax, dword ptr wrapperthread; |
91 lea eax, dword ptr wrapperthread; |
92 sub eax, dword ptr FS:[0H]; |
92 sub eax, dword ptr FS:[0H]; |
93 mov thread_ptr_offset, eax |
93 mov thread_ptr_offset, eax |
94 }; |
94 }; |
95 ThreadLocalStorage::set_thread_ptr_offset(thread_ptr_offset); |
95 os::win32::set_thread_ptr_offset(thread_ptr_offset); |
96 } |
96 } |
97 #ifdef ASSERT |
97 #ifdef ASSERT |
98 // Verify that the offset hasn't changed since we initally captured |
98 // Verify that the offset hasn't changed since we initally captured |
99 // it. This might happen if we accidentally ended up with an |
99 // it. This might happen if we accidentally ended up with an |
100 // inlined version of this routine. |
100 // inlined version of this routine. |
103 __asm { |
103 __asm { |
104 lea eax, dword ptr wrapperthread; |
104 lea eax, dword ptr wrapperthread; |
105 sub eax, dword ptr FS:[0H]; |
105 sub eax, dword ptr FS:[0H]; |
106 mov test_thread_ptr_offset, eax |
106 mov test_thread_ptr_offset, eax |
107 }; |
107 }; |
108 assert(test_thread_ptr_offset == ThreadLocalStorage::get_thread_ptr_offset(), |
108 assert(test_thread_ptr_offset == os::win32::get_thread_ptr_offset(), |
109 "thread pointer offset from SEH changed"); |
109 "thread pointer offset from SEH changed"); |
110 } |
110 } |
111 #endif // ASSERT |
111 #endif // ASSERT |
112 #endif // !AMD64 |
112 #endif // !AMD64 |
113 |
113 |