Mercurial > hg > graal-jvmci-8
comparison c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotTypeUnresolved.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 | 44efca8a02d6 |
children | abc670a709dc |
comparison
equal
deleted
inserted
replaced
1422:3483ec571caf | 1423:760213a60e8b |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. | 2 * Copyright (c) 2010 Sun Microsystems, Inc. All rights reserved. |
3 * | 3 * |
4 * Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product that is | 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 | 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 | 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. | 7 * applications in the U.S. and in other countries. |
19 | 19 |
20 import com.sun.cri.ci.*; | 20 import com.sun.cri.ci.*; |
21 import com.sun.cri.ri.*; | 21 import com.sun.cri.ri.*; |
22 | 22 |
23 /** | 23 /** |
24 * @author Thomas Wuerthinger | 24 * Implementation of RiType for unresolved HotSpot classes. |
25 * | |
26 * @author Thomas Wuerthinger, Lukas Stadler | |
25 */ | 27 */ |
26 public class HotSpotTypeUnresolved implements RiType { | 28 public class HotSpotTypeUnresolved implements HotSpotType { |
27 | 29 |
28 public final String name; | 30 public final String name; |
31 private final long accessingClassVmId; | |
29 | 32 |
30 /** | 33 /** |
31 * Creates a new unresolved type for a specified type descriptor. | 34 * Creates a new unresolved type for a specified type descriptor. |
32 * | |
33 * @param typeDescriptor the type's descriptor | |
34 * @param pool the constant pool containing the unresolved type reference | |
35 * @param cpi the index in {@code constantPool} of the unresolved type reference | |
36 */ | 35 */ |
37 public HotSpotTypeUnresolved(String name) { | 36 public HotSpotTypeUnresolved(String name, long accessingClassVmId) { |
38 this.name = name; | 37 this.name = name; |
38 this.accessingClassVmId = accessingClassVmId; | |
39 } | 39 } |
40 | 40 |
41 @Override | |
41 public String name() { | 42 public String name() { |
42 return name; | 43 return name; |
43 } | 44 } |
44 | 45 |
45 public Class< ? > javaClass() { | 46 @Override |
47 public Class<?> javaClass() { | |
46 throw unresolved("javaClass"); | 48 throw unresolved("javaClass"); |
47 } | 49 } |
48 | 50 |
51 @Override | |
49 public boolean hasSubclass() { | 52 public boolean hasSubclass() { |
50 throw unresolved("hasSubclass()"); | 53 throw unresolved("hasSubclass()"); |
51 } | 54 } |
52 | 55 |
56 @Override | |
53 public boolean hasFinalizer() { | 57 public boolean hasFinalizer() { |
54 throw unresolved("hasFinalizer()"); | 58 throw unresolved("hasFinalizer()"); |
55 } | 59 } |
56 | 60 |
61 @Override | |
57 public boolean hasFinalizableSubclass() { | 62 public boolean hasFinalizableSubclass() { |
58 throw unresolved("hasFinalizableSubclass()"); | 63 throw unresolved("hasFinalizableSubclass()"); |
59 } | 64 } |
60 | 65 |
66 @Override | |
61 public boolean isInterface() { | 67 public boolean isInterface() { |
62 throw unresolved("isInterface()"); | 68 throw unresolved("isInterface()"); |
63 } | 69 } |
64 | 70 |
71 @Override | |
65 public boolean isArrayClass() { | 72 public boolean isArrayClass() { |
66 throw unresolved("isArrayClass()"); | 73 throw unresolved("isArrayClass()"); |
67 } | 74 } |
68 | 75 |
76 @Override | |
69 public boolean isInstanceClass() { | 77 public boolean isInstanceClass() { |
70 throw unresolved("isInstanceClass()"); | 78 throw unresolved("isInstanceClass()"); |
71 } | 79 } |
72 | 80 |
81 @Override | |
73 public int accessFlags() { | 82 public int accessFlags() { |
74 throw unresolved("accessFlags()"); | 83 throw unresolved("accessFlags()"); |
75 } | 84 } |
76 | 85 |
86 @Override | |
77 public boolean isResolved() { | 87 public boolean isResolved() { |
78 return false; | 88 return false; |
79 } | 89 } |
80 | 90 |
91 @Override | |
81 public boolean isInitialized() { | 92 public boolean isInitialized() { |
82 throw unresolved("isInitialized()"); | 93 throw unresolved("isInitialized()"); |
83 } | 94 } |
84 | 95 |
96 @Override | |
85 public boolean isSubtypeOf(RiType other) { | 97 public boolean isSubtypeOf(RiType other) { |
86 throw unresolved("isSubtypeOf()"); | 98 throw unresolved("isSubtypeOf()"); |
87 } | 99 } |
88 | 100 |
101 @Override | |
89 public boolean isInstance(Object obj) { | 102 public boolean isInstance(Object obj) { |
90 throw unresolved("isInstance()"); | 103 throw unresolved("isInstance()"); |
91 } | 104 } |
92 | 105 |
106 @Override | |
93 public RiType componentType() { | 107 public RiType componentType() { |
94 // TODO: Implement | 108 // TODO: Implement |
95 throw new UnsupportedOperationException(); | 109 throw new UnsupportedOperationException(); |
96 } | 110 } |
97 | 111 |
112 @Override | |
98 public RiType exactType() { | 113 public RiType exactType() { |
99 throw unresolved("exactType()"); | 114 throw unresolved("exactType()"); |
100 } | 115 } |
101 | 116 |
117 @Override | |
102 public RiType arrayOf() { | 118 public RiType arrayOf() { |
103 // TODO: Implement | 119 // TODO: Implement |
104 throw new UnsupportedOperationException(); | 120 throw new UnsupportedOperationException(); |
105 } | 121 } |
106 | 122 |
123 @Override | |
107 public RiMethod resolveMethodImpl(RiMethod method) { | 124 public RiMethod resolveMethodImpl(RiMethod method) { |
108 throw unresolved("resolveMethodImpl()"); | 125 throw unresolved("resolveMethodImpl()"); |
109 } | 126 } |
110 | 127 |
128 @Override | |
111 public CiKind kind() { | 129 public CiKind kind() { |
112 // TODO: Check if this is correct. | 130 // TODO: Check if this is correct. |
113 return CiKind.Object; | 131 return CiKind.Object; |
114 } | 132 } |
115 | 133 |
127 return o == this; | 145 return o == this; |
128 } | 146 } |
129 | 147 |
130 @Override | 148 @Override |
131 public String toString() { | 149 public String toString() { |
132 return name() + " [unresolved]"; | 150 return "HotSpotTypeUnresolved<" + name + ">"; |
133 } | 151 } |
134 | 152 |
153 @Override | |
135 public CiConstant getEncoding(RiType.Representation r) { | 154 public CiConstant getEncoding(RiType.Representation r) { |
136 throw unresolved("getEncoding()"); | 155 throw unresolved("getEncoding()"); |
137 } | 156 } |
138 | 157 |
158 @Override | |
139 public CiKind getRepresentationKind(RiType.Representation r) { | 159 public CiKind getRepresentationKind(RiType.Representation r) { |
140 // TODO: Check if this is correct. | 160 // TODO: Check if this is correct. |
141 return CiKind.Object; | 161 return CiKind.Object; |
142 } | 162 } |
163 | |
143 } | 164 } |