hotspot/src/share/vm/oops/cpCacheKlass.hpp

Print this page
rev 611 : Merge
   1 #ifdef USE_PRAGMA_IDENT_HDR
   2 #pragma ident "@(#)cpCacheKlass.hpp     1.33 07/05/29 09:44:19 JVM"
   3 #endif
   4 /*
   5  * Copyright 1998-2006 Sun Microsystems, Inc.  All Rights Reserved.
   6  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   7  *
   8  * This code is free software; you can redistribute it and/or modify it
   9  * under the terms of the GNU General Public License version 2 only, as
  10  * published by the Free Software Foundation.
  11  *
  12  * This code is distributed in the hope that it will be useful, but WITHOUT
  13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15  * version 2 for more details (a copy is included in the LICENSE file that
  16  * accompanied this code).
  17  *
  18  * You should have received a copy of the GNU General Public License version
  19  * 2 along with this work; if not, write to the Free Software Foundation,
  20  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  21  *
  22  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  23  * CA 95054 USA or visit www.sun.com if you need additional information or
  24  * have any questions.
  25  *  
  26  */
  27 
  28 class constantPoolCacheKlass: public arrayKlass {

  29  public:
  30   // Dispatched klass operations
  31   bool oop_is_constantPoolCache() const          { return true; }
  32   int  oop_size(oop obj) const;
  33   int  klass_oop_size() const                    { return object_size(); }
  34 
  35   // Allocation
  36   DEFINE_ALLOCATE_PERMANENT(constantPoolCacheKlass);
  37   constantPoolCacheOop allocate(int length, TRAPS); 
  38   static klassOop create_klass(TRAPS);
  39 
  40   // Casting from klassOop
  41   static constantPoolCacheKlass* cast(klassOop k) {
  42     assert(k->klass_part()->oop_is_constantPoolCache(), "cast to constantPoolCacheKlass");
  43     return (constantPoolCacheKlass*)k->klass_part(); 
  44   }
  45 
  46   // Sizing
  47   static int header_size()                       { return oopDesc::header_size() + sizeof(constantPoolCacheKlass)/HeapWordSize; }
  48   int object_size() const                        { return arrayKlass::object_size(header_size()); }
  49 
  50   // Garbage collection
  51   void oop_follow_contents(oop obj);
  52   int oop_adjust_pointers(oop obj);
  53 
  54   // Parallel Scavenge and Parallel Old
  55   PARALLEL_GC_DECLS
  56 
  57   // Iterators
  58   int oop_oop_iterate(oop obj, OopClosure* blk);
  59   int oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr);
  60 




  61 #ifndef PRODUCT
  62  public:
  63   // Printing
  64   void oop_print_on(oop obj, outputStream* st);
  65 #endif
  66 
  67  public:
  68   // Verification
  69   const char* internal_name() const;
  70   void oop_verify_on(oop obj, outputStream* st);
  71 };
  72 
   1 #ifdef USE_PRAGMA_IDENT_HDR
   2 #pragma ident "@(#)cpCacheKlass.hpp     1.33 07/05/29 09:44:19 JVM"
   3 #endif
   4 /*
   5  * Copyright 1998-2008 Sun Microsystems, Inc.  All Rights Reserved.
   6  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   7  *
   8  * This code is free software; you can redistribute it and/or modify it
   9  * under the terms of the GNU General Public License version 2 only, as
  10  * published by the Free Software Foundation.
  11  *
  12  * This code is distributed in the hope that it will be useful, but WITHOUT
  13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15  * version 2 for more details (a copy is included in the LICENSE file that
  16  * accompanied this code).
  17  *
  18  * You should have received a copy of the GNU General Public License version
  19  * 2 along with this work; if not, write to the Free Software Foundation,
  20  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  21  *
  22  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  23  * CA 95054 USA or visit www.sun.com if you need additional information or
  24  * have any questions.
  25  *  
  26  */
  27 
  28 class constantPoolCacheKlass: public Klass {
  29   juint    _alloc_size;        // allocation profiling support
  30  public:
  31   // Dispatched klass operations
  32   bool oop_is_constantPoolCache() const          { return true; }
  33   int  oop_size(oop obj) const;
  34   int  klass_oop_size() const                    { return object_size(); }
  35 
  36   // Allocation
  37   DEFINE_ALLOCATE_PERMANENT(constantPoolCacheKlass);
  38   constantPoolCacheOop allocate(int length, TRAPS); 
  39   static klassOop create_klass(TRAPS);
  40 
  41   // Casting from klassOop
  42   static constantPoolCacheKlass* cast(klassOop k) {
  43     assert(k->klass_part()->oop_is_constantPoolCache(), "cast to constantPoolCacheKlass");
  44     return (constantPoolCacheKlass*)k->klass_part(); 
  45   }
  46 
  47   // Sizing
  48   static int header_size()       { return oopDesc::header_size() + sizeof(constantPoolCacheKlass)/HeapWordSize; }
  49   int object_size() const        { return align_object_size(header_size()); }
  50 
  51   // Garbage collection
  52   void oop_follow_contents(oop obj);
  53   int oop_adjust_pointers(oop obj);
  54 
  55   // Parallel Scavenge and Parallel Old
  56   PARALLEL_GC_DECLS
  57 
  58   // Iterators
  59   int oop_oop_iterate(oop obj, OopClosure* blk);
  60   int oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr);
  61 
  62   // Allocation profiling support
  63   juint alloc_size() const              { return _alloc_size; }
  64   void set_alloc_size(juint n)          { _alloc_size = n; }
  65 
  66 #ifndef PRODUCT
  67  public:
  68   // Printing
  69   void oop_print_on(oop obj, outputStream* st);
  70 #endif
  71 
  72  public:
  73   // Verification
  74   const char* internal_name() const;
  75   void oop_verify_on(oop obj, outputStream* st);
  76 };
  77