10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_RUNTIME_VM_VERSION_HPP
26 #define SHARE_VM_RUNTIME_VM_VERSION_HPP
27
28 #include "memory/allocation.hpp"
29 #include "utilities/ostream.hpp"
30
31 // VM_Version provides information about the VM.
32
33 class Abstract_VM_Version: AllStatic {
34 friend class VMStructs;
35 friend class JVMCIVMStructs;
36
37 protected:
38 static const char* _s_vm_release;
39 static const char* _s_internal_vm_info_string;
40
41 // CPU feature flags.
42 static uint64_t _features;
43 static const char* _features_string;
44
45 // These are set by machine-dependent initializations
46 static bool _supports_cx8;
47 static bool _supports_atomic_getset4;
48 static bool _supports_atomic_getset8;
49 static bool _supports_atomic_getadd4;
143
144 // Number of page sizes efficiently supported by the hardware. Most chips now
145 // support two sizes, thus this default implementation. Processor-specific
146 // subclasses should define new versions to hide this one as needed. Note
147 // that the O/S may support more sizes, but at most this many are used.
148 static uint page_size_count() { return 2; }
149
150 // Returns the number of parallel threads to be used for VM
151 // work. If that number has not been calculated, do so and
152 // save it. Returns ParallelGCThreads if it is set on the
153 // command line.
154 static unsigned int parallel_worker_threads();
155 // Calculates and returns the number of parallel threads. May
156 // be VM version specific.
157 static unsigned int calc_parallel_worker_threads();
158
159 // Does this CPU support spin wait instruction?
160 static bool supports_on_spin_wait() { return false; }
161 };
162
163 #ifdef TARGET_ARCH_x86
164 # include "vm_version_x86.hpp"
165 #endif
166 #ifdef TARGET_ARCH_sparc
167 # include "vm_version_sparc.hpp"
168 #endif
169 #ifdef TARGET_ARCH_zero
170 # include "vm_version_zero.hpp"
171 #endif
172 #ifdef TARGET_ARCH_arm
173 # include "vm_version_arm.hpp"
174 #endif
175 #ifdef TARGET_ARCH_ppc
176 # include "vm_version_ppc.hpp"
177 #endif
178
179 #endif // SHARE_VM_RUNTIME_VM_VERSION_HPP
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_RUNTIME_VM_VERSION_HPP
26 #define SHARE_VM_RUNTIME_VM_VERSION_HPP
27
28 #include "memory/allocation.hpp"
29 #include "utilities/ostream.hpp"
30 #include "utilities/macros.hpp"
31
32 // VM_Version provides information about the VM.
33
34 class Abstract_VM_Version: AllStatic {
35 friend class VMStructs;
36 friend class JVMCIVMStructs;
37
38 protected:
39 static const char* _s_vm_release;
40 static const char* _s_internal_vm_info_string;
41
42 // CPU feature flags.
43 static uint64_t _features;
44 static const char* _features_string;
45
46 // These are set by machine-dependent initializations
47 static bool _supports_cx8;
48 static bool _supports_atomic_getset4;
49 static bool _supports_atomic_getset8;
50 static bool _supports_atomic_getadd4;
144
145 // Number of page sizes efficiently supported by the hardware. Most chips now
146 // support two sizes, thus this default implementation. Processor-specific
147 // subclasses should define new versions to hide this one as needed. Note
148 // that the O/S may support more sizes, but at most this many are used.
149 static uint page_size_count() { return 2; }
150
151 // Returns the number of parallel threads to be used for VM
152 // work. If that number has not been calculated, do so and
153 // save it. Returns ParallelGCThreads if it is set on the
154 // command line.
155 static unsigned int parallel_worker_threads();
156 // Calculates and returns the number of parallel threads. May
157 // be VM version specific.
158 static unsigned int calc_parallel_worker_threads();
159
160 // Does this CPU support spin wait instruction?
161 static bool supports_on_spin_wait() { return false; }
162 };
163
164 #include CPU_HEADER(vm_version)
165
166 #endif // SHARE_VM_RUNTIME_VM_VERSION_HPP
|