mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 11:04:34 +02:00
8026054: New type profiling points: type of return values at calls
X86 interpreter and c1 type profiling for return values at calls Reviewed-by: kvn, twisti
This commit is contained in:
parent
0fa4a576fd
commit
c8bfc7e7d7
24 changed files with 814 additions and 216 deletions
|
@ -137,12 +137,17 @@ void ciReceiverTypeData::translate_receiver_data_from(const ProfileData* data) {
|
|||
|
||||
|
||||
void ciTypeStackSlotEntries::translate_type_data_from(const TypeStackSlotEntries* entries) {
|
||||
for (int i = 0; i < number_of_arguments(); i++) {
|
||||
for (int i = 0; i < _number_of_entries; i++) {
|
||||
intptr_t k = entries->type(i);
|
||||
TypeStackSlotEntries::set_type(i, translate_klass(k));
|
||||
}
|
||||
}
|
||||
|
||||
void ciReturnTypeEntry::translate_type_data_from(const ReturnTypeEntry* ret) {
|
||||
intptr_t k = ret->type();
|
||||
set_type(translate_klass(k));
|
||||
}
|
||||
|
||||
// Get the data at an arbitrary (sort of) data index.
|
||||
ciProfileData* ciMethodData::data_at(int data_index) {
|
||||
if (out_of_bounds(data_index)) {
|
||||
|
@ -313,6 +318,20 @@ void ciMethodData::set_argument_type(int bci, int i, ciKlass* k) {
|
|||
}
|
||||
}
|
||||
|
||||
void ciMethodData::set_return_type(int bci, ciKlass* k) {
|
||||
VM_ENTRY_MARK;
|
||||
MethodData* mdo = get_MethodData();
|
||||
if (mdo != NULL) {
|
||||
ProfileData* data = mdo->bci_to_data(bci);
|
||||
if (data->is_CallTypeData()) {
|
||||
data->as_CallTypeData()->set_return_type(k->get_Klass());
|
||||
} else {
|
||||
assert(data->is_VirtualCallTypeData(), "no arguments!");
|
||||
data->as_VirtualCallTypeData()->set_return_type(k->get_Klass());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool ciMethodData::has_escape_info() {
|
||||
return eflag_set(MethodData::estimated);
|
||||
}
|
||||
|
@ -517,9 +536,7 @@ void ciTypeEntries::print_ciklass(outputStream* st, intptr_t k) {
|
|||
}
|
||||
|
||||
void ciTypeStackSlotEntries::print_data_on(outputStream* st) const {
|
||||
_pd->tab(st, true);
|
||||
st->print("argument types");
|
||||
for (int i = 0; i < number_of_arguments(); i++) {
|
||||
for (int i = 0; i < _number_of_entries; i++) {
|
||||
_pd->tab(st);
|
||||
st->print("%d: stack (%u) ", i, stack_slot(i));
|
||||
print_ciklass(st, type(i));
|
||||
|
@ -527,9 +544,25 @@ void ciTypeStackSlotEntries::print_data_on(outputStream* st) const {
|
|||
}
|
||||
}
|
||||
|
||||
void ciReturnTypeEntry::print_data_on(outputStream* st) const {
|
||||
_pd->tab(st);
|
||||
st->print("ret ");
|
||||
print_ciklass(st, type());
|
||||
st->cr();
|
||||
}
|
||||
|
||||
void ciCallTypeData::print_data_on(outputStream* st) const {
|
||||
print_shared(st, "ciCallTypeData");
|
||||
args()->print_data_on(st);
|
||||
if (has_arguments()) {
|
||||
tab(st, true);
|
||||
st->print("argument types");
|
||||
args()->print_data_on(st);
|
||||
}
|
||||
if (has_return()) {
|
||||
tab(st, true);
|
||||
st->print("return type");
|
||||
ret()->print_data_on(st);
|
||||
}
|
||||
}
|
||||
|
||||
void ciReceiverTypeData::print_receiver_data_on(outputStream* st) const {
|
||||
|
@ -561,6 +594,15 @@ void ciVirtualCallData::print_data_on(outputStream* st) const {
|
|||
void ciVirtualCallTypeData::print_data_on(outputStream* st) const {
|
||||
print_shared(st, "ciVirtualCallTypeData");
|
||||
rtd_super()->print_receiver_data_on(st);
|
||||
args()->print_data_on(st);
|
||||
if (has_arguments()) {
|
||||
tab(st, true);
|
||||
st->print("argument types");
|
||||
args()->print_data_on(st);
|
||||
}
|
||||
if (has_return()) {
|
||||
tab(st, true);
|
||||
st->print("return type");
|
||||
ret()->print_data_on(st);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue