提交 bdc9068a 编写于 作者: S sjohanss

8062672: JVM crashes during GC on various asserts which checks that HeapWord ptr is an oop

Summary: Crashes were caused by not disabling UseMemSetInBOT as should be done on sparc. Added support for picking up blkinit as a platform feature if available on Linux sparc. This is needed to avoid enabling UseMemSetInBOT when running on this platform.
Reviewed-by: jmasa, brutisso
上级 96f778a3
......@@ -26,8 +26,8 @@
#include "runtime/os.hpp"
#include "vm_version_sparc.hpp"
static bool detect_niagara() {
char cpu[128];
static bool cpuinfo_field_contains(const char* field, const char* value) {
char line[1024];
bool rv = false;
FILE* fp = fopen("/proc/cpuinfo", "r");
......@@ -35,9 +35,10 @@ static bool detect_niagara() {
return rv;
}
while (!feof(fp)) {
if (fscanf(fp, "cpu\t\t: %100[^\n]", &cpu) == 1) {
if (strstr(cpu, "Niagara") != NULL) {
while (fgets(line, sizeof(line), fp) != NULL) {
assert(strlen(line) < sizeof(line) - 1, "buffer line[1024] is too small.");
if (strncmp(line, field, strlen(field)) == 0) {
if (strstr(line, value) != NULL) {
rv = true;
}
break;
......@@ -45,10 +46,17 @@ static bool detect_niagara() {
}
fclose(fp);
return rv;
}
static bool detect_niagara() {
return cpuinfo_field_contains("cpu", "Niagara");
}
static bool detect_blkinit() {
return cpuinfo_field_contains("cpucaps", "blkinit");
}
int VM_Version::platform_features(int features) {
// Default to generic v9
features = generic_v9_m;
......@@ -58,5 +66,9 @@ int VM_Version::platform_features(int features) {
features = niagara1_m | T_family_m;
}
if (detect_blkinit()) {
features |= blk_init_instructions_m;
}
return features;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册