提交 113e45b6 编写于 作者: K kvn

7014998: assert(is_T_family(features) == is_niagara(features)) failed: Niagara should be T series

Summary: Use substring search instead of compare and convert string to upper case before search.
Reviewed-by: never, phh, iveresov
上级 67299e6d
/* /*
* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -189,14 +189,22 @@ int VM_Version::platform_features(int features) { ...@@ -189,14 +189,22 @@ int VM_Version::platform_features(int features) {
tty->print_cr("cpu_info.implementation: %s", implementation); tty->print_cr("cpu_info.implementation: %s", implementation);
} }
#endif #endif
if (strncmp(implementation, "SPARC64", 7) == 0) { // Convert to UPPER case before compare.
char* impl = strdup(implementation);
for (int i = 0; impl[i] != 0; i++)
impl[i] = (char)toupper((uint)impl[i]);
if (strstr(impl, "SPARC64") != NULL) {
features |= sparc64_family_m; features |= sparc64_family_m;
} else if (strncmp(implementation, "UltraSPARC-T", 12) == 0) { } else if (strstr(impl, "SPARC-T") != NULL) {
features |= T_family_m; features |= T_family_m;
if (strncmp(implementation, "UltraSPARC-T1", 13) == 0) { if (strstr(impl, "SPARC-T1") != NULL) {
features |= T1_model_m; features |= T1_model_m;
} }
} else {
assert(strstr(impl, "SPARC") != NULL, "should be sparc");
} }
free((void*)impl);
break; break;
} }
} // for( } // for(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册