src/share/vm/code/dependencies.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/code

src/share/vm/code/dependencies.cpp

Print this page
rev 7046 : 8058578: -XX:+TraceDependencies is broken for call_site_target_value dependency type
Reviewed-by: ?


 550   // print arguments
 551   int ctxkj = dep_context_arg(dept);  // -1 if no context arg
 552   for (int j = 0; j < args->length(); j++) {
 553     DepArgument arg = args->at(j);
 554     bool put_star = false;
 555     if (arg.is_null())  continue;
 556     const char* what;
 557     if (j == ctxkj) {
 558       assert(arg.is_metadata(), "must be");
 559       what = "context";
 560       put_star = !Dependencies::is_concrete_klass((Klass*)arg.metadata_value());
 561     } else if (arg.is_method()) {
 562       what = "method ";
 563       put_star = !Dependencies::is_concrete_method((Method*)arg.metadata_value());
 564     } else if (arg.is_klass()) {
 565       what = "class  ";
 566     } else {
 567       what = "object ";
 568     }
 569     tty->print("  %s = %s", what, (put_star? "*": ""));
 570     if (arg.is_klass())
 571       tty->print("%s", ((Klass*)arg.metadata_value())->external_name());
 572     else if (arg.is_method())
 573       ((Method*)arg.metadata_value())->print_value();
 574     else


 575       ShouldNotReachHere(); // Provide impl for this type.


 576     tty->cr();
 577   }
 578   if (witness != NULL) {
 579     bool put_star = !Dependencies::is_concrete_klass(witness);
 580     tty->print_cr("  witness = %s%s",
 581                   (put_star? "*": ""),
 582                   witness->external_name());
 583   }
 584 }
 585 
 586 void Dependencies::DepStream::log_dependency(Klass* witness) {
 587   if (_deps == NULL && xtty == NULL)  return;  // fast cutout for runtime
 588   ResourceMark rm;
 589   const int nargs = argument_count();
 590   GrowableArray<DepArgument>* args = new GrowableArray<DepArgument>(nargs);
 591   for (int j = 0; j < nargs; j++) {
 592     if (type() == call_site_target_value) {
 593       args->push(argument_oop(j));
 594     } else {
 595       args->push(argument(j));
 596     }
 597   }
 598   int argslen = args->length();
 599   if (_deps != NULL && _deps->log() != NULL) {
 600     Dependencies::write_dependency_to(_deps->log(), type(), args, witness);
 601   } else {
 602     Dependencies::write_dependency_to(xtty, type(), args, witness);
 603   }
 604   guarantee(argslen == args->length(), "args array cannot grow inside nested ResoureMark scope");
 605 }
 606 
 607 void Dependencies::DepStream::print_dependency(Klass* witness, bool verbose) {
 608   ResourceMark rm;
 609   int nargs = argument_count();
 610   GrowableArray<DepArgument>* args = new GrowableArray<DepArgument>(nargs);
 611   for (int j = 0; j < nargs; j++) {



 612     args->push(argument(j));
 613   }

 614   int argslen = args->length();
 615   Dependencies::print_dependency(type(), args, witness);
 616   if (verbose) {
 617     if (_code != NULL) {
 618       tty->print("  code: ");
 619       _code->print_value_on(tty);
 620       tty->cr();
 621     }
 622   }
 623   guarantee(argslen == args->length(), "args array cannot grow inside nested ResoureMark scope");
 624 }
 625 
 626 
 627 /// Dependency stream support (decodes dependencies from an nmethod):
 628 
 629 #ifdef ASSERT
 630 void Dependencies::DepStream::initial_asserts(size_t byte_limit) {
 631   assert(must_be_in_vm(), "raw oops here");
 632   _byte_limit = byte_limit;
 633   _type       = (DepType)(end_marker-1);  // defeat "already at end" assert




 550   // print arguments
 551   int ctxkj = dep_context_arg(dept);  // -1 if no context arg
 552   for (int j = 0; j < args->length(); j++) {
 553     DepArgument arg = args->at(j);
 554     bool put_star = false;
 555     if (arg.is_null())  continue;
 556     const char* what;
 557     if (j == ctxkj) {
 558       assert(arg.is_metadata(), "must be");
 559       what = "context";
 560       put_star = !Dependencies::is_concrete_klass((Klass*)arg.metadata_value());
 561     } else if (arg.is_method()) {
 562       what = "method ";
 563       put_star = !Dependencies::is_concrete_method((Method*)arg.metadata_value());
 564     } else if (arg.is_klass()) {
 565       what = "class  ";
 566     } else {
 567       what = "object ";
 568     }
 569     tty->print("  %s = %s", what, (put_star? "*": ""));
 570     if (arg.is_klass()) {
 571       tty->print("%s", ((Klass*)arg.metadata_value())->external_name());
 572     } else if (arg.is_method()) {
 573       ((Method*)arg.metadata_value())->print_value();
 574     } else if (arg.is_oop()) {
 575       arg.oop_value()->print_value_on(tty);
 576     } else {
 577       ShouldNotReachHere(); // Provide impl for this type.
 578     }
 579 
 580     tty->cr();
 581   }
 582   if (witness != NULL) {
 583     bool put_star = !Dependencies::is_concrete_klass(witness);
 584     tty->print_cr("  witness = %s%s",
 585                   (put_star? "*": ""),
 586                   witness->external_name());
 587   }
 588 }
 589 
 590 void Dependencies::DepStream::log_dependency(Klass* witness) {
 591   if (_deps == NULL && xtty == NULL)  return;  // fast cutout for runtime
 592   ResourceMark rm;
 593   const int nargs = argument_count();
 594   GrowableArray<DepArgument>* args = new GrowableArray<DepArgument>(nargs);
 595   for (int j = 0; j < nargs; j++) {
 596     if (type() == call_site_target_value) {
 597       args->push(argument_oop(j));
 598     } else {
 599       args->push(argument(j));
 600     }
 601   }
 602   int argslen = args->length();
 603   if (_deps != NULL && _deps->log() != NULL) {
 604     Dependencies::write_dependency_to(_deps->log(), type(), args, witness);
 605   } else {
 606     Dependencies::write_dependency_to(xtty, type(), args, witness);
 607   }
 608   guarantee(argslen == args->length(), "args array cannot grow inside nested ResoureMark scope");
 609 }
 610 
 611 void Dependencies::DepStream::print_dependency(Klass* witness, bool verbose) {
 612   ResourceMark rm;
 613   int nargs = argument_count();
 614   GrowableArray<DepArgument>* args = new GrowableArray<DepArgument>(nargs);
 615   for (int j = 0; j < nargs; j++) {
 616     if (type() == call_site_target_value) {
 617       args->push(argument_oop(j));
 618     } else {
 619       args->push(argument(j));
 620     }
 621   }
 622   int argslen = args->length();
 623   Dependencies::print_dependency(type(), args, witness);
 624   if (verbose) {
 625     if (_code != NULL) {
 626       tty->print("  code: ");
 627       _code->print_value_on(tty);
 628       tty->cr();
 629     }
 630   }
 631   guarantee(argslen == args->length(), "args array cannot grow inside nested ResoureMark scope");
 632 }
 633 
 634 
 635 /// Dependency stream support (decodes dependencies from an nmethod):
 636 
 637 #ifdef ASSERT
 638 void Dependencies::DepStream::initial_asserts(size_t byte_limit) {
 639   assert(must_be_in_vm(), "raw oops here");
 640   _byte_limit = byte_limit;
 641   _type       = (DepType)(end_marker-1);  // defeat "already at end" assert


src/share/vm/code/dependencies.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File