comparison src/share/vm/ci/ciMethodData.hpp @ 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 b2ee5dc63353
comparison
equal deleted inserted replaced
12961:4748b3308cda 12962:5ccbab1c69f3
41 class ciArrayData; 41 class ciArrayData;
42 class ciMultiBranchData; 42 class ciMultiBranchData;
43 class ciArgInfoData; 43 class ciArgInfoData;
44 class ciCallTypeData; 44 class ciCallTypeData;
45 class ciVirtualCallTypeData; 45 class ciVirtualCallTypeData;
46 class ciParametersTypeData;
46 47
47 typedef ProfileData ciProfileData; 48 typedef ProfileData ciProfileData;
48 49
49 class ciBitData : public BitData { 50 class ciBitData : public BitData {
50 public: 51 public:
122 ciCallTypeData(DataLayout* layout) : CallTypeData(layout) {} 123 ciCallTypeData(DataLayout* layout) : CallTypeData(layout) {}
123 124
124 ciTypeStackSlotEntries* args() const { return (ciTypeStackSlotEntries*)CallTypeData::args(); } 125 ciTypeStackSlotEntries* args() const { return (ciTypeStackSlotEntries*)CallTypeData::args(); }
125 ciReturnTypeEntry* ret() const { return (ciReturnTypeEntry*)CallTypeData::ret(); } 126 ciReturnTypeEntry* ret() const { return (ciReturnTypeEntry*)CallTypeData::ret(); }
126 127
127 void translate_type_data_from(const ProfileData* data) { 128 void translate_from(const ProfileData* data) {
128 if (has_arguments()) { 129 if (has_arguments()) {
129 args()->translate_type_data_from(data->as_CallTypeData()->args()); 130 args()->translate_type_data_from(data->as_CallTypeData()->args());
130 } 131 }
131 if (has_return()) { 132 if (has_return()) {
132 ret()->translate_type_data_from(data->as_CallTypeData()->ret()); 133 ret()->translate_type_data_from(data->as_CallTypeData()->ret());
288 class ciArgInfoData : public ArgInfoData { 289 class ciArgInfoData : public ArgInfoData {
289 public: 290 public:
290 ciArgInfoData(DataLayout* layout) : ArgInfoData(layout) {}; 291 ciArgInfoData(DataLayout* layout) : ArgInfoData(layout) {};
291 }; 292 };
292 293
294 class ciParametersTypeData : public ParametersTypeData {
295 public:
296 ciParametersTypeData(DataLayout* layout) : ParametersTypeData(layout) {}
297
298 virtual void translate_from(const ProfileData* data) {
299 parameters()->translate_type_data_from(data->as_ParametersTypeData()->parameters());
300 }
301
302 ciTypeStackSlotEntries* parameters() const { return (ciTypeStackSlotEntries*)ParametersTypeData::parameters(); }
303
304 ciKlass* valid_parameter_type(int i) const {
305 return parameters()->valid_type(i);
306 }
307
308 #ifndef PRODUCT
309 void print_data_on(outputStream* st) const;
310 #endif
311 };
312
293 // ciMethodData 313 // ciMethodData
294 // 314 //
295 // This class represents a MethodData* in the HotSpot virtual 315 // This class represents a MethodData* in the HotSpot virtual
296 // machine. 316 // machine.
297 317
332 int _invocation_counter; 352 int _invocation_counter;
333 int _backedge_counter; 353 int _backedge_counter;
334 354
335 // Coherent snapshot of original header. 355 // Coherent snapshot of original header.
336 MethodData _orig; 356 MethodData _orig;
357
358 // Dedicated area dedicated to parameters. Null if no parameter
359 // profiling for this method.
360 DataLayout* _parameters;
337 361
338 ciMethodData(MethodData* md); 362 ciMethodData(MethodData* md);
339 ciMethodData(); 363 ciMethodData();
340 364
341 // Accessors 365 // Accessors
401 // Again, this is used to determine if a method is trivial. 425 // Again, this is used to determine if a method is trivial.
402 void set_compilation_stats(short loops, short blocks); 426 void set_compilation_stats(short loops, short blocks);
403 // If the compiler finds a profiled type that is known statically 427 // If the compiler finds a profiled type that is known statically
404 // for sure, set it in the MethodData 428 // for sure, set it in the MethodData
405 void set_argument_type(int bci, int i, ciKlass* k); 429 void set_argument_type(int bci, int i, ciKlass* k);
430 void set_parameter_type(int i, ciKlass* k);
406 void set_return_type(int bci, ciKlass* k); 431 void set_return_type(int bci, ciKlass* k);
407 432
408 void load_data(); 433 void load_data();
409 434
410 // Convert a dp (data pointer) to a di (data index). 435 // Convert a dp (data pointer) to a di (data index).
465 bool is_arg_local(int i) const; 490 bool is_arg_local(int i) const;
466 bool is_arg_stack(int i) const; 491 bool is_arg_stack(int i) const;
467 bool is_arg_returned(int i) const; 492 bool is_arg_returned(int i) const;
468 uint arg_modified(int arg) const; 493 uint arg_modified(int arg) const;
469 494
495 ciParametersTypeData* parameters_type_data() const {
496 return _parameters != NULL ? new ciParametersTypeData(_parameters) : NULL;
497 }
498
470 // Code generation helper 499 // Code generation helper
471 ByteSize offset_of_slot(ciProfileData* data, ByteSize slot_offset_in_data); 500 ByteSize offset_of_slot(ciProfileData* data, ByteSize slot_offset_in_data);
472 int byte_offset_of_slot(ciProfileData* data, ByteSize slot_offset_in_data) { return in_bytes(offset_of_slot(data, slot_offset_in_data)); } 501 int byte_offset_of_slot(ciProfileData* data, ByteSize slot_offset_in_data) { return in_bytes(offset_of_slot(data, slot_offset_in_data)); }
473 502
474 #ifndef PRODUCT 503 #ifndef PRODUCT