src/share/vm/shark/sharkType.hpp

Sat, 01 Sep 2012 13:25:18 -0400

author
coleenp
date
Sat, 01 Sep 2012 13:25:18 -0400
changeset 4037
da91efe96a93
parent 2314
f95d63e2154a
child 4314
2cd5e15048e6
permissions
-rw-r--r--

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>

twisti@2047 1 /*
coleenp@4037 2 * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
twisti@2047 3 * Copyright 2008, 2009 Red Hat, Inc.
twisti@2047 4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
twisti@2047 5 *
twisti@2047 6 * This code is free software; you can redistribute it and/or modify it
twisti@2047 7 * under the terms of the GNU General Public License version 2 only, as
twisti@2047 8 * published by the Free Software Foundation.
twisti@2047 9 *
twisti@2047 10 * This code is distributed in the hope that it will be useful, but WITHOUT
twisti@2047 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
twisti@2047 12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
twisti@2047 13 * version 2 for more details (a copy is included in the LICENSE file that
twisti@2047 14 * accompanied this code).
twisti@2047 15 *
twisti@2047 16 * You should have received a copy of the GNU General Public License version
twisti@2047 17 * 2 along with this work; if not, write to the Free Software Foundation,
twisti@2047 18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
twisti@2047 19 *
twisti@2047 20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
twisti@2047 21 * or visit www.oracle.com if you need additional information or have any
twisti@2047 22 * questions.
twisti@2047 23 *
twisti@2047 24 */
twisti@2047 25
stefank@2314 26 #ifndef SHARE_VM_SHARK_SHARKTYPE_HPP
stefank@2314 27 #define SHARE_VM_SHARK_SHARKTYPE_HPP
stefank@2314 28
stefank@2314 29 #include "ci/ciType.hpp"
stefank@2314 30 #include "memory/allocation.hpp"
stefank@2314 31 #include "shark/llvmHeaders.hpp"
stefank@2314 32 #include "shark/sharkContext.hpp"
stefank@2314 33 #include "utilities/globalDefinitions.hpp"
stefank@2314 34
twisti@2047 35 class SharkType : public AllStatic {
twisti@2047 36 private:
twisti@2047 37 static SharkContext& context() {
twisti@2047 38 return SharkContext::current();
twisti@2047 39 }
twisti@2047 40
twisti@2047 41 // Basic types
twisti@2047 42 public:
twisti@2047 43 static const llvm::Type* void_type() {
twisti@2047 44 return context().void_type();
twisti@2047 45 }
twisti@2047 46 static const llvm::IntegerType* bit_type() {
twisti@2047 47 return context().bit_type();
twisti@2047 48 }
twisti@2047 49 static const llvm::IntegerType* jbyte_type() {
twisti@2047 50 return context().jbyte_type();
twisti@2047 51 }
twisti@2047 52 static const llvm::IntegerType* jshort_type() {
twisti@2047 53 return context().jshort_type();
twisti@2047 54 }
twisti@2047 55 static const llvm::IntegerType* jint_type() {
twisti@2047 56 return context().jint_type();
twisti@2047 57 }
twisti@2047 58 static const llvm::IntegerType* jlong_type() {
twisti@2047 59 return context().jlong_type();
twisti@2047 60 }
twisti@2047 61 static const llvm::Type* jfloat_type() {
twisti@2047 62 return context().jfloat_type();
twisti@2047 63 }
twisti@2047 64 static const llvm::Type* jdouble_type() {
twisti@2047 65 return context().jdouble_type();
twisti@2047 66 }
twisti@2047 67 static const llvm::IntegerType* intptr_type() {
twisti@2047 68 return context().intptr_type();
twisti@2047 69 }
twisti@2047 70
twisti@2047 71 // Compound types
twisti@2047 72 public:
twisti@2047 73 static const llvm::PointerType* itableOffsetEntry_type() {
twisti@2047 74 return context().itableOffsetEntry_type();
twisti@2047 75 }
twisti@2047 76 static const llvm::PointerType* jniEnv_type() {
twisti@2047 77 return context().jniEnv_type();
twisti@2047 78 }
twisti@2047 79 static const llvm::PointerType* jniHandleBlock_type() {
twisti@2047 80 return context().jniHandleBlock_type();
twisti@2047 81 }
twisti@2047 82 static const llvm::PointerType* klass_type() {
twisti@2047 83 return context().klass_type();
twisti@2047 84 }
coleenp@4037 85 static const llvm::PointerType* Method*_type() {
coleenp@4037 86 return context().Method*_type();
twisti@2047 87 }
twisti@2047 88 static const llvm::ArrayType* monitor_type() {
twisti@2047 89 return context().monitor_type();
twisti@2047 90 }
twisti@2047 91 static const llvm::PointerType* oop_type() {
twisti@2047 92 return context().oop_type();
twisti@2047 93 }
twisti@2047 94 static const llvm::PointerType* thread_type() {
twisti@2047 95 return context().thread_type();
twisti@2047 96 }
twisti@2047 97 static const llvm::PointerType* zeroStack_type() {
twisti@2047 98 return context().zeroStack_type();
twisti@2047 99 }
twisti@2047 100 static const llvm::FunctionType* entry_point_type() {
twisti@2047 101 return context().entry_point_type();
twisti@2047 102 }
twisti@2047 103 static const llvm::FunctionType* osr_entry_point_type() {
twisti@2047 104 return context().osr_entry_point_type();
twisti@2047 105 }
twisti@2047 106
twisti@2047 107 // Mappings
twisti@2047 108 public:
twisti@2047 109 static const llvm::Type* to_stackType(BasicType type) {
twisti@2047 110 return context().to_stackType(type);
twisti@2047 111 }
twisti@2047 112 static const llvm::Type* to_stackType(ciType* type) {
twisti@2047 113 return to_stackType(type->basic_type());
twisti@2047 114 }
twisti@2047 115 static const llvm::Type* to_arrayType(BasicType type) {
twisti@2047 116 return context().to_arrayType(type);
twisti@2047 117 }
twisti@2047 118 static const llvm::Type* to_arrayType(ciType* type) {
twisti@2047 119 return to_arrayType(type->basic_type());
twisti@2047 120 }
twisti@2047 121 };
stefank@2314 122
stefank@2314 123 #endif // SHARE_VM_SHARK_SHARKTYPE_HPP

mercurial