< prev index next >

src/hotspot/share/oops/methodData.cpp

Print this page




1398   int nb_cells = 0;
1399   switch(dp->tag()) {
1400   case DataLayout::bit_data_tag:
1401   case DataLayout::no_tag:
1402     nb_cells = BitData::static_cell_count();
1403     break;
1404   case DataLayout::speculative_trap_data_tag:
1405     nb_cells = SpeculativeTrapData::static_cell_count();
1406     break;
1407   default:
1408     fatal("unexpected tag %d", dp->tag());
1409   }
1410   return (DataLayout*)((address)dp + DataLayout::compute_size_in_bytes(nb_cells));
1411 }
1412 
1413 ProfileData* MethodData::bci_to_extra_data_helper(int bci, Method* m, DataLayout*& dp, bool concurrent) {
1414   DataLayout* end = args_data_limit();
1415 
1416   for (;; dp = next_extra(dp)) {
1417     assert(dp < end, "moved past end of extra data");
1418     // No need for "OrderAccess::load_acquire" ops,
1419     // since the data structure is monotonic.
1420     switch(dp->tag()) {
1421     case DataLayout::no_tag:
1422       return NULL;
1423     case DataLayout::arg_info_data_tag:
1424       dp = end;
1425       return NULL; // ArgInfoData is at the end of extra data section.
1426     case DataLayout::bit_data_tag:
1427       if (m == NULL && dp->bci() == bci) {
1428         return new BitData(dp);
1429       }
1430       break;
1431     case DataLayout::speculative_trap_data_tag:
1432       if (m != NULL) {
1433         SpeculativeTrapData* data = new SpeculativeTrapData(dp);
1434         // data->method() may be null in case of a concurrent
1435         // allocation. Maybe it's for the same method. Try to use that
1436         // entry in that case.
1437         if (dp->bci() == bci) {
1438           if (data->method() == NULL) {


1533   st->print("method data for ");
1534   method()->print_value_on(st);
1535 }
1536 
1537 void MethodData::print_data_on(outputStream* st) const {
1538   ResourceMark rm;
1539   ProfileData* data = first_data();
1540   if (_parameters_type_data_di != no_parameters) {
1541     parameters_type_data()->print_data_on(st);
1542   }
1543   for ( ; is_valid(data); data = next_data(data)) {
1544     st->print("%d", dp_to_di(data->dp()));
1545     st->fill_to(6);
1546     data->print_data_on(st, this);
1547   }
1548   st->print_cr("--- Extra data:");
1549   DataLayout* dp    = extra_data_base();
1550   DataLayout* end   = args_data_limit();
1551   for (;; dp = next_extra(dp)) {
1552     assert(dp < end, "moved past end of extra data");
1553     // No need for "OrderAccess::load_acquire" ops,
1554     // since the data structure is monotonic.
1555     switch(dp->tag()) {
1556     case DataLayout::no_tag:
1557       continue;
1558     case DataLayout::bit_data_tag:
1559       data = new BitData(dp);
1560       break;
1561     case DataLayout::speculative_trap_data_tag:
1562       data = new SpeculativeTrapData(dp);
1563       break;
1564     case DataLayout::arg_info_data_tag:
1565       data = new ArgInfoData(dp);
1566       dp = end; // ArgInfoData is at the end of extra data section.
1567       break;
1568     default:
1569       fatal("unexpected tag %d", dp->tag());
1570     }
1571     st->print("%d", dp_to_di(data->dp()));
1572     st->fill_to(6);
1573     data->print_data_on(st);




1398   int nb_cells = 0;
1399   switch(dp->tag()) {
1400   case DataLayout::bit_data_tag:
1401   case DataLayout::no_tag:
1402     nb_cells = BitData::static_cell_count();
1403     break;
1404   case DataLayout::speculative_trap_data_tag:
1405     nb_cells = SpeculativeTrapData::static_cell_count();
1406     break;
1407   default:
1408     fatal("unexpected tag %d", dp->tag());
1409   }
1410   return (DataLayout*)((address)dp + DataLayout::compute_size_in_bytes(nb_cells));
1411 }
1412 
1413 ProfileData* MethodData::bci_to_extra_data_helper(int bci, Method* m, DataLayout*& dp, bool concurrent) {
1414   DataLayout* end = args_data_limit();
1415 
1416   for (;; dp = next_extra(dp)) {
1417     assert(dp < end, "moved past end of extra data");
1418     // No need for "Atomic::load_acquire" ops,
1419     // since the data structure is monotonic.
1420     switch(dp->tag()) {
1421     case DataLayout::no_tag:
1422       return NULL;
1423     case DataLayout::arg_info_data_tag:
1424       dp = end;
1425       return NULL; // ArgInfoData is at the end of extra data section.
1426     case DataLayout::bit_data_tag:
1427       if (m == NULL && dp->bci() == bci) {
1428         return new BitData(dp);
1429       }
1430       break;
1431     case DataLayout::speculative_trap_data_tag:
1432       if (m != NULL) {
1433         SpeculativeTrapData* data = new SpeculativeTrapData(dp);
1434         // data->method() may be null in case of a concurrent
1435         // allocation. Maybe it's for the same method. Try to use that
1436         // entry in that case.
1437         if (dp->bci() == bci) {
1438           if (data->method() == NULL) {


1533   st->print("method data for ");
1534   method()->print_value_on(st);
1535 }
1536 
1537 void MethodData::print_data_on(outputStream* st) const {
1538   ResourceMark rm;
1539   ProfileData* data = first_data();
1540   if (_parameters_type_data_di != no_parameters) {
1541     parameters_type_data()->print_data_on(st);
1542   }
1543   for ( ; is_valid(data); data = next_data(data)) {
1544     st->print("%d", dp_to_di(data->dp()));
1545     st->fill_to(6);
1546     data->print_data_on(st, this);
1547   }
1548   st->print_cr("--- Extra data:");
1549   DataLayout* dp    = extra_data_base();
1550   DataLayout* end   = args_data_limit();
1551   for (;; dp = next_extra(dp)) {
1552     assert(dp < end, "moved past end of extra data");
1553     // No need for "Atomic::load_acquire" ops,
1554     // since the data structure is monotonic.
1555     switch(dp->tag()) {
1556     case DataLayout::no_tag:
1557       continue;
1558     case DataLayout::bit_data_tag:
1559       data = new BitData(dp);
1560       break;
1561     case DataLayout::speculative_trap_data_tag:
1562       data = new SpeculativeTrapData(dp);
1563       break;
1564     case DataLayout::arg_info_data_tag:
1565       data = new ArgInfoData(dp);
1566       dp = end; // ArgInfoData is at the end of extra data section.
1567       break;
1568     default:
1569       fatal("unexpected tag %d", dp->tag());
1570     }
1571     st->print("%d", dp_to_di(data->dp()));
1572     st->fill_to(6);
1573     data->print_data_on(st);


< prev index next >