8160177: [JVMCI] race condition in HotSpotMemoryAccessProviderImpl.verifyReadRawObject

Reviewed-by: kvn
This commit is contained in:
Roland Schatz 2016-06-24 15:45:47 +00:00
parent 87f15c2bcf
commit 1ecfe15d17

View File

@ -109,13 +109,7 @@ class HotSpotMemoryAccessProviderImpl implements HotSpotMemoryAccessProvider {
}
}
private boolean verifyReadRawObject(Object expected, Constant base, long displacement, boolean compressed) {
if (compressed == runtime.getConfig().useCompressedOops) {
Object obj = asObject(base);
if (obj != null) {
assert expected == UNSAFE.getObject(obj, displacement) : "readUnsafeOop doesn't agree with unsafe.getObject";
}
}
private boolean verifyReadRawObject(Object expected, Constant base, long displacement) {
if (base instanceof HotSpotMetaspaceConstant) {
MetaspaceWrapperObject metaspaceObject = HotSpotMetaspaceConstantImpl.getMetaspaceObject(base);
if (metaspaceObject instanceof HotSpotResolvedObjectTypeImpl) {
@ -136,11 +130,11 @@ class HotSpotMemoryAccessProviderImpl implements HotSpotMemoryAccessProvider {
assert !compressed;
displacement += asRawPointer(baseConstant);
ret = UNSAFE.getUncompressedObject(displacement);
assert verifyReadRawObject(ret, baseConstant, initialDisplacement);
} else {
assert runtime.getConfig().useCompressedOops == compressed;
ret = UNSAFE.getObject(base, displacement);
}
assert verifyReadRawObject(ret, baseConstant, initialDisplacement, compressed);
return ret;
}