src/share/vm/oops/typeArrayKlass.hpp

Tue, 14 Oct 2008 10:15:33 -0400

author
coleenp
date
Tue, 14 Oct 2008 10:15:33 -0400
changeset 833
443791f333a2
parent 435
a61af66fc99e
child 916
7d7a7c599c17
permissions
-rw-r--r--

6700107: java/lang/Class/forName/TooManyDimensions.java crashes with SIGSEGV in c2 compiler with fastdebug
Summary: objArrayKlass::compute_modifier_flags was unnecessarily recursive
Reviewed-by: kamg

     1 /*
     2  * Copyright 1997-2007 Sun Microsystems, Inc.  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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20  * CA 95054 USA or visit www.sun.com if you need additional information or
    21  * have any questions.
    22  *
    23  */
    25 // A typeArrayKlass is the klass of a typeArray
    26 // It contains the type and size of the elements
    28 class typeArrayKlass : public arrayKlass {
    29   friend class VMStructs;
    30  private:
    31   jint _max_length;            // maximum number of elements allowed in an array
    32  public:
    33   // instance variables
    34   jint max_length()                     { return _max_length; }
    35   void set_max_length(jint m)           { _max_length = m;    }
    37   // testers
    38   bool oop_is_typeArray_slow() const    { return true; }
    40   // klass allocation
    41   DEFINE_ALLOCATE_PERMANENT(typeArrayKlass);
    42   static klassOop create_klass(BasicType type, int scale, TRAPS);
    44   int oop_size(oop obj) const;
    45   int klass_oop_size() const  { return object_size(); }
    47   bool compute_is_subtype_of(klassOop k);
    49   // Allocation
    50   typeArrayOop allocate(int length, TRAPS);
    51   typeArrayOop allocate_permanent(int length, TRAPS);  // used for class file structures
    52   oop multi_allocate(int rank, jint* sizes, TRAPS);
    54   // Copying
    55   void  copy_array(arrayOop s, int src_pos, arrayOop d, int dst_pos, int length, TRAPS);
    57   // Iteration
    58   int oop_oop_iterate(oop obj, OopClosure* blk);
    59   int oop_oop_iterate_m(oop obj, OopClosure* blk, MemRegion mr);
    61   // Garbage collection
    62   void oop_follow_contents(oop obj);
    63   int  oop_adjust_pointers(oop obj);
    65   // Parallel Scavenge and Parallel Old
    66   PARALLEL_GC_DECLS
    68  protected:
    69   // Find n'th dimensional array
    70   virtual klassOop array_klass_impl(bool or_null, int n, TRAPS);
    72   // Returns the array class with this class as element type
    73   virtual klassOop array_klass_impl(bool or_null, TRAPS);
    75  public:
    76   // Casting from klassOop
    77   static typeArrayKlass* cast(klassOop k) {
    78     assert(k->klass_part()->oop_is_typeArray_slow(), "cast to typeArrayKlass");
    79     return (typeArrayKlass*) k->klass_part();
    80   }
    82   // Naming
    83   static const char* external_name(BasicType type);
    85   // Sizing
    86   static int header_size()  { return oopDesc::header_size() + sizeof(typeArrayKlass)/HeapWordSize; }
    87   int object_size() const   { return arrayKlass::object_size(header_size()); }
    89   // Initialization (virtual from Klass)
    90   void initialize(TRAPS);
    92  private:
    93    // Helpers
    94    static klassOop array_klass_impl(typeArrayKlassHandle h_this, bool or_null, int n, TRAPS);
    96 #ifndef PRODUCT
    97  public:
    98   // Printing
    99   void oop_print_on(oop obj, outputStream* st);
   100 #endif
   101  public:
   102   const char* internal_name() const;
   103 };

mercurial