annotate src/share/vm/runtime/threadLocalStorage.hpp @ 7850:1d0974d906a5

Merge
author enevill
date Tue, 03 May 2016 11:05:40 +0100
parents 0d63f295c3c2 dce99debdba2
children
rev   line source
duke@0 1 /*
trims@2273 2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
duke@0 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@0 4 *
duke@0 5 * This code is free software; you can redistribute it and/or modify it
duke@0 6 * under the terms of the GNU General Public License version 2 only, as
duke@0 7 * published by the Free Software Foundation.
duke@0 8 *
duke@0 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@0 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@0 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@0 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@0 13 * accompanied this code).
duke@0 14 *
duke@0 15 * You should have received a copy of the GNU General Public License version
duke@0 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@0 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@0 18 *
trims@1472 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1472 20 * or visit www.oracle.com if you need additional information or have any
trims@1472 21 * questions.
duke@0 22 *
duke@0 23 */
duke@0 24
stefank@1879 25 #ifndef SHARE_VM_RUNTIME_THREADLOCALSTORAGE_HPP
stefank@1879 26 #define SHARE_VM_RUNTIME_THREADLOCALSTORAGE_HPP
stefank@1879 27
stefank@1879 28 #include "gc_implementation/shared/gcUtil.hpp"
stefank@1879 29 #include "runtime/os.hpp"
stefank@1879 30 #include "utilities/top.hpp"
stefank@1879 31
duke@0 32 // Interface for thread local storage
duke@0 33
duke@0 34 // Fast variant of ThreadLocalStorage::get_thread_slow
duke@0 35 extern "C" Thread* get_thread();
duke@0 36
duke@0 37 // Get raw thread id: e.g., %g7 on sparc, fs or gs on x86
duke@0 38 extern "C" uintptr_t _raw_thread_id();
duke@0 39
duke@0 40 class ThreadLocalStorage : AllStatic {
dholmes@7815 41
dholmes@7815 42 // Exported API
duke@0 43 public:
duke@0 44 static void set_thread(Thread* thread);
duke@0 45 static Thread* get_thread_slow();
duke@0 46 static void invalidate_all() { pd_invalidate_all(); }
dholmes@7815 47 static void init();
dholmes@7815 48 static bool is_initialized();
duke@0 49
duke@0 50 // Machine dependent stuff
stefank@1879 51 #ifdef TARGET_OS_ARCH_linux_x86
stefank@1879 52 # include "threadLS_linux_x86.hpp"
stefank@1879 53 #endif
stefank@1879 54 #ifdef TARGET_OS_ARCH_linux_sparc
stefank@1879 55 # include "threadLS_linux_sparc.hpp"
stefank@1879 56 #endif
stefank@1879 57 #ifdef TARGET_OS_ARCH_linux_zero
stefank@1879 58 # include "threadLS_linux_zero.hpp"
stefank@1879 59 #endif
enevill@7673 60 #ifdef TARGET_OS_ARCH_linux_arm
enevill@7673 61 # include "threadLS_linux_arm.hpp"
enevill@7673 62 #endif
enevill@7673 63 #ifdef TARGET_OS_ARCH_linux_ppc
enevill@7673 64 # include "threadLS_linux_ppc.hpp"
enevill@7673 65 #endif
enevill@7673 66 #ifdef TARGET_OS_ARCH_linux_aarch32
enevill@7673 67 # include "threadLS_linux_aarch32.hpp"
enevill@7673 68 #endif
stefank@1879 69 #ifdef TARGET_OS_ARCH_solaris_x86
stefank@1879 70 # include "threadLS_solaris_x86.hpp"
stefank@1879 71 #endif
stefank@1879 72 #ifdef TARGET_OS_ARCH_solaris_sparc
stefank@1879 73 # include "threadLS_solaris_sparc.hpp"
stefank@1879 74 #endif
stefank@1879 75 #ifdef TARGET_OS_ARCH_windows_x86
stefank@1879 76 # include "threadLS_windows_x86.hpp"
stefank@1879 77 #endif
goetz@6026 78 #ifdef TARGET_OS_ARCH_aix_ppc
goetz@6026 79 # include "threadLS_aix_ppc.hpp"
goetz@6026 80 #endif
never@2721 81 #ifdef TARGET_OS_ARCH_bsd_x86
never@2721 82 # include "threadLS_bsd_x86.hpp"
never@2721 83 #endif
never@2721 84 #ifdef TARGET_OS_ARCH_bsd_zero
never@2721 85 # include "threadLS_bsd_zero.hpp"
never@2721 86 #endif
stefank@1879 87
dholmes@7815 88 #ifndef SOLARIS
duke@0 89 public:
duke@0 90 // Accessor
duke@0 91 static inline int thread_index() { return _thread_index; }
duke@0 92 static inline void set_thread_index(int index) { _thread_index = index; }
duke@0 93
duke@0 94 private:
duke@0 95 static int _thread_index;
duke@0 96
duke@0 97 static void generate_code_for_get_thread();
duke@0 98
duke@0 99 // Processor dependent parts of set_thread and initialization
duke@0 100 static void pd_set_thread(Thread* thread);
duke@0 101 static void pd_init();
dholmes@7815 102
dholmes@7815 103 #endif // SOLARIS
dholmes@7815 104
duke@0 105 // Invalidate any thread cacheing or optimization schemes.
duke@0 106 static void pd_invalidate_all();
duke@0 107
duke@0 108 };
stefank@1879 109
stefank@1879 110 #endif // SHARE_VM_RUNTIME_THREADLOCALSTORAGE_HPP