提交 4a3d8765 编写于 作者: N never

7105305: assert check_method_context proper context

Reviewed-by: jrose, kvn
上级 4d7fdbee
...@@ -763,9 +763,14 @@ class ClassHierarchyWalker { ...@@ -763,9 +763,14 @@ class ClassHierarchyWalker {
// Method m is inherited into ctxk. // Method m is inherited into ctxk.
return true; return true;
if (lm != NULL) { if (lm != NULL) {
if (!(lm->is_public() || lm->is_protected())) if (!(lm->is_public() || lm->is_protected())) {
// Method is [package-]private, so the override story is complex. // Method is [package-]private, so the override story is complex.
return true; // Must punt the assertion to true. return true; // Must punt the assertion to true.
}
if (lm->is_static()) {
// Static methods don't override non-static so punt
return true;
}
if ( !Dependencies::is_concrete_method(lm) if ( !Dependencies::is_concrete_method(lm)
&& !Dependencies::is_concrete_method(m) && !Dependencies::is_concrete_method(m)
&& Klass::cast(lm->method_holder())->is_subtype_of(m->method_holder())) && Klass::cast(lm->method_holder())->is_subtype_of(m->method_holder()))
...@@ -1091,9 +1096,11 @@ bool Dependencies::is_concrete_klass(klassOop k) { ...@@ -1091,9 +1096,11 @@ bool Dependencies::is_concrete_klass(klassOop k) {
} }
bool Dependencies::is_concrete_method(methodOop m) { bool Dependencies::is_concrete_method(methodOop m) {
if (m->is_abstract()) return false; // Statics are irrelevant to virtual call sites.
// %%% We could treat unexecuted methods as virtually abstract also. if (m->is_static()) return false;
// This would require a deoptimization barrier on first execution.
// We could also return false if m does not yet appear to be
// executed, if the VM version supports this distinction also.
return !m->is_abstract(); return !m->is_abstract();
} }
...@@ -1113,7 +1120,7 @@ Klass* Dependencies::find_finalizable_subclass(Klass* k) { ...@@ -1113,7 +1120,7 @@ Klass* Dependencies::find_finalizable_subclass(Klass* k) {
bool Dependencies::is_concrete_klass(ciInstanceKlass* k) { bool Dependencies::is_concrete_klass(ciInstanceKlass* k) {
if (k->is_abstract()) return false; if (k->is_abstract()) return false;
// We could return also false if k does not yet appear to be // We could also return false if k does not yet appear to be
// instantiated, if the VM version supports this distinction also. // instantiated, if the VM version supports this distinction also.
//if (k->is_not_instantiated()) return false; //if (k->is_not_instantiated()) return false;
return true; return true;
...@@ -1123,7 +1130,7 @@ bool Dependencies::is_concrete_method(ciMethod* m) { ...@@ -1123,7 +1130,7 @@ bool Dependencies::is_concrete_method(ciMethod* m) {
// Statics are irrelevant to virtual call sites. // Statics are irrelevant to virtual call sites.
if (m->is_static()) return false; if (m->is_static()) return false;
// We could return also false if m does not yet appear to be // We could also return false if m does not yet appear to be
// executed, if the VM version supports this distinction also. // executed, if the VM version supports this distinction also.
return !m->is_abstract(); return !m->is_abstract();
} }
......
...@@ -532,7 +532,7 @@ void constantPoolKlass::preload_and_initialize_all_classes(oop obj, TRAPS) { ...@@ -532,7 +532,7 @@ void constantPoolKlass::preload_and_initialize_all_classes(oop obj, TRAPS) {
if (cp->tag_at(i).is_unresolved_klass()) { if (cp->tag_at(i).is_unresolved_klass()) {
// This will force loading of the class // This will force loading of the class
klassOop klass = cp->klass_at(i, CHECK); klassOop klass = cp->klass_at(i, CHECK);
if (klass->is_instance()) { if (klass->klass_part()->oop_is_instance()) {
// Force initialization of class // Force initialization of class
instanceKlass::cast(klass)->initialize(CHECK); instanceKlass::cast(klass)->initialize(CHECK);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册