18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
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/os.hpp"
30 #include "runtime/stubCodeGenerator.hpp"
31 #include "vm_version_sparc.hpp"
32
33 int VM_Version::_features = VM_Version::unknown_m;
34 const char* VM_Version::_features_str = "";
35 unsigned int VM_Version::_L2_data_cache_line_size = 0;
36
37 void VM_Version::initialize() {
38 _features = determine_features();
39 PrefetchCopyIntervalInBytes = prefetch_copy_interval_in_bytes();
40 PrefetchScanIntervalInBytes = prefetch_scan_interval_in_bytes();
41 PrefetchFieldsAhead = prefetch_fields_ahead();
42
43 // Allocation prefetch settings
44 intx cache_line_size = prefetch_data_size();
45 if( cache_line_size > AllocatePrefetchStepSize )
46 AllocatePrefetchStepSize = cache_line_size;
47
48 assert(AllocatePrefetchLines > 0, "invalid value");
49 if( AllocatePrefetchLines < 1 ) // set valid value in product VM
50 AllocatePrefetchLines = 3;
51 assert(AllocateInstancePrefetchLines > 0, "invalid value");
52 if( AllocateInstancePrefetchLines < 1 ) // set valid value in product VM
53 AllocateInstancePrefetchLines = 1;
54
55 AllocatePrefetchDistance = allocate_prefetch_distance();
56 AllocatePrefetchStyle = allocate_prefetch_style();
57
58 if (AllocatePrefetchStyle == 3 && !has_blk_init()) {
59 warning("BIS instructions are not available on this CPU");
60 FLAG_SET_DEFAULT(AllocatePrefetchStyle, 1);
61 }
62
63 guarantee(VM_Version::has_v9(), "only SPARC v9 is supported");
64
65 UseSSE = 0; // Only on x86 and x64
66
67 _supports_cx8 = has_v9();
68 _supports_atomic_getset4 = true; // swap instruction
69
70 if (is_niagara()) {
71 // Indirect branch is the same cost as direct
72 if (FLAG_IS_DEFAULT(UseInlineCaches)) {
73 FLAG_SET_DEFAULT(UseInlineCaches, false);
74 }
75 // Align loops on a single instruction boundary.
76 if (FLAG_IS_DEFAULT(OptoLoopAlignment)) {
77 FLAG_SET_DEFAULT(OptoLoopAlignment, 4);
78 }
79 #ifdef _LP64
80 // 32-bit oops don't make sense for the 64-bit VM on sparc
81 // since the 32-bit VM has the same registers and smaller objects.
82 Universe::set_narrow_oop_shift(LogMinObjAlignmentInBytes);
83 Universe::set_narrow_klass_shift(LogKlassAlignmentInBytes);
|
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
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/os.hpp"
30 #include "runtime/stubCodeGenerator.hpp"
31 #include "vm_version_sparc.hpp"
32
33 int VM_Version::_features = VM_Version::unknown_m;
34 const char* VM_Version::_features_str = "";
35 unsigned int VM_Version::_L2_data_cache_line_size = 0;
36
37 void VM_Version::initialize() {
38
39 assert(_features != VM_Version::unknown_m, "System pre-initialization is not complete.");
40 guarantee(VM_Version::has_v9(), "only SPARC v9 is supported");
41
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 = prefetch_data_size();
48 if( cache_line_size > AllocatePrefetchStepSize )
49 AllocatePrefetchStepSize = cache_line_size;
50
51 assert(AllocatePrefetchLines > 0, "invalid value");
52 if( AllocatePrefetchLines < 1 ) // set valid value in product VM
53 AllocatePrefetchLines = 3;
54 assert(AllocateInstancePrefetchLines > 0, "invalid value");
55 if( AllocateInstancePrefetchLines < 1 ) // set valid value in product VM
56 AllocateInstancePrefetchLines = 1;
57
58 AllocatePrefetchDistance = allocate_prefetch_distance();
59 AllocatePrefetchStyle = allocate_prefetch_style();
60
61 if (AllocatePrefetchStyle == 3 && !has_blk_init()) {
62 warning("BIS instructions are not available on this CPU");
63 FLAG_SET_DEFAULT(AllocatePrefetchStyle, 1);
64 }
65
66 UseSSE = 0; // Only on x86 and x64
67
68 _supports_cx8 = has_v9();
69 _supports_atomic_getset4 = true; // swap instruction
70
71 if (is_niagara()) {
72 // Indirect branch is the same cost as direct
73 if (FLAG_IS_DEFAULT(UseInlineCaches)) {
74 FLAG_SET_DEFAULT(UseInlineCaches, false);
75 }
76 // Align loops on a single instruction boundary.
77 if (FLAG_IS_DEFAULT(OptoLoopAlignment)) {
78 FLAG_SET_DEFAULT(OptoLoopAlignment, 4);
79 }
80 #ifdef _LP64
81 // 32-bit oops don't make sense for the 64-bit VM on sparc
82 // since the 32-bit VM has the same registers and smaller objects.
83 Universe::set_narrow_oop_shift(LogMinObjAlignmentInBytes);
84 Universe::set_narrow_klass_shift(LogKlassAlignmentInBytes);
|