1204 intx _eflags; // flags on escape information |
1204 intx _eflags; // flags on escape information |
1205 intx _arg_local; // bit set of non-escaping arguments |
1205 intx _arg_local; // bit set of non-escaping arguments |
1206 intx _arg_stack; // bit set of stack-allocatable arguments |
1206 intx _arg_stack; // bit set of stack-allocatable arguments |
1207 intx _arg_returned; // bit set of returned arguments |
1207 intx _arg_returned; // bit set of returned arguments |
1208 |
1208 |
1209 int _creation_mileage; // method mileage at MDO creation |
1209 int _creation_mileage; // method mileage at MDO creation |
|
1210 |
|
1211 // How many invocations has this MDO seen? |
|
1212 // These counters are used to determine the exact age of MDO. |
|
1213 // We need those because in tiered a method can be concurrently |
|
1214 // executed at different levels. |
|
1215 InvocationCounter _invocation_counter; |
|
1216 // Same for backedges. |
|
1217 InvocationCounter _backedge_counter; |
|
1218 // Number of loops and blocks is computed when compiling the first |
|
1219 // time with C1. It is used to determine if method is trivial. |
|
1220 short _num_loops; |
|
1221 short _num_blocks; |
|
1222 // Highest compile level this method has ever seen. |
|
1223 u1 _highest_comp_level; |
|
1224 // Same for OSR level |
|
1225 u1 _highest_osr_comp_level; |
|
1226 // Does this method contain anything worth profiling? |
|
1227 bool _would_profile; |
1210 |
1228 |
1211 // Size of _data array in bytes. (Excludes header and extra_data fields.) |
1229 // Size of _data array in bytes. (Excludes header and extra_data fields.) |
1212 int _data_size; |
1230 int _data_size; |
1213 |
1231 |
1214 // Beginning of the data entries |
1232 // Beginning of the data entries |
1290 return align_object_size(align_size_up(_size, BytesPerWord)/BytesPerWord); |
1308 return align_object_size(align_size_up(_size, BytesPerWord)/BytesPerWord); |
1291 } |
1309 } |
1292 |
1310 |
1293 int creation_mileage() const { return _creation_mileage; } |
1311 int creation_mileage() const { return _creation_mileage; } |
1294 void set_creation_mileage(int x) { _creation_mileage = x; } |
1312 void set_creation_mileage(int x) { _creation_mileage = x; } |
|
1313 |
|
1314 int invocation_count() { |
|
1315 if (invocation_counter()->carry()) { |
|
1316 return InvocationCounter::count_limit; |
|
1317 } |
|
1318 return invocation_counter()->count(); |
|
1319 } |
|
1320 int backedge_count() { |
|
1321 if (backedge_counter()->carry()) { |
|
1322 return InvocationCounter::count_limit; |
|
1323 } |
|
1324 return backedge_counter()->count(); |
|
1325 } |
|
1326 |
|
1327 InvocationCounter* invocation_counter() { return &_invocation_counter; } |
|
1328 InvocationCounter* backedge_counter() { return &_backedge_counter; } |
|
1329 |
|
1330 void set_would_profile(bool p) { _would_profile = p; } |
|
1331 bool would_profile() const { return _would_profile; } |
|
1332 |
|
1333 int highest_comp_level() { return _highest_comp_level; } |
|
1334 void set_highest_comp_level(int level) { _highest_comp_level = level; } |
|
1335 int highest_osr_comp_level() { return _highest_osr_comp_level; } |
|
1336 void set_highest_osr_comp_level(int level) { _highest_osr_comp_level = level; } |
|
1337 |
|
1338 int num_loops() const { return _num_loops; } |
|
1339 void set_num_loops(int n) { _num_loops = n; } |
|
1340 int num_blocks() const { return _num_blocks; } |
|
1341 void set_num_blocks(int n) { _num_blocks = n; } |
|
1342 |
1295 bool is_mature() const; // consult mileage and ProfileMaturityPercentage |
1343 bool is_mature() const; // consult mileage and ProfileMaturityPercentage |
1296 static int mileage_of(methodOop m); |
1344 static int mileage_of(methodOop m); |
1297 |
1345 |
1298 // Support for interprocedural escape analysis, from Thomas Kotzmann. |
1346 // Support for interprocedural escape analysis, from Thomas Kotzmann. |
1299 enum EscapeFlag { |
1347 enum EscapeFlag { |
1411 return _nof_decompiles; |
1459 return _nof_decompiles; |
1412 } |
1460 } |
1413 void inc_decompile_count() { |
1461 void inc_decompile_count() { |
1414 _nof_decompiles += 1; |
1462 _nof_decompiles += 1; |
1415 if (decompile_count() > (uint)PerMethodRecompilationCutoff) { |
1463 if (decompile_count() > (uint)PerMethodRecompilationCutoff) { |
1416 method()->set_not_compilable(); |
1464 method()->set_not_compilable(CompLevel_full_optimization); |
1417 } |
1465 } |
1418 } |
1466 } |
1419 |
1467 |
1420 // Support for code generation |
1468 // Support for code generation |
1421 static ByteSize data_offset() { |
1469 static ByteSize data_offset() { |
1422 return byte_offset_of(methodDataOopDesc, _data[0]); |
1470 return byte_offset_of(methodDataOopDesc, _data[0]); |
|
1471 } |
|
1472 |
|
1473 static ByteSize invocation_counter_offset() { |
|
1474 return byte_offset_of(methodDataOopDesc, _invocation_counter); |
|
1475 } |
|
1476 static ByteSize backedge_counter_offset() { |
|
1477 return byte_offset_of(methodDataOopDesc, _backedge_counter); |
1423 } |
1478 } |
1424 |
1479 |
1425 // GC support |
1480 // GC support |
1426 oop* adr_method() const { return (oop*)&_method; } |
1481 oop* adr_method() const { return (oop*)&_method; } |
1427 bool object_is_parsable() const { return _size != 0; } |
1482 bool object_is_parsable() const { return _size != 0; } |