src/cpu/sparc/vm/vm_version_sparc.cpp

Print this page




  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "asm/macroAssembler.inline.hpp"
  27 #include "memory/resourceArea.hpp"
  28 #include "runtime/java.hpp"
  29 #include "runtime/stubCodeGenerator.hpp"
  30 #include "vm_version_sparc.hpp"
  31 #ifdef TARGET_OS_FAMILY_linux
  32 # include "os_linux.inline.hpp"
  33 #endif
  34 #ifdef TARGET_OS_FAMILY_solaris
  35 # include "os_solaris.inline.hpp"
  36 #endif
  37 
  38 int VM_Version::_features = VM_Version::unknown_m;
  39 const char* VM_Version::_features_str = "";
  40 unsigned int VM_Version::_L2_data_cache_line_size = 0;
  41 
  42 void VM_Version::initialize() {
  43   _features = determine_features();



  44   PrefetchCopyIntervalInBytes = prefetch_copy_interval_in_bytes();
  45   PrefetchScanIntervalInBytes = prefetch_scan_interval_in_bytes();
  46   PrefetchFieldsAhead         = prefetch_fields_ahead();
  47 
  48   assert(0 <= AllocatePrefetchInstr && AllocatePrefetchInstr <= 1, "invalid value");
  49   if( AllocatePrefetchInstr < 0 ) AllocatePrefetchInstr = 0;
  50   if( AllocatePrefetchInstr > 1 ) AllocatePrefetchInstr = 0;
  51 
  52   // Allocation prefetch settings
  53   intx cache_line_size = prefetch_data_size();
  54   if( cache_line_size > AllocatePrefetchStepSize )
  55     AllocatePrefetchStepSize = cache_line_size;
  56 
  57   assert(AllocatePrefetchLines > 0, "invalid value");
  58   if( AllocatePrefetchLines < 1 )     // set valid value in product VM
  59     AllocatePrefetchLines = 3;
  60   assert(AllocateInstancePrefetchLines > 0, "invalid value");
  61   if( AllocateInstancePrefetchLines < 1 ) // set valid value in product VM
  62     AllocateInstancePrefetchLines = 1;
  63 
  64   AllocatePrefetchDistance = allocate_prefetch_distance();
  65   AllocatePrefetchStyle    = allocate_prefetch_style();
  66 
  67   assert((AllocatePrefetchDistance % AllocatePrefetchStepSize) == 0 &&
  68          (AllocatePrefetchDistance > 0), "invalid value");
  69   if ((AllocatePrefetchDistance % AllocatePrefetchStepSize) != 0 ||
  70       (AllocatePrefetchDistance <= 0)) {
  71     AllocatePrefetchDistance = AllocatePrefetchStepSize;
  72   }
  73 
  74   if (AllocatePrefetchStyle == 3 && !has_blk_init()) {
  75     warning("BIS instructions are not available on this CPU");
  76     FLAG_SET_DEFAULT(AllocatePrefetchStyle, 1);
  77   }
  78 
  79   guarantee(VM_Version::has_v9(), "only SPARC v9 is supported");
  80 
  81   assert(ArraycopySrcPrefetchDistance < 4096, "invalid value");
  82   if (ArraycopySrcPrefetchDistance >= 4096)
  83     ArraycopySrcPrefetchDistance = 4064;
  84   assert(ArraycopyDstPrefetchDistance < 4096, "invalid value");
  85   if (ArraycopyDstPrefetchDistance >= 4096)
  86     ArraycopyDstPrefetchDistance = 4064;
  87 
  88   UseSSE = 0; // Only on x86 and x64
  89 
  90   _supports_cx8 = has_v9();
  91   _supports_atomic_getset4 = true; // swap instruction
  92 
  93   // There are Fujitsu Sparc64 CPUs which support blk_init as well so
  94   // we have to take this check out of the 'is_niagara()' block below.
  95   if (has_blk_init()) {
  96     // When using CMS or G1, we cannot use memset() in BOT updates
  97     // because the sun4v/CMT version in libc_psr uses BIS which
  98     // exposes "phantom zeros" to concurrent readers. See 6948537.
  99     if (FLAG_IS_DEFAULT(UseMemSetInBOT) && (UseConcMarkSweepGC || UseG1GC)) {
 100       FLAG_SET_DEFAULT(UseMemSetInBOT, false);




  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "asm/macroAssembler.inline.hpp"
  27 #include "memory/resourceArea.hpp"
  28 #include "runtime/java.hpp"
  29 #include "runtime/stubCodeGenerator.hpp"
  30 #include "vm_version_sparc.hpp"
  31 #ifdef TARGET_OS_FAMILY_linux
  32 # include "os_linux.inline.hpp"
  33 #endif
  34 #ifdef TARGET_OS_FAMILY_solaris
  35 # include "os_solaris.inline.hpp"
  36 #endif
  37 
  38 int VM_Version::_features = VM_Version::unknown_m;
  39 const char* VM_Version::_features_str = "";
  40 unsigned int VM_Version::_L2_data_cache_line_size = 0;
  41 
  42 void VM_Version::initialize() {
  43 
  44   assert(_features != VM_Version::unknown_m, "System pre-initialization is not complete.");
  45   guarantee(VM_Version::has_v9(), "only SPARC v9 is supported");
  46 
  47   PrefetchCopyIntervalInBytes = prefetch_copy_interval_in_bytes();
  48   PrefetchScanIntervalInBytes = prefetch_scan_interval_in_bytes();
  49   PrefetchFieldsAhead         = prefetch_fields_ahead();
  50 
  51   assert(0 <= AllocatePrefetchInstr && AllocatePrefetchInstr <= 1, "invalid value");
  52   if( AllocatePrefetchInstr < 0 ) AllocatePrefetchInstr = 0;
  53   if( AllocatePrefetchInstr > 1 ) AllocatePrefetchInstr = 0;
  54 
  55   // Allocation prefetch settings
  56   intx cache_line_size = prefetch_data_size();
  57   if( cache_line_size > AllocatePrefetchStepSize )
  58     AllocatePrefetchStepSize = cache_line_size;
  59 
  60   assert(AllocatePrefetchLines > 0, "invalid value");
  61   if( AllocatePrefetchLines < 1 )     // set valid value in product VM
  62     AllocatePrefetchLines = 3;
  63   assert(AllocateInstancePrefetchLines > 0, "invalid value");
  64   if( AllocateInstancePrefetchLines < 1 ) // set valid value in product VM
  65     AllocateInstancePrefetchLines = 1;
  66 
  67   AllocatePrefetchDistance = allocate_prefetch_distance();
  68   AllocatePrefetchStyle    = allocate_prefetch_style();
  69 
  70   assert((AllocatePrefetchDistance % AllocatePrefetchStepSize) == 0 &&
  71          (AllocatePrefetchDistance > 0), "invalid value");
  72   if ((AllocatePrefetchDistance % AllocatePrefetchStepSize) != 0 ||
  73       (AllocatePrefetchDistance <= 0)) {
  74     AllocatePrefetchDistance = AllocatePrefetchStepSize;
  75   }
  76 
  77   if (AllocatePrefetchStyle == 3 && !has_blk_init()) {
  78     warning("BIS instructions are not available on this CPU");
  79     FLAG_SET_DEFAULT(AllocatePrefetchStyle, 1);
  80   }
  81 


  82   assert(ArraycopySrcPrefetchDistance < 4096, "invalid value");
  83   if (ArraycopySrcPrefetchDistance >= 4096)
  84     ArraycopySrcPrefetchDistance = 4064;
  85   assert(ArraycopyDstPrefetchDistance < 4096, "invalid value");
  86   if (ArraycopyDstPrefetchDistance >= 4096)
  87     ArraycopyDstPrefetchDistance = 4064;
  88 
  89   UseSSE = 0; // Only on x86 and x64
  90 
  91   _supports_cx8 = has_v9();
  92   _supports_atomic_getset4 = true; // swap instruction
  93 
  94   // There are Fujitsu Sparc64 CPUs which support blk_init as well so
  95   // we have to take this check out of the 'is_niagara()' block below.
  96   if (has_blk_init()) {
  97     // When using CMS or G1, we cannot use memset() in BOT updates
  98     // because the sun4v/CMT version in libc_psr uses BIS which
  99     // exposes "phantom zeros" to concurrent readers. See 6948537.
 100     if (FLAG_IS_DEFAULT(UseMemSetInBOT) && (UseConcMarkSweepGC || UseG1GC)) {
 101       FLAG_SET_DEFAULT(UseMemSetInBOT, false);