# HG changeset patch # User Lukas Stadler # Date 1353932372 -3600 # Node ID be508977fb47a6d0756c6cdf1173c8d71222ea70 # Parent 231cfb5490d3d4731ab3cabf68fdec868f4c8841# Parent 472609cc3e1054fa244c57063272b06ac29b497e Merge diff -r 231cfb5490d3 -r be508977fb47 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java --- 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); diff -r 231cfb5490d3 -r be508977fb47 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaType.java --- 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(); diff -r 231cfb5490d3 -r be508977fb47 graal/com.oracle.graal.snippets.test/src/com/oracle/graal/snippets/InstanceOfTest.java --- 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); + } } diff -r 231cfb5490d3 -r be508977fb47 src/share/vm/graal/graalCompilerToVM.cpp --- 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());