8155244: JVMCI: MemoryAccessProvider.readUnsafeConstant javadoc should be updated for null JavaKind case
Reviewed-by: twisti
This commit is contained in:
parent
17ee5a98f3
commit
7982dafac2
@ -146,6 +146,9 @@ class HotSpotMemoryAccessProviderImpl implements HotSpotMemoryAccessProvider, Ho
|
||||
|
||||
@Override
|
||||
public JavaConstant readUnsafeConstant(JavaKind kind, JavaConstant baseConstant, long displacement) {
|
||||
if (kind == null) {
|
||||
throw new IllegalArgumentException("null JavaKind");
|
||||
}
|
||||
if (kind == JavaKind.Object) {
|
||||
Object o = readRawObject(baseConstant, displacement, runtime.getConfig().useCompressedOops);
|
||||
return HotSpotObjectConstantImpl.forObject(o);
|
||||
|
@ -35,8 +35,8 @@ public interface MemoryAccessProvider {
|
||||
* @param displacement the displacement within the object in bytes
|
||||
* @return the read value encapsulated in a {@link JavaConstant} object, or {@code null} if the
|
||||
* value cannot be read.
|
||||
* @throws IllegalArgumentException if {@code kind} is {@link JavaKind#Void} or not
|
||||
* {@linkplain JavaKind#isPrimitive() primitive} kind
|
||||
* @throws IllegalArgumentException if {@code kind} is {@code null}, {@link JavaKind#Void} or
|
||||
* not {@linkplain JavaKind#isPrimitive() primitive} kind
|
||||
*/
|
||||
JavaConstant readUnsafeConstant(JavaKind kind, JavaConstant base, long displacement) throws IllegalArgumentException;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user