Skip to content

Commit 1e3ae3b

Browse files
committedDec 15, 2021
8202579: Revisit VM_Version and VM_Version_ext for overlap and consolidation
Reviewed-by: dholmes, hseigel
1 parent 7adf7f3 commit 1e3ae3b

33 files changed

+1146
-1867
lines changed
 

‎src/hotspot/cpu/aarch64/vm_version_aarch64.cpp

+19
Original file line numberDiff line numberDiff line change
@@ -488,3 +488,22 @@ void VM_Version::initialize() {
488488

489489
_spin_wait = get_spin_wait_desc();
490490
}
491+
492+
void VM_Version::initialize_cpu_information(void) {
493+
// do nothing if cpu info has been initialized
494+
if (_initialized) {
495+
return;
496+
}
497+
498+
_no_of_cores = os::processor_count();
499+
_no_of_threads = _no_of_cores;
500+
_no_of_sockets = _no_of_cores;
501+
snprintf(_cpu_name, CPU_TYPE_DESC_BUF_SIZE - 1, "AArch64");
502+
503+
int desc_len = snprintf(_cpu_desc, CPU_DETAILED_DESC_BUF_SIZE, "AArch64 ");
504+
get_compatible_board(_cpu_desc + desc_len, CPU_DETAILED_DESC_BUF_SIZE - desc_len);
505+
desc_len = (int)strlen(_cpu_desc);
506+
snprintf(_cpu_desc + desc_len, CPU_DETAILED_DESC_BUF_SIZE - desc_len, " %s", _features_string);
507+
508+
_initialized = true;
509+
}

‎src/hotspot/cpu/aarch64/vm_version_aarch64.hpp

+3
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ class VM_Version : public Abstract_VM_Version {
153153
// Is the CPU running emulated (for example macOS Rosetta running x86_64 code on M1 ARM (aarch64)
154154
static bool is_cpu_emulated();
155155
#endif
156+
157+
static void initialize_cpu_information(void);
158+
156159
};
157160

158161
#endif // CPU_AARCH64_VM_VERSION_AARCH64_HPP

‎src/hotspot/cpu/aarch64/vm_version_ext_aarch64.cpp

-96
This file was deleted.

‎src/hotspot/cpu/aarch64/vm_version_ext_aarch64.hpp

-54
This file was deleted.

‎src/hotspot/cpu/arm/vm_version_arm.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ class VM_Version: public Abstract_VM_Version {
106106

107107
friend class VM_Version_StubGenerator;
108108

109+
static void initialize_cpu_information(void);
109110
};
110111

111112
#endif // CPU_ARM_VM_VERSION_ARM_HPP

‎src/hotspot/cpu/arm/vm_version_arm_32.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -347,3 +347,17 @@ void VM_Version::initialize() {
347347

348348
_is_initialized = true;
349349
}
350+
351+
void VM_Version::initialize_cpu_information(void) {
352+
// do nothing if cpu info has been initialized
353+
if (_initialized) {
354+
return;
355+
}
356+
357+
_no_of_cores = os::processor_count();
358+
_no_of_threads = _no_of_cores;
359+
_no_of_sockets = _no_of_cores;
360+
snprintf(_cpu_name, CPU_TYPE_DESC_BUF_SIZE - 1, "ARM%d", _arm_arch);
361+
snprintf(_cpu_desc, CPU_DETAILED_DESC_BUF_SIZE, "%s", _features_string);
362+
_initialized = true;
363+
}

‎src/hotspot/cpu/arm/vm_version_ext_arm.cpp

-90
This file was deleted.

‎src/hotspot/cpu/arm/vm_version_ext_arm.hpp

-54
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.