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