diff src/share/vm/graal/graalCodeInstaller.cpp @ 3550:aee1479c0a4b

Use 2 different marks for NEAR/FAR polling : fixes wrong polling addresse problem after relocation
author Gilles Duboscq <gilles.duboscq@oracle.com>
date Mon, 22 Aug 2011 14:39:05 +0200
parents 25765a764212
children b20889b42d12
line wrap: on
line diff
--- a/src/share/vm/graal/graalCodeInstaller.cpp	Fri Aug 19 17:28:37 2011 +0200
+++ b/src/share/vm/graal/graalCodeInstaller.cpp	Mon Aug 22 14:39:05 2011 +0200
@@ -804,10 +804,22 @@
       case MARK_IMPLICIT_NULL:
         _implicit_exception_table.append(pc_offset, pc_offset);
         break;
-      case MARK_POLL:
+      case MARK_POLL_NEAR: {
+        NativeInstruction* ni = nativeInstruction_at(instruction);
+        int32_t* disp = (int32_t*) Assembler::locate_operand(instruction, Assembler::disp32_operand);
+        intptr_t new_disp = (intptr_t) (os::get_polling_page() + (SafepointPollOffset % os::vm_page_size())) - (intptr_t) ni;
+        *disp = (int32_t)new_disp;
+      }
+      case MARK_POLL_FAR:
         _instructions->relocate(instruction, relocInfo::poll_type);
         break;
-      case MARK_POLL_RETURN:
+      case MARK_POLL_RETURN_NEAR: {
+        NativeInstruction* ni = nativeInstruction_at(instruction);
+        int32_t* disp = (int32_t*) Assembler::locate_operand(instruction, Assembler::disp32_operand);
+        intptr_t new_disp = (intptr_t) (os::get_polling_page() + (SafepointPollOffset % os::vm_page_size())) - (intptr_t) ni;
+        *disp = (int32_t)new_disp;
+      }
+      case MARK_POLL_RETURN_FAR:
         _instructions->relocate(instruction, relocInfo::poll_return_type);
         break;
       case MARK_KLASS_PATCHING: