mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 17:44:40 +02:00
8273359: CI: ciInstanceKlass::get_canonical_holder() doesn't respect instance size
Reviewed-by: kvn
This commit is contained in:
parent
d7efd0e8cf
commit
f7e9f56e23
5 changed files with 68 additions and 7 deletions
|
@ -1355,7 +1355,7 @@ const TypePtr *Compile::flatten_alias_type( const TypePtr *tj ) const {
|
|||
ciInstanceKlass *k = to->klass()->as_instance_klass();
|
||||
if( ptr == TypePtr::Constant ) {
|
||||
if (to->klass() != ciEnv::current()->Class_klass() ||
|
||||
offset < k->size_helper() * wordSize) {
|
||||
offset < k->layout_helper_size_in_bytes()) {
|
||||
// No constant oop pointers (such as Strings); they alias with
|
||||
// unknown strings.
|
||||
assert(!is_known_inst, "not scalarizable allocation");
|
||||
|
@ -1379,7 +1379,7 @@ const TypePtr *Compile::flatten_alias_type( const TypePtr *tj ) const {
|
|||
if (!is_known_inst) { // Do it only for non-instance types
|
||||
tj = to = TypeInstPtr::make(TypePtr::BotPTR, env()->Object_klass(), false, NULL, offset);
|
||||
}
|
||||
} else if (offset < 0 || offset >= k->size_helper() * wordSize) {
|
||||
} else if (offset < 0 || offset >= k->layout_helper_size_in_bytes()) {
|
||||
// Static fields are in the space above the normal instance
|
||||
// fields in the java.lang.Class instance.
|
||||
if (to->klass() != ciEnv::current()->Class_klass()) {
|
||||
|
@ -1389,6 +1389,7 @@ const TypePtr *Compile::flatten_alias_type( const TypePtr *tj ) const {
|
|||
}
|
||||
} else {
|
||||
ciInstanceKlass *canonical_holder = k->get_canonical_holder(offset);
|
||||
assert(offset < canonical_holder->layout_helper_size_in_bytes(), "");
|
||||
if (!k->equals(canonical_holder) || tj->offset() != offset) {
|
||||
if( is_known_inst ) {
|
||||
tj = to = TypeInstPtr::make(to->ptr(), canonical_holder, true, NULL, offset, to->instance_id());
|
||||
|
@ -1661,7 +1662,7 @@ Compile::AliasType* Compile::find_alias_type(const TypePtr* adr_type, bool no_cr
|
|||
ciField* field;
|
||||
if (tinst->const_oop() != NULL &&
|
||||
tinst->klass() == ciEnv::current()->Class_klass() &&
|
||||
tinst->offset() >= (tinst->klass()->as_instance_klass()->size_helper() * wordSize)) {
|
||||
tinst->offset() >= (tinst->klass()->as_instance_klass()->layout_helper_size_in_bytes())) {
|
||||
// static field
|
||||
ciInstanceKlass* k = tinst->const_oop()->as_instance()->java_lang_Class_klass()->as_instance_klass();
|
||||
field = k->get_field_by_offset(tinst->offset(), true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue