src/share/vm/oops/objArrayKlass.hpp

Print this page


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







  25 // objArrayKlass is the klass for objArrays
  26 
  27 class objArrayKlass : public arrayKlass {
  28   friend class VMStructs;
  29  private:
  30   klassOop _element_klass;            // The klass of the elements of this array type
  31   klassOop _bottom_klass;             // The one-dimensional type (instanceKlass or typeArrayKlass)
  32  public:
  33   // Instance variables
  34   klassOop element_klass() const      { return _element_klass; }
  35   void set_element_klass(klassOop k)  { oop_store_without_check((oop*) &_element_klass, (oop) k); }
  36   oop* element_klass_addr()           { return (oop*)&_element_klass; }
  37 
  38   klassOop bottom_klass() const       { return _bottom_klass; }
  39   void set_bottom_klass(klassOop k)   { oop_store_without_check((oop*) &_bottom_klass, (oop) k); }
  40   oop* bottom_klass_addr()            { return (oop*)&_bottom_klass; }
  41 
  42   // Compiler/Interpreter offset
  43   static int element_klass_offset_in_bytes() { return offset_of(objArrayKlass, _element_klass); }
  44 


 123 
 124   // JVM support
 125   jint compute_modifier_flags(TRAPS) const;
 126 
 127  private:
 128    static klassOop array_klass_impl   (objArrayKlassHandle this_oop, bool or_null, int n, TRAPS);
 129 
 130  public:
 131   // Printing
 132   void oop_print_value_on(oop obj, outputStream* st);
 133 #ifndef PRODUCT
 134   void oop_print_on      (oop obj, outputStream* st);
 135 #endif //PRODUCT
 136 
 137   // Verification
 138   const char* internal_name() const;
 139   void oop_verify_on(oop obj, outputStream* st);
 140   void oop_verify_old_oop(oop obj, oop* p, bool allow_dirty);
 141   void oop_verify_old_oop(oop obj, narrowOop* p, bool allow_dirty);
 142 };


   1 /*
   2  * Copyright (c) 1997, 2010, 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  *
  23  */
  24 
  25 #ifndef SHARE_VM_OOPS_OBJARRAYKLASS_HPP
  26 #define SHARE_VM_OOPS_OBJARRAYKLASS_HPP
  27 
  28 #include "memory/specialized_oop_closures.hpp"
  29 #include "oops/arrayKlass.hpp"
  30 #include "oops/instanceKlass.hpp"
  31 
  32 // objArrayKlass is the klass for objArrays
  33 
  34 class objArrayKlass : public arrayKlass {
  35   friend class VMStructs;
  36  private:
  37   klassOop _element_klass;            // The klass of the elements of this array type
  38   klassOop _bottom_klass;             // The one-dimensional type (instanceKlass or typeArrayKlass)
  39  public:
  40   // Instance variables
  41   klassOop element_klass() const      { return _element_klass; }
  42   void set_element_klass(klassOop k)  { oop_store_without_check((oop*) &_element_klass, (oop) k); }
  43   oop* element_klass_addr()           { return (oop*)&_element_klass; }
  44 
  45   klassOop bottom_klass() const       { return _bottom_klass; }
  46   void set_bottom_klass(klassOop k)   { oop_store_without_check((oop*) &_bottom_klass, (oop) k); }
  47   oop* bottom_klass_addr()            { return (oop*)&_bottom_klass; }
  48 
  49   // Compiler/Interpreter offset
  50   static int element_klass_offset_in_bytes() { return offset_of(objArrayKlass, _element_klass); }
  51 


 130 
 131   // JVM support
 132   jint compute_modifier_flags(TRAPS) const;
 133 
 134  private:
 135    static klassOop array_klass_impl   (objArrayKlassHandle this_oop, bool or_null, int n, TRAPS);
 136 
 137  public:
 138   // Printing
 139   void oop_print_value_on(oop obj, outputStream* st);
 140 #ifndef PRODUCT
 141   void oop_print_on      (oop obj, outputStream* st);
 142 #endif //PRODUCT
 143 
 144   // Verification
 145   const char* internal_name() const;
 146   void oop_verify_on(oop obj, outputStream* st);
 147   void oop_verify_old_oop(oop obj, oop* p, bool allow_dirty);
 148   void oop_verify_old_oop(oop obj, narrowOop* p, bool allow_dirty);
 149 };
 150 
 151 #endif // SHARE_VM_OOPS_OBJARRAYKLASS_HPP