1 /*
2 * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved.
3 * Copyright 2008, 2009 Red Hat, Inc.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
24 */
25
26 class SharkType : public AllStatic {
27 private:
28 static SharkContext& context() {
29 return SharkContext::current();
30 }
31
32 // Basic types
33 public:
34 static const llvm::Type* void_type() {
35 return context().void_type();
36 }
37 static const llvm::IntegerType* bit_type() {
38 return context().bit_type();
39 }
40 static const llvm::IntegerType* jbyte_type() {
41 return context().jbyte_type();
42 }
43 static const llvm::IntegerType* jshort_type() {
44 return context().jshort_type();
45 }
93 }
94 static const llvm::FunctionType* osr_entry_point_type() {
95 return context().osr_entry_point_type();
96 }
97
98 // Mappings
99 public:
100 static const llvm::Type* to_stackType(BasicType type) {
101 return context().to_stackType(type);
102 }
103 static const llvm::Type* to_stackType(ciType* type) {
104 return to_stackType(type->basic_type());
105 }
106 static const llvm::Type* to_arrayType(BasicType type) {
107 return context().to_arrayType(type);
108 }
109 static const llvm::Type* to_arrayType(ciType* type) {
110 return to_arrayType(type->basic_type());
111 }
112 };
|
1 /*
2 * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
3 * Copyright 2008, 2009 Red Hat, Inc.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
24 */
25
26 #ifndef SHARE_VM_SHARK_SHARKTYPE_HPP
27 #define SHARE_VM_SHARK_SHARKTYPE_HPP
28
29 #include "ci/ciType.hpp"
30 #include "memory/allocation.hpp"
31 #include "shark/llvmHeaders.hpp"
32 #include "shark/sharkContext.hpp"
33 #include "utilities/globalDefinitions.hpp"
34
35 class SharkType : public AllStatic {
36 private:
37 static SharkContext& context() {
38 return SharkContext::current();
39 }
40
41 // Basic types
42 public:
43 static const llvm::Type* void_type() {
44 return context().void_type();
45 }
46 static const llvm::IntegerType* bit_type() {
47 return context().bit_type();
48 }
49 static const llvm::IntegerType* jbyte_type() {
50 return context().jbyte_type();
51 }
52 static const llvm::IntegerType* jshort_type() {
53 return context().jshort_type();
54 }
102 }
103 static const llvm::FunctionType* osr_entry_point_type() {
104 return context().osr_entry_point_type();
105 }
106
107 // Mappings
108 public:
109 static const llvm::Type* to_stackType(BasicType type) {
110 return context().to_stackType(type);
111 }
112 static const llvm::Type* to_stackType(ciType* type) {
113 return to_stackType(type->basic_type());
114 }
115 static const llvm::Type* to_arrayType(BasicType type) {
116 return context().to_arrayType(type);
117 }
118 static const llvm::Type* to_arrayType(ciType* type) {
119 return to_arrayType(type->basic_type());
120 }
121 };
122
123 #endif // SHARE_VM_SHARK_SHARKTYPE_HPP
|