src/share/vm/code/codeCache.cpp

changeset 5792
510fbd28919c
parent 5237
f2110083203d
child 6680
78bbf4d43a14
     1.1 --- a/src/share/vm/code/codeCache.cpp	Fri Sep 27 08:39:19 2013 +0200
     1.2 +++ b/src/share/vm/code/codeCache.cpp	Fri Sep 27 10:50:55 2013 +0200
     1.3 @@ -124,7 +124,6 @@
     1.4  int CodeCache::_number_of_nmethods_with_dependencies = 0;
     1.5  bool CodeCache::_needs_cache_clean = false;
     1.6  nmethod* CodeCache::_scavenge_root_nmethods = NULL;
     1.7 -nmethod* CodeCache::_saved_nmethods = NULL;
     1.8  
     1.9  int CodeCache::_codemem_full_count = 0;
    1.10  
    1.11 @@ -464,96 +463,11 @@
    1.12  }
    1.13  #endif //PRODUCT
    1.14  
    1.15 -/**
    1.16 - * Remove and return nmethod from the saved code list in order to reanimate it.
    1.17 - */
    1.18 -nmethod* CodeCache::reanimate_saved_code(Method* m) {
    1.19 -  MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
    1.20 -  nmethod* saved = _saved_nmethods;
    1.21 -  nmethod* prev = NULL;
    1.22 -  while (saved != NULL) {
    1.23 -    if (saved->is_in_use() && saved->method() == m) {
    1.24 -      if (prev != NULL) {
    1.25 -        prev->set_saved_nmethod_link(saved->saved_nmethod_link());
    1.26 -      } else {
    1.27 -        _saved_nmethods = saved->saved_nmethod_link();
    1.28 -      }
    1.29 -      assert(saved->is_speculatively_disconnected(), "shouldn't call for other nmethods");
    1.30 -      saved->set_speculatively_disconnected(false);
    1.31 -      saved->set_saved_nmethod_link(NULL);
    1.32 -      if (PrintMethodFlushing) {
    1.33 -        saved->print_on(tty, " ### nmethod is reconnected");
    1.34 -      }
    1.35 -      if (LogCompilation && (xtty != NULL)) {
    1.36 -        ttyLocker ttyl;
    1.37 -        xtty->begin_elem("nmethod_reconnected compile_id='%3d'", saved->compile_id());
    1.38 -        xtty->method(m);
    1.39 -        xtty->stamp();
    1.40 -        xtty->end_elem();
    1.41 -      }
    1.42 -      return saved;
    1.43 -    }
    1.44 -    prev = saved;
    1.45 -    saved = saved->saved_nmethod_link();
    1.46 -  }
    1.47 -  return NULL;
    1.48 -}
    1.49 -
    1.50 -/**
    1.51 - * Remove nmethod from the saved code list in order to discard it permanently
    1.52 - */
    1.53 -void CodeCache::remove_saved_code(nmethod* nm) {
    1.54 -  // For conc swpr this will be called with CodeCache_lock taken by caller
    1.55 -  assert_locked_or_safepoint(CodeCache_lock);
    1.56 -  assert(nm->is_speculatively_disconnected(), "shouldn't call for other nmethods");
    1.57 -  nmethod* saved = _saved_nmethods;
    1.58 -  nmethod* prev = NULL;
    1.59 -  while (saved != NULL) {
    1.60 -    if (saved == nm) {
    1.61 -      if (prev != NULL) {
    1.62 -        prev->set_saved_nmethod_link(saved->saved_nmethod_link());
    1.63 -      } else {
    1.64 -        _saved_nmethods = saved->saved_nmethod_link();
    1.65 -      }
    1.66 -      if (LogCompilation && (xtty != NULL)) {
    1.67 -        ttyLocker ttyl;
    1.68 -        xtty->begin_elem("nmethod_removed compile_id='%3d'", nm->compile_id());
    1.69 -        xtty->stamp();
    1.70 -        xtty->end_elem();
    1.71 -      }
    1.72 -      return;
    1.73 -    }
    1.74 -    prev = saved;
    1.75 -    saved = saved->saved_nmethod_link();
    1.76 -  }
    1.77 -  ShouldNotReachHere();
    1.78 -}
    1.79 -
    1.80 -void CodeCache::speculatively_disconnect(nmethod* nm) {
    1.81 -  assert_locked_or_safepoint(CodeCache_lock);
    1.82 -  assert(nm->is_in_use() && !nm->is_speculatively_disconnected(), "should only disconnect live nmethods");
    1.83 -  nm->set_saved_nmethod_link(_saved_nmethods);
    1.84 -  _saved_nmethods = nm;
    1.85 -  if (PrintMethodFlushing) {
    1.86 -    nm->print_on(tty, " ### nmethod is speculatively disconnected");
    1.87 -  }
    1.88 -  if (LogCompilation && (xtty != NULL)) {
    1.89 -    ttyLocker ttyl;
    1.90 -    xtty->begin_elem("nmethod_disconnected compile_id='%3d'", nm->compile_id());
    1.91 -    xtty->method(nm->method());
    1.92 -    xtty->stamp();
    1.93 -    xtty->end_elem();
    1.94 -  }
    1.95 -  nm->method()->clear_code();
    1.96 -  nm->set_speculatively_disconnected(true);
    1.97 -}
    1.98 -
    1.99  
   1.100  void CodeCache::gc_prologue() {
   1.101    assert(!nmethod::oops_do_marking_is_active(), "oops_do_marking_epilogue must be called");
   1.102  }
   1.103  
   1.104 -
   1.105  void CodeCache::gc_epilogue() {
   1.106    assert_locked_or_safepoint(CodeCache_lock);
   1.107    FOR_ALL_ALIVE_BLOBS(cb) {

mercurial