1280 // 1281 class nmethodBucket: public CHeapObj<mtClass> { 1282 friend class VMStructs; 1283 private: 1284 nmethod* _nmethod; 1285 int _count; 1286 nmethodBucket* _next; 1287 1288 public: 1289 nmethodBucket(nmethod* nmethod, nmethodBucket* next) { 1290 _nmethod = nmethod; 1291 _next = next; 1292 _count = 1; 1293 } 1294 int count() { return _count; } 1295 int increment() { _count += 1; return _count; } 1296 int decrement(); 1297 nmethodBucket* next() { return _next; } 1298 void set_next(nmethodBucket* b) { _next = b; } 1299 nmethod* get_nmethod() { return _nmethod; } 1300 }; 1301 1302 // An iterator that's used to access the inner classes indices in the 1303 // InstanceKlass::_inner_classes array. 1304 class InnerClassesIterator : public StackObj { 1305 private: 1306 Array<jushort>* _inner_classes; 1307 int _length; 1308 int _idx; 1309 public: 1310 1311 InnerClassesIterator(instanceKlassHandle k) { 1312 _inner_classes = k->inner_classes(); 1313 if (k->inner_classes() != NULL) { 1314 _length = _inner_classes->length(); 1315 // The inner class array's length should be the multiple of 1316 // inner_class_next_offset if it only contains the InnerClasses 1317 // attribute data, or it should be 1318 // n*inner_class_next_offset+enclosing_method_attribute_size 1319 // if it also contains the EnclosingMethod data. | 1280 // 1281 class nmethodBucket: public CHeapObj<mtClass> { 1282 friend class VMStructs; 1283 private: 1284 nmethod* _nmethod; 1285 int _count; 1286 nmethodBucket* _next; 1287 1288 public: 1289 nmethodBucket(nmethod* nmethod, nmethodBucket* next) { 1290 _nmethod = nmethod; 1291 _next = next; 1292 _count = 1; 1293 } 1294 int count() { return _count; } 1295 int increment() { _count += 1; return _count; } 1296 int decrement(); 1297 nmethodBucket* next() { return _next; } 1298 void set_next(nmethodBucket* b) { _next = b; } 1299 nmethod* get_nmethod() { return _nmethod; } 1300 1301 static int mark_dependent_nmethods(nmethodBucket* deps, DepChange& changes); 1302 static nmethodBucket* add_dependent_nmethod(nmethodBucket* deps, nmethod* nm); 1303 static bool remove_dependent_nmethod(nmethodBucket* deps, nmethod* nm); 1304 static nmethodBucket* clean_dependent_nmethods(nmethodBucket* deps); 1305 #ifndef PRODUCT 1306 static void print_dependent_nmethods(nmethodBucket* deps, bool verbose); 1307 static bool is_dependent_nmethod(nmethodBucket* deps, nmethod* nm); 1308 #endif //PRODUCT 1309 }; 1310 1311 // An iterator that's used to access the inner classes indices in the 1312 // InstanceKlass::_inner_classes array. 1313 class InnerClassesIterator : public StackObj { 1314 private: 1315 Array<jushort>* _inner_classes; 1316 int _length; 1317 int _idx; 1318 public: 1319 1320 InnerClassesIterator(instanceKlassHandle k) { 1321 _inner_classes = k->inner_classes(); 1322 if (k->inner_classes() != NULL) { 1323 _length = _inner_classes->length(); 1324 // The inner class array's length should be the multiple of 1325 // inner_class_next_offset if it only contains the InnerClasses 1326 // attribute data, or it should be 1327 // n*inner_class_next_offset+enclosing_method_attribute_size 1328 // if it also contains the EnclosingMethod data. |