6777083: assert(target != __null,"must not be null")

Reviewed-by: iveresov, kvn
This commit is contained in:
Tom Rodriguez 2011-04-05 00:31:09 -07:00
parent 642c26950d
commit 1a5a2ecd25
3 changed files with 26 additions and 14 deletions

View file

@ -385,10 +385,18 @@ class OopAddress: public AddressLiteral {
};
class ExternalAddress: public AddressLiteral {
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:
public:
ExternalAddress(address target) : AddressLiteral(target, relocInfo::external_word_type){}
ExternalAddress(address target) : AddressLiteral(target, reloc_for_target(target)) {}
};