hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp
changeset 46547 e1b926a0b23f
parent 46381 020219e46c86
child 46560 388aa8d67c80
equal deleted inserted replaced
46546:4dba7f5446f3 46547:e1b926a0b23f
    35 
    35 
    36 void VM_Version::initialize() {
    36 void VM_Version::initialize() {
    37   assert(_features != 0, "System pre-initialization is not complete.");
    37   assert(_features != 0, "System pre-initialization is not complete.");
    38   guarantee(VM_Version::has_v9(), "only SPARC v9 is supported");
    38   guarantee(VM_Version::has_v9(), "only SPARC v9 is supported");
    39 
    39 
    40   PrefetchCopyIntervalInBytes = prefetch_copy_interval_in_bytes();
    40   if (FLAG_IS_DEFAULT(PrefetchCopyIntervalInBytes)) {
    41   PrefetchScanIntervalInBytes = prefetch_scan_interval_in_bytes();
    41     FLAG_SET_DEFAULT(PrefetchCopyIntervalInBytes, prefetch_copy_interval_in_bytes());
    42   PrefetchFieldsAhead         = prefetch_fields_ahead();
    42   }
       
    43   if (FLAG_IS_DEFAULT(PrefetchScanIntervalInBytes)) {
       
    44     FLAG_SET_DEFAULT(PrefetchScanIntervalInBytes, prefetch_scan_interval_in_bytes());
       
    45   }
       
    46   if (FLAG_IS_DEFAULT(PrefetchFieldsAhead)) {
       
    47     FLAG_SET_DEFAULT(PrefetchFieldsAhead, prefetch_fields_ahead());
       
    48   }
    43 
    49 
    44   // Allocation prefetch settings
    50   // Allocation prefetch settings
    45   intx cache_line_size = prefetch_data_size();
    51   intx cache_line_size = prefetch_data_size();
    46   if( cache_line_size > AllocatePrefetchStepSize )
    52   if (FLAG_IS_DEFAULT(AllocatePrefetchStepSize) &&
    47     AllocatePrefetchStepSize = cache_line_size;
    53       (cache_line_size > AllocatePrefetchStepSize)) {
    48 
    54     FLAG_SET_DEFAULT(AllocatePrefetchStepSize, cache_line_size);
    49   AllocatePrefetchDistance = allocate_prefetch_distance();
    55   }
    50   AllocatePrefetchStyle    = allocate_prefetch_style();
    56 
    51 
    57   if (FLAG_IS_DEFAULT(AllocatePrefetchDistance)) {
    52   if (!has_blk_init() || cache_line_size <= 0) {
    58     FLAG_SET_DEFAULT(AllocatePrefetchDistance, 512);
    53     if (AllocatePrefetchInstr == 1) {
    59   }
       
    60 
       
    61   if ((AllocatePrefetchDistance == 0) && (AllocatePrefetchStyle != 0)) {
       
    62     assert(!FLAG_IS_DEFAULT(AllocatePrefetchDistance), "default value should not be 0");
       
    63     if (!FLAG_IS_DEFAULT(AllocatePrefetchStyle)) {
       
    64       warning("AllocatePrefetchDistance is set to 0 which disable prefetching. Ignoring AllocatePrefetchStyle flag.");
       
    65     }
       
    66     FLAG_SET_DEFAULT(AllocatePrefetchStyle, 0);
       
    67   }
       
    68 
       
    69   if ((AllocatePrefetchInstr == 1) && (!has_blk_init() || cache_line_size <= 0)) {
       
    70     if (!FLAG_IS_DEFAULT(AllocatePrefetchInstr)) {
    54       warning("BIS instructions required for AllocatePrefetchInstr 1 unavailable");
    71       warning("BIS instructions required for AllocatePrefetchInstr 1 unavailable");
    55       FLAG_SET_DEFAULT(AllocatePrefetchInstr, 0);
    72     }
    56     }
    73     FLAG_SET_DEFAULT(AllocatePrefetchInstr, 0);
    57   }
    74   }
    58 
    75 
    59   UseSSE = 0; // Only on x86 and x64
    76   UseSSE = 0; // Only on x86 and x64
    60 
    77 
    61   _supports_cx8 = has_v9();
    78   _supports_cx8 = has_v9();
   119           FLAG_SET_ERGO(intx, AllocateInstancePrefetchLines, AllocateInstancePrefetchLines*2);
   136           FLAG_SET_ERGO(intx, AllocateInstancePrefetchLines, AllocateInstancePrefetchLines*2);
   120         }
   137         }
   121       }
   138       }
   122     }
   139     }
   123 
   140 
   124     if (AllocatePrefetchInstr == 1) {
   141     if ((AllocatePrefetchInstr == 1) && (AllocatePrefetchStyle != 3)) {
   125       // Use allocation prefetch style 3 because BIS instructions
   142       if (!FLAG_IS_DEFAULT(AllocatePrefetchStyle)) {
   126       // require aligned memory addresses.
   143         warning("AllocatePrefetchStyle set to 3 because BIS instructions require aligned memory addresses");
       
   144       }
   127       FLAG_SET_DEFAULT(AllocatePrefetchStyle, 3);
   145       FLAG_SET_DEFAULT(AllocatePrefetchStyle, 3);
   128     }
   146     }
   129 #endif /* COMPILER2 */
   147 #endif /* COMPILER2 */
   130   }
   148   }
   131 
   149