diff src/share/vm/code/relocInfo.hpp @ 3243:208b6c560ff4

Merge
author vladidan
date Thu, 14 Apr 2011 11:02:05 -0400
parents 6c97c830fb6f
children da91efe96a93
line wrap: on
line diff
--- a/src/share/vm/code/relocInfo.hpp	Tue Apr 12 10:32:42 2011 -0400
+++ b/src/share/vm/code/relocInfo.hpp	Thu Apr 14 11:02:05 2011 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -703,6 +703,10 @@
     assert(datalen()==0 || type()==relocInfo::none, "no data here");
   }
 
+  static bool is_reloc_index(intptr_t index) {
+    return 0 < index && index < os::vm_page_size();
+  }
+
  protected:
   // Helper functions for pack_data_to() and unpack_data().
 
@@ -1127,6 +1131,12 @@
     return rh;
   }
 
+  // Some address looking values aren't safe to treat as relocations
+  // and should just be treated as constants.
+  static bool can_be_relocated(address target) {
+    return target != NULL && !is_reloc_index((intptr_t)target);
+  }
+
  private:
   address _target;                  // address in runtime