comparison src/share/vm/code/dependencies.cpp @ 19426:dd8989d5547f

provide more detail when Graal code installation fails due to a failed dependency check
author Doug Simon <doug.simon@oracle.com>
date Tue, 17 Feb 2015 14:49:05 +0100
parents 6eda3b299460
children 7848fc12602b
comparison
equal deleted inserted replaced
19425:b6d8deed3fd5 19426:dd8989d5547f
735 } 735 }
736 xtty->end_elem(); 736 xtty->end_elem();
737 } 737 }
738 738
739 void Dependencies::print_dependency(DepType dept, int nargs, DepArgument args[], 739 void Dependencies::print_dependency(DepType dept, int nargs, DepArgument args[],
740 Klass* witness) { 740 Klass* witness, outputStream* st) {
741 ResourceMark rm; 741 ResourceMark rm;
742 ttyLocker ttyl; // keep the following output all in one block 742 ttyLocker ttyl; // keep the following output all in one block
743 tty->print_cr("%s of type %s", 743 st->print_cr("%s of type %s",
744 (witness == NULL)? "Dependency": "Failed dependency", 744 (witness == NULL)? "Dependency": "Failed dependency",
745 dep_name(dept)); 745 dep_name(dept));
746 // print arguments 746 // print arguments
747 int ctxkj = dep_context_arg(dept); // -1 if no context arg 747 int ctxkj = dep_context_arg(dept); // -1 if no context arg
748 for (int j = 0; j < nargs; j++) { 748 for (int j = 0; j < nargs; j++) {
760 } else if (arg.is_klass()) { 760 } else if (arg.is_klass()) {
761 what = "class "; 761 what = "class ";
762 } else { 762 } else {
763 what = "object "; 763 what = "object ";
764 } 764 }
765 tty->print(" %s = %s", what, (put_star? "*": "")); 765 st->print(" %s = %s", what, (put_star? "*": ""));
766 if (arg.is_klass()) 766 if (arg.is_klass())
767 tty->print("%s", ((Klass*)arg.metadata_value())->external_name()); 767 st->print("%s", ((Klass*)arg.metadata_value())->external_name());
768 else if (arg.is_method()) 768 else if (arg.is_method())
769 ((Method*)arg.metadata_value())->print_value(); 769 ((Method*)arg.metadata_value())->print_value_on(st);
770 else 770 else
771 ShouldNotReachHere(); // Provide impl for this type. 771 ShouldNotReachHere(); // Provide impl for this type.
772 tty->cr(); 772 st->cr();
773 } 773 }
774 if (witness != NULL) { 774 if (witness != NULL) {
775 bool put_star = !Dependencies::is_concrete_klass(witness); 775 bool put_star = !Dependencies::is_concrete_klass(witness);
776 tty->print_cr(" witness = %s%s", 776 st->print_cr(" witness = %s%s",
777 (put_star? "*": ""), 777 (put_star? "*": ""),
778 witness->external_name()); 778 witness->external_name());
779 } 779 }
780 } 780 }
781 781
804 Dependencies::write_dependency_to(xtty, 804 Dependencies::write_dependency_to(xtty,
805 type(), nargs, args, witness); 805 type(), nargs, args, witness);
806 } 806 }
807 } 807 }
808 808
809 void Dependencies::DepStream::print_dependency(Klass* witness, bool verbose) { 809 void Dependencies::DepStream::print_dependency(Klass* witness, bool verbose, outputStream* st) {
810 int nargs = argument_count(); 810 int nargs = argument_count();
811 DepArgument args[max_arg_count]; 811 DepArgument args[max_arg_count];
812 for (int j = 0; j < nargs; j++) { 812 for (int j = 0; j < nargs; j++) {
813 args[j] = argument(j); 813 args[j] = argument(j);
814 } 814 }
815 Dependencies::print_dependency(type(), nargs, args, witness); 815 Dependencies::print_dependency(type(), nargs, args, witness, st);
816 if (verbose) { 816 if (verbose) {
817 if (_code != NULL) { 817 if (_code != NULL) {
818 tty->print(" code: "); 818 st->print(" code: ");
819 _code->print_value_on(tty); 819 _code->print_value_on(st);
820 tty->cr(); 820 st->cr();
821 } 821 }
822 } 822 }
823 } 823 }
824 824
825 825