Mercurial > hg > truffle
comparison graal/com.oracle.max.cri/src/com/sun/cri/ri/RiType.java @ 3733:e233f5660da4
Added Java files from Maxine project.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Sat, 17 Dec 2011 19:59:18 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
3732:3e2e8b8abdaf | 3733:e233f5660da4 |
---|---|
1 /* | |
2 * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. | |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
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 package com.sun.cri.ri; | |
24 | |
25 import com.sun.cri.ci.*; | |
26 | |
27 /** | |
28 * Represents a resolved or unresolved type in the compiler-runtime interface. Types include primitives, objects, {@code void}, | |
29 * and arrays thereof. | |
30 */ | |
31 public interface RiType { | |
32 | |
33 /** | |
34 * Represents each of the several different parts of the runtime representation of | |
35 * a type which compiled code may need to reference individually. These may or may not be | |
36 * different objects or data structures, depending on the runtime system. | |
37 */ | |
38 public enum Representation { | |
39 /** | |
40 * The runtime representation of the data structure containing the static fields of this type. | |
41 */ | |
42 StaticFields, | |
43 | |
44 /** | |
45 * The runtime representation of the Java class object of this type. | |
46 */ | |
47 JavaClass, | |
48 | |
49 /** | |
50 * The runtime representation of the "hub" of this type--that is, the closest part of the type | |
51 * representation which is typically stored in the object header. | |
52 */ | |
53 ObjectHub, | |
54 | |
55 /** | |
56 * The runtime representation of the type information for an object, which is typically used | |
57 * for subtype tests. | |
58 */ | |
59 TypeInfo | |
60 } | |
61 | |
62 /** | |
63 * Gets the name of this type in internal form. The following are examples of strings returned by this method: | |
64 * <pre> | |
65 * "Ljava/lang/Object;" | |
66 * "I" | |
67 * "[[B" | |
68 * </pre> | |
69 * | |
70 * @return the name of this type in internal form | |
71 */ | |
72 String name(); | |
73 | |
74 /** | |
75 * For array types, gets the type of the components. | |
76 * @return the component type of this array type | |
77 */ | |
78 RiType componentType(); | |
79 | |
80 /** | |
81 * Gets the type representing an array with elements of this type. | |
82 * @return a new compiler interface type representing an array of this type | |
83 */ | |
84 RiType arrayOf(); | |
85 | |
86 /** | |
87 * Gets the kind of this compiler interface type. | |
88 * @param architecture When true, the architecture-specific kind used for emitting machine code is returned. | |
89 * When false, the kind according to the Java specification is returned. | |
90 * @return the kind | |
91 */ | |
92 CiKind kind(boolean architecture); | |
93 | |
94 /** | |
95 * Gets the kind used to represent the specified part of this type. | |
96 * @param r the part of the this type | |
97 * @return the kind of constants for the specified part of the type | |
98 */ | |
99 CiKind getRepresentationKind(Representation r); | |
100 } |