8155244: JVMCI: MemoryAccessProvider.readUnsafeConstant javadoc should be updated for null JavaKind case

Reviewed-by: twisti
This commit is contained in:
Dmitrij Pochepko 2016-05-02 03:20:23 +03:00
parent 17ee5a98f3
commit 7982dafac2
2 changed files with 5 additions and 2 deletions

View File

@ -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);

View File

@ -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;