132 AllocatePrefetchStepSize = cache_line_size; // Need exact value.
133 if (FLAG_IS_DEFAULT(AllocatePrefetchLines)) AllocatePrefetchLines = 12; // Use larger blocks by default.
134 if (AllocatePrefetchDistance < 0) AllocatePrefetchDistance = 2*cache_line_size; // Default is not defined?
135 } else {
136 if (cache_line_size > AllocatePrefetchStepSize) AllocatePrefetchStepSize = cache_line_size;
137 if (FLAG_IS_DEFAULT(AllocatePrefetchLines)) AllocatePrefetchLines = 3; // Optimistic value.
138 if (AllocatePrefetchDistance < 0) AllocatePrefetchDistance = 3*cache_line_size; // Default is not defined?
139 }
140
141 assert(AllocatePrefetchLines > 0, "invalid value");
142 if (AllocatePrefetchLines < 1) // Set valid value in product VM.
143 AllocatePrefetchLines = 1; // Conservative value.
144
145 if (AllocatePrefetchStyle == 3 && AllocatePrefetchDistance < cache_line_size)
146 AllocatePrefetchStyle = 1; // Fall back if inappropriate.
147
148 assert(AllocatePrefetchStyle >= 0, "AllocatePrefetchStyle should be positive");
149 }
150
151 void VM_Version::print_features() {
152 tty->print_cr("Version: %s cache_line_size = %d", cpu_features(), get_cache_line_size());
153 }
154
155 #ifdef COMPILER2
156 // Determine section size on power6: If section size is 8 instructions,
157 // there should be a difference between the two testloops of ~15 %. If
158 // no difference is detected the section is assumed to be 32 instructions.
159 void VM_Version::determine_section_size() {
160
161 int unroll = 80;
162
163 const int code_size = (2* unroll * 32 + 100)*BytesPerInstWord;
164
165 // Allocate space for the code.
166 ResourceMark rm;
167 CodeBuffer cb("detect_section_size", code_size, 0);
168 MacroAssembler* a = new MacroAssembler(&cb);
169
170 uint32_t *code = (uint32_t *)a->pc();
171 // Emit code.
172 void (*test1)() = (void(*)())(void *)a->function_entry();
|
132 AllocatePrefetchStepSize = cache_line_size; // Need exact value.
133 if (FLAG_IS_DEFAULT(AllocatePrefetchLines)) AllocatePrefetchLines = 12; // Use larger blocks by default.
134 if (AllocatePrefetchDistance < 0) AllocatePrefetchDistance = 2*cache_line_size; // Default is not defined?
135 } else {
136 if (cache_line_size > AllocatePrefetchStepSize) AllocatePrefetchStepSize = cache_line_size;
137 if (FLAG_IS_DEFAULT(AllocatePrefetchLines)) AllocatePrefetchLines = 3; // Optimistic value.
138 if (AllocatePrefetchDistance < 0) AllocatePrefetchDistance = 3*cache_line_size; // Default is not defined?
139 }
140
141 assert(AllocatePrefetchLines > 0, "invalid value");
142 if (AllocatePrefetchLines < 1) // Set valid value in product VM.
143 AllocatePrefetchLines = 1; // Conservative value.
144
145 if (AllocatePrefetchStyle == 3 && AllocatePrefetchDistance < cache_line_size)
146 AllocatePrefetchStyle = 1; // Fall back if inappropriate.
147
148 assert(AllocatePrefetchStyle >= 0, "AllocatePrefetchStyle should be positive");
149 }
150
151 void VM_Version::print_features() {
152 tty->print_cr("Version: %s cache_line_size = %d", cpu_features(), (int) get_cache_line_size());
153 }
154
155 #ifdef COMPILER2
156 // Determine section size on power6: If section size is 8 instructions,
157 // there should be a difference between the two testloops of ~15 %. If
158 // no difference is detected the section is assumed to be 32 instructions.
159 void VM_Version::determine_section_size() {
160
161 int unroll = 80;
162
163 const int code_size = (2* unroll * 32 + 100)*BytesPerInstWord;
164
165 // Allocate space for the code.
166 ResourceMark rm;
167 CodeBuffer cb("detect_section_size", code_size, 0);
168 MacroAssembler* a = new MacroAssembler(&cb);
169
170 uint32_t *code = (uint32_t *)a->pc();
171 // Emit code.
172 void (*test1)() = (void(*)())(void *)a->function_entry();
|