hotspot/src/share/vm/runtime/stubRoutines.cpp
changeset 31635 6bf7a358ca17
parent 31584 24e491478c2f
parent 31627 a7141b9a8e0f
child 32384 d28b2b792dba
--- a/hotspot/src/share/vm/runtime/stubRoutines.cpp	Tue Jul 07 15:04:25 2015 +0000
+++ b/hotspot/src/share/vm/runtime/stubRoutines.cpp	Thu Jul 09 14:35:13 2015 -0700
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "asm/codeBuffer.hpp"
+#include "code/codeCacheExtensions.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/oop.inline.hpp"
 #include "runtime/interfaceSupport.hpp"
@@ -190,6 +191,12 @@
 
 // simple tests of generated arraycopy functions
 static void test_arraycopy_func(address func, int alignment) {
+  if (CodeCacheExtensions::use_pregenerated_interpreter() || !CodeCacheExtensions::is_executable(func)) {
+    // Exit safely if stubs were generated but cannot be used.
+    // Also excluding pregenerated interpreter since the code may depend on
+    // some registers being properly initialized (for instance Rthread)
+    return;
+  }
   int v = 0xcc;
   int v2 = 0x11;
   jlong lbuffer[8];