src/cpu/sparc/vm/vm_version_sparc.cpp

Wed, 30 Apr 2014 14:14:01 -0700

author
kvn
date
Wed, 30 Apr 2014 14:14:01 -0700
changeset 6653
03214612e77e
parent 6312
04d32e7fad07
child 6680
78bbf4d43a14
permissions
-rw-r--r--

8035936: SIGBUS in StubRoutines::aesencryptBlock, solaris-sparc
Summary: Fix the arbitrary alignment issue in SPARC AES crypto stub routines.
Reviewed-by: kvn, iveresov
Contributed-by: shrinivas.joshi@oracle.com

duke@435 1 /*
kvn@6653 2 * Copyright (c) 1997, 2014, 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 #include "precompiled.hpp"
twisti@4323 26 #include "asm/macroAssembler.inline.hpp"
stefank@2314 27 #include "memory/resourceArea.hpp"
stefank@2314 28 #include "runtime/java.hpp"
stefank@2314 29 #include "runtime/stubCodeGenerator.hpp"
stefank@2314 30 #include "vm_version_sparc.hpp"
stefank@2314 31 #ifdef TARGET_OS_FAMILY_linux
stefank@2314 32 # include "os_linux.inline.hpp"
stefank@2314 33 #endif
stefank@2314 34 #ifdef TARGET_OS_FAMILY_solaris
stefank@2314 35 # include "os_solaris.inline.hpp"
stefank@2314 36 #endif
duke@435 37
duke@435 38 int VM_Version::_features = VM_Version::unknown_m;
duke@435 39 const char* VM_Version::_features_str = "";
duke@435 40
duke@435 41 void VM_Version::initialize() {
duke@435 42 _features = determine_features();
duke@435 43 PrefetchCopyIntervalInBytes = prefetch_copy_interval_in_bytes();
duke@435 44 PrefetchScanIntervalInBytes = prefetch_scan_interval_in_bytes();
duke@435 45 PrefetchFieldsAhead = prefetch_fields_ahead();
duke@435 46
kvn@3052 47 assert(0 <= AllocatePrefetchInstr && AllocatePrefetchInstr <= 1, "invalid value");
kvn@3052 48 if( AllocatePrefetchInstr < 0 ) AllocatePrefetchInstr = 0;
kvn@3052 49 if( AllocatePrefetchInstr > 1 ) AllocatePrefetchInstr = 0;
kvn@3052 50
duke@435 51 // Allocation prefetch settings
kvn@3052 52 intx cache_line_size = prefetch_data_size();
duke@435 53 if( cache_line_size > AllocatePrefetchStepSize )
duke@435 54 AllocatePrefetchStepSize = cache_line_size;
kvn@3052 55
kvn@3052 56 assert(AllocatePrefetchLines > 0, "invalid value");
kvn@3052 57 if( AllocatePrefetchLines < 1 ) // set valid value in product VM
kvn@3052 58 AllocatePrefetchLines = 3;
kvn@3052 59 assert(AllocateInstancePrefetchLines > 0, "invalid value");
kvn@3052 60 if( AllocateInstancePrefetchLines < 1 ) // set valid value in product VM
kvn@3052 61 AllocateInstancePrefetchLines = 1;
duke@435 62
duke@435 63 AllocatePrefetchDistance = allocate_prefetch_distance();
duke@435 64 AllocatePrefetchStyle = allocate_prefetch_style();
duke@435 65
kvn@3052 66 assert((AllocatePrefetchDistance % AllocatePrefetchStepSize) == 0 &&
kvn@3052 67 (AllocatePrefetchDistance > 0), "invalid value");
kvn@3052 68 if ((AllocatePrefetchDistance % AllocatePrefetchStepSize) != 0 ||
kvn@3052 69 (AllocatePrefetchDistance <= 0)) {
kvn@3052 70 AllocatePrefetchDistance = AllocatePrefetchStepSize;
kvn@3052 71 }
duke@435 72
kvn@3037 73 if (AllocatePrefetchStyle == 3 && !has_blk_init()) {
kvn@3037 74 warning("BIS instructions are not available on this CPU");
kvn@3037 75 FLAG_SET_DEFAULT(AllocatePrefetchStyle, 1);
kvn@3037 76 }
kvn@3037 77
morris@5283 78 guarantee(VM_Version::has_v9(), "only SPARC v9 is supported");
morris@5283 79
morris@5283 80 assert(ArraycopySrcPrefetchDistance < 4096, "invalid value");
morris@5283 81 if (ArraycopySrcPrefetchDistance >= 4096)
morris@5283 82 ArraycopySrcPrefetchDistance = 4064;
morris@5283 83 assert(ArraycopyDstPrefetchDistance < 4096, "invalid value");
morris@5283 84 if (ArraycopyDstPrefetchDistance >= 4096)
morris@5283 85 ArraycopyDstPrefetchDistance = 4064;
kvn@3103 86
duke@435 87 UseSSE = 0; // Only on x86 and x64
duke@435 88
kvn@3052 89 _supports_cx8 = has_v9();
roland@4106 90 _supports_atomic_getset4 = true; // swap instruction
duke@435 91
simonis@6154 92 // There are Fujitsu Sparc64 CPUs which support blk_init as well so
simonis@6154 93 // we have to take this check out of the 'is_niagara()' block below.
simonis@6154 94 if (has_blk_init()) {
simonis@6154 95 // When using CMS or G1, we cannot use memset() in BOT updates
simonis@6154 96 // because the sun4v/CMT version in libc_psr uses BIS which
simonis@6154 97 // exposes "phantom zeros" to concurrent readers. See 6948537.
simonis@6154 98 if (FLAG_IS_DEFAULT(UseMemSetInBOT) && (UseConcMarkSweepGC || UseG1GC)) {
simonis@6154 99 FLAG_SET_DEFAULT(UseMemSetInBOT, false);
simonis@6154 100 }
simonis@6154 101 // Issue a stern warning if the user has explicitly set
simonis@6154 102 // UseMemSetInBOT (it is known to cause issues), but allow
simonis@6154 103 // use for experimentation and debugging.
simonis@6154 104 if (UseConcMarkSweepGC || UseG1GC) {
simonis@6154 105 if (UseMemSetInBOT) {
simonis@6154 106 assert(!FLAG_IS_DEFAULT(UseMemSetInBOT), "Error");
simonis@6154 107 warning("Experimental flag -XX:+UseMemSetInBOT is known to cause instability"
simonis@6154 108 " on sun4v; please understand that you are using at your own risk!");
simonis@6154 109 }
simonis@6154 110 }
simonis@6154 111 }
simonis@6154 112
kvn@2403 113 if (is_niagara()) {
duke@435 114 // Indirect branch is the same cost as direct
duke@435 115 if (FLAG_IS_DEFAULT(UseInlineCaches)) {
kvn@1110 116 FLAG_SET_DEFAULT(UseInlineCaches, false);
duke@435 117 }
kvn@2403 118 // Align loops on a single instruction boundary.
kvn@2403 119 if (FLAG_IS_DEFAULT(OptoLoopAlignment)) {
kvn@2403 120 FLAG_SET_DEFAULT(OptoLoopAlignment, 4);
kvn@2403 121 }
coleenp@548 122 #ifdef _LP64
kvn@1077 123 // 32-bit oops don't make sense for the 64-bit VM on sparc
kvn@1077 124 // since the 32-bit VM has the same registers and smaller objects.
kvn@1077 125 Universe::set_narrow_oop_shift(LogMinObjAlignmentInBytes);
roland@4159 126 Universe::set_narrow_klass_shift(LogKlassAlignmentInBytes);
coleenp@548 127 #endif // _LP64
duke@435 128 #ifdef COMPILER2
duke@435 129 // Indirect branch is the same cost as direct
duke@435 130 if (FLAG_IS_DEFAULT(UseJumpTables)) {
kvn@1110 131 FLAG_SET_DEFAULT(UseJumpTables, true);
duke@435 132 }
duke@435 133 // Single-issue, so entry and loop tops are
duke@435 134 // aligned on a single instruction boundary
duke@435 135 if (FLAG_IS_DEFAULT(InteriorEntryAlignment)) {
kvn@1110 136 FLAG_SET_DEFAULT(InteriorEntryAlignment, 4);
duke@435 137 }
kvn@2403 138 if (is_niagara_plus()) {
kvn@3052 139 if (has_blk_init() && UseTLAB &&
kvn@3052 140 FLAG_IS_DEFAULT(AllocatePrefetchInstr)) {
kvn@3052 141 // Use BIS instruction for TLAB allocation prefetch.
kvn@3052 142 FLAG_SET_ERGO(intx, AllocatePrefetchInstr, 1);
kvn@3052 143 if (FLAG_IS_DEFAULT(AllocatePrefetchStyle)) {
kvn@3052 144 FLAG_SET_ERGO(intx, AllocatePrefetchStyle, 3);
kvn@3052 145 }
kvn@1802 146 if (FLAG_IS_DEFAULT(AllocatePrefetchDistance)) {
kvn@3052 147 // Use smaller prefetch distance with BIS
kvn@1802 148 FLAG_SET_DEFAULT(AllocatePrefetchDistance, 64);
kvn@1802 149 }
kvn@1802 150 }
kvn@3052 151 if (is_T4()) {
kvn@3052 152 // Double number of prefetched cache lines on T4
kvn@3052 153 // since L2 cache line size is smaller (32 bytes).
kvn@3052 154 if (FLAG_IS_DEFAULT(AllocatePrefetchLines)) {
kvn@3052 155 FLAG_SET_ERGO(intx, AllocatePrefetchLines, AllocatePrefetchLines*2);
kvn@3052 156 }
kvn@3052 157 if (FLAG_IS_DEFAULT(AllocateInstancePrefetchLines)) {
kvn@3052 158 FLAG_SET_ERGO(intx, AllocateInstancePrefetchLines, AllocateInstancePrefetchLines*2);
kvn@3052 159 }
kvn@3052 160 }
kvn@1802 161 if (AllocatePrefetchStyle != 3 && FLAG_IS_DEFAULT(AllocatePrefetchDistance)) {
kvn@1802 162 // Use different prefetch distance without BIS
kvn@1802 163 FLAG_SET_DEFAULT(AllocatePrefetchDistance, 256);
kvn@1802 164 }
kvn@3052 165 if (AllocatePrefetchInstr == 1) {
kvn@3052 166 // Need a space at the end of TLAB for BIS since it
kvn@3052 167 // will fault when accessing memory outside of heap.
kvn@3052 168
kvn@3052 169 // +1 for rounding up to next cache line, +1 to be safe
kvn@3052 170 int lines = AllocatePrefetchLines + 2;
kvn@3052 171 int step_size = AllocatePrefetchStepSize;
kvn@3052 172 int distance = AllocatePrefetchDistance;
kvn@3052 173 _reserve_for_allocation_prefetch = (distance + step_size*lines)/(int)HeapWordSize;
kvn@3052 174 }
duke@435 175 }
duke@435 176 #endif
duke@435 177 }
duke@435 178
twisti@1078 179 // Use hardware population count instruction if available.
twisti@1078 180 if (has_hardware_popc()) {
twisti@1078 181 if (FLAG_IS_DEFAULT(UsePopCountInstruction)) {
kvn@1110 182 FLAG_SET_DEFAULT(UsePopCountInstruction, true);
twisti@1078 183 }
kvn@3037 184 } else if (UsePopCountInstruction) {
kvn@3037 185 warning("POPC instruction is not available on this CPU");
kvn@3037 186 FLAG_SET_DEFAULT(UsePopCountInstruction, false);
kvn@3037 187 }
kvn@3037 188
kvn@3037 189 // T4 and newer Sparc cpus have new compare and branch instruction.
kvn@3037 190 if (has_cbcond()) {
kvn@3037 191 if (FLAG_IS_DEFAULT(UseCBCond)) {
kvn@3037 192 FLAG_SET_DEFAULT(UseCBCond, true);
kvn@3037 193 }
kvn@3037 194 } else if (UseCBCond) {
kvn@3037 195 warning("CBCOND instruction is not available on this CPU");
kvn@3037 196 FLAG_SET_DEFAULT(UseCBCond, false);
twisti@1078 197 }
twisti@1078 198
kvn@3092 199 assert(BlockZeroingLowLimit > 0, "invalid value");
kvn@3092 200 if (has_block_zeroing()) {
kvn@3092 201 if (FLAG_IS_DEFAULT(UseBlockZeroing)) {
kvn@3092 202 FLAG_SET_DEFAULT(UseBlockZeroing, true);
kvn@3092 203 }
kvn@3092 204 } else if (UseBlockZeroing) {
kvn@3092 205 warning("BIS zeroing instructions are not available on this CPU");
kvn@3092 206 FLAG_SET_DEFAULT(UseBlockZeroing, false);
kvn@3092 207 }
kvn@3092 208
kvn@3103 209 assert(BlockCopyLowLimit > 0, "invalid value");
kvn@3103 210 if (has_block_zeroing()) { // has_blk_init() && is_T4(): core's local L2 cache
kvn@3103 211 if (FLAG_IS_DEFAULT(UseBlockCopy)) {
kvn@3103 212 FLAG_SET_DEFAULT(UseBlockCopy, true);
kvn@3103 213 }
kvn@3103 214 } else if (UseBlockCopy) {
kvn@3103 215 warning("BIS instructions are not available or expensive on this CPU");
kvn@3103 216 FLAG_SET_DEFAULT(UseBlockCopy, false);
kvn@3103 217 }
kvn@3103 218
never@2085 219 #ifdef COMPILER2
kvn@3037 220 // T4 and newer Sparc cpus have fast RDPC.
kvn@3037 221 if (has_fast_rdpc() && FLAG_IS_DEFAULT(UseRDPCForConstantTableBase)) {
twisti@3249 222 FLAG_SET_DEFAULT(UseRDPCForConstantTableBase, true);
kvn@3037 223 }
kvn@3037 224
never@2085 225 // Currently not supported anywhere.
never@2085 226 FLAG_SET_DEFAULT(UseFPUForSpilling, false);
kvn@3049 227
kvn@3882 228 MaxVectorSize = 8;
kvn@3882 229
kvn@3049 230 assert((InteriorEntryAlignment % relocInfo::addr_unit()) == 0, "alignment is not a multiple of NOP size");
never@2085 231 #endif
never@2085 232
kvn@3049 233 assert((CodeEntryAlignment % relocInfo::addr_unit()) == 0, "alignment is not a multiple of NOP size");
kvn@3049 234 assert((OptoLoopAlignment % relocInfo::addr_unit()) == 0, "alignment is not a multiple of NOP size");
kvn@3049 235
duke@435 236 char buf[512];
kvn@6312 237 jio_snprintf(buf, sizeof(buf), "%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
kvn@3037 238 (has_v9() ? ", v9" : (has_v8() ? ", v8" : "")),
twisti@1078 239 (has_hardware_popc() ? ", popc" : ""),
kvn@3037 240 (has_vis1() ? ", vis1" : ""),
kvn@3037 241 (has_vis2() ? ", vis2" : ""),
kvn@3037 242 (has_vis3() ? ", vis3" : ""),
kvn@3037 243 (has_blk_init() ? ", blk_init" : ""),
kvn@3037 244 (has_cbcond() ? ", cbcond" : ""),
kvn@6312 245 (has_aes() ? ", aes" : ""),
kvn@3037 246 (is_ultra3() ? ", ultra3" : ""),
kvn@3037 247 (is_sun4v() ? ", sun4v" : ""),
kvn@3037 248 (is_niagara_plus() ? ", niagara_plus" : (is_niagara() ? ", niagara" : "")),
kvn@3037 249 (is_sparc64() ? ", sparc64" : ""),
twisti@1076 250 (!has_hardware_mul32() ? ", no-mul32" : ""),
twisti@1076 251 (!has_hardware_div32() ? ", no-div32" : ""),
duke@435 252 (!has_hardware_fsmuld() ? ", no-fsmuld" : ""));
duke@435 253
duke@435 254 // buf is started with ", " or is empty
duke@435 255 _features_str = strdup(strlen(buf) > 2 ? buf + 2 : buf);
duke@435 256
kvn@3001 257 // UseVIS is set to the smallest of what hardware supports and what
kvn@3001 258 // the command line requires. I.e., you cannot set UseVIS to 3 on
kvn@3001 259 // older UltraSparc which do not support it.
kvn@3001 260 if (UseVIS > 3) UseVIS=3;
kvn@3001 261 if (UseVIS < 0) UseVIS=0;
kvn@3001 262 if (!has_vis3()) // Drop to 2 if no VIS3 support
kvn@3001 263 UseVIS = MIN2((intx)2,UseVIS);
kvn@3001 264 if (!has_vis2()) // Drop to 1 if no VIS2 support
kvn@3001 265 UseVIS = MIN2((intx)1,UseVIS);
kvn@3001 266 if (!has_vis1()) // Drop to 0 if no VIS1 support
kvn@3001 267 UseVIS = 0;
kvn@3001 268
kvn@6653 269 // SPARC T4 and above should have support for AES instructions
kvn@6312 270 if (has_aes()) {
kvn@6653 271 if (UseVIS > 2) { // AES intrinsics use MOVxTOd/MOVdTOx which are VIS3
kvn@6312 272 if (FLAG_IS_DEFAULT(UseAES)) {
kvn@6312 273 FLAG_SET_DEFAULT(UseAES, true);
kvn@6312 274 }
kvn@6312 275 if (FLAG_IS_DEFAULT(UseAESIntrinsics)) {
kvn@6312 276 FLAG_SET_DEFAULT(UseAESIntrinsics, true);
kvn@6312 277 }
kvn@6312 278 // we disable both the AES flags if either of them is disabled on the command line
kvn@6312 279 if (!UseAES || !UseAESIntrinsics) {
kvn@6312 280 FLAG_SET_DEFAULT(UseAES, false);
kvn@6312 281 FLAG_SET_DEFAULT(UseAESIntrinsics, false);
kvn@6312 282 }
kvn@6312 283 } else {
kvn@6312 284 if (UseAES || UseAESIntrinsics) {
kvn@6653 285 warning("SPARC AES intrinsics require VIS3 instruction support. Intrinsics will be disabled.");
kvn@6312 286 if (UseAES) {
kvn@6312 287 FLAG_SET_DEFAULT(UseAES, false);
kvn@6312 288 }
kvn@6312 289 if (UseAESIntrinsics) {
kvn@6312 290 FLAG_SET_DEFAULT(UseAESIntrinsics, false);
kvn@6312 291 }
kvn@6312 292 }
kvn@6312 293 }
kvn@6312 294 } else if (UseAES || UseAESIntrinsics) {
kvn@6312 295 warning("AES instructions are not available on this CPU");
kvn@6312 296 if (UseAES) {
kvn@6312 297 FLAG_SET_DEFAULT(UseAES, false);
kvn@6312 298 }
kvn@6312 299 if (UseAESIntrinsics) {
kvn@6312 300 FLAG_SET_DEFAULT(UseAESIntrinsics, false);
kvn@6312 301 }
kvn@6312 302 }
kvn@6312 303
jwilhelm@4430 304 if (FLAG_IS_DEFAULT(ContendedPaddingWidth) &&
jwilhelm@4430 305 (cache_line_size > ContendedPaddingWidth))
jwilhelm@4430 306 ContendedPaddingWidth = cache_line_size;
jwilhelm@4430 307
duke@435 308 #ifndef PRODUCT
duke@435 309 if (PrintMiscellaneous && Verbose) {
kvn@3052 310 tty->print("Allocation");
duke@435 311 if (AllocatePrefetchStyle <= 0) {
kvn@3052 312 tty->print_cr(": no prefetching");
duke@435 313 } else {
kvn@3052 314 tty->print(" prefetching: ");
kvn@3052 315 if (AllocatePrefetchInstr == 0) {
kvn@3052 316 tty->print("PREFETCH");
kvn@3052 317 } else if (AllocatePrefetchInstr == 1) {
kvn@3052 318 tty->print("BIS");
kvn@3052 319 }
duke@435 320 if (AllocatePrefetchLines > 1) {
kvn@3052 321 tty->print_cr(" at distance %d, %d lines of %d bytes", AllocatePrefetchDistance, AllocatePrefetchLines, AllocatePrefetchStepSize);
duke@435 322 } else {
kvn@3052 323 tty->print_cr(" at distance %d, one line of %d bytes", AllocatePrefetchDistance, AllocatePrefetchStepSize);
duke@435 324 }
duke@435 325 }
duke@435 326 if (PrefetchCopyIntervalInBytes > 0) {
duke@435 327 tty->print_cr("PrefetchCopyIntervalInBytes %d", PrefetchCopyIntervalInBytes);
duke@435 328 }
duke@435 329 if (PrefetchScanIntervalInBytes > 0) {
duke@435 330 tty->print_cr("PrefetchScanIntervalInBytes %d", PrefetchScanIntervalInBytes);
duke@435 331 }
duke@435 332 if (PrefetchFieldsAhead > 0) {
duke@435 333 tty->print_cr("PrefetchFieldsAhead %d", PrefetchFieldsAhead);
duke@435 334 }
jwilhelm@4430 335 if (ContendedPaddingWidth > 0) {
jwilhelm@4430 336 tty->print_cr("ContendedPaddingWidth %d", ContendedPaddingWidth);
jwilhelm@4430 337 }
duke@435 338 }
duke@435 339 #endif // PRODUCT
duke@435 340 }
duke@435 341
duke@435 342 void VM_Version::print_features() {
duke@435 343 tty->print_cr("Version:%s", cpu_features());
duke@435 344 }
duke@435 345
duke@435 346 int VM_Version::determine_features() {
duke@435 347 if (UseV8InstrsOnly) {
duke@435 348 NOT_PRODUCT(if (PrintMiscellaneous && Verbose) tty->print_cr("Version is Forced-V8");)
duke@435 349 return generic_v8_m;
duke@435 350 }
duke@435 351
duke@435 352 int features = platform_features(unknown_m); // platform_features() is os_arch specific
duke@435 353
duke@435 354 if (features == unknown_m) {
duke@435 355 features = generic_v9_m;
duke@435 356 warning("Cannot recognize SPARC version. Default to V9");
duke@435 357 }
duke@435 358
kvn@2403 359 assert(is_T_family(features) == is_niagara(features), "Niagara should be T series");
kvn@2403 360 if (UseNiagaraInstrs) { // Force code generation for Niagara
kvn@2403 361 if (is_T_family(features)) {
duke@435 362 // Happy to accomodate...
duke@435 363 } else {
duke@435 364 NOT_PRODUCT(if (PrintMiscellaneous && Verbose) tty->print_cr("Version is Forced-Niagara");)
kvn@2403 365 features |= T_family_m;
duke@435 366 }
duke@435 367 } else {
kvn@2403 368 if (is_T_family(features) && !FLAG_IS_DEFAULT(UseNiagaraInstrs)) {
duke@435 369 NOT_PRODUCT(if (PrintMiscellaneous && Verbose) tty->print_cr("Version is Forced-Not-Niagara");)
kvn@2403 370 features &= ~(T_family_m | T1_model_m);
duke@435 371 } else {
duke@435 372 // Happy to accomodate...
duke@435 373 }
duke@435 374 }
duke@435 375
duke@435 376 return features;
duke@435 377 }
duke@435 378
duke@435 379 static int saved_features = 0;
duke@435 380
duke@435 381 void VM_Version::allow_all() {
duke@435 382 saved_features = _features;
duke@435 383 _features = all_features_m;
duke@435 384 }
duke@435 385
duke@435 386 void VM_Version::revert() {
duke@435 387 _features = saved_features;
duke@435 388 }
jmasa@445 389
jmasa@445 390 unsigned int VM_Version::calc_parallel_worker_threads() {
jmasa@445 391 unsigned int result;
twisti@4108 392 if (is_M_series()) {
twisti@4108 393 // for now, use same gc thread calculation for M-series as for niagara-plus
twisti@4108 394 // in future, we may want to tweak parameters for nof_parallel_worker_thread
twisti@4108 395 result = nof_parallel_worker_threads(5, 16, 8);
twisti@4108 396 } else if (is_niagara_plus()) {
jmasa@445 397 result = nof_parallel_worker_threads(5, 16, 8);
jmasa@445 398 } else {
jmasa@445 399 result = nof_parallel_worker_threads(5, 8, 8);
jmasa@445 400 }
jmasa@445 401 return result;
jmasa@445 402 }

mercurial