comparison src/share/vm/code/dependencies.cpp @ 14909:4ca6dc0799b6

Backout jdk9 merge
author Gilles Duboscq <duboscq@ssw.jku.at>
date Tue, 01 Apr 2014 13:57:07 +0200
parents d8041d695d19
children 89152779163c
comparison
equal deleted inserted replaced
14908:8db6e76cb658 14909:4ca6dc0799b6
865 if (_code != NULL) { 865 if (_code != NULL) {
866 o = _code->metadata_at(i); 866 o = _code->metadata_at(i);
867 } else { 867 } else {
868 o = _deps->oop_recorder()->metadata_at(i); 868 o = _deps->oop_recorder()->metadata_at(i);
869 } 869 }
870 assert(o == NULL || o->is_metaspace_object(),
871 err_msg("Should be metadata " PTR_FORMAT, o));
870 return o; 872 return o;
871 } 873 }
872 874
873 inline oop Dependencies::DepStream::recorded_oop_at(int i) { 875 inline oop Dependencies::DepStream::recorded_oop_at(int i) {
874 return (_code != NULL) 876 return (_code != NULL)
886 } 888 }
887 } 889 }
888 890
889 assert(result == NULL || result->is_klass() || result->is_method(), "must be"); 891 assert(result == NULL || result->is_klass() || result->is_method(), "must be");
890 return result; 892 return result;
891 }
892
893 /**
894 * Returns a unique identifier for each dependency argument.
895 */
896 uintptr_t Dependencies::DepStream::get_identifier(int i) {
897 if (has_oop_argument()) {
898 return (uintptr_t)(oopDesc*)argument_oop(i);
899 } else {
900 return (uintptr_t)argument(i);
901 }
902 } 893 }
903 894
904 oop Dependencies::DepStream::argument_oop(int i) { 895 oop Dependencies::DepStream::argument_oop(int i) {
905 oop result = recorded_oop_at(argument_index(i)); 896 oop result = recorded_oop_at(argument_index(i));
906 assert(result == NULL || result->is_oop(), "must be"); 897 assert(result == NULL || result->is_oop(), "must be");
932 } 923 }
933 924
934 // And some dependencies don't have a context type at all, 925 // And some dependencies don't have a context type at all,
935 // e.g. evol_method. 926 // e.g. evol_method.
936 return NULL; 927 return NULL;
937 }
938
939 // ----------------- DependencySignature --------------------------------------
940 bool DependencySignature::equals(DependencySignature* sig) const {
941 if ((type() != sig->type()) || (args_count() != sig->args_count())) {
942 return false;
943 }
944
945 for (int i = 0; i < sig->args_count(); i++) {
946 if (arg(i) != sig->arg(i)) {
947 return false;
948 }
949 }
950 return true;
951 } 928 }
952 929
953 /// Checking dependencies: 930 /// Checking dependencies:
954 931
955 // This hierarchy walker inspects subtypes of a given type, 932 // This hierarchy walker inspects subtypes of a given type,
1394 // Statics are irrelevant to virtual call sites. 1371 // Statics are irrelevant to virtual call sites.
1395 if (m->is_static()) return false; 1372 if (m->is_static()) return false;
1396 1373
1397 // We could also return false if m does not yet appear to be 1374 // We could also return false if m does not yet appear to be
1398 // executed, if the VM version supports this distinction also. 1375 // executed, if the VM version supports this distinction also.
1399 // Default methods are considered "concrete" as well.
1400 return !m->is_abstract() && 1376 return !m->is_abstract() &&
1401 !m->is_overpass(); // error functions aren't concrete 1377 !InstanceKlass::cast(m->method_holder())->is_interface();
1378 // TODO: investigate whether default methods should be
1379 // considered as "concrete" in this situation. For now they
1380 // are not.
1402 } 1381 }
1403 1382
1404 1383
1405 Klass* Dependencies::find_finalizable_subclass(Klass* k) { 1384 Klass* Dependencies::find_finalizable_subclass(Klass* k) {
1406 if (k->is_interface()) return NULL; 1385 if (k->is_interface()) return NULL;