1.1 --- a/src/cpu/sparc/vm/vm_version_sparc.cpp Fri Mar 31 01:25:26 2017 -0700 1.2 +++ b/src/cpu/sparc/vm/vm_version_sparc.cpp Fri Mar 17 07:52:54 2017 -0700 1.3 @@ -459,3 +459,37 @@ 1.4 } 1.5 return result; 1.6 } 1.7 + 1.8 + 1.9 +int VM_Version::parse_features(const char* implementation) { 1.10 + int features = unknown_m; 1.11 + // Convert to UPPER case before compare. 1.12 + char* impl = os::strdup(implementation); 1.13 + 1.14 + for (int i = 0; impl[i] != 0; i++) 1.15 + impl[i] = (char)toupper((uint)impl[i]); 1.16 + 1.17 + if (strstr(impl, "SPARC64") != NULL) { 1.18 + features |= sparc64_family_m; 1.19 + } else if (strstr(impl, "SPARC-M") != NULL) { 1.20 + // M-series SPARC is based on T-series. 1.21 + features |= (M_family_m | T_family_m); 1.22 + } else if (strstr(impl, "SPARC-T") != NULL) { 1.23 + features |= T_family_m; 1.24 + if (strstr(impl, "SPARC-T1") != NULL) { 1.25 + features |= T1_model_m; 1.26 + } 1.27 + } else { 1.28 + if (strstr(impl, "SPARC") == NULL) { 1.29 +#ifndef PRODUCT 1.30 + // kstat on Solaris 8 virtual machines (branded zones) 1.31 + // returns "(unsupported)" implementation. Solaris 8 is not 1.32 + // supported anymore, but include this check to be on the 1.33 + // safe side. 1.34 + warning("Can't parse CPU implementation = '%s', assume generic SPARC", impl); 1.35 +#endif 1.36 + } 1.37 + } 1.38 + os::free((void*)impl); 1.39 + return features; 1.40 +}