Print this page


Split Close
Expand all
Collapse all
          --- old/src/share/vm/code/codeCache.cpp
          +++ new/src/share/vm/code/codeCache.cpp
↓ open down ↓ 66 lines elided ↑ open up ↑
  67   67                    scopes_oop_size         * 100 / total_size,
  68   68                    scopes_data_size        * 100 / total_size,
  69   69                    scopes_pcs_size         * 100 / total_size);
  70   70    }
  71   71  
  72   72    void add(CodeBlob* cb) {
  73   73      count++;
  74   74      total_size       += cb->size();
  75   75      header_size      += cb->header_size();
  76   76      relocation_size  += cb->relocation_size();
  77      -    scopes_oop_size  += cb->oops_size();
  78   77      if (cb->is_nmethod()) {
  79      -      nmethod *nm = (nmethod*)cb;
       78 +      nmethod* nm = cb->as_nmethod_or_null();
  80   79        code_size        += nm->code_size();
  81   80        stub_size        += nm->stub_size();
  82   81  
       82 +      scopes_oop_size  += nm->oops_size();
  83   83        scopes_data_size += nm->scopes_data_size();
  84   84        scopes_pcs_size  += nm->scopes_pcs_size();
  85   85      } else {
  86   86        code_size        += cb->instructions_size();
  87   87      }
  88   88    }
  89   89  };
  90   90  
  91   91  
  92   92  // CodeCache implementation
↓ open down ↓ 162 lines elided ↑ open up ↑
 255  255  int CodeCache::alignment_unit() {
 256  256    return (int)_heap->alignment_unit();
 257  257  }
 258  258  
 259  259  
 260  260  int CodeCache::alignment_offset() {
 261  261    return (int)_heap->alignment_offset();
 262  262  }
 263  263  
 264  264  
 265      -// Mark code blobs for unloading if they contain otherwise
 266      -// unreachable oops.
      265 +// Mark nmethods for unloading if they contain otherwise unreachable
      266 +// oops.
 267  267  void CodeCache::do_unloading(BoolObjectClosure* is_alive,
 268  268                               OopClosure* keep_alive,
 269  269                               bool unloading_occurred) {
 270  270    assert_locked_or_safepoint(CodeCache_lock);
 271      -  FOR_ALL_ALIVE_BLOBS(cb) {
 272      -    cb->do_unloading(is_alive, keep_alive, unloading_occurred);
      271 +  FOR_ALL_ALIVE_NMETHODS(nm) {
      272 +    nm->do_unloading(is_alive, keep_alive, unloading_occurred);
 273  273    }
 274  274  }
 275  275  
 276  276  void CodeCache::blobs_do(CodeBlobClosure* f) {
 277  277    assert_locked_or_safepoint(CodeCache_lock);
 278  278    FOR_ALL_ALIVE_BLOBS(cb) {
 279  279      f->do_code_blob(cb);
 280  280  
 281  281  #ifdef ASSERT
 282  282      if (cb->is_nmethod())
↓ open down ↓ 219 lines elided ↑ open up ↑
 502  502  
 503  503  void CodeCache::gc_epilogue() {
 504  504    assert_locked_or_safepoint(CodeCache_lock);
 505  505    FOR_ALL_ALIVE_BLOBS(cb) {
 506  506      if (cb->is_nmethod()) {
 507  507        nmethod *nm = (nmethod*)cb;
 508  508        assert(!nm->is_unloaded(), "Tautology");
 509  509        if (needs_cache_clean()) {
 510  510          nm->cleanup_inline_caches();
 511  511        }
 512      -      debug_only(nm->verify();)
      512 +      DEBUG_ONLY(nm->verify());
      513 +      nm->fix_oop_relocations();
 513  514      }
 514      -    cb->fix_oop_relocations();
 515  515    }
 516  516    set_needs_cache_clean(false);
 517  517    prune_scavenge_root_nmethods();
 518  518    assert(!nmethod::oops_do_marking_is_active(), "oops_do_marking_prologue must be called");
 519  519  }
 520  520  
 521  521  
 522  522  address CodeCache::first_address() {
 523  523    assert_locked_or_safepoint(CodeCache_lock);
 524  524    return (address)_heap->begin();
↓ open down ↓ 377 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX