2007-12-01 00:00:00 +00:00
|
|
|
/*
|
2014-07-04 11:46:01 +02:00
|
|
|
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
2007-12-01 00:00:00 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
*
|
|
|
|
* This code is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License version 2 only, as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* version 2 for more details (a copy is included in the LICENSE file that
|
|
|
|
* accompanied this code).
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License version
|
|
|
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*
|
2010-05-27 19:08:38 -07:00
|
|
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
|
|
* or visit www.oracle.com if you need additional information or have any
|
|
|
|
* questions.
|
2007-12-01 00:00:00 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2010-11-23 13:22:55 -08:00
|
|
|
#ifndef SHARE_VM_RUNTIME_VM_VERSION_HPP
|
|
|
|
#define SHARE_VM_RUNTIME_VM_VERSION_HPP
|
|
|
|
|
|
|
|
#include "memory/allocation.hpp"
|
|
|
|
#include "utilities/ostream.hpp"
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// VM_Version provides information about the VM.
|
|
|
|
|
|
|
|
class Abstract_VM_Version: AllStatic {
|
|
|
|
protected:
|
|
|
|
friend class VMStructs;
|
|
|
|
static const char* _s_vm_release;
|
|
|
|
static const char* _s_internal_vm_info_string;
|
|
|
|
// These are set by machine-dependent initializations
|
|
|
|
static bool _supports_cx8;
|
2012-09-20 16:49:17 +02:00
|
|
|
static bool _supports_atomic_getset4;
|
|
|
|
static bool _supports_atomic_getset8;
|
|
|
|
static bool _supports_atomic_getadd4;
|
|
|
|
static bool _supports_atomic_getadd8;
|
2007-12-01 00:00:00 +00:00
|
|
|
static unsigned int _logical_processors_per_package;
|
2014-07-15 07:33:49 -07:00
|
|
|
static unsigned int _L1_data_cache_line_size;
|
2007-12-01 00:00:00 +00:00
|
|
|
static int _vm_major_version;
|
|
|
|
static int _vm_minor_version;
|
2014-04-24 14:06:40 -07:00
|
|
|
static int _vm_micro_version;
|
2007-12-01 00:00:00 +00:00
|
|
|
static int _vm_build_number;
|
|
|
|
static bool _initialized;
|
2008-02-22 17:17:14 -08:00
|
|
|
static int _parallel_worker_threads;
|
|
|
|
static bool _parallel_worker_threads_initialized;
|
2011-08-16 16:59:46 -07:00
|
|
|
static int _reserve_for_allocation_prefetch;
|
2008-02-22 17:17:14 -08:00
|
|
|
|
|
|
|
static unsigned int nof_parallel_worker_threads(unsigned int num,
|
|
|
|
unsigned int dem,
|
|
|
|
unsigned int switch_pt);
|
2007-12-01 00:00:00 +00:00
|
|
|
public:
|
|
|
|
static void initialize();
|
|
|
|
|
|
|
|
// Name
|
|
|
|
static const char* vm_name();
|
|
|
|
// Vendor
|
|
|
|
static const char* vm_vendor();
|
|
|
|
// VM version information string printed by launcher (java -version)
|
|
|
|
static const char* vm_info_string();
|
|
|
|
static const char* vm_release();
|
|
|
|
static const char* vm_platform_string();
|
2011-02-08 17:20:45 -05:00
|
|
|
static const char* vm_build_user();
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
static int vm_major_version() { assert(_initialized, "not initialized"); return _vm_major_version; }
|
|
|
|
static int vm_minor_version() { assert(_initialized, "not initialized"); return _vm_minor_version; }
|
2014-04-24 14:06:40 -07:00
|
|
|
static int vm_micro_version() { assert(_initialized, "not initialized"); return _vm_micro_version; }
|
2007-12-01 00:00:00 +00:00
|
|
|
static int vm_build_number() { assert(_initialized, "not initialized"); return _vm_build_number; }
|
|
|
|
|
|
|
|
// Gets the jvm_version_info.jvm_version defined in jvm.h
|
|
|
|
static unsigned int jvm_version();
|
|
|
|
|
|
|
|
// Internal version providing additional build information
|
|
|
|
static const char* internal_vm_info_string();
|
2012-01-31 13:12:39 +01:00
|
|
|
static const char* jre_release_version();
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
// does HW support an 8-byte compare-exchange operation?
|
2013-09-20 15:06:23 -04:00
|
|
|
static bool supports_cx8() {
|
|
|
|
#ifdef SUPPORTS_NATIVE_CX8
|
|
|
|
return true;
|
|
|
|
#else
|
|
|
|
return _supports_cx8;
|
|
|
|
#endif
|
|
|
|
}
|
2012-09-20 16:49:17 +02:00
|
|
|
// does HW support atomic get-and-set or atomic get-and-add? Used
|
|
|
|
// to guide intrinsification decisions for Unsafe atomic ops
|
|
|
|
static bool supports_atomic_getset4() {return _supports_atomic_getset4;}
|
|
|
|
static bool supports_atomic_getset8() {return _supports_atomic_getset8;}
|
|
|
|
static bool supports_atomic_getadd4() {return _supports_atomic_getadd4;}
|
|
|
|
static bool supports_atomic_getadd8() {return _supports_atomic_getadd8;}
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
static unsigned int logical_processors_per_package() {
|
|
|
|
return _logical_processors_per_package;
|
|
|
|
}
|
|
|
|
|
2014-07-15 07:33:49 -07:00
|
|
|
static unsigned int L1_data_cache_line_size() {
|
|
|
|
return _L1_data_cache_line_size;
|
|
|
|
}
|
|
|
|
|
2011-08-16 16:59:46 -07:00
|
|
|
// Need a space at the end of TLAB for prefetch instructions
|
|
|
|
// which may fault when accessing memory outside of heap.
|
|
|
|
static int reserve_for_allocation_prefetch() {
|
|
|
|
return _reserve_for_allocation_prefetch;
|
|
|
|
}
|
|
|
|
|
2010-08-03 08:13:38 -04:00
|
|
|
// ARCH specific policy for the BiasedLocking
|
|
|
|
static bool use_biased_locking() { return true; }
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// Number of page sizes efficiently supported by the hardware. Most chips now
|
|
|
|
// support two sizes, thus this default implementation. Processor-specific
|
|
|
|
// subclasses should define new versions to hide this one as needed. Note
|
|
|
|
// that the O/S may support more sizes, but at most this many are used.
|
|
|
|
static uint page_size_count() { return 2; }
|
2008-02-22 17:17:14 -08:00
|
|
|
|
|
|
|
// Returns the number of parallel threads to be used for VM
|
|
|
|
// work. If that number has not been calculated, do so and
|
|
|
|
// save it. Returns ParallelGCThreads if it is set on the
|
|
|
|
// command line.
|
|
|
|
static unsigned int parallel_worker_threads();
|
|
|
|
// Calculates and returns the number of parallel threads. May
|
|
|
|
// be VM version specific.
|
|
|
|
static unsigned int calc_parallel_worker_threads();
|
2007-12-01 00:00:00 +00:00
|
|
|
};
|
2010-11-23 13:22:55 -08:00
|
|
|
|
2014-07-04 11:46:01 +02:00
|
|
|
#ifdef TARGET_ARCH_x86
|
|
|
|
# include "vm_version_x86.hpp"
|
|
|
|
#endif
|
|
|
|
#ifdef TARGET_ARCH_sparc
|
|
|
|
# include "vm_version_sparc.hpp"
|
|
|
|
#endif
|
|
|
|
#ifdef TARGET_ARCH_zero
|
|
|
|
# include "vm_version_zero.hpp"
|
|
|
|
#endif
|
|
|
|
#ifdef TARGET_ARCH_arm
|
|
|
|
# include "vm_version_arm.hpp"
|
|
|
|
#endif
|
|
|
|
#ifdef TARGET_ARCH_ppc
|
|
|
|
# include "vm_version_ppc.hpp"
|
|
|
|
#endif
|
|
|
|
|
2010-11-23 13:22:55 -08:00
|
|
|
#endif // SHARE_VM_RUNTIME_VM_VERSION_HPP
|