src/share/vm/code/codeCache.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8067836 Sdiff src/share/vm/code

src/share/vm/code/codeCache.hpp

Print this page
rev 7616 : 8067836: The Universe::flush_foo methods belong in CodeCache.
Summary: Move this code to CodeCache.
Reviewed-by: kbarrett, kvn
   1 /*
   2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 192   // Returns the CodeBlobType for nmethods of the given compilation level
 193   static int get_code_blob_type(int comp_level) {
 194     if (comp_level == CompLevel_none ||
 195         comp_level == CompLevel_simple ||
 196         comp_level == CompLevel_full_optimization) {
 197       // Non profiled methods
 198       return CodeBlobType::MethodNonProfiled;
 199     } else if (comp_level == CompLevel_limited_profile ||
 200                comp_level == CompLevel_full_profile) {
 201       // Profiled methods
 202       return CodeBlobType::MethodProfiled;
 203     }
 204     ShouldNotReachHere();
 205     return 0;
 206   }
 207 
 208   static void verify_clean_inline_caches();
 209   static void verify_icholder_relocations();
 210 
 211   // Deoptimization

 212   static int  mark_for_deoptimization(DepChange& changes);
 213 #ifdef HOTSWAP
 214   static int  mark_for_evol_deoptimization(instanceKlassHandle dependee);
 215 #endif // HOTSWAP
 216 

 217   static void mark_all_nmethods_for_deoptimization();
 218   static int  mark_for_deoptimization(Method* dependee);
 219   static void make_marked_nmethods_zombies();
 220   static void make_marked_nmethods_not_entrant();










 221 
 222   // tells how many nmethods have dependencies
 223   static int number_of_nmethods_with_dependencies();
 224 
 225   static int get_codemem_full_count() { return _codemem_full_count; }
 226 };
 227 
 228 
 229 // Iterator to iterate over nmethods in the CodeCache.
 230 class NMethodIterator : public StackObj {
 231  private:
 232   CodeBlob* _code_blob;   // Current CodeBlob
 233   int _code_blob_type;    // Refers to current CodeHeap
 234 
 235  public:
 236   NMethodIterator() {
 237     initialize(NULL); // Set to NULL, initialized by first call to next()
 238   }
 239 
 240   NMethodIterator(nmethod* nm) {


   1 /*
   2  * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 192   // Returns the CodeBlobType for nmethods of the given compilation level
 193   static int get_code_blob_type(int comp_level) {
 194     if (comp_level == CompLevel_none ||
 195         comp_level == CompLevel_simple ||
 196         comp_level == CompLevel_full_optimization) {
 197       // Non profiled methods
 198       return CodeBlobType::MethodNonProfiled;
 199     } else if (comp_level == CompLevel_limited_profile ||
 200                comp_level == CompLevel_full_profile) {
 201       // Profiled methods
 202       return CodeBlobType::MethodProfiled;
 203     }
 204     ShouldNotReachHere();
 205     return 0;
 206   }
 207 
 208   static void verify_clean_inline_caches();
 209   static void verify_icholder_relocations();
 210 
 211   // Deoptimization
 212  private:
 213   static int  mark_for_deoptimization(DepChange& changes);
 214 #ifdef HOTSWAP
 215   static int  mark_for_evol_deoptimization(instanceKlassHandle dependee);
 216 #endif // HOTSWAP
 217 
 218  public:
 219   static void mark_all_nmethods_for_deoptimization();
 220   static int  mark_for_deoptimization(Method* dependee);
 221   static void make_marked_nmethods_zombies();
 222   static void make_marked_nmethods_not_entrant();
 223 
 224   // Flushing and deoptimization
 225   static void flush_dependents_on(instanceKlassHandle dependee);
 226   static void flush_dependents_on(Handle call_site, Handle method_handle);
 227 #ifdef HOTSWAP
 228   // Flushing and deoptimization in case of evolution
 229   static void flush_evol_dependents_on(instanceKlassHandle dependee);
 230 #endif // HOTSWAP
 231   // Support for fullspeed debugging
 232   static void flush_dependents_on_method(methodHandle dependee);
 233 
 234   // tells how many nmethods have dependencies
 235   static int number_of_nmethods_with_dependencies();
 236 
 237   static int get_codemem_full_count() { return _codemem_full_count; }
 238 };
 239 
 240 
 241 // Iterator to iterate over nmethods in the CodeCache.
 242 class NMethodIterator : public StackObj {
 243  private:
 244   CodeBlob* _code_blob;   // Current CodeBlob
 245   int _code_blob_type;    // Refers to current CodeHeap
 246 
 247  public:
 248   NMethodIterator() {
 249     initialize(NULL); // Set to NULL, initialized by first call to next()
 250   }
 251 
 252   NMethodIterator(nmethod* nm) {


src/share/vm/code/codeCache.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File