src/share/vm/ci/ciMethodData.cpp

changeset 5914
d13d7aba8c12
parent 5907
c775af091fe9
child 5921
ce0cc25bc5e2
     1.1 --- a/src/share/vm/ci/ciMethodData.cpp	Wed Oct 09 11:05:17 2013 -0700
     1.2 +++ b/src/share/vm/ci/ciMethodData.cpp	Wed Oct 09 16:32:21 2013 +0200
     1.3 @@ -125,7 +125,7 @@
     1.4  #endif
     1.5  }
     1.6  
     1.7 -void ciReceiverTypeData::translate_receiver_data_from(ProfileData* data) {
     1.8 +void ciReceiverTypeData::translate_receiver_data_from(const ProfileData* data) {
     1.9    for (uint row = 0; row < row_limit(); row++) {
    1.10      Klass* k = data->as_ReceiverTypeData()->receiver(row);
    1.11      if (k != NULL) {
    1.12 @@ -136,6 +136,13 @@
    1.13  }
    1.14  
    1.15  
    1.16 +void ciTypeStackSlotEntries::translate_type_data_from(const TypeStackSlotEntries* entries) {
    1.17 +  for (int i = 0; i < number_of_arguments(); i++) {
    1.18 +    intptr_t k = entries->type(i);
    1.19 +    TypeStackSlotEntries::set_type(i, translate_klass(k));
    1.20 +  }
    1.21 +}
    1.22 +
    1.23  // Get the data at an arbitrary (sort of) data index.
    1.24  ciProfileData* ciMethodData::data_at(int data_index) {
    1.25    if (out_of_bounds(data_index)) {
    1.26 @@ -166,6 +173,10 @@
    1.27      return new ciMultiBranchData(data_layout);
    1.28    case DataLayout::arg_info_data_tag:
    1.29      return new ciArgInfoData(data_layout);
    1.30 +  case DataLayout::call_type_data_tag:
    1.31 +    return new ciCallTypeData(data_layout);
    1.32 +  case DataLayout::virtual_call_type_data_tag:
    1.33 +    return new ciVirtualCallTypeData(data_layout);
    1.34    };
    1.35  }
    1.36  
    1.37 @@ -288,6 +299,20 @@
    1.38    }
    1.39  }
    1.40  
    1.41 +void ciMethodData::set_argument_type(int bci, int i, ciKlass* k) {
    1.42 +  VM_ENTRY_MARK;
    1.43 +  MethodData* mdo = get_MethodData();
    1.44 +  if (mdo != NULL) {
    1.45 +    ProfileData* data = mdo->bci_to_data(bci);
    1.46 +    if (data->is_CallTypeData()) {
    1.47 +      data->as_CallTypeData()->set_argument_type(i, k->get_Klass());
    1.48 +    } else {
    1.49 +      assert(data->is_VirtualCallTypeData(), "no arguments!");
    1.50 +      data->as_VirtualCallTypeData()->set_argument_type(i, k->get_Klass());
    1.51 +    }
    1.52 +  }
    1.53 +}
    1.54 +
    1.55  bool ciMethodData::has_escape_info() {
    1.56    return eflag_set(MethodData::estimated);
    1.57  }
    1.58 @@ -478,7 +503,36 @@
    1.59    }
    1.60  }
    1.61  
    1.62 -void ciReceiverTypeData::print_receiver_data_on(outputStream* st) {
    1.63 +void ciTypeEntries::print_ciklass(outputStream* st, intptr_t k) {
    1.64 +  if (TypeEntries::is_type_none(k)) {
    1.65 +    st->print("none");
    1.66 +  } else if (TypeEntries::is_type_unknown(k)) {
    1.67 +    st->print("unknown");
    1.68 +  } else {
    1.69 +    valid_ciklass(k)->print_name_on(st);
    1.70 +  }
    1.71 +  if (TypeEntries::was_null_seen(k)) {
    1.72 +    st->print(" (null seen)");
    1.73 +  }
    1.74 +}
    1.75 +
    1.76 +void ciTypeStackSlotEntries::print_data_on(outputStream* st) const {
    1.77 +  _pd->tab(st, true);
    1.78 +  st->print("argument types");
    1.79 +  for (int i = 0; i < number_of_arguments(); i++) {
    1.80 +    _pd->tab(st);
    1.81 +    st->print("%d: stack (%u) ", i, stack_slot(i));
    1.82 +    print_ciklass(st, type(i));
    1.83 +    st->cr();
    1.84 +  }
    1.85 +}
    1.86 +
    1.87 +void ciCallTypeData::print_data_on(outputStream* st) const {
    1.88 +  print_shared(st, "ciCallTypeData");
    1.89 +  args()->print_data_on(st);
    1.90 +}
    1.91 +
    1.92 +void ciReceiverTypeData::print_receiver_data_on(outputStream* st) const {
    1.93    uint row;
    1.94    int entries = 0;
    1.95    for (row = 0; row < row_limit(); row++) {
    1.96 @@ -494,13 +548,19 @@
    1.97    }
    1.98  }
    1.99  
   1.100 -void ciReceiverTypeData::print_data_on(outputStream* st) {
   1.101 +void ciReceiverTypeData::print_data_on(outputStream* st) const {
   1.102    print_shared(st, "ciReceiverTypeData");
   1.103    print_receiver_data_on(st);
   1.104  }
   1.105  
   1.106 -void ciVirtualCallData::print_data_on(outputStream* st) {
   1.107 +void ciVirtualCallData::print_data_on(outputStream* st) const {
   1.108    print_shared(st, "ciVirtualCallData");
   1.109    rtd_super()->print_receiver_data_on(st);
   1.110  }
   1.111 +
   1.112 +void ciVirtualCallTypeData::print_data_on(outputStream* st) const {
   1.113 +  print_shared(st, "ciVirtualCallTypeData");
   1.114 +  rtd_super()->print_receiver_data_on(st);
   1.115 +  args()->print_data_on(st);
   1.116 +}
   1.117  #endif

mercurial