593 InlineTree* InlineTree::find_subtree_from_root(InlineTree* root, JVMState* jvms, ciMethod* callee, bool create_if_not_found) { 594 InlineTree* iltp = root; 595 uint depth = jvms && jvms->has_method() ? jvms->depth() : 0; 596 for (uint d = 1; d <= depth; d++) { 597 JVMState* jvmsp = jvms->of_depth(d); 598 // Select the corresponding subtree for this bci. 599 assert(jvmsp->method() == iltp->method(), "tree still in sync"); 600 ciMethod* d_callee = (d == depth) ? callee : jvms->of_depth(d+1)->method(); 601 InlineTree* sub = iltp->callee_at(jvmsp->bci(), d_callee); 602 if (!sub) { 603 if (create_if_not_found && d == depth) { 604 return iltp->build_inline_tree_for_callee(d_callee, jvmsp, jvmsp->bci()); 605 } 606 assert(sub != NULL, "should be a sub-ilt here"); 607 return NULL; 608 } 609 iltp = sub; 610 } 611 return iltp; 612 } | 593 InlineTree* InlineTree::find_subtree_from_root(InlineTree* root, JVMState* jvms, ciMethod* callee, bool create_if_not_found) { 594 InlineTree* iltp = root; 595 uint depth = jvms && jvms->has_method() ? jvms->depth() : 0; 596 for (uint d = 1; d <= depth; d++) { 597 JVMState* jvmsp = jvms->of_depth(d); 598 // Select the corresponding subtree for this bci. 599 assert(jvmsp->method() == iltp->method(), "tree still in sync"); 600 ciMethod* d_callee = (d == depth) ? callee : jvms->of_depth(d+1)->method(); 601 InlineTree* sub = iltp->callee_at(jvmsp->bci(), d_callee); 602 if (!sub) { 603 if (create_if_not_found && d == depth) { 604 return iltp->build_inline_tree_for_callee(d_callee, jvmsp, jvmsp->bci()); 605 } 606 assert(sub != NULL, "should be a sub-ilt here"); 607 return NULL; 608 } 609 iltp = sub; 610 } 611 return iltp; 612 } 613 614 615 616 #ifndef PRODUCT 617 void InlineTree::print_impl(outputStream* st, int indent) const { 618 for (int i = 0; i < indent; i++) st->print(" "); 619 st->print(" @ %d ", caller_bci()); 620 method()->print_short_name(st); 621 st->cr(); 622 623 for (int i = 0 ; i < _subtrees.length(); i++) { 624 _subtrees.at(i)->print_impl(st, indent + 2); 625 } 626 } 627 628 void InlineTree::print_value_on(outputStream* st) const { 629 print_impl(st, 2); 630 } 631 #endif |