annotate src/share/vm/memory/oopFactory.hpp @ 3602:da91efe96a93

6964458: Reimplement class meta-data storage to use native memory Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author coleenp
date Sat, 01 Sep 2012 13:25:18 -0400
parents 8150fa46d2ed
children d8ce2825b193
rev   line source
duke@0 1 /*
jiangli@3266 2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
duke@0 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@0 4 *
duke@0 5 * This code is free software; you can redistribute it and/or modify it
duke@0 6 * under the terms of the GNU General Public License version 2 only, as
duke@0 7 * published by the Free Software Foundation.
duke@0 8 *
duke@0 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@0 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@0 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@0 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@0 13 * accompanied this code).
duke@0 14 *
duke@0 15 * You should have received a copy of the GNU General Public License version
duke@0 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@0 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@0 18 *
trims@1472 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1472 20 * or visit www.oracle.com if you need additional information or have any
trims@1472 21 * questions.
duke@0 22 *
duke@0 23 */
duke@0 24
stefank@1879 25 #ifndef SHARE_VM_MEMORY_OOPFACTORY_HPP
stefank@1879 26 #define SHARE_VM_MEMORY_OOPFACTORY_HPP
stefank@1879 27
stefank@1879 28 #include "classfile/symbolTable.hpp"
stefank@1879 29 #include "classfile/systemDictionary.hpp"
stefank@1879 30 #include "memory/universe.hpp"
stefank@1879 31 #include "oops/objArrayKlass.hpp"
stefank@1879 32 #include "oops/oop.hpp"
stefank@1879 33 #include "oops/typeArrayKlass.hpp"
stefank@1879 34 #include "utilities/growableArray.hpp"
stefank@1879 35
duke@0 36 // oopFactory is a class used for creating new objects.
duke@0 37
duke@0 38 class vframeArray;
duke@0 39
duke@0 40 class oopFactory: AllStatic {
duke@0 41 public:
duke@0 42 // Basic type leaf array allocation
duke@0 43 static typeArrayOop new_boolArray (int length, TRAPS) { return typeArrayKlass::cast(Universe::boolArrayKlassObj ())->allocate(length, CHECK_NULL); }
duke@0 44 static typeArrayOop new_charArray (int length, TRAPS) { return typeArrayKlass::cast(Universe::charArrayKlassObj ())->allocate(length, CHECK_NULL); }
duke@0 45 static typeArrayOop new_singleArray(int length, TRAPS) { return typeArrayKlass::cast(Universe::singleArrayKlassObj())->allocate(length, CHECK_NULL); }
duke@0 46 static typeArrayOop new_doubleArray(int length, TRAPS) { return typeArrayKlass::cast(Universe::doubleArrayKlassObj())->allocate(length, CHECK_NULL); }
duke@0 47 static typeArrayOop new_byteArray (int length, TRAPS) { return typeArrayKlass::cast(Universe::byteArrayKlassObj ())->allocate(length, CHECK_NULL); }
duke@0 48 static typeArrayOop new_shortArray (int length, TRAPS) { return typeArrayKlass::cast(Universe::shortArrayKlassObj ())->allocate(length, CHECK_NULL); }
duke@0 49 static typeArrayOop new_intArray (int length, TRAPS) { return typeArrayKlass::cast(Universe::intArrayKlassObj ())->allocate(length, CHECK_NULL); }
duke@0 50 static typeArrayOop new_longArray (int length, TRAPS) { return typeArrayKlass::cast(Universe::longArrayKlassObj ())->allocate(length, CHECK_NULL); }
duke@0 51
duke@0 52 // create java.lang.Object[]
duke@0 53 static objArrayOop new_objectArray(int length, TRAPS) {
coleenp@3602 54 assert(Universe::objectArrayKlassObj() != NULL, "Too early?");
duke@0 55 return objArrayKlass::
duke@0 56 cast(Universe::objectArrayKlassObj())->allocate(length, CHECK_NULL);
duke@0 57 }
duke@0 58
duke@0 59 static typeArrayOop new_charArray (const char* utf8_str, TRAPS);
coleenp@3602 60 static typeArrayOop new_tenured_charArray(int length, TRAPS);
duke@0 61
duke@0 62 static typeArrayOop new_typeArray(BasicType type, int length, TRAPS);
kvn@2722 63 static typeArrayOop new_typeArray_nozero(BasicType type, int length, TRAPS);
coleenp@3602 64 static typeArrayOop new_metaDataArray(int length, TRAPS);
duke@0 65
duke@0 66 // Regular object arrays
coleenp@3602 67 static objArrayOop new_objArray(Klass* klass, int length, TRAPS);
duke@0 68 };
stefank@1879 69
stefank@1879 70 #endif // SHARE_VM_MEMORY_OOPFACTORY_HPP