Mercurial > hg > graal-jvmci-8
comparison src/share/vm/code/dependencies.cpp @ 4060:c9a03402fe56
7105305: assert check_method_context proper context
Reviewed-by: jrose, kvn
author | never |
---|---|
date | Tue, 08 Nov 2011 17:29:57 -0800 |
parents | b27c72d69fd1 |
children | da4dd142ea01 |
comparison
equal
deleted
inserted
replaced
4059:44ce519bc3d1 | 4060:c9a03402fe56 |
---|---|
761 } | 761 } |
762 if (lm == m) | 762 if (lm == m) |
763 // Method m is inherited into ctxk. | 763 // Method m is inherited into ctxk. |
764 return true; | 764 return true; |
765 if (lm != NULL) { | 765 if (lm != NULL) { |
766 if (!(lm->is_public() || lm->is_protected())) | 766 if (!(lm->is_public() || lm->is_protected())) { |
767 // Method is [package-]private, so the override story is complex. | 767 // Method is [package-]private, so the override story is complex. |
768 return true; // Must punt the assertion to true. | 768 return true; // Must punt the assertion to true. |
769 } | |
770 if (lm->is_static()) { | |
771 // Static methods don't override non-static so punt | |
772 return true; | |
773 } | |
769 if ( !Dependencies::is_concrete_method(lm) | 774 if ( !Dependencies::is_concrete_method(lm) |
770 && !Dependencies::is_concrete_method(m) | 775 && !Dependencies::is_concrete_method(m) |
771 && Klass::cast(lm->method_holder())->is_subtype_of(m->method_holder())) | 776 && Klass::cast(lm->method_holder())->is_subtype_of(m->method_holder())) |
772 // Method m is overridden by lm, but both are non-concrete. | 777 // Method m is overridden by lm, but both are non-concrete. |
773 return true; | 778 return true; |
1089 //if (k->is_not_instantiated()) return false; | 1094 //if (k->is_not_instantiated()) return false; |
1090 return true; | 1095 return true; |
1091 } | 1096 } |
1092 | 1097 |
1093 bool Dependencies::is_concrete_method(methodOop m) { | 1098 bool Dependencies::is_concrete_method(methodOop m) { |
1094 if (m->is_abstract()) return false; | 1099 // Statics are irrelevant to virtual call sites. |
1095 // %%% We could treat unexecuted methods as virtually abstract also. | 1100 if (m->is_static()) return false; |
1096 // This would require a deoptimization barrier on first execution. | 1101 |
1102 // We could also return false if m does not yet appear to be | |
1103 // executed, if the VM version supports this distinction also. | |
1097 return !m->is_abstract(); | 1104 return !m->is_abstract(); |
1098 } | 1105 } |
1099 | 1106 |
1100 | 1107 |
1101 Klass* Dependencies::find_finalizable_subclass(Klass* k) { | 1108 Klass* Dependencies::find_finalizable_subclass(Klass* k) { |
1111 } | 1118 } |
1112 | 1119 |
1113 | 1120 |
1114 bool Dependencies::is_concrete_klass(ciInstanceKlass* k) { | 1121 bool Dependencies::is_concrete_klass(ciInstanceKlass* k) { |
1115 if (k->is_abstract()) return false; | 1122 if (k->is_abstract()) return false; |
1116 // We could return also false if k does not yet appear to be | 1123 // We could also return false if k does not yet appear to be |
1117 // instantiated, if the VM version supports this distinction also. | 1124 // instantiated, if the VM version supports this distinction also. |
1118 //if (k->is_not_instantiated()) return false; | 1125 //if (k->is_not_instantiated()) return false; |
1119 return true; | 1126 return true; |
1120 } | 1127 } |
1121 | 1128 |
1122 bool Dependencies::is_concrete_method(ciMethod* m) { | 1129 bool Dependencies::is_concrete_method(ciMethod* m) { |
1123 // Statics are irrelevant to virtual call sites. | 1130 // Statics are irrelevant to virtual call sites. |
1124 if (m->is_static()) return false; | 1131 if (m->is_static()) return false; |
1125 | 1132 |
1126 // We could return also false if m does not yet appear to be | 1133 // We could also return false if m does not yet appear to be |
1127 // executed, if the VM version supports this distinction also. | 1134 // executed, if the VM version supports this distinction also. |
1128 return !m->is_abstract(); | 1135 return !m->is_abstract(); |
1129 } | 1136 } |
1130 | 1137 |
1131 | 1138 |