src/hotspot/cpu/s390/s390.ad
changeset 48332 651a95f30dfb
parent 48094 bca569f79fa1
child 49943 8e1ed2a15845
--- a/src/hotspot/cpu/s390/s390.ad	Thu Dec 14 12:02:16 2017 +0100
+++ b/src/hotspot/cpu/s390/s390.ad	Thu Dec 14 13:05:20 2017 +0100
@@ -919,8 +919,12 @@
 
   // Touch the polling page.
   if (need_polling) {
-    AddressLiteral pp(os::get_polling_page());
-    __ load_const_optimized(Z_R1_scratch, pp);
+    if (SafepointMechanism::uses_thread_local_poll()) {
+      __ z_lg(Z_R1_scratch, Address(Z_thread, Thread::polling_page_offset()));
+    } else {
+      AddressLiteral pp(os::get_polling_page());
+      __ load_const_optimized(Z_R1_scratch, pp);
+    }
     // We need to mark the code position where the load from the safepoint
     // polling page was emitted as relocInfo::poll_return_type here.
     __ relocate(relocInfo::poll_return_type);