hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp

Print this page
rev 611 : Merge
   1 #ifdef USE_PRAGMA_IDENT_SRC
   2 #pragma ident "@(#)vm_version_sparc.cpp 1.56 07/07/02 18:40:59 JVM"
   3 #endif
   4 /*
   5  * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
   6  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   7  *
   8  * This code is free software; you can redistribute it and/or modify it
   9  * under the terms of the GNU General Public License version 2 only, as
  10  * published by the Free Software Foundation.
  11  *
  12  * This code is distributed in the hope that it will be useful, but WITHOUT
  13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15  * version 2 for more details (a copy is included in the LICENSE file that
  16  * accompanied this code).
  17  *
  18  * You should have received a copy of the GNU General Public License version
  19  * 2 along with this work; if not, write to the Free Software Foundation,
  20  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  21  *
  22  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  23  * CA 95054 USA or visit www.sun.com if you need additional information or
  24  * have any questions.
  25  *  
  26  */
  27 
  28 # include "incls/_precompiled.incl"
  29 # include "incls/_vm_version_sparc.cpp.incl"
  30 
  31 int VM_Version::_features = VM_Version::unknown_m;
  32 const char* VM_Version::_features_str = "";
  33 






  34 void VM_Version::initialize() {
  35   _features = determine_features();
  36   PrefetchCopyIntervalInBytes = prefetch_copy_interval_in_bytes(); 
  37   PrefetchScanIntervalInBytes = prefetch_scan_interval_in_bytes();
  38   PrefetchFieldsAhead         = prefetch_fields_ahead();
  39 
  40   // Allocation prefetch settings
  41   intx cache_line_size = L1_data_cache_line_size();
  42   if( cache_line_size > AllocatePrefetchStepSize )
  43     AllocatePrefetchStepSize = cache_line_size;
  44   if( FLAG_IS_DEFAULT(AllocatePrefetchLines) )
  45     AllocatePrefetchLines = 3; // Optimistic value
  46   assert( AllocatePrefetchLines > 0, "invalid value");
  47   if( AllocatePrefetchLines < 1 ) // set valid value in product VM
  48     AllocatePrefetchLines = 1; // Conservative value
  49 
  50   AllocatePrefetchDistance = allocate_prefetch_distance();
  51   AllocatePrefetchStyle    = allocate_prefetch_style();
  52 
  53   assert(AllocatePrefetchDistance % AllocatePrefetchStepSize == 0, "invalid value");
  54 
  55   UseSSE = 0; // Only on x86 and x64
  56 
  57   _supports_cx8               = has_v9();
  58 
  59   if (is_niagara1()) {
  60     // Indirect branch is the same cost as direct
  61     if (FLAG_IS_DEFAULT(UseInlineCaches)) {
  62       UseInlineCaches         = false;
  63     }









  64 #ifdef COMPILER2
  65     // Indirect branch is the same cost as direct
  66     if (FLAG_IS_DEFAULT(UseJumpTables)) {
  67       UseJumpTables           = true;
  68     }
  69     // Single-issue, so entry and loop tops are
  70     // aligned on a single instruction boundary
  71     if (FLAG_IS_DEFAULT(InteriorEntryAlignment)) {
  72       InteriorEntryAlignment  = 4;
  73     }
  74     if (FLAG_IS_DEFAULT(OptoLoopAlignment)) {
  75       OptoLoopAlignment       = 4;
  76     }
  77 #endif
  78   }
  79 
  80   char buf[512];
  81   jio_snprintf(buf, sizeof(buf), "%s%s%s%s%s%s%s%s%s",
  82                (has_v8() ? ", has_v8" : ""),
  83                (has_v9() ? ", has_v9" : ""),


 146       NOT_PRODUCT(if (PrintMiscellaneous && Verbose) tty->print_cr("Version is Forced-Not-Niagara");)
 147       features &= ~niagara1_unique_m;
 148     } else {
 149       // Happy to accomodate...
 150     }
 151   }
 152 
 153   return features;
 154 }
 155 
 156 static int saved_features = 0;
 157 
 158 void VM_Version::allow_all() {
 159   saved_features = _features;
 160   _features      = all_features_m;
 161 }
 162 
 163 void VM_Version::revert() {
 164   _features = saved_features;
 165 }










   1 #ifdef USE_PRAGMA_IDENT_SRC
   2 #pragma ident "@(#)vm_version_sparc.cpp 1.56 07/07/02 18:40:59 JVM"
   3 #endif
   4 /*
   5  * Copyright 1997-2008 Sun Microsystems, Inc.  All Rights Reserved.
   6  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   7  *
   8  * This code is free software; you can redistribute it and/or modify it
   9  * under the terms of the GNU General Public License version 2 only, as
  10  * published by the Free Software Foundation.
  11  *
  12  * This code is distributed in the hope that it will be useful, but WITHOUT
  13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15  * version 2 for more details (a copy is included in the LICENSE file that
  16  * accompanied this code).
  17  *
  18  * You should have received a copy of the GNU General Public License version
  19  * 2 along with this work; if not, write to the Free Software Foundation,
  20  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  21  *
  22  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  23  * CA 95054 USA or visit www.sun.com if you need additional information or
  24  * have any questions.
  25  *  
  26  */
  27 
  28 # include "incls/_precompiled.incl"
  29 # include "incls/_vm_version_sparc.cpp.incl"
  30 
  31 int VM_Version::_features = VM_Version::unknown_m;
  32 const char* VM_Version::_features_str = "";
  33 
  34 bool VM_Version::is_niagara1_plus() {
  35   // This is a placeholder until the real test is determined.
  36   return is_niagara1() &&
  37     (os::processor_count() > maximum_niagara1_processor_count());
  38 }
  39 
  40 void VM_Version::initialize() {
  41   _features = determine_features();
  42   PrefetchCopyIntervalInBytes = prefetch_copy_interval_in_bytes(); 
  43   PrefetchScanIntervalInBytes = prefetch_scan_interval_in_bytes();
  44   PrefetchFieldsAhead         = prefetch_fields_ahead();
  45 
  46   // Allocation prefetch settings
  47   intx cache_line_size = L1_data_cache_line_size();
  48   if( cache_line_size > AllocatePrefetchStepSize )
  49     AllocatePrefetchStepSize = cache_line_size;
  50   if( FLAG_IS_DEFAULT(AllocatePrefetchLines) )
  51     AllocatePrefetchLines = 3; // Optimistic value
  52   assert( AllocatePrefetchLines > 0, "invalid value");
  53   if( AllocatePrefetchLines < 1 ) // set valid value in product VM
  54     AllocatePrefetchLines = 1; // Conservative value
  55 
  56   AllocatePrefetchDistance = allocate_prefetch_distance();
  57   AllocatePrefetchStyle    = allocate_prefetch_style();
  58 
  59   assert(AllocatePrefetchDistance % AllocatePrefetchStepSize == 0, "invalid value");
  60 
  61   UseSSE = 0; // Only on x86 and x64
  62 
  63   _supports_cx8               = has_v9();
  64 
  65   if (is_niagara1()) {
  66     // Indirect branch is the same cost as direct
  67     if (FLAG_IS_DEFAULT(UseInlineCaches)) {
  68       UseInlineCaches         = false;
  69     }
  70 #ifdef _LP64
  71     // Single issue niagara1 is slower for CompressedOops
  72     // but niagaras after that it's fine.
  73     if (!is_niagara1_plus()) {
  74       if (FLAG_IS_DEFAULT(UseCompressedOops)) {
  75         FLAG_SET_ERGO(bool, UseCompressedOops, false);
  76       }
  77     }
  78 #endif // _LP64
  79 #ifdef COMPILER2
  80     // Indirect branch is the same cost as direct
  81     if (FLAG_IS_DEFAULT(UseJumpTables)) {
  82       UseJumpTables           = true;
  83     }
  84     // Single-issue, so entry and loop tops are
  85     // aligned on a single instruction boundary
  86     if (FLAG_IS_DEFAULT(InteriorEntryAlignment)) {
  87       InteriorEntryAlignment  = 4;
  88     }
  89     if (FLAG_IS_DEFAULT(OptoLoopAlignment)) {
  90       OptoLoopAlignment       = 4;
  91     }
  92 #endif
  93   }
  94 
  95   char buf[512];
  96   jio_snprintf(buf, sizeof(buf), "%s%s%s%s%s%s%s%s%s",
  97                (has_v8() ? ", has_v8" : ""),
  98                (has_v9() ? ", has_v9" : ""),


 161       NOT_PRODUCT(if (PrintMiscellaneous && Verbose) tty->print_cr("Version is Forced-Not-Niagara");)
 162       features &= ~niagara1_unique_m;
 163     } else {
 164       // Happy to accomodate...
 165     }
 166   }
 167 
 168   return features;
 169 }
 170 
 171 static int saved_features = 0;
 172 
 173 void VM_Version::allow_all() {
 174   saved_features = _features;
 175   _features      = all_features_m;
 176 }
 177 
 178 void VM_Version::revert() {
 179   _features = saved_features;
 180 }
 181 
 182 unsigned int VM_Version::calc_parallel_worker_threads() {
 183   unsigned int result;
 184   if (is_niagara1_plus()) {
 185     result = nof_parallel_worker_threads(5, 16, 8);
 186   } else {
 187     result = nof_parallel_worker_threads(5, 8, 8);
 188   }
 189   return result;
 190 }