1641 if (bci < 0) bci = 0;
1642 st.print("%s.%s@%d", m->holder()->name()->as_utf8(), m->name()->as_utf8(), bci);
1643 // To print linenumbers instead of bci use: m->line_number_from_bci(bci)
1644 }
1645 NamedCounter* c;
1646 if (tag == NamedCounter::BiasedLockingCounter) {
1647 c = new BiasedLockingNamedCounter(st.as_string());
1648 } else if (tag == NamedCounter::RTMLockingCounter) {
1649 c = new RTMLockingNamedCounter(st.as_string());
1650 } else {
1651 c = new NamedCounter(st.as_string(), tag);
1652 }
1653
1654 // atomically add the new counter to the head of the list. We only
1655 // add counters so this is safe.
1656 NamedCounter* head;
1657 do {
1658 c->set_next(NULL);
1659 head = _named_counters;
1660 c->set_next(head);
1661 } while (Atomic::cmpxchg_ptr(c, &_named_counters, head) != head);
1662 return c;
1663 }
1664
1665 int trace_exception_counter = 0;
1666 static void trace_exception(outputStream* st, oop exception_oop, address exception_pc, const char* msg) {
1667 trace_exception_counter++;
1668 stringStream tempst;
1669
1670 tempst.print("%d [Exception (%s): ", trace_exception_counter, msg);
1671 exception_oop->print_value_on(&tempst);
1672 tempst.print(" in ");
1673 CodeBlob* blob = CodeCache::find_blob(exception_pc);
1674 if (blob->is_compiled()) {
1675 CompiledMethod* cm = blob->as_compiled_method_or_null();
1676 cm->method()->print_value_on(&tempst);
1677 } else if (blob->is_runtime_stub()) {
1678 tempst.print("<runtime-stub>");
1679 } else {
1680 tempst.print("<unknown>");
1681 }
|
1641 if (bci < 0) bci = 0;
1642 st.print("%s.%s@%d", m->holder()->name()->as_utf8(), m->name()->as_utf8(), bci);
1643 // To print linenumbers instead of bci use: m->line_number_from_bci(bci)
1644 }
1645 NamedCounter* c;
1646 if (tag == NamedCounter::BiasedLockingCounter) {
1647 c = new BiasedLockingNamedCounter(st.as_string());
1648 } else if (tag == NamedCounter::RTMLockingCounter) {
1649 c = new RTMLockingNamedCounter(st.as_string());
1650 } else {
1651 c = new NamedCounter(st.as_string(), tag);
1652 }
1653
1654 // atomically add the new counter to the head of the list. We only
1655 // add counters so this is safe.
1656 NamedCounter* head;
1657 do {
1658 c->set_next(NULL);
1659 head = _named_counters;
1660 c->set_next(head);
1661 } while (Atomic::cmpxchg(c, &_named_counters, head) != head);
1662 return c;
1663 }
1664
1665 int trace_exception_counter = 0;
1666 static void trace_exception(outputStream* st, oop exception_oop, address exception_pc, const char* msg) {
1667 trace_exception_counter++;
1668 stringStream tempst;
1669
1670 tempst.print("%d [Exception (%s): ", trace_exception_counter, msg);
1671 exception_oop->print_value_on(&tempst);
1672 tempst.print(" in ");
1673 CodeBlob* blob = CodeCache::find_blob(exception_pc);
1674 if (blob->is_compiled()) {
1675 CompiledMethod* cm = blob->as_compiled_method_or_null();
1676 cm->method()->print_value_on(&tempst);
1677 } else if (blob->is_runtime_stub()) {
1678 tempst.print("<runtime-stub>");
1679 } else {
1680 tempst.print("<unknown>");
1681 }
|