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 #include "precompiled.hpp"
26 #include "classfile/classLoaderData.hpp"
27 #include "classfile/javaClasses.inline.hpp"
28 #include "classfile/metadataOnStackMark.hpp"
29 #include "classfile/stringTable.hpp"
30 #include "classfile/systemDictionary.hpp"
31 #include "classfile/vmSymbols.hpp"
32 #include "interpreter/linkResolver.hpp"
33 #include "memory/heapInspection.hpp"
34 #include "memory/metadataFactory.hpp"
35 #include "memory/metaspaceClosure.hpp"
36 #include "memory/metaspaceShared.hpp"
37 #include "memory/oopFactory.hpp"
38 #include "memory/resourceArea.hpp"
39 #include "oops/constantPool.hpp"
40 #include "oops/instanceKlass.hpp"
41 #include "oops/objArrayKlass.hpp"
42 #include "oops/objArrayOop.inline.hpp"
43 #include "oops/oop.inline.hpp"
44 #include "prims/jvm.h"
45 #include "runtime/fieldType.hpp"
46 #include "runtime/init.hpp"
47 #include "runtime/javaCalls.hpp"
48 #include "runtime/signature.hpp"
49 #include "runtime/vframe.hpp"
50 #include "utilities/copy.hpp"
51 #if INCLUDE_ALL_GCS
52 #include "gc/g1/g1SATBCardTableModRefBS.hpp"
53 #endif // INCLUDE_ALL_GCS
54
55 ConstantPool* ConstantPool::allocate(ClassLoaderData* loader_data, int length, TRAPS) {
56 Array<u1>* tags = MetadataFactory::new_array<u1>(loader_data, length, 0, CHECK_NULL);
57 int size = ConstantPool::size(length);
58 return new (loader_data, size, MetaspaceObj::ConstantPoolType, THREAD) ConstantPool(tags);
59 }
60
61 #ifdef ASSERT
62
63 // MetaspaceObj allocation invariant is calloc equivalent memory
64 // simple verification of this here (JVM_CONSTANT_Invalid == 0 )
|
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 #include "precompiled.hpp"
26 #include "jvm.h"
27 #include "classfile/classLoaderData.hpp"
28 #include "classfile/javaClasses.inline.hpp"
29 #include "classfile/metadataOnStackMark.hpp"
30 #include "classfile/stringTable.hpp"
31 #include "classfile/systemDictionary.hpp"
32 #include "classfile/vmSymbols.hpp"
33 #include "interpreter/linkResolver.hpp"
34 #include "memory/heapInspection.hpp"
35 #include "memory/metadataFactory.hpp"
36 #include "memory/metaspaceClosure.hpp"
37 #include "memory/metaspaceShared.hpp"
38 #include "memory/oopFactory.hpp"
39 #include "memory/resourceArea.hpp"
40 #include "oops/constantPool.hpp"
41 #include "oops/instanceKlass.hpp"
42 #include "oops/objArrayKlass.hpp"
43 #include "oops/objArrayOop.inline.hpp"
44 #include "oops/oop.inline.hpp"
45 #include "runtime/fieldType.hpp"
46 #include "runtime/init.hpp"
47 #include "runtime/javaCalls.hpp"
48 #include "runtime/signature.hpp"
49 #include "runtime/vframe.hpp"
50 #include "utilities/copy.hpp"
51 #if INCLUDE_ALL_GCS
52 #include "gc/g1/g1SATBCardTableModRefBS.hpp"
53 #endif // INCLUDE_ALL_GCS
54
55 ConstantPool* ConstantPool::allocate(ClassLoaderData* loader_data, int length, TRAPS) {
56 Array<u1>* tags = MetadataFactory::new_array<u1>(loader_data, length, 0, CHECK_NULL);
57 int size = ConstantPool::size(length);
58 return new (loader_data, size, MetaspaceObj::ConstantPoolType, THREAD) ConstantPool(tags);
59 }
60
61 #ifdef ASSERT
62
63 // MetaspaceObj allocation invariant is calloc equivalent memory
64 // simple verification of this here (JVM_CONSTANT_Invalid == 0 )
|