1042 |
1042 |
1043 public: |
1043 public: |
1044 // "cached_value" points to the first associated set-oop. |
1044 // "cached_value" points to the first associated set-oop. |
1045 // The oop_limit helps find the last associated set-oop. |
1045 // The oop_limit helps find the last associated set-oop. |
1046 // (See comments at the top of this file.) |
1046 // (See comments at the top of this file.) |
1047 static RelocationHolder spec(address cached_value) { |
1047 static RelocationHolder spec(address cached_value, jint method_index = 0) { |
1048 RelocationHolder rh = newHolder(); |
1048 RelocationHolder rh = newHolder(); |
1049 new(rh) virtual_call_Relocation(cached_value); |
1049 new(rh) virtual_call_Relocation(cached_value, method_index); |
1050 return rh; |
1050 return rh; |
1051 } |
1051 } |
1052 |
1052 |
1053 virtual_call_Relocation(address cached_value) { |
1053 private: |
|
1054 address _cached_value; // location of set-value instruction |
|
1055 jint _method_index; // resolved method for a Java call |
|
1056 |
|
1057 virtual_call_Relocation(address cached_value, int method_index) { |
1054 _cached_value = cached_value; |
1058 _cached_value = cached_value; |
|
1059 _method_index = method_index; |
1055 assert(cached_value != NULL, "first oop address must be specified"); |
1060 assert(cached_value != NULL, "first oop address must be specified"); |
1056 } |
1061 } |
1057 |
|
1058 private: |
|
1059 address _cached_value; // location of set-value instruction |
|
1060 |
1062 |
1061 friend class RelocIterator; |
1063 friend class RelocIterator; |
1062 virtual_call_Relocation() { } |
1064 virtual_call_Relocation() { } |
1063 |
1065 |
1064 |
|
1065 public: |
1066 public: |
1066 address cached_value(); |
1067 address cached_value(); |
|
1068 |
|
1069 int method_index() { return _method_index; } |
|
1070 Method* method_value(); |
1067 |
1071 |
1068 // data is packed as scaled offsets in "2_ints" format: [f l] or [Ff Ll] |
1072 // data is packed as scaled offsets in "2_ints" format: [f l] or [Ff Ll] |
1069 // oop_limit is set to 0 if the limit falls somewhere within the call. |
1073 // oop_limit is set to 0 if the limit falls somewhere within the call. |
1070 // When unpacking, a zero oop_limit is taken to refer to the end of the call. |
1074 // When unpacking, a zero oop_limit is taken to refer to the end of the call. |
1071 // (This has the effect of bringing in the call's delay slot on SPARC.) |
1075 // (This has the effect of bringing in the call's delay slot on SPARC.) |
1078 |
1082 |
1079 class opt_virtual_call_Relocation : public CallRelocation { |
1083 class opt_virtual_call_Relocation : public CallRelocation { |
1080 relocInfo::relocType type() { return relocInfo::opt_virtual_call_type; } |
1084 relocInfo::relocType type() { return relocInfo::opt_virtual_call_type; } |
1081 |
1085 |
1082 public: |
1086 public: |
1083 static RelocationHolder spec() { |
1087 static RelocationHolder spec(int method_index = 0) { |
1084 RelocationHolder rh = newHolder(); |
1088 RelocationHolder rh = newHolder(); |
1085 new(rh) opt_virtual_call_Relocation(); |
1089 new(rh) opt_virtual_call_Relocation(method_index); |
1086 return rh; |
1090 return rh; |
1087 } |
1091 } |
1088 |
1092 |
1089 private: |
1093 private: |
|
1094 jint _method_index; // resolved method for a Java call |
|
1095 |
|
1096 opt_virtual_call_Relocation(int method_index) { |
|
1097 _method_index = method_index; |
|
1098 } |
|
1099 |
1090 friend class RelocIterator; |
1100 friend class RelocIterator; |
1091 opt_virtual_call_Relocation() { } |
1101 opt_virtual_call_Relocation() {} |
1092 |
1102 |
1093 public: |
1103 public: |
|
1104 int method_index() { return _method_index; } |
|
1105 Method* method_value(); |
|
1106 |
|
1107 void pack_data_to(CodeSection* dest); |
|
1108 void unpack_data(); |
|
1109 |
1094 void clear_inline_cache(); |
1110 void clear_inline_cache(); |
1095 |
1111 |
1096 // find the matching static_stub |
1112 // find the matching static_stub |
1097 address static_stub(); |
1113 address static_stub(); |
1098 }; |
1114 }; |
1100 |
1116 |
1101 class static_call_Relocation : public CallRelocation { |
1117 class static_call_Relocation : public CallRelocation { |
1102 relocInfo::relocType type() { return relocInfo::static_call_type; } |
1118 relocInfo::relocType type() { return relocInfo::static_call_type; } |
1103 |
1119 |
1104 public: |
1120 public: |
1105 static RelocationHolder spec() { |
1121 static RelocationHolder spec(int method_index = 0) { |
1106 RelocationHolder rh = newHolder(); |
1122 RelocationHolder rh = newHolder(); |
1107 new(rh) static_call_Relocation(); |
1123 new(rh) static_call_Relocation(method_index); |
1108 return rh; |
1124 return rh; |
1109 } |
1125 } |
1110 |
1126 |
1111 private: |
1127 private: |
|
1128 jint _method_index; // resolved method for a Java call |
|
1129 |
|
1130 static_call_Relocation(int method_index) { |
|
1131 _method_index = method_index; |
|
1132 } |
|
1133 |
1112 friend class RelocIterator; |
1134 friend class RelocIterator; |
1113 static_call_Relocation() { } |
1135 static_call_Relocation() {} |
1114 |
1136 |
1115 public: |
1137 public: |
|
1138 int method_index() { return _method_index; } |
|
1139 Method* method_value(); |
|
1140 |
|
1141 void pack_data_to(CodeSection* dest); |
|
1142 void unpack_data(); |
|
1143 |
1116 void clear_inline_cache(); |
1144 void clear_inline_cache(); |
1117 |
1145 |
1118 // find the matching static_stub |
1146 // find the matching static_stub |
1119 address static_stub(); |
1147 address static_stub(); |
1120 }; |
1148 }; |