hotspot/src/share/vm/ci/ciMethodData.cpp
changeset 20702 bbe0fcde6e13
parent 20695 4f5a5e95090b
child 20709 034be898bf04
equal deleted inserted replaced
20701:ef9996662fd5 20702:bbe0fcde6e13
   123     ciReplay::initialize(this);
   123     ciReplay::initialize(this);
   124   }
   124   }
   125 #endif
   125 #endif
   126 }
   126 }
   127 
   127 
   128 void ciReceiverTypeData::translate_receiver_data_from(ProfileData* data) {
   128 void ciReceiverTypeData::translate_receiver_data_from(const ProfileData* data) {
   129   for (uint row = 0; row < row_limit(); row++) {
   129   for (uint row = 0; row < row_limit(); row++) {
   130     Klass* k = data->as_ReceiverTypeData()->receiver(row);
   130     Klass* k = data->as_ReceiverTypeData()->receiver(row);
   131     if (k != NULL) {
   131     if (k != NULL) {
   132       ciKlass* klass = CURRENT_ENV->get_klass(k);
   132       ciKlass* klass = CURRENT_ENV->get_klass(k);
   133       set_receiver(row, klass);
   133       set_receiver(row, klass);
   134     }
   134     }
   135   }
   135   }
   136 }
   136 }
   137 
   137 
       
   138 
       
   139 void ciTypeStackSlotEntries::translate_type_data_from(const TypeStackSlotEntries* entries) {
       
   140   for (int i = 0; i < number_of_arguments(); i++) {
       
   141     intptr_t k = entries->type(i);
       
   142     TypeStackSlotEntries::set_type(i, translate_klass(k));
       
   143   }
       
   144 }
   138 
   145 
   139 // Get the data at an arbitrary (sort of) data index.
   146 // Get the data at an arbitrary (sort of) data index.
   140 ciProfileData* ciMethodData::data_at(int data_index) {
   147 ciProfileData* ciMethodData::data_at(int data_index) {
   141   if (out_of_bounds(data_index)) {
   148   if (out_of_bounds(data_index)) {
   142     return NULL;
   149     return NULL;
   164     return new ciBranchData(data_layout);
   171     return new ciBranchData(data_layout);
   165   case DataLayout::multi_branch_data_tag:
   172   case DataLayout::multi_branch_data_tag:
   166     return new ciMultiBranchData(data_layout);
   173     return new ciMultiBranchData(data_layout);
   167   case DataLayout::arg_info_data_tag:
   174   case DataLayout::arg_info_data_tag:
   168     return new ciArgInfoData(data_layout);
   175     return new ciArgInfoData(data_layout);
       
   176   case DataLayout::call_type_data_tag:
       
   177     return new ciCallTypeData(data_layout);
       
   178   case DataLayout::virtual_call_type_data_tag:
       
   179     return new ciVirtualCallTypeData(data_layout);
   169   };
   180   };
   170 }
   181 }
   171 
   182 
   172 // Iteration over data.
   183 // Iteration over data.
   173 ciProfileData* ciMethodData::next_data(ciProfileData* current) {
   184 ciProfileData* ciMethodData::next_data(ciProfileData* current) {
   283 void ciMethodData::set_would_profile(bool p) {
   294 void ciMethodData::set_would_profile(bool p) {
   284   VM_ENTRY_MARK;
   295   VM_ENTRY_MARK;
   285   MethodData* mdo = get_MethodData();
   296   MethodData* mdo = get_MethodData();
   286   if (mdo != NULL) {
   297   if (mdo != NULL) {
   287     mdo->set_would_profile(p);
   298     mdo->set_would_profile(p);
       
   299   }
       
   300 }
       
   301 
       
   302 void ciMethodData::set_argument_type(int bci, int i, ciKlass* k) {
       
   303   VM_ENTRY_MARK;
       
   304   MethodData* mdo = get_MethodData();
       
   305   if (mdo != NULL) {
       
   306     ProfileData* data = mdo->bci_to_data(bci);
       
   307     if (data->is_CallTypeData()) {
       
   308       data->as_CallTypeData()->set_argument_type(i, k->get_Klass());
       
   309     } else {
       
   310       assert(data->is_VirtualCallTypeData(), "no arguments!");
       
   311       data->as_VirtualCallTypeData()->set_argument_type(i, k->get_Klass());
       
   312     }
   288   }
   313   }
   289 }
   314 }
   290 
   315 
   291 bool ciMethodData::has_escape_info() {
   316 bool ciMethodData::has_escape_info() {
   292   return eflag_set(MethodData::estimated);
   317   return eflag_set(MethodData::estimated);
   476     st->fill_to(6);
   501     st->fill_to(6);
   477     data->print_data_on(st);
   502     data->print_data_on(st);
   478   }
   503   }
   479 }
   504 }
   480 
   505 
   481 void ciReceiverTypeData::print_receiver_data_on(outputStream* st) {
   506 void ciTypeEntries::print_ciklass(outputStream* st, intptr_t k) {
       
   507   if (TypeEntries::is_type_none(k)) {
       
   508     st->print("none");
       
   509   } else if (TypeEntries::is_type_unknown(k)) {
       
   510     st->print("unknown");
       
   511   } else {
       
   512     valid_ciklass(k)->print_name_on(st);
       
   513   }
       
   514   if (TypeEntries::was_null_seen(k)) {
       
   515     st->print(" (null seen)");
       
   516   }
       
   517 }
       
   518 
       
   519 void ciTypeStackSlotEntries::print_data_on(outputStream* st) const {
       
   520   _pd->tab(st, true);
       
   521   st->print("argument types");
       
   522   for (int i = 0; i < number_of_arguments(); i++) {
       
   523     _pd->tab(st);
       
   524     st->print("%d: stack (%u) ", i, stack_slot(i));
       
   525     print_ciklass(st, type(i));
       
   526     st->cr();
       
   527   }
       
   528 }
       
   529 
       
   530 void ciCallTypeData::print_data_on(outputStream* st) const {
       
   531   print_shared(st, "ciCallTypeData");
       
   532   args()->print_data_on(st);
       
   533 }
       
   534 
       
   535 void ciReceiverTypeData::print_receiver_data_on(outputStream* st) const {
   482   uint row;
   536   uint row;
   483   int entries = 0;
   537   int entries = 0;
   484   for (row = 0; row < row_limit(); row++) {
   538   for (row = 0; row < row_limit(); row++) {
   485     if (receiver(row) != NULL)  entries++;
   539     if (receiver(row) != NULL)  entries++;
   486   }
   540   }
   492       st->print_cr("(%u)", receiver_count(row));
   546       st->print_cr("(%u)", receiver_count(row));
   493     }
   547     }
   494   }
   548   }
   495 }
   549 }
   496 
   550 
   497 void ciReceiverTypeData::print_data_on(outputStream* st) {
   551 void ciReceiverTypeData::print_data_on(outputStream* st) const {
   498   print_shared(st, "ciReceiverTypeData");
   552   print_shared(st, "ciReceiverTypeData");
   499   print_receiver_data_on(st);
   553   print_receiver_data_on(st);
   500 }
   554 }
   501 
   555 
   502 void ciVirtualCallData::print_data_on(outputStream* st) {
   556 void ciVirtualCallData::print_data_on(outputStream* st) const {
   503   print_shared(st, "ciVirtualCallData");
   557   print_shared(st, "ciVirtualCallData");
   504   rtd_super()->print_receiver_data_on(st);
   558   rtd_super()->print_receiver_data_on(st);
   505 }
   559 }
       
   560 
       
   561 void ciVirtualCallTypeData::print_data_on(outputStream* st) const {
       
   562   print_shared(st, "ciVirtualCallTypeData");
       
   563   rtd_super()->print_receiver_data_on(st);
       
   564   args()->print_data_on(st);
       
   565 }
   506 #endif
   566 #endif