Mercurial > hg > graal-jvmci-8
comparison src/share/vm/oops/methodData.hpp @ 13108:d84fa69a9874
added support for printing method profiles for virtual calls
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 22 Nov 2013 01:30:06 +0100 |
parents | 096c224171c4 |
children | 389d40d7d99f |
comparison
equal
deleted
inserted
replaced
13107:91933915d1d0 | 13108:d84fa69a9874 |
---|---|
1077 // C1/C2: count is incremented on type overflow and decremented for failed type checks | 1077 // C1/C2: count is incremented on type overflow and decremented for failed type checks |
1078 // Graal: count decremented for failed type checks and nonprofiled_count is incremented on type overflow | 1078 // Graal: count decremented for failed type checks and nonprofiled_count is incremented on type overflow |
1079 // TODO (chaeubl): in fact, Graal should also increment the count for failed type checks to mimic the C1/C2 behavior | 1079 // TODO (chaeubl): in fact, Graal should also increment the count for failed type checks to mimic the C1/C2 behavior |
1080 // VirtualCallData for invokevirtual/invokeinterface: | 1080 // VirtualCallData for invokevirtual/invokeinterface: |
1081 // C1/C2: count is incremented on type overflow | 1081 // C1/C2: count is incremented on type overflow |
1082 // Graal: count is incremented on type overflow, nonprofiled_count is increment on method overflow | 1082 // Graal: count is incremented on type overflow, nonprofiled_count is incremented on method overflow |
1083 | 1083 |
1084 // Graal is interested in knowing the percentage of type checks involving a type not explicitly in the profile | 1084 // Graal is interested in knowing the percentage of type checks involving a type not explicitly in the profile |
1085 nonprofiled_count_off_set = counter_cell_count, | 1085 nonprofiled_count_off_set = counter_cell_count, |
1086 receiver0_offset, | 1086 receiver0_offset, |
1087 #else | 1087 #else |
1181 } | 1181 } |
1182 #ifdef GRAAL | 1182 #ifdef GRAAL |
1183 static ByteSize nonprofiled_receiver_count_offset() { | 1183 static ByteSize nonprofiled_receiver_count_offset() { |
1184 return cell_offset(nonprofiled_count_off_set); | 1184 return cell_offset(nonprofiled_count_off_set); |
1185 } | 1185 } |
1186 uint nonprofiled_count() const { | |
1187 return uint_at(nonprofiled_count_off_set); | |
1188 } | |
1186 void set_nonprofiled_count(uint count) { | 1189 void set_nonprofiled_count(uint count) { |
1187 set_uint_at(nonprofiled_count_off_set, count); | 1190 set_uint_at(nonprofiled_count_off_set, count); |
1188 } | 1191 } |
1189 #endif | 1192 #endif |
1190 static ByteSize receiver_type_data_size() { | 1193 static ByteSize receiver_type_data_size() { |
1243 } | 1246 } |
1244 static uint method_row_limit() { | 1247 static uint method_row_limit() { |
1245 return MethodProfileWidth; | 1248 return MethodProfileWidth; |
1246 } | 1249 } |
1247 | 1250 |
1248 Method* method(uint row) { | 1251 Method* method(uint row) const { |
1249 assert(row < method_row_limit(), "oob"); | 1252 assert(row < method_row_limit(), "oob"); |
1250 | 1253 |
1251 Method* method = (Method*)intptr_at(method_cell_index(row)); | 1254 Method* method = (Method*)intptr_at(method_cell_index(row)); |
1252 assert(method == NULL || method->is_method(), "must be"); | 1255 assert(method == NULL || method->is_method(), "must be"); |
1253 return method; | 1256 return method; |
1257 } | |
1258 | |
1259 uint method_count(uint row) const { | |
1260 assert(row < method_row_limit(), "oob"); | |
1261 return uint_at(method_count_cell_index(row)); | |
1254 } | 1262 } |
1255 | 1263 |
1256 void set_method(uint row, Method* m) { | 1264 void set_method(uint row, Method* m) { |
1257 assert((uint)row < method_row_limit(), "oob"); | 1265 assert((uint)row < method_row_limit(), "oob"); |
1258 set_intptr_at(method_cell_index(row), (uintptr_t)m); | 1266 set_intptr_at(method_cell_index(row), (uintptr_t)m); |
1274 // GC support | 1282 // GC support |
1275 virtual void clean_weak_klass_links(BoolObjectClosure* is_alive_closure); | 1283 virtual void clean_weak_klass_links(BoolObjectClosure* is_alive_closure); |
1276 #endif | 1284 #endif |
1277 | 1285 |
1278 #ifndef PRODUCT | 1286 #ifndef PRODUCT |
1287 #ifdef GRAAL | |
1288 void print_method_data_on(outputStream* st) const; | |
1289 #endif | |
1279 void print_data_on(outputStream* st) const; | 1290 void print_data_on(outputStream* st) const; |
1280 #endif | 1291 #endif |
1281 }; | 1292 }; |
1282 | 1293 |
1283 // VirtualCallTypeData | 1294 // VirtualCallTypeData |