893 894 // First, check non-klass dependencies as we might return early and 895 // not check klass dependencies if the system dictionary 896 // modification counter hasn't changed (see below). 897 for (Dependencies::DepStream deps(dependencies()); deps.next(); ) { 898 if (deps.is_klass_type()) continue; // skip klass dependencies 899 klassOop witness = deps.check_dependency(); 900 if (witness != NULL) { 901 record_failure("invalid non-klass dependency"); 902 return; 903 } 904 } 905 906 // Klass dependencies must be checked when the system dictionary 907 // changes. If logging is enabled all violated dependences will be 908 // recorded in the log. In debug mode check dependencies even if 909 // the system dictionary hasn't changed to verify that no invalid 910 // dependencies were inserted. Any violated dependences in this 911 // case are dumped to the tty. 912 bool counter_changed = system_dictionary_modification_counter_changed(); 913 bool test_deps = counter_changed; 914 DEBUG_ONLY(test_deps = true); 915 if (!test_deps) return; 916 917 bool print_failures = false; 918 DEBUG_ONLY(print_failures = !counter_changed); 919 bool keep_going = (print_failures || xtty != NULL); 920 int klass_violations = 0; 921 922 for (Dependencies::DepStream deps(dependencies()); deps.next(); ) { 923 if (!deps.is_klass_type()) continue; // skip non-klass dependencies 924 klassOop witness = deps.check_dependency(); 925 if (witness != NULL) { 926 klass_violations++; 927 if (print_failures) deps.print_dependency(witness, /*verbose=*/ true); 928 } 929 // If there's no log and we're not sanity-checking, we're done. 930 if (!keep_going) break; 931 } 932 933 if (klass_violations != 0) { 934 assert(counter_changed, "failed dependencies, but counter didn't change"); 935 record_failure("concurrent class loading"); 936 } 937 } 938 939 // ------------------------------------------------------------------ 940 // ciEnv::register_method 941 void ciEnv::register_method(ciMethod* target, 942 int entry_bci, 943 CodeOffsets* offsets, 944 int orig_pc_offset, 945 CodeBuffer* code_buffer, 946 int frame_words, 947 OopMapSet* oop_map_set, 948 ExceptionHandlerTable* handler_table, 949 ImplicitExceptionTable* inc_table, 950 AbstractCompiler* compiler, 951 int comp_level, 952 bool has_unsafe_access) { 953 VM_ENTRY_MARK; | 893 894 // First, check non-klass dependencies as we might return early and 895 // not check klass dependencies if the system dictionary 896 // modification counter hasn't changed (see below). 897 for (Dependencies::DepStream deps(dependencies()); deps.next(); ) { 898 if (deps.is_klass_type()) continue; // skip klass dependencies 899 klassOop witness = deps.check_dependency(); 900 if (witness != NULL) { 901 record_failure("invalid non-klass dependency"); 902 return; 903 } 904 } 905 906 // Klass dependencies must be checked when the system dictionary 907 // changes. If logging is enabled all violated dependences will be 908 // recorded in the log. In debug mode check dependencies even if 909 // the system dictionary hasn't changed to verify that no invalid 910 // dependencies were inserted. Any violated dependences in this 911 // case are dumped to the tty. 912 bool counter_changed = system_dictionary_modification_counter_changed(); 913 914 bool verify_deps = trueInDebug; 915 if (!counter_changed && !verify_deps) return; 916 917 int klass_violations = 0; 918 for (Dependencies::DepStream deps(dependencies()); deps.next(); ) { 919 if (!deps.is_klass_type()) continue; // skip non-klass dependencies 920 klassOop witness = deps.check_dependency(); 921 if (witness != NULL) { 922 klass_violations++; 923 if (!counter_changed) { 924 // Dependence failed but counter didn't change. Log a message 925 // describing what failed and allow the assert at the end to 926 // trigger. 927 deps.print_dependency(witness); 928 } else if (xtty == NULL) { 929 // If we're not logging then a single violation is sufficient, 930 // other we want to log all the dependences which were 931 // violated. 932 break; 933 } 934 } 935 } 936 937 if (klass_violations != 0) { 938 #ifdef ASSERT 939 if (!counter_changed && !PrintCompilation) { 940 // Print out the compile task that failed 941 _task->print_line(); 942 } 943 #endif 944 assert(counter_changed, "failed dependencies, but counter didn't change"); 945 record_failure("concurrent class loading"); 946 } 947 } 948 949 // ------------------------------------------------------------------ 950 // ciEnv::register_method 951 void ciEnv::register_method(ciMethod* target, 952 int entry_bci, 953 CodeOffsets* offsets, 954 int orig_pc_offset, 955 CodeBuffer* code_buffer, 956 int frame_words, 957 OopMapSet* oop_map_set, 958 ExceptionHandlerTable* handler_table, 959 ImplicitExceptionTable* inc_table, 960 AbstractCompiler* compiler, 961 int comp_level, 962 bool has_unsafe_access) { 963 VM_ENTRY_MARK; |