diff src/cpu/x86/vm/assembler_x86.hpp @ 2455:479b4b4b6950

6777083: assert(target != __null,"must not be null") Reviewed-by: iveresov, kvn
author never
date Tue, 05 Apr 2011 00:31:09 -0700
parents 09f96c3ff1ad
children d86923d96dca
line wrap: on
line diff
--- a/src/cpu/x86/vm/assembler_x86.hpp	Mon Apr 04 22:17:15 2011 -0700
+++ b/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)) {}
 
 };