changeset 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 077add4e3ccc
files src/share/vm/graal/graalCodeInstaller.cpp src/share/vm/graal/graalCodeInstaller.hpp
diffstat 2 files changed, 18 insertions(+), 4 deletions(-) [+]
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:
--- a/src/share/vm/graal/graalCodeInstaller.hpp	Fri Aug 19 17:28:37 2011 +0200
+++ b/src/share/vm/graal/graalCodeInstaller.hpp	Mon Aug 22 14:39:05 2011 +0200
@@ -41,8 +41,10 @@
     MARK_INVOKESPECIAL              = 0x2003,
     MARK_INVOKEVIRTUAL              = 0x2004,
     MARK_IMPLICIT_NULL              = 0x3000,
-    MARK_POLL                       = 0x3001,
-    MARK_POLL_RETURN                = 0x3002,
+    MARK_POLL_NEAR                  = 0x3001,
+    MARK_POLL_RETURN_NEAR           = 0x3002,
+    MARK_POLL_FAR                   = 0x3003,
+    MARK_POLL_RETURN_FAR            = 0x3004,
     MARK_KLASS_PATCHING             = 0x4000,
     MARK_DUMMY_OOP_RELOCATION       = 0x4001,
     MARK_ACCESS_FIELD_PATCHING      = 0x4002