--- a/hotspot/src/share/vm/ci/ciMethodData.hpp Mon Oct 21 17:34:27 2013 -0700
+++ b/hotspot/src/share/vm/ci/ciMethodData.hpp Tue Oct 22 09:51:47 2013 +0200
@@ -43,6 +43,7 @@
class ciArgInfoData;
class ciCallTypeData;
class ciVirtualCallTypeData;
+class ciParametersTypeData;
typedef ProfileData ciProfileData;
@@ -124,7 +125,7 @@
ciTypeStackSlotEntries* args() const { return (ciTypeStackSlotEntries*)CallTypeData::args(); }
ciReturnTypeEntry* ret() const { return (ciReturnTypeEntry*)CallTypeData::ret(); }
- void translate_type_data_from(const ProfileData* data) {
+ void translate_from(const ProfileData* data) {
if (has_arguments()) {
args()->translate_type_data_from(data->as_CallTypeData()->args());
}
@@ -290,6 +291,25 @@
ciArgInfoData(DataLayout* layout) : ArgInfoData(layout) {};
};
+class ciParametersTypeData : public ParametersTypeData {
+public:
+ ciParametersTypeData(DataLayout* layout) : ParametersTypeData(layout) {}
+
+ virtual void translate_from(const ProfileData* data) {
+ parameters()->translate_type_data_from(data->as_ParametersTypeData()->parameters());
+ }
+
+ ciTypeStackSlotEntries* parameters() const { return (ciTypeStackSlotEntries*)ParametersTypeData::parameters(); }
+
+ ciKlass* valid_parameter_type(int i) const {
+ return parameters()->valid_type(i);
+ }
+
+#ifndef PRODUCT
+ void print_data_on(outputStream* st) const;
+#endif
+};
+
// ciMethodData
//
// This class represents a MethodData* in the HotSpot virtual
@@ -335,6 +355,10 @@
// Coherent snapshot of original header.
MethodData _orig;
+ // Dedicated area dedicated to parameters. Null if no parameter
+ // profiling for this method.
+ DataLayout* _parameters;
+
ciMethodData(MethodData* md);
ciMethodData();
@@ -403,6 +427,7 @@
// If the compiler finds a profiled type that is known statically
// for sure, set it in the MethodData
void set_argument_type(int bci, int i, ciKlass* k);
+ void set_parameter_type(int i, ciKlass* k);
void set_return_type(int bci, ciKlass* k);
void load_data();
@@ -467,6 +492,10 @@
bool is_arg_returned(int i) const;
uint arg_modified(int arg) const;
+ ciParametersTypeData* parameters_type_data() const {
+ return _parameters != NULL ? new ciParametersTypeData(_parameters) : NULL;
+ }
+
// Code generation helper
ByteSize offset_of_slot(ciProfileData* data, ByteSize slot_offset_in_data);
int byte_offset_of_slot(ciProfileData* data, ByteSize slot_offset_in_data) { return in_bytes(offset_of_slot(data, slot_offset_in_data)); }