--- a/hotspot/src/share/vm/opto/library_call.cpp Thu Jul 07 15:07:13 2016 +0100
+++ b/hotspot/src/share/vm/opto/library_call.cpp Thu Jul 07 15:39:12 2016 +0100
@@ -2337,6 +2337,8 @@
return false;
}
mismatched = (bt != type);
+ } else if (alias_type->adr_type() == TypeOopPtr::BOTTOM) {
+ mismatched = true; // conservatively mark all "wide" on-heap accesses as mismatched
}
// First guess at the value type.
--- a/hotspot/src/share/vm/opto/memnode.cpp Thu Jul 07 15:07:13 2016 +0100
+++ b/hotspot/src/share/vm/opto/memnode.cpp Thu Jul 07 15:39:12 2016 +0100
@@ -1713,9 +1713,6 @@
}
}
} else if (tp->base() == Type::InstPtr) {
- ciEnv* env = C->env();
- const TypeInstPtr* tinst = tp->is_instptr();
- ciKlass* klass = tinst->klass();
assert( off != Type::OffsetBot ||
// arrays can be cast to Objects
tp->is_oopptr()->klass()->is_java_lang_Object() ||
@@ -1723,9 +1720,11 @@
C->has_unsafe_access(),
"Field accesses must be precise" );
// For oop loads, we expect the _type to be precise.
- // Optimizations for constant objects
+
+ // Optimize loads from constant fields.
+ const TypeInstPtr* tinst = tp->is_instptr();
ciObject* const_oop = tinst->const_oop();
- if (const_oop != NULL && const_oop->is_instance()) {
+ if (!is_mismatched_access() && off != Type::OffsetBot && const_oop != NULL && const_oop->is_instance()) {
const Type* con_type = Type::make_constant_from_field(const_oop->as_instance(), off, is_unsigned(), memory_type());
if (con_type != NULL) {
return con_type;
--- a/hotspot/src/share/vm/opto/type.hpp Thu Jul 07 15:07:13 2016 +0100
+++ b/hotspot/src/share/vm/opto/type.hpp Thu Jul 07 15:39:12 2016 +0100
@@ -936,7 +936,7 @@
};
//------------------------------TypeOopPtr-------------------------------------
-// Some kind of oop (Java pointer), either klass or instance or array.
+// Some kind of oop (Java pointer), either instance or array.
class TypeOopPtr : public TypePtr {
protected:
TypeOopPtr(TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id,
--- a/hotspot/test/testlibrary_tests/ctw/ClassesDirTest.java Thu Jul 07 15:07:13 2016 +0100
+++ b/hotspot/test/testlibrary_tests/ctw/ClassesDirTest.java Thu Jul 07 15:39:12 2016 +0100
@@ -25,7 +25,8 @@
* @test
* @bug 8012447
* @library /testlibrary /test/lib /testlibrary/ctw/src
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.jimage
+ * java.base/jdk.internal.misc
* java.base/jdk.internal.reflect
* java.management
* @build ClassFileInstaller sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
--- a/hotspot/test/testlibrary_tests/ctw/ClassesListTest.java Thu Jul 07 15:07:13 2016 +0100
+++ b/hotspot/test/testlibrary_tests/ctw/ClassesListTest.java Thu Jul 07 15:39:12 2016 +0100
@@ -25,7 +25,8 @@
* @test
* @bug 8012447
* @library /testlibrary /test/lib /testlibrary/ctw/src
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.jimage
+ * java.base/jdk.internal.misc
* java.base/jdk.internal.reflect
* java.management
* @build ClassFileInstaller sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
--- a/hotspot/test/testlibrary_tests/ctw/JarDirTest.java Thu Jul 07 15:07:13 2016 +0100
+++ b/hotspot/test/testlibrary_tests/ctw/JarDirTest.java Thu Jul 07 15:39:12 2016 +0100
@@ -25,7 +25,8 @@
* @test
* @bug 8012447
* @library /testlibrary /test/lib /testlibrary/ctw/src
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.jimage
+ * java.base/jdk.internal.misc
* java.base/jdk.internal.reflect
* java.compiler
* java.management
--- a/hotspot/test/testlibrary_tests/ctw/JarsTest.java Thu Jul 07 15:07:13 2016 +0100
+++ b/hotspot/test/testlibrary_tests/ctw/JarsTest.java Thu Jul 07 15:39:12 2016 +0100
@@ -25,7 +25,8 @@
* @test
* @bug 8012447
* @library /testlibrary /test/lib /testlibrary/ctw/src
- * @modules java.base/jdk.internal.misc
+ * @modules java.base/jdk.internal.jimage
+ * java.base/jdk.internal.misc
* java.base/jdk.internal.reflect
* java.compiler
* java.management