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