jdk

Форк
0
/
vm_version_zero.cpp 
162 строки · 5.2 Кб
1
/*
2
 * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
3
 * Copyright 2009 Red Hat, Inc.
4
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5
 *
6
 * This code is free software; you can redistribute it and/or modify it
7
 * under the terms of the GNU General Public License version 2 only, as
8
 * published by the Free Software Foundation.
9
 *
10
 * This code is distributed in the hope that it will be useful, but WITHOUT
11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
13
 * version 2 for more details (a copy is included in the LICENSE file that
14
 * accompanied this code).
15
 *
16
 * You should have received a copy of the GNU General Public License version
17
 * 2 along with this work; if not, write to the Free Software Foundation,
18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19
 *
20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21
 * or visit www.oracle.com if you need additional information or have any
22
 * questions.
23
 *
24
 */
25

26
#include "precompiled.hpp"
27
#include "asm/assembler.inline.hpp"
28
#include "memory/resourceArea.hpp"
29
#include "runtime/arguments.hpp"
30
#include "runtime/globals_extension.hpp"
31
#include "runtime/java.hpp"
32
#include "runtime/stubCodeGenerator.hpp"
33
#include "runtime/vm_version.hpp"
34

35

36
void VM_Version::initialize() {
37
  // This machine does not allow unaligned memory accesses
38
  if (! FLAG_IS_DEFAULT(UseUnalignedAccesses)) {
39
    warning("Unaligned memory access is not available on this CPU");
40
    FLAG_SET_DEFAULT(UseUnalignedAccesses, false);
41
  }
42
  // Disable prefetching for Zero
43
  if (! FLAG_IS_DEFAULT(AllocatePrefetchDistance)) {
44
    warning("Prefetching is not available for a Zero VM");
45
  }
46
  FLAG_SET_DEFAULT(AllocatePrefetchDistance, 0);
47

48
  // Disable lock diagnostics for Zero
49
  if (DiagnoseSyncOnValueBasedClasses != 0) {
50
    warning("Lock diagnostics is not available for a Zero VM");
51
    FLAG_SET_DEFAULT(DiagnoseSyncOnValueBasedClasses, 0);
52
  }
53

54
  if (UseAESIntrinsics) {
55
    warning("AES intrinsics are not available on this CPU");
56
    FLAG_SET_DEFAULT(UseAESIntrinsics, false);
57
  }
58

59
  if (UseAES) {
60
    warning("AES instructions are not available on this CPU");
61
    FLAG_SET_DEFAULT(UseAES, false);
62
  }
63

64
  if (UseAESCTRIntrinsics) {
65
    warning("AES/CTR intrinsics are not available on this CPU");
66
    FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false);
67
  }
68

69
  if (UseFMA) {
70
    warning("FMA instructions are not available on this CPU");
71
    FLAG_SET_DEFAULT(UseFMA, false);
72
  }
73

74
  if (UseMD5Intrinsics) {
75
    warning("MD5 intrinsics are not available on this CPU");
76
    FLAG_SET_DEFAULT(UseMD5Intrinsics, false);
77
  }
78

79
  if (UseSHA) {
80
    warning("SHA instructions are not available on this CPU");
81
    FLAG_SET_DEFAULT(UseSHA, false);
82
  }
83

84
  if (UseSHA1Intrinsics) {
85
    warning("Intrinsics for SHA-1 crypto hash functions not available on this CPU.");
86
    FLAG_SET_DEFAULT(UseSHA1Intrinsics, false);
87
  }
88

89
  if (UseSHA256Intrinsics) {
90
    warning("Intrinsics for SHA-224 and SHA-256 crypto hash functions not available on this CPU.");
91
    FLAG_SET_DEFAULT(UseSHA256Intrinsics, false);
92
  }
93

94
  if (UseSHA512Intrinsics) {
95
    warning("Intrinsics for SHA-384 and SHA-512 crypto hash functions not available on this CPU.");
96
    FLAG_SET_DEFAULT(UseSHA512Intrinsics, false);
97
  }
98

99
  if (UseSHA3Intrinsics) {
100
    warning("Intrinsics for SHA3-224, SHA3-256, SHA3-384 and SHA3-512 crypto hash functions not available on this CPU.");
101
    FLAG_SET_DEFAULT(UseSHA3Intrinsics, false);
102
  }
103

104
  if (UseCRC32Intrinsics) {
105
    warning("CRC32 intrinsics are not available on this CPU");
106
    FLAG_SET_DEFAULT(UseCRC32Intrinsics, false);
107
  }
108

109
  if (UseAdler32Intrinsics) {
110
    warning("Adler32 intrinsics are not available on this CPU");
111
    FLAG_SET_DEFAULT(UseAdler32Intrinsics, false);
112
  }
113

114
  if (UseVectorizedMismatchIntrinsic) {
115
    warning("vectorizedMismatch intrinsic is not available on this CPU.");
116
    FLAG_SET_DEFAULT(UseVectorizedMismatchIntrinsic, false);
117
  }
118

119
  if ((LockingMode != LM_LEGACY) && (LockingMode != LM_MONITOR)) {
120
    warning("Unsupported locking mode for this CPU.");
121
    FLAG_SET_DEFAULT(LockingMode, LM_LEGACY);
122
  }
123

124
  // Enable error context decoding on known platforms
125
#if defined(IA32) || defined(AMD64) || defined(ARM) || \
126
    defined(AARCH64) || defined(PPC) || defined(RISCV) || \
127
    defined(S390)
128
  if (FLAG_IS_DEFAULT(DecodeErrorContext)) {
129
    FLAG_SET_DEFAULT(DecodeErrorContext, true);
130
  }
131
#else
132
  UNSUPPORTED_OPTION(DecodeErrorContext);
133
#endif
134

135
  // Not implemented
136
  UNSUPPORTED_OPTION(UseCompiler);
137
#ifdef ASSERT
138
  UNSUPPORTED_OPTION(CountCompiledCalls);
139
#endif
140

141
#ifndef SUPPORTS_NATIVE_CX8
142
  // Supports 8-byte cmpxchg with compiler built-ins.
143
  // These built-ins are supposed to be implemented on
144
  // all platforms (even if not natively), so we claim
145
  // the support unconditionally.
146
  _supports_cx8 = true;
147
#endif
148
}
149

150
void VM_Version::initialize_cpu_information(void) {
151
  // do nothing if cpu info has been initialized
152
  if (_initialized) {
153
    return;
154
  }
155

156
  _no_of_cores  = os::processor_count();
157
  _no_of_threads = _no_of_cores;
158
  _no_of_sockets = _no_of_cores;
159
  snprintf(_cpu_name, CPU_TYPE_DESC_BUF_SIZE - 1, "Zero VM");
160
  snprintf(_cpu_desc, CPU_DETAILED_DESC_BUF_SIZE, "%s", _features_string);
161
  _initialized = true;
162
}
163

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.