Mercurial > hg > graal-jvmci-8
changeset 7023:be508977fb47
Merge
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Mon, 26 Nov 2012 13:19:32 +0100 |
parents | 231cfb5490d3 (current diff) 472609cc3e10 (diff) |
children | 24950e93b962 |
files | |
diffstat | 4 files changed, 28 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java Mon Nov 26 12:03:46 2012 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java Mon Nov 26 13:19:32 2012 +0100 @@ -123,7 +123,7 @@ * @param code if not null, then the code is installed as the non-default compiled code for the associated method * and the details of the installation are written to this object * @param info additional information about the installation are written to this object if it is not null - * @return the value of {@code code} + * @return the value of {@code code} if installation was successful, null otherwise */ HotSpotInstalledCode installCode(HotSpotCompilationResult compResult, HotSpotInstalledCode code, HotSpotCodeInfo info);
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaType.java Mon Nov 26 12:03:46 2012 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaType.java Mon Nov 26 13:19:32 2012 +0100 @@ -160,7 +160,7 @@ @Override public ResolvedJavaType findUniqueConcreteSubtype() { if (isArrayClass()) { - return getComponentType().findUniqueConcreteSubtype() != null ? this : null; + return getComponentType().findUniqueConcreteSubtype() == getComponentType() ? this : null; } else { ResolvedJavaType subtype = (ResolvedJavaType) HotSpotGraalRuntime.getInstance().getCompilerToVM().getUniqueConcreteSubtype(this); assert subtype == null || !subtype.isInterface();
--- a/graal/com.oracle.graal.snippets.test/src/com/oracle/graal/snippets/InstanceOfTest.java Mon Nov 26 12:03:46 2012 +0100 +++ b/graal/com.oracle.graal.snippets.test/src/com/oracle/graal/snippets/InstanceOfTest.java Mon Nov 26 13:19:32 2012 +0100 @@ -324,4 +324,25 @@ } return b; } + + abstract static class A {} + static class B extends A {} + + public static boolean isArrayOfA(Object o) { + return o instanceof A[]; + } + + public static boolean isArrayOfB(Object o) { + return o instanceof A[]; + } + + @Test + public void testArray() { + Object bArray = new A[10]; + Object aArray = new B[10]; + test("isArrayOfA", aArray); + test("isArrayOfA", bArray); + test("isArrayOfB", aArray); + test("isArrayOfB", bArray); + } }
--- a/src/share/vm/graal/graalCompilerToVM.cpp Mon Nov 26 12:03:46 2012 +0100 +++ b/src/share/vm/graal/graalCompilerToVM.cpp Mon Nov 26 13:19:32 2012 +0100 @@ -776,6 +776,11 @@ Handle installed_code_handle = JNIHandles::resolve(installed_code); CodeInstaller installer(compResultHandle, method, nm, installed_code_handle); + if (nm == NULL) { + // dependency (re)checking failed + return NULL; + } + if (info != NULL) { arrayOop codeCopy = oopFactory::new_byteArray(nm->code_size(), CHECK_0); memcpy(codeCopy->base(T_BYTE), nm->code_begin(), nm->code_size());