hotspot/src/cpu/x86/vm/assembler_x86.hpp
changeset 9111 c100c09c66f2
parent 8882 f852635a6383
child 9120 3606dd709168
--- a/hotspot/src/cpu/x86/vm/assembler_x86.hpp	Mon Apr 04 22:17:15 2011 -0700
+++ b/hotspot/src/cpu/x86/vm/assembler_x86.hpp	Tue Apr 05 00:31:09 2011 -0700
@@ -385,10 +385,18 @@
 };
 
 class ExternalAddress: public AddressLiteral {
-
-  public:
-
-  ExternalAddress(address target) : AddressLiteral(target, relocInfo::external_word_type){}
+ private:
+  static relocInfo::relocType reloc_for_target(address target) {
+    // Sometimes ExternalAddress is used for values which aren't
+    // exactly addresses, like the card table base.
+    // external_word_type can't be used for values in the first page
+    // so just skip the reloc in that case.
+    return external_word_Relocation::can_be_relocated(target) ? relocInfo::external_word_type : relocInfo::none;
+  }
+
+ public:
+
+  ExternalAddress(address target) : AddressLiteral(target, reloc_for_target(target)) {}
 
 };