提交 c2d69d99 编写于 作者: N never

7161796: PhaseStringOpts::fetch_static_field tries to fetch field from the...

7161796: PhaseStringOpts::fetch_static_field tries to fetch field from the Klass instead of the mirror
Reviewed-by: twisti
上级 7f58b2a7
...@@ -897,8 +897,8 @@ bool StringConcat::validate_control_flow() { ...@@ -897,8 +897,8 @@ bool StringConcat::validate_control_flow() {
} }
Node* PhaseStringOpts::fetch_static_field(GraphKit& kit, ciField* field) { Node* PhaseStringOpts::fetch_static_field(GraphKit& kit, ciField* field) {
const TypeKlassPtr* klass_type = TypeKlassPtr::make(field->holder()); const TypeInstPtr* mirror_type = TypeInstPtr::make(field->holder()->java_mirror());
Node* klass_node = __ makecon(klass_type); Node* klass_node = __ makecon(mirror_type);
BasicType bt = field->layout_type(); BasicType bt = field->layout_type();
ciType* field_klass = field->type(); ciType* field_klass = field->type();
...@@ -913,6 +913,7 @@ Node* PhaseStringOpts::fetch_static_field(GraphKit& kit, ciField* field) { ...@@ -913,6 +913,7 @@ Node* PhaseStringOpts::fetch_static_field(GraphKit& kit, ciField* field) {
// and may yield a vacuous result if the field is of interface type. // and may yield a vacuous result if the field is of interface type.
type = TypeOopPtr::make_from_constant(con, true)->isa_oopptr(); type = TypeOopPtr::make_from_constant(con, true)->isa_oopptr();
assert(type != NULL, "field singleton type must be consistent"); assert(type != NULL, "field singleton type must be consistent");
return __ makecon(type);
} else { } else {
type = TypeOopPtr::make_from_klass(field_klass->as_klass()); type = TypeOopPtr::make_from_klass(field_klass->as_klass());
} }
...@@ -922,7 +923,7 @@ Node* PhaseStringOpts::fetch_static_field(GraphKit& kit, ciField* field) { ...@@ -922,7 +923,7 @@ Node* PhaseStringOpts::fetch_static_field(GraphKit& kit, ciField* field) {
return kit.make_load(NULL, kit.basic_plus_adr(klass_node, field->offset_in_bytes()), return kit.make_load(NULL, kit.basic_plus_adr(klass_node, field->offset_in_bytes()),
type, T_OBJECT, type, T_OBJECT,
C->get_alias_index(klass_type->add_offset(field->offset_in_bytes()))); C->get_alias_index(mirror_type->add_offset(field->offset_in_bytes())));
} }
Node* PhaseStringOpts::int_stringSize(GraphKit& kit, Node* arg) { Node* PhaseStringOpts::int_stringSize(GraphKit& kit, Node* arg) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册