Wed, 16 Nov 2011 20:38:24 -0500
7110017: is_headless_jre should be updated to reflect the new location of awt toolkit libraries
Reviewed-by: dholmes, dsamersoff
Contributed-by: Chris Hegarty <chris.hegarty@oracle.com>
duke@435 | 1 | /* |
phh@2423 | 2 | * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. |
duke@435 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@435 | 4 | * |
duke@435 | 5 | * This code is free software; you can redistribute it and/or modify it |
duke@435 | 6 | * under the terms of the GNU General Public License version 2 only, as |
duke@435 | 7 | * published by the Free Software Foundation. |
duke@435 | 8 | * |
duke@435 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
duke@435 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@435 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@435 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
duke@435 | 13 | * accompanied this code). |
duke@435 | 14 | * |
duke@435 | 15 | * You should have received a copy of the GNU General Public License version |
duke@435 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
duke@435 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@435 | 18 | * |
trims@1907 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
trims@1907 | 20 | * or visit www.oracle.com if you need additional information or have any |
trims@1907 | 21 | * questions. |
duke@435 | 22 | * |
duke@435 | 23 | */ |
duke@435 | 24 | |
stefank@2314 | 25 | #ifndef OS_SOLARIS_VM_THREAD_SOLARIS_INLINE_HPP |
stefank@2314 | 26 | #define OS_SOLARIS_VM_THREAD_SOLARIS_INLINE_HPP |
stefank@2314 | 27 | |
stefank@2314 | 28 | #include "runtime/atomic.hpp" |
stefank@2314 | 29 | #include "runtime/prefetch.hpp" |
stefank@2314 | 30 | #include "runtime/thread.hpp" |
stefank@2314 | 31 | #include "runtime/threadLocalStorage.hpp" |
stefank@2314 | 32 | #ifdef TARGET_OS_ARCH_solaris_x86 |
stefank@2314 | 33 | # include "atomic_solaris_x86.inline.hpp" |
stefank@2314 | 34 | # include "orderAccess_solaris_x86.inline.hpp" |
stefank@2314 | 35 | # include "prefetch_solaris_x86.inline.hpp" |
stefank@2314 | 36 | #endif |
stefank@2314 | 37 | #ifdef TARGET_OS_ARCH_solaris_sparc |
stefank@2314 | 38 | # include "atomic_solaris_sparc.inline.hpp" |
stefank@2314 | 39 | # include "orderAccess_solaris_sparc.inline.hpp" |
stefank@2314 | 40 | # include "prefetch_solaris_sparc.inline.hpp" |
stefank@2314 | 41 | #endif |
stefank@2314 | 42 | |
duke@435 | 43 | // Thread::current is "hot" it's called > 128K times in the 1st 500 msecs of |
duke@435 | 44 | // startup. |
duke@435 | 45 | // ThreadLocalStorage::thread is warm -- it's called > 16K times in the same |
duke@435 | 46 | // period. Thread::current() now calls ThreadLocalStorage::thread() directly. |
duke@435 | 47 | // For SPARC, to avoid excessive register window spill-fill faults, |
duke@435 | 48 | // we aggressively inline these routines. |
duke@435 | 49 | |
duke@435 | 50 | inline Thread* ThreadLocalStorage::thread() { |
duke@435 | 51 | // don't use specialized code if +UseMallocOnly -- may confuse Purify et al. |
duke@435 | 52 | debug_only(if (UseMallocOnly) return get_thread_slow();); |
duke@435 | 53 | |
duke@435 | 54 | uintptr_t raw = pd_raw_thread_id(); |
duke@435 | 55 | int ix = pd_cache_index(raw); |
phh@2423 | 56 | Thread* candidate = ThreadLocalStorage::_get_thread_cache[ix]; |
phh@2423 | 57 | if (candidate->self_raw_id() == raw) { |
duke@435 | 58 | // hit |
phh@2423 | 59 | return candidate; |
duke@435 | 60 | } else { |
duke@435 | 61 | return ThreadLocalStorage::get_thread_via_cache_slowly(raw, ix); |
duke@435 | 62 | } |
duke@435 | 63 | } |
stefank@2314 | 64 | |
stefank@2314 | 65 | #endif // OS_SOLARIS_VM_THREAD_SOLARIS_INLINE_HPP |