Mercurial > hg > graal-jvmci-8
comparison src/share/vm/ci/ciMethodData.cpp @ 12962:5ccbab1c69f3
8026251: New type profiling points: parameters to methods
Summary: x86 interpreter and c1 type profiling for parameters on method entries
Reviewed-by: kvn, twisti
author | roland |
---|---|
date | Tue, 22 Oct 2013 09:51:47 +0200 |
parents | ce0cc25bc5e2 |
children | de6a9e811145 |
comparison
equal
deleted
inserted
replaced
12961:4748b3308cda | 12962:5ccbab1c69f3 |
---|---|
51 // Set an initial hint. Don't use set_hint_di() because | 51 // Set an initial hint. Don't use set_hint_di() because |
52 // first_di() may be out of bounds if data_size is 0. | 52 // first_di() may be out of bounds if data_size is 0. |
53 _hint_di = first_di(); | 53 _hint_di = first_di(); |
54 // Initialize the escape information (to "don't know."); | 54 // Initialize the escape information (to "don't know."); |
55 _eflags = _arg_local = _arg_stack = _arg_returned = 0; | 55 _eflags = _arg_local = _arg_stack = _arg_returned = 0; |
56 _parameters = NULL; | |
56 } | 57 } |
57 | 58 |
58 // ------------------------------------------------------------------ | 59 // ------------------------------------------------------------------ |
59 // ciMethodData::ciMethodData | 60 // ciMethodData::ciMethodData |
60 // | 61 // |
72 // Set an initial hint. Don't use set_hint_di() because | 73 // Set an initial hint. Don't use set_hint_di() because |
73 // first_di() may be out of bounds if data_size is 0. | 74 // first_di() may be out of bounds if data_size is 0. |
74 _hint_di = first_di(); | 75 _hint_di = first_di(); |
75 // Initialize the escape information (to "don't know."); | 76 // Initialize the escape information (to "don't know."); |
76 _eflags = _arg_local = _arg_stack = _arg_returned = 0; | 77 _eflags = _arg_local = _arg_stack = _arg_returned = 0; |
78 _parameters = NULL; | |
77 } | 79 } |
78 | 80 |
79 void ciMethodData::load_data() { | 81 void ciMethodData::load_data() { |
80 MethodData* mdo = get_MethodData(); | 82 MethodData* mdo = get_MethodData(); |
81 if (mdo == NULL) { | 83 if (mdo == NULL) { |
106 while (is_valid(ci_data)) { | 108 while (is_valid(ci_data)) { |
107 ci_data->translate_from(data); | 109 ci_data->translate_from(data); |
108 ci_data = next_data(ci_data); | 110 ci_data = next_data(ci_data); |
109 data = mdo->next_data(data); | 111 data = mdo->next_data(data); |
110 } | 112 } |
113 if (mdo->parameters_type_data() != NULL) { | |
114 _parameters = data_layout_at(mdo->parameters_type_data_di()); | |
115 ciParametersTypeData* parameters = new ciParametersTypeData(_parameters); | |
116 parameters->translate_from(mdo->parameters_type_data()); | |
117 } | |
118 | |
111 // Note: Extra data are all BitData, and do not need translation. | 119 // Note: Extra data are all BitData, and do not need translation. |
112 _current_mileage = MethodData::mileage_of(mdo->method()); | 120 _current_mileage = MethodData::mileage_of(mdo->method()); |
113 _invocation_counter = mdo->invocation_count(); | 121 _invocation_counter = mdo->invocation_count(); |
114 _backedge_counter = mdo->backedge_count(); | 122 _backedge_counter = mdo->backedge_count(); |
115 _state = mdo->is_mature()? mature_state: immature_state; | 123 _state = mdo->is_mature()? mature_state: immature_state; |
180 return new ciArgInfoData(data_layout); | 188 return new ciArgInfoData(data_layout); |
181 case DataLayout::call_type_data_tag: | 189 case DataLayout::call_type_data_tag: |
182 return new ciCallTypeData(data_layout); | 190 return new ciCallTypeData(data_layout); |
183 case DataLayout::virtual_call_type_data_tag: | 191 case DataLayout::virtual_call_type_data_tag: |
184 return new ciVirtualCallTypeData(data_layout); | 192 return new ciVirtualCallTypeData(data_layout); |
193 case DataLayout::parameters_type_data_tag: | |
194 return new ciParametersTypeData(data_layout); | |
185 }; | 195 }; |
186 } | 196 } |
187 | 197 |
188 // Iteration over data. | 198 // Iteration over data. |
189 ciProfileData* ciMethodData::next_data(ciProfileData* current) { | 199 ciProfileData* ciMethodData::next_data(ciProfileData* current) { |
313 data->as_CallTypeData()->set_argument_type(i, k->get_Klass()); | 323 data->as_CallTypeData()->set_argument_type(i, k->get_Klass()); |
314 } else { | 324 } else { |
315 assert(data->is_VirtualCallTypeData(), "no arguments!"); | 325 assert(data->is_VirtualCallTypeData(), "no arguments!"); |
316 data->as_VirtualCallTypeData()->set_argument_type(i, k->get_Klass()); | 326 data->as_VirtualCallTypeData()->set_argument_type(i, k->get_Klass()); |
317 } | 327 } |
328 } | |
329 } | |
330 | |
331 void ciMethodData::set_parameter_type(int i, ciKlass* k) { | |
332 VM_ENTRY_MARK; | |
333 MethodData* mdo = get_MethodData(); | |
334 if (mdo != NULL) { | |
335 mdo->parameters_type_data()->set_type(i, k->get_Klass()); | |
318 } | 336 } |
319 } | 337 } |
320 | 338 |
321 void ciMethodData::set_return_type(int bci, ciKlass* k) { | 339 void ciMethodData::set_return_type(int bci, ciKlass* k) { |
322 VM_ENTRY_MARK; | 340 VM_ENTRY_MARK; |
603 tab(st, true); | 621 tab(st, true); |
604 st->print("return type"); | 622 st->print("return type"); |
605 ret()->print_data_on(st); | 623 ret()->print_data_on(st); |
606 } | 624 } |
607 } | 625 } |
626 | |
627 void ciParametersTypeData::print_data_on(outputStream* st) const { | |
628 st->print_cr("Parametertypes"); | |
629 parameters()->print_data_on(st); | |
630 } | |
608 #endif | 631 #endif |