src/share/vm/oops/methodData.hpp

Print this page




1267   ProfileData* bci_to_extra_data(int bci, bool create_if_missing);
1268 
1269   // return the argument info cell
1270   ArgInfoData *arg_info();
1271 
1272 public:
1273   static int header_size() {
1274     return sizeof(MethodData)/wordSize;
1275   }
1276 
1277   // Compute the size of a MethodData* before it is created.
1278   static int compute_allocation_size_in_bytes(methodHandle method);
1279   static int compute_allocation_size_in_words(methodHandle method);
1280   static int compute_extra_data_count(int data_size, int empty_bc_count);
1281 
1282   // Determine if a given bytecode can have profile information.
1283   static bool bytecode_has_profile(Bytecodes::Code code) {
1284     return bytecode_cell_count(code) != no_profile_data;
1285   }
1286 
1287   // Perform initialization of a new MethodData*
1288   void initialize(methodHandle method);
1289 
1290   // My size
1291   int size_in_bytes() const { return _size; }
1292   int size() const    { return align_object_size(align_size_up(_size, BytesPerWord)/BytesPerWord); }
1293 #if INCLUDE_SERVICES
1294   void collect_statistics(KlassSizeStats *sz) const;
1295 #endif
1296 
1297   int      creation_mileage() const  { return _creation_mileage; }
1298   void set_creation_mileage(int x)   { _creation_mileage = x; }
1299 
1300   int invocation_count() {
1301     if (invocation_counter()->carry()) {
1302       return InvocationCounter::count_limit;
1303     }
1304     return invocation_counter()->count();
1305   }
1306   int backedge_count() {
1307     if (backedge_counter()->carry()) {
1308       return InvocationCounter::count_limit;


1348   int num_blocks() const                      { return _num_blocks; }
1349   void set_num_blocks(int n)                  { _num_blocks = n;    }
1350 
1351   bool is_mature() const;  // consult mileage and ProfileMaturityPercentage
1352   static int mileage_of(Method* m);
1353 
1354   // Support for interprocedural escape analysis, from Thomas Kotzmann.
1355   enum EscapeFlag {
1356     estimated    = 1 << 0,
1357     return_local = 1 << 1,
1358     return_allocated = 1 << 2,
1359     allocated_escapes = 1 << 3,
1360     unknown_modified = 1 << 4
1361   };
1362 
1363   intx eflags()                                  { return _eflags; }
1364   intx arg_local()                               { return _arg_local; }
1365   intx arg_stack()                               { return _arg_stack; }
1366   intx arg_returned()                            { return _arg_returned; }
1367   uint arg_modified(int a)                       { ArgInfoData *aid = arg_info();

1368                                                    assert(a >= 0 && a < aid->number_of_args(), "valid argument number");
1369                                                    return aid->arg_modified(a); }
1370 
1371   void set_eflags(intx v)                        { _eflags = v; }
1372   void set_arg_local(intx v)                     { _arg_local = v; }
1373   void set_arg_stack(intx v)                     { _arg_stack = v; }
1374   void set_arg_returned(intx v)                  { _arg_returned = v; }
1375   void set_arg_modified(int a, uint v)           { ArgInfoData *aid = arg_info();

1376                                                    assert(a >= 0 && a < aid->number_of_args(), "valid argument number");
1377 
1378                                                    aid->set_arg_modified(a, v); }
1379 
1380   void clear_escape_info()                       { _eflags = _arg_local = _arg_stack = _arg_returned = 0; }
1381 
1382   // Location and size of data area
1383   address data_base() const {
1384     return (address) _data;
1385   }
1386   int data_size() const {
1387     return _data_size;
1388   }
1389 
1390   // Accessors
1391   Method* method() const { return _method; }
1392 
1393   // Get the data at an arbitrary (sort of) data index.
1394   ProfileData* data_at(int data_index) const;
1395 
1396   // Walk through the data in order.
1397   ProfileData* first_data() const { return data_at(first_di()); }




1267   ProfileData* bci_to_extra_data(int bci, bool create_if_missing);
1268 
1269   // return the argument info cell
1270   ArgInfoData *arg_info();
1271 
1272 public:
1273   static int header_size() {
1274     return sizeof(MethodData)/wordSize;
1275   }
1276 
1277   // Compute the size of a MethodData* before it is created.
1278   static int compute_allocation_size_in_bytes(methodHandle method);
1279   static int compute_allocation_size_in_words(methodHandle method);
1280   static int compute_extra_data_count(int data_size, int empty_bc_count);
1281 
1282   // Determine if a given bytecode can have profile information.
1283   static bool bytecode_has_profile(Bytecodes::Code code) {
1284     return bytecode_cell_count(code) != no_profile_data;
1285   }
1286 
1287   // reset into original state
1288   void init();
1289 
1290   // My size
1291   int size_in_bytes() const { return _size; }
1292   int size() const    { return align_object_size(align_size_up(_size, BytesPerWord)/BytesPerWord); }
1293 #if INCLUDE_SERVICES
1294   void collect_statistics(KlassSizeStats *sz) const;
1295 #endif
1296 
1297   int      creation_mileage() const  { return _creation_mileage; }
1298   void set_creation_mileage(int x)   { _creation_mileage = x; }
1299 
1300   int invocation_count() {
1301     if (invocation_counter()->carry()) {
1302       return InvocationCounter::count_limit;
1303     }
1304     return invocation_counter()->count();
1305   }
1306   int backedge_count() {
1307     if (backedge_counter()->carry()) {
1308       return InvocationCounter::count_limit;


1348   int num_blocks() const                      { return _num_blocks; }
1349   void set_num_blocks(int n)                  { _num_blocks = n;    }
1350 
1351   bool is_mature() const;  // consult mileage and ProfileMaturityPercentage
1352   static int mileage_of(Method* m);
1353 
1354   // Support for interprocedural escape analysis, from Thomas Kotzmann.
1355   enum EscapeFlag {
1356     estimated    = 1 << 0,
1357     return_local = 1 << 1,
1358     return_allocated = 1 << 2,
1359     allocated_escapes = 1 << 3,
1360     unknown_modified = 1 << 4
1361   };
1362 
1363   intx eflags()                                  { return _eflags; }
1364   intx arg_local()                               { return _arg_local; }
1365   intx arg_stack()                               { return _arg_stack; }
1366   intx arg_returned()                            { return _arg_returned; }
1367   uint arg_modified(int a)                       { ArgInfoData *aid = arg_info();
1368                                                    assert(aid != NULL, "arg_info must be not null");
1369                                                    assert(a >= 0 && a < aid->number_of_args(), "valid argument number");
1370                                                    return aid->arg_modified(a); }
1371 
1372   void set_eflags(intx v)                        { _eflags = v; }
1373   void set_arg_local(intx v)                     { _arg_local = v; }
1374   void set_arg_stack(intx v)                     { _arg_stack = v; }
1375   void set_arg_returned(intx v)                  { _arg_returned = v; }
1376   void set_arg_modified(int a, uint v)           { ArgInfoData *aid = arg_info();
1377                                                    assert(aid != NULL, "arg_info must be not null");
1378                                                    assert(a >= 0 && a < aid->number_of_args(), "valid argument number");

1379                                                    aid->set_arg_modified(a, v); }
1380 
1381   void clear_escape_info()                       { _eflags = _arg_local = _arg_stack = _arg_returned = 0; }
1382 
1383   // Location and size of data area
1384   address data_base() const {
1385     return (address) _data;
1386   }
1387   int data_size() const {
1388     return _data_size;
1389   }
1390 
1391   // Accessors
1392   Method* method() const { return _method; }
1393 
1394   // Get the data at an arbitrary (sort of) data index.
1395   ProfileData* data_at(int data_index) const;
1396 
1397   // Walk through the data in order.
1398   ProfileData* first_data() const { return data_at(first_di()); }