Mercurial > hg > graal-compiler
comparison c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotTypeResolved.java @ 1423:760213a60e8b
* rewrite of the code installation
* partial support for safepoints
* macro-based CiTargetMethod interface
* code stub support
author | Lukas Stadler <lukas.stadler@oracle.com> |
---|---|
date | Mon, 16 Aug 2010 18:59:36 -0700 |
parents | c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotType.java@3483ec571caf |
children | 98fffb304868 |
comparison
equal
deleted
inserted
replaced
1422:3483ec571caf | 1423:760213a60e8b |
---|---|
1 /* | |
2 * Copyright (c) 2010 Sun Microsystems, Inc. All rights reserved. | |
3 * | |
4 * Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product that is | |
5 * described in this document. In particular, and without limitation, these intellectual property rights may include one | |
6 * or more of the U.S. patents listed at http://www.sun.com/patents and one or more additional patents or pending patent | |
7 * applications in the U.S. and in other countries. | |
8 * | |
9 * U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard | |
10 * license agreement and applicable provisions of the FAR and its supplements. | |
11 * | |
12 * Use is subject to license terms. Sun, Sun Microsystems, the Sun logo, Java and Solaris are trademarks or registered | |
13 * trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks are used under license and | |
14 * are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and other countries. | |
15 * | |
16 * UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open Company, Ltd. | |
17 */ | |
18 package com.sun.hotspot.c1x; | |
19 | |
20 import com.sun.cri.ci.*; | |
21 import com.sun.cri.ri.*; | |
22 | |
23 /** | |
24 * Implementation of RiType for resolved non-primitive HotSpot classes. | |
25 * | |
26 * @author Thomas Wuerthinger, Lukas Stadler | |
27 */ | |
28 public class HotSpotTypeResolved implements HotSpotType { | |
29 | |
30 private final long vmId; | |
31 | |
32 private final String name; | |
33 | |
34 // cached values | |
35 private Boolean isArrayClass; | |
36 private Boolean isInstanceClass; | |
37 private Boolean isInterface; | |
38 | |
39 public HotSpotTypeResolved(long vmId, String name) { | |
40 this.vmId = vmId; | |
41 this.name = name; | |
42 } | |
43 | |
44 @Override | |
45 public int accessFlags() { | |
46 // TODO Auto-generated method stub | |
47 return 0; | |
48 } | |
49 | |
50 @Override | |
51 public RiType arrayOf() { | |
52 // TODO Auto-generated method stub | |
53 return null; | |
54 } | |
55 | |
56 @Override | |
57 public RiType componentType() { | |
58 // TODO Auto-generated method stub | |
59 return null; | |
60 } | |
61 | |
62 @Override | |
63 public RiType exactType() { | |
64 // TODO Auto-generated method stub | |
65 return null; | |
66 } | |
67 | |
68 @Override | |
69 public CiConstant getEncoding(Representation r) { | |
70 // TODO Auto-generated method stub | |
71 return null; | |
72 } | |
73 | |
74 @Override | |
75 public CiKind getRepresentationKind(Representation r) { | |
76 return CiKind.Object; | |
77 } | |
78 | |
79 @Override | |
80 public boolean hasFinalizableSubclass() { | |
81 // TODO Auto-generated method stub | |
82 return false; | |
83 } | |
84 | |
85 @Override | |
86 public boolean hasFinalizer() { | |
87 // TODO Auto-generated method stub | |
88 return false; | |
89 } | |
90 | |
91 @Override | |
92 public boolean hasSubclass() { | |
93 // TODO Auto-generated method stub | |
94 return false; | |
95 } | |
96 | |
97 @Override | |
98 public boolean isArrayClass() { | |
99 if (isArrayClass == null) | |
100 isArrayClass = Compiler.getVMEntries().RiType_isArrayClass(vmId); | |
101 return isArrayClass; | |
102 } | |
103 | |
104 @Override | |
105 public boolean isInitialized() { | |
106 // TODO Auto-generated method stub | |
107 return false; | |
108 } | |
109 | |
110 @Override | |
111 public boolean isInstance(Object obj) { | |
112 // TODO Auto-generated method stub | |
113 return false; | |
114 } | |
115 | |
116 @Override | |
117 public boolean isInstanceClass() { | |
118 if (isInstanceClass == null) | |
119 isInstanceClass = Compiler.getVMEntries().RiType_isInstanceClass(vmId); | |
120 return isInstanceClass; | |
121 } | |
122 | |
123 @Override | |
124 public boolean isInterface() { | |
125 if (isInterface == null) | |
126 isInterface = Compiler.getVMEntries().RiType_isInterface(vmId); | |
127 return isInterface; | |
128 } | |
129 | |
130 @Override | |
131 public boolean isResolved() { | |
132 return true; | |
133 } | |
134 | |
135 @Override | |
136 public boolean isSubtypeOf(RiType other) { | |
137 // TODO Auto-generated method stub | |
138 return false; | |
139 } | |
140 | |
141 @Override | |
142 public Class<?> javaClass() { | |
143 throw new RuntimeException("javaClass not implemented"); | |
144 } | |
145 | |
146 @Override | |
147 public CiKind kind() { | |
148 return CiKind.Object; | |
149 } | |
150 | |
151 @Override | |
152 public String name() { | |
153 return name; | |
154 } | |
155 | |
156 @Override | |
157 public RiMethod resolveMethodImpl(RiMethod method) { | |
158 // TODO Auto-generated method stub | |
159 return null; | |
160 } | |
161 | |
162 @Override | |
163 public String toString() { | |
164 return "HotSpotType<" + name + ">"; | |
165 } | |
166 | |
167 public RiConstantPool constantPool() { | |
168 return Compiler.getVMEntries().RiType_constantPool(vmId); | |
169 } | |
170 | |
171 public long getVmId() { | |
172 return vmId; | |
173 } | |
174 | |
175 } |