< prev index next >

src/share/vm/code/nmethod.cpp

Print this page




2308   DepTable* table = new DepTable();
2309 
2310   // Iterate over live nmethods and check dependencies of all nmethods that are not
2311   // marked for deoptimization. A particular dependency is only checked once.
2312   NMethodIterator iter;
2313   while(iter.next()) {
2314     nmethod* nm = iter.method();
2315     // Only notify for live nmethods
2316     if (nm->is_alive() && !nm->is_marked_for_deoptimization()) {
2317       for (Dependencies::DepStream deps(nm); deps.next(); ) {
2318         // Construct abstraction of a dependency.
2319         DependencySignature* current_sig = new DependencySignature(deps);
2320 
2321         // Determine if dependency is already checked. table->put(...) returns
2322         // 'true' if the dependency is added (i.e., was not in the hashtable).
2323         if (table->put(*current_sig, 1)) {
2324           if (deps.check_dependency() != NULL) {
2325             // Dependency checking failed. Print out information about the failed
2326             // dependency and finally fail with an assert. We can fail here, since
2327             // dependency checking is never done in a product build.

2328             changes.print();
2329             nm->print();
2330             nm->print_dependencies();
2331             assert(false, "Should have been marked for deoptimization");
2332           }
2333         }
2334       }
2335     }
2336   }
2337 }
2338 
2339 bool nmethod::check_dependency_on(DepChange& changes) {
2340   // What has happened:
2341   // 1) a new class dependee has been added
2342   // 2) dependee and all its super classes have been marked
2343   bool found_check = false;  // set true if we are upset
2344   for (Dependencies::DepStream deps(this); deps.next(); ) {
2345     // Evaluate only relevant dependencies.
2346     if (deps.spot_check_dependency_at(changes) != NULL) {
2347       found_check = true;




2308   DepTable* table = new DepTable();
2309 
2310   // Iterate over live nmethods and check dependencies of all nmethods that are not
2311   // marked for deoptimization. A particular dependency is only checked once.
2312   NMethodIterator iter;
2313   while(iter.next()) {
2314     nmethod* nm = iter.method();
2315     // Only notify for live nmethods
2316     if (nm->is_alive() && !nm->is_marked_for_deoptimization()) {
2317       for (Dependencies::DepStream deps(nm); deps.next(); ) {
2318         // Construct abstraction of a dependency.
2319         DependencySignature* current_sig = new DependencySignature(deps);
2320 
2321         // Determine if dependency is already checked. table->put(...) returns
2322         // 'true' if the dependency is added (i.e., was not in the hashtable).
2323         if (table->put(*current_sig, 1)) {
2324           if (deps.check_dependency() != NULL) {
2325             // Dependency checking failed. Print out information about the failed
2326             // dependency and finally fail with an assert. We can fail here, since
2327             // dependency checking is never done in a product build.
2328             tty->print_cr("Failed dependency:");
2329             changes.print();
2330             nm->print();
2331             nm->print_dependencies();
2332             assert(false, "Should have been marked for deoptimization");
2333           }
2334         }
2335       }
2336     }
2337   }
2338 }
2339 
2340 bool nmethod::check_dependency_on(DepChange& changes) {
2341   // What has happened:
2342   // 1) a new class dependee has been added
2343   // 2) dependee and all its super classes have been marked
2344   bool found_check = false;  // set true if we are upset
2345   for (Dependencies::DepStream deps(this); deps.next(); ) {
2346     // Evaluate only relevant dependencies.
2347     if (deps.spot_check_dependency_at(changes) != NULL) {
2348       found_check = true;


< prev index next >