8340012: [C2] assert(KlassEncodingMetaspaceMax > pd) failed: change encoding max if new encoding after 8338526
Reviewed-by: kvn, coleenp
This commit is contained in:
parent
4b7906375b
commit
6be15c3d0b
@ -107,6 +107,13 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool is_in_encoding_range() {
|
||||
Klass* k = get_Klass();
|
||||
bool is_in_encoding_range = CompressedKlassPointers::is_in_encoding_range(k);
|
||||
assert(is_in_encoding_range || k->is_interface() || k->is_abstract(), "sanity");
|
||||
return is_in_encoding_range;
|
||||
}
|
||||
|
||||
// Attempt to get a klass using this ciKlass's loader.
|
||||
ciKlass* find_klass(ciSymbol* klass_name);
|
||||
// Note: To find a class from its name string, use ciSymbol::make,
|
||||
|
@ -51,7 +51,7 @@ inline narrowKlass CompressedKlassPointers::encode_not_null(Klass* v, address na
|
||||
assert(!is_null(v), "klass value can never be zero");
|
||||
assert(check_alignment(v), "Address not aligned");
|
||||
uint64_t pd = (uint64_t)(pointer_delta(v, narrow_base, 1));
|
||||
assert(KlassEncodingMetaspaceMax > pd, "change encoding max if new encoding");
|
||||
assert(KlassEncodingMetaspaceMax > pd, "change encoding max if new encoding (Klass " PTR_FORMAT ", Base " PTR_FORMAT ")", p2i(v), p2i(narrow_base));
|
||||
uint64_t result = pd >> shift;
|
||||
assert((result & CONST64(0xffffffff00000000)) == 0, "narrow klass pointer overflow");
|
||||
assert(decode_not_null((narrowKlass)result, narrow_base, shift) == v, "reversibility");
|
||||
|
@ -3324,7 +3324,7 @@ void Compile::final_graph_reshaping_main_switch(Node* n, Final_Reshape_Counts& f
|
||||
bool is_klass = t->isa_klassptr() != nullptr;
|
||||
|
||||
if ((is_oop && Matcher::const_oop_prefer_decode() ) ||
|
||||
(is_klass && Matcher::const_klass_prefer_decode())) {
|
||||
(is_klass && Matcher::const_klass_prefer_decode() && t->isa_klassptr()->exact_klass()->is_in_encoding_range())) {
|
||||
Node* nn = nullptr;
|
||||
|
||||
int op = is_oop ? Op_ConN : Op_ConNKlass;
|
||||
|
Loading…
Reference in New Issue
Block a user