Mercurial > hg > truffle
comparison src/share/vm/code/dependencies.cpp @ 14518:d8041d695d19
Merged with jdk9/dev/hotspot changeset 3812c088b945
author | twisti |
---|---|
date | Tue, 11 Mar 2014 18:45:59 -0700 |
parents | 096c224171c4 524b54a7f1b5 |
children | b51e29501f30 4ca6dc0799b6 |
comparison
equal
deleted
inserted
replaced
14141:f97c5ec83832 | 14518:d8041d695d19 |
---|---|
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)); | |
872 return o; | 870 return o; |
873 } | 871 } |
874 | 872 |
875 inline oop Dependencies::DepStream::recorded_oop_at(int i) { | 873 inline oop Dependencies::DepStream::recorded_oop_at(int i) { |
876 return (_code != NULL) | 874 return (_code != NULL) |
888 } | 886 } |
889 } | 887 } |
890 | 888 |
891 assert(result == NULL || result->is_klass() || result->is_method(), "must be"); | 889 assert(result == NULL || result->is_klass() || result->is_method(), "must be"); |
892 return result; | 890 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 } | |
893 } | 902 } |
894 | 903 |
895 oop Dependencies::DepStream::argument_oop(int i) { | 904 oop Dependencies::DepStream::argument_oop(int i) { |
896 oop result = recorded_oop_at(argument_index(i)); | 905 oop result = recorded_oop_at(argument_index(i)); |
897 assert(result == NULL || result->is_oop(), "must be"); | 906 assert(result == NULL || result->is_oop(), "must be"); |
923 } | 932 } |
924 | 933 |
925 // And some dependencies don't have a context type at all, | 934 // And some dependencies don't have a context type at all, |
926 // e.g. evol_method. | 935 // e.g. evol_method. |
927 return NULL; | 936 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; | |
928 } | 951 } |
929 | 952 |
930 /// Checking dependencies: | 953 /// Checking dependencies: |
931 | 954 |
932 // This hierarchy walker inspects subtypes of a given type, | 955 // This hierarchy walker inspects subtypes of a given type, |
1371 // Statics are irrelevant to virtual call sites. | 1394 // Statics are irrelevant to virtual call sites. |
1372 if (m->is_static()) return false; | 1395 if (m->is_static()) return false; |
1373 | 1396 |
1374 // We could also return false if m does not yet appear to be | 1397 // We could also return false if m does not yet appear to be |
1375 // executed, if the VM version supports this distinction also. | 1398 // executed, if the VM version supports this distinction also. |
1399 // Default methods are considered "concrete" as well. | |
1376 return !m->is_abstract() && | 1400 return !m->is_abstract() && |
1377 !InstanceKlass::cast(m->method_holder())->is_interface(); | 1401 !m->is_overpass(); // error functions aren't concrete |
1378 // TODO: investigate whether default methods should be | |
1379 // considered as "concrete" in this situation. For now they | |
1380 // are not. | |
1381 } | 1402 } |
1382 | 1403 |
1383 | 1404 |
1384 Klass* Dependencies::find_finalizable_subclass(Klass* k) { | 1405 Klass* Dependencies::find_finalizable_subclass(Klass* k) { |
1385 if (k->is_interface()) return NULL; | 1406 if (k->is_interface()) return NULL; |