hotspot/src/share/vm/runtime/stubRoutines.cpp
changeset 31627 a7141b9a8e0f
parent 31515 6aed85dadbe6
parent 31620 53be635ad49c
child 31635 6bf7a358ca17
--- a/hotspot/src/share/vm/runtime/stubRoutines.cpp	Wed Jul 01 09:15:34 2015 +0200
+++ b/hotspot/src/share/vm/runtime/stubRoutines.cpp	Thu Jul 02 14:20:36 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"
@@ -188,6 +189,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];