src/share/vm/memory/universe.hpp

Print this page


   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  *


 230     return m;
 231   }
 232 
 233   static void     set_narrow_oop_base(address base) {
 234     assert(UseCompressedOops, "no compressed oops?");
 235     _narrow_oop._base    = base;
 236   }
 237   static void     set_narrow_klass_base(address base) {
 238     assert(UseCompressedClassPointers, "no compressed klass ptrs?");
 239     _narrow_klass._base   = base;
 240   }
 241   static void     set_narrow_oop_use_implicit_null_checks(bool use) {
 242     assert(UseCompressedOops, "no compressed ptrs?");
 243     _narrow_oop._use_implicit_null_checks   = use;
 244   }
 245 
 246   // Debugging
 247   static int _verify_count;                           // number of verifies done
 248   // True during call to verify().  Should only be set/cleared in verify().
 249   static bool _verify_in_progress;

 250 
 251   static void compute_verify_oop_data();
 252 
 253  public:
 254   // Known classes in the VM
 255   static Klass* boolArrayKlassObj()                 { return _boolArrayKlassObj;   }
 256   static Klass* byteArrayKlassObj()                 { return _byteArrayKlassObj;   }
 257   static Klass* charArrayKlassObj()                 { return _charArrayKlassObj;   }
 258   static Klass* intArrayKlassObj()                  { return _intArrayKlassObj;    }
 259   static Klass* shortArrayKlassObj()                { return _shortArrayKlassObj;  }
 260   static Klass* longArrayKlassObj()                 { return _longArrayKlassObj;   }
 261   static Klass* singleArrayKlassObj()               { return _singleArrayKlassObj; }
 262   static Klass* doubleArrayKlassObj()               { return _doubleArrayKlassObj; }
 263 
 264   static Klass* objectArrayKlassObj() {
 265     return _objectArrayKlassObj;
 266   }
 267 
 268   static Klass* typeArrayKlassObj(BasicType t) {
 269     assert((uint)t < T_VOID+1, err_msg("range check for type: %s", type2name(t)));


 408   // Finalizer support.
 409   static void run_finalizers_on_exit();
 410 
 411   // Iteration
 412 
 413   // Apply "f" to the addresses of all the direct heap pointers maintained
 414   // as static fields of "Universe".
 415   static void oops_do(OopClosure* f, bool do_all = false);
 416 
 417   // CDS support
 418   static void serialize(SerializeClosure* f, bool do_all = false);
 419 
 420   // Apply "f" to all klasses for basic types (classes not present in
 421   // SystemDictionary).
 422   static void basic_type_classes_do(void f(Klass*));
 423 
 424   // For sharing -- fill in a list of known vtable pointers.
 425   static void init_self_patching_vtbl_list(void** list, int count);
 426 
 427   // Debugging
















 428   static bool verify_in_progress() { return _verify_in_progress; }
 429   static void verify(VerifyOption option, const char* prefix, bool silent = VerifySilently);
 430   static void verify(const char* prefix, bool silent = VerifySilently) {
 431     verify(VerifyOption_Default, prefix, silent);
 432   }
 433   static void verify(bool silent = VerifySilently) {
 434     verify("", silent);
 435   }
 436 
 437   static int  verify_count()       { return _verify_count; }
 438   // The default behavior is to call print_on() on gclog_or_tty.
 439   static void print();
 440   // The extended parameter determines which method on the heap will
 441   // be called: print_on() (extended == false) or print_extended_on()
 442   // (extended == true).
 443   static void print_on(outputStream* st, bool extended = false);
 444   static void print_heap_at_SIGBREAK();
 445   static void print_heap_before_gc() { print_heap_before_gc(gclog_or_tty); }
 446   static void print_heap_after_gc()  { print_heap_after_gc(gclog_or_tty); }
 447   static void print_heap_before_gc(outputStream* st, bool ignore_extended = false);


   1 /*
   2  * Copyright (c) 1997, 2016, 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  *


 230     return m;
 231   }
 232 
 233   static void     set_narrow_oop_base(address base) {
 234     assert(UseCompressedOops, "no compressed oops?");
 235     _narrow_oop._base    = base;
 236   }
 237   static void     set_narrow_klass_base(address base) {
 238     assert(UseCompressedClassPointers, "no compressed klass ptrs?");
 239     _narrow_klass._base   = base;
 240   }
 241   static void     set_narrow_oop_use_implicit_null_checks(bool use) {
 242     assert(UseCompressedOops, "no compressed ptrs?");
 243     _narrow_oop._use_implicit_null_checks   = use;
 244   }
 245 
 246   // Debugging
 247   static int _verify_count;                           // number of verifies done
 248   // True during call to verify().  Should only be set/cleared in verify().
 249   static bool _verify_in_progress;
 250   static long verify_flags;
 251 
 252   static void compute_verify_oop_data();
 253 
 254  public:
 255   // Known classes in the VM
 256   static Klass* boolArrayKlassObj()                 { return _boolArrayKlassObj;   }
 257   static Klass* byteArrayKlassObj()                 { return _byteArrayKlassObj;   }
 258   static Klass* charArrayKlassObj()                 { return _charArrayKlassObj;   }
 259   static Klass* intArrayKlassObj()                  { return _intArrayKlassObj;    }
 260   static Klass* shortArrayKlassObj()                { return _shortArrayKlassObj;  }
 261   static Klass* longArrayKlassObj()                 { return _longArrayKlassObj;   }
 262   static Klass* singleArrayKlassObj()               { return _singleArrayKlassObj; }
 263   static Klass* doubleArrayKlassObj()               { return _doubleArrayKlassObj; }
 264 
 265   static Klass* objectArrayKlassObj() {
 266     return _objectArrayKlassObj;
 267   }
 268 
 269   static Klass* typeArrayKlassObj(BasicType t) {
 270     assert((uint)t < T_VOID+1, err_msg("range check for type: %s", type2name(t)));


 409   // Finalizer support.
 410   static void run_finalizers_on_exit();
 411 
 412   // Iteration
 413 
 414   // Apply "f" to the addresses of all the direct heap pointers maintained
 415   // as static fields of "Universe".
 416   static void oops_do(OopClosure* f, bool do_all = false);
 417 
 418   // CDS support
 419   static void serialize(SerializeClosure* f, bool do_all = false);
 420 
 421   // Apply "f" to all klasses for basic types (classes not present in
 422   // SystemDictionary).
 423   static void basic_type_classes_do(void f(Klass*));
 424 
 425   // For sharing -- fill in a list of known vtable pointers.
 426   static void init_self_patching_vtbl_list(void** list, int count);
 427 
 428   // Debugging
 429   enum VERIFY_FLAGS {
 430     Verify_Threads = 1,
 431     Verify_Heap = 2,
 432     Verify_SymbolTable = 4,
 433     Verify_StringTable = 8,
 434     Verify_CodeCache = 16,
 435     Verify_SystemDictionary = 32,
 436     Verify_ClassLoaderDataGraph = 64,
 437     Verify_MetaspaceAux = 128,
 438     Verify_JNIHandles = 256,
 439     Verify_CHeap = 512,
 440     Verify_CodeCacheOops = 1024,
 441     Verify_All = -1
 442   };
 443   static void initialize_verify_flags();
 444   static bool should_verify_subset(uint subset);
 445   static bool verify_in_progress() { return _verify_in_progress; }
 446   static void verify(VerifyOption option, const char* prefix, bool silent = VerifySilently);
 447   static void verify(const char* prefix, bool silent = VerifySilently) {
 448     verify(VerifyOption_Default, prefix, silent);
 449   }
 450   static void verify(bool silent = VerifySilently) {
 451     verify("", silent);
 452   }
 453 
 454   static int  verify_count()       { return _verify_count; }
 455   // The default behavior is to call print_on() on gclog_or_tty.
 456   static void print();
 457   // The extended parameter determines which method on the heap will
 458   // be called: print_on() (extended == false) or print_extended_on()
 459   // (extended == true).
 460   static void print_on(outputStream* st, bool extended = false);
 461   static void print_heap_at_SIGBREAK();
 462   static void print_heap_before_gc() { print_heap_before_gc(gclog_or_tty); }
 463   static void print_heap_after_gc()  { print_heap_after_gc(gclog_or_tty); }
 464   static void print_heap_before_gc(outputStream* st, bool ignore_extended = false);