src/share/vm/code/codeCache.cpp

changeset 1999
2a47bd84841f
parent 1934
e9ff18c4ace7
child 2103
3e8fbc61cee8
     1.1 --- a/src/share/vm/code/codeCache.cpp	Wed Jul 07 12:40:01 2010 -0700
     1.2 +++ b/src/share/vm/code/codeCache.cpp	Thu Jul 08 14:29:44 2010 -0700
     1.3 @@ -93,6 +93,8 @@
     1.4  
     1.5  CodeHeap * CodeCache::_heap = new CodeHeap();
     1.6  int CodeCache::_number_of_blobs = 0;
     1.7 +int CodeCache::_number_of_adapters = 0;
     1.8 +int CodeCache::_number_of_nmethods = 0;
     1.9  int CodeCache::_number_of_nmethods_with_dependencies = 0;
    1.10  bool CodeCache::_needs_cache_clean = false;
    1.11  nmethod* CodeCache::_scavenge_root_nmethods = NULL;
    1.12 @@ -176,8 +178,14 @@
    1.13    verify_if_often();
    1.14  
    1.15    print_trace("free", cb);
    1.16 -  if (cb->is_nmethod() && ((nmethod *)cb)->has_dependencies()) {
    1.17 -    _number_of_nmethods_with_dependencies--;
    1.18 +  if (cb->is_nmethod()) {
    1.19 +    _number_of_nmethods--;
    1.20 +    if (((nmethod *)cb)->has_dependencies()) {
    1.21 +      _number_of_nmethods_with_dependencies--;
    1.22 +    }
    1.23 +  }
    1.24 +  if (cb->is_adapter_blob()) {
    1.25 +    _number_of_adapters--;
    1.26    }
    1.27    _number_of_blobs--;
    1.28  
    1.29 @@ -191,9 +199,16 @@
    1.30  void CodeCache::commit(CodeBlob* cb) {
    1.31    // this is called by nmethod::nmethod, which must already own CodeCache_lock
    1.32    assert_locked_or_safepoint(CodeCache_lock);
    1.33 -  if (cb->is_nmethod() && ((nmethod *)cb)->has_dependencies()) {
    1.34 -    _number_of_nmethods_with_dependencies++;
    1.35 +  if (cb->is_nmethod()) {
    1.36 +    _number_of_nmethods++;
    1.37 +    if (((nmethod *)cb)->has_dependencies()) {
    1.38 +      _number_of_nmethods_with_dependencies++;
    1.39 +    }
    1.40    }
    1.41 +  if (cb->is_adapter_blob()) {
    1.42 +    _number_of_adapters++;
    1.43 +  }
    1.44 +
    1.45    // flush the hardware I-cache
    1.46    ICache::invalidate_range(cb->instructions_begin(), cb->instructions_size());
    1.47  }

mercurial