comparison src/share/vm/oops/instanceKlass.cpp @ 3939:f6f3bb0ee072

7088955: add C2 IR support to the SA Reviewed-by: kvn
author never
date Sun, 11 Sep 2011 14:48:24 -0700
parents e6b1331a51d2
children f08d439fab8c
comparison
equal deleted inserted replaced
3938:e6b1331a51d2 3939:f6f3bb0ee072
1370 return -1; 1370 return -1;
1371 } 1371 }
1372 1372
1373 1373
1374 // 1374 //
1375 // nmethodBucket is used to record dependent nmethods for
1376 // deoptimization. nmethod dependencies are actually <klass, method>
1377 // pairs but we really only care about the klass part for purposes of
1378 // finding nmethods which might need to be deoptimized. Instead of
1379 // recording the method, a count of how many times a particular nmethod
1380 // was recorded is kept. This ensures that any recording errors are
1381 // noticed since an nmethod should be removed as many times are it's
1382 // added.
1383 //
1384 class nmethodBucket {
1385 private:
1386 nmethod* _nmethod;
1387 int _count;
1388 nmethodBucket* _next;
1389
1390 public:
1391 nmethodBucket(nmethod* nmethod, nmethodBucket* next) {
1392 _nmethod = nmethod;
1393 _next = next;
1394 _count = 1;
1395 }
1396 int count() { return _count; }
1397 int increment() { _count += 1; return _count; }
1398 int decrement() { _count -= 1; assert(_count >= 0, "don't underflow"); return _count; }
1399 nmethodBucket* next() { return _next; }
1400 void set_next(nmethodBucket* b) { _next = b; }
1401 nmethod* get_nmethod() { return _nmethod; }
1402 };
1403
1404
1405 //
1406 // Walk the list of dependent nmethods searching for nmethods which 1375 // Walk the list of dependent nmethods searching for nmethods which
1407 // are dependent on the changes that were passed in and mark them for 1376 // are dependent on the changes that were passed in and mark them for
1408 // deoptimization. Returns the number of nmethods found. 1377 // deoptimization. Returns the number of nmethods found.
1409 // 1378 //
1410 int instanceKlass::mark_dependent_nmethods(DepChange& changes) { 1379 int instanceKlass::mark_dependent_nmethods(DepChange& changes) {