comparison c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotTypeUnresolved.java @ 1416:1b41af477605

Added HotSpotVM project Java source files.
author Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
date Wed, 23 Jun 2010 16:36:58 +0200
parents
children 44efca8a02d6
comparison
equal deleted inserted replaced
1415:712c7ff1afc1 1416:1b41af477605
1 /*
2 * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
3 *
4 * Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product
5 * that is described in this document. In particular, and without limitation, these intellectual property
6 * rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or
7 * more additional patents or pending patent applications in the U.S. and in other countries.
8 *
9 * U.S. Government Rights - Commercial software. Government users are subject to the Sun
10 * Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its
11 * supplements.
12 *
13 * Use is subject to license terms. Sun, Sun Microsystems, the Sun logo, Java and Solaris are trademarks or
14 * registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks
15 * are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the
16 * U.S. and other countries.
17 *
18 * UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open
19 * Company, Ltd.
20 */
21 package com.sun.hotspot.c1x;
22
23 import com.sun.cri.ci.*;
24 import com.sun.cri.ri.*;
25
26 /**
27 * @author Thomas Wuerthinger
28 */
29 public class HotSpotTypeUnresolved implements RiType {
30
31 public final String name;
32
33 /**
34 * Creates a new unresolved type for a specified type descriptor.
35 *
36 * @param typeDescriptor the type's descriptor
37 * @param pool the constant pool containing the unresolved type reference
38 * @param cpi the index in {@code constantPool} of the unresolved type reference
39 */
40 public HotSpotTypeUnresolved(String name) {
41 this.name = name;
42 }
43
44 public String name() {
45 return name;
46 }
47
48 public Class<?> javaClass() {
49 throw unresolved("javaClass");
50 }
51
52 public boolean hasSubclass() {
53 throw unresolved("hasSubclass()");
54 }
55
56 public boolean hasFinalizer() {
57 throw unresolved("hasFinalizer()");
58 }
59
60 public boolean hasFinalizableSubclass() {
61 throw unresolved("hasFinalizableSubclass()");
62 }
63
64 public boolean isInterface() {
65 throw unresolved("isInterface()");
66 }
67
68 public boolean isArrayClass() {
69 throw unresolved("isArrayClass()");
70 }
71
72 public boolean isInstanceClass() {
73 throw unresolved("isInstanceClass()");
74 }
75
76 public int accessFlags() {
77 throw unresolved("accessFlags()");
78 }
79
80 public boolean isResolved() {
81 return false;
82 }
83
84 public boolean isInitialized() {
85 throw unresolved("isInitialized()");
86 }
87
88 public boolean isSubtypeOf(RiType other) {
89 throw unresolved("isSubtypeOf()");
90 }
91
92 public boolean isInstance(Object obj) {
93 throw unresolved("isInstance()");
94 }
95
96 public RiType componentType() {
97 // TODO: Implement
98 throw new UnsupportedOperationException();
99 }
100
101 public RiType exactType() {
102 throw unresolved("exactType()");
103 }
104
105 public RiType arrayOf() {
106 // TODO: Implement
107 throw new UnsupportedOperationException();
108 }
109
110 public RiMethod resolveMethodImpl(RiMethod method) {
111 throw unresolved("resolveMethodImpl()");
112 }
113
114 public CiKind kind() {
115 // TODO: Check if this is correct.
116 return CiKind.Object;
117 }
118
119 private CiUnresolvedException unresolved(String operation) {
120 throw new CiUnresolvedException(operation + " not defined for unresolved class " + name);
121 }
122
123 @Override
124 public int hashCode() {
125 return name.hashCode();
126 }
127
128 @Override
129 public boolean equals(Object o) {
130 return o == this;
131 }
132
133 @Override
134 public String toString() {
135 return name() + " [unresolved]";
136 }
137
138 public CiConstant getEncoding(RiType.Representation r) {
139 throw unresolved("getEncoding()");
140 }
141
142 public CiKind getRepresentationKind(RiType.Representation r) {
143 // TODO: Check if this is correct.
144 return CiKind.Object;
145 }
146 }