Mercurial > hg > graal-jvmci-8
comparison src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp @ 2247:c52cba2a3359
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
author | kvn |
---|---|
date | Tue, 01 Feb 2011 10:27:02 -0800 |
parents | c04052fd6ae1 |
children | 3d42f82cd811 |
comparison
equal
deleted
inserted
replaced
2246:fbf3184da15d | 2247:c52cba2a3359 |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
187 #ifndef PRODUCT | 187 #ifndef PRODUCT |
188 if (PrintMiscellaneous && Verbose) { | 188 if (PrintMiscellaneous && Verbose) { |
189 tty->print_cr("cpu_info.implementation: %s", implementation); | 189 tty->print_cr("cpu_info.implementation: %s", implementation); |
190 } | 190 } |
191 #endif | 191 #endif |
192 if (strncmp(implementation, "SPARC64", 7) == 0) { | 192 // Convert to UPPER case before compare. |
193 char* impl = strdup(implementation); | |
194 | |
195 for (int i = 0; impl[i] != 0; i++) | |
196 impl[i] = (char)toupper((uint)impl[i]); | |
197 if (strstr(impl, "SPARC64") != NULL) { | |
193 features |= sparc64_family_m; | 198 features |= sparc64_family_m; |
194 } else if (strncmp(implementation, "UltraSPARC-T", 12) == 0) { | 199 } else if (strstr(impl, "SPARC-T") != NULL) { |
195 features |= T_family_m; | 200 features |= T_family_m; |
196 if (strncmp(implementation, "UltraSPARC-T1", 13) == 0) { | 201 if (strstr(impl, "SPARC-T1") != NULL) { |
197 features |= T1_model_m; | 202 features |= T1_model_m; |
198 } | 203 } |
204 } else { | |
205 assert(strstr(impl, "SPARC") != NULL, "should be sparc"); | |
199 } | 206 } |
207 free((void*)impl); | |
200 break; | 208 break; |
201 } | 209 } |
202 } // for( | 210 } // for( |
203 } | 211 } |
204 } | 212 } |