annotate agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicField.java @ 196:d1605aabd0a1 jdk7-b30

6719955: Update copyright year Summary: Update copyright year for files that have been modified in 2008 Reviewed-by: ohair, tbell
author xdono
date Wed, 02 Jul 2008 12:55:16 -0700
parents ba764ed4b6f2
children c18cbe5936b8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
196
d1605aabd0a1 6719955: Update copyright year
xdono
parents: 113
diff changeset
2 * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
a61af66fc99e Initial load
duke
parents:
diff changeset
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
a61af66fc99e Initial load
duke
parents:
diff changeset
20 * CA 95054 USA or visit www.sun.com if you need additional information or
a61af66fc99e Initial load
duke
parents:
diff changeset
21 * have any questions.
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 package sun.jvm.hotspot.types.basic;
a61af66fc99e Initial load
duke
parents:
diff changeset
26
a61af66fc99e Initial load
duke
parents:
diff changeset
27 import sun.jvm.hotspot.debugger.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
28 import sun.jvm.hotspot.types.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
29
a61af66fc99e Initial load
duke
parents:
diff changeset
30 /** A basic implementation of Field which should be suitable for
a61af66fc99e Initial load
duke
parents:
diff changeset
31 cross-platform use. */
a61af66fc99e Initial load
duke
parents:
diff changeset
32
a61af66fc99e Initial load
duke
parents:
diff changeset
33 public class BasicField implements Field {
a61af66fc99e Initial load
duke
parents:
diff changeset
34 protected BasicTypeDataBase db;
a61af66fc99e Initial load
duke
parents:
diff changeset
35 protected Type type;
a61af66fc99e Initial load
duke
parents:
diff changeset
36
a61af66fc99e Initial load
duke
parents:
diff changeset
37 private Type containingType;
a61af66fc99e Initial load
duke
parents:
diff changeset
38 private String name;
a61af66fc99e Initial load
duke
parents:
diff changeset
39 private long size;
a61af66fc99e Initial load
duke
parents:
diff changeset
40 private boolean isStatic;
a61af66fc99e Initial load
duke
parents:
diff changeset
41 /** Used for nonstatic fields only */
a61af66fc99e Initial load
duke
parents:
diff changeset
42 private long offset;
a61af66fc99e Initial load
duke
parents:
diff changeset
43 /** Used for static fields only */
a61af66fc99e Initial load
duke
parents:
diff changeset
44 private Address staticFieldAddress;
a61af66fc99e Initial load
duke
parents:
diff changeset
45
113
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
46 // Copy constructor to create NarrowOopField from OopField.
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
47 public BasicField(Field fld) {
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
48 BasicField field = (BasicField)fld;
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
49
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
50 this.db = field.db;
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
51 this.containingType = field.containingType;
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
52 this.name = field.name;
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
53 this.type = field.type;
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
54 this.size = field.size;
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
55 this.isStatic = field.isStatic;
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
56 this.offset = field.offset;
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
57 this.staticFieldAddress = field.staticFieldAddress;
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
58 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
59 /** offsetInBytes is ignored if the field is static;
a61af66fc99e Initial load
duke
parents:
diff changeset
60 staticFieldAddress is used only if the field is static. */
a61af66fc99e Initial load
duke
parents:
diff changeset
61 public BasicField(BasicTypeDataBase db, Type containingType, String name, Type type,
a61af66fc99e Initial load
duke
parents:
diff changeset
62 boolean isStatic, long offsetInBytes, Address staticFieldAddress) {
a61af66fc99e Initial load
duke
parents:
diff changeset
63 this.db = db;
a61af66fc99e Initial load
duke
parents:
diff changeset
64 this.containingType = containingType;
a61af66fc99e Initial load
duke
parents:
diff changeset
65 this.name = name;
a61af66fc99e Initial load
duke
parents:
diff changeset
66 this.type = type;
a61af66fc99e Initial load
duke
parents:
diff changeset
67 this.size = type.getSize();
a61af66fc99e Initial load
duke
parents:
diff changeset
68 this.isStatic = isStatic;
a61af66fc99e Initial load
duke
parents:
diff changeset
69 this.offset = offsetInBytes;
a61af66fc99e Initial load
duke
parents:
diff changeset
70 this.staticFieldAddress = staticFieldAddress;
a61af66fc99e Initial load
duke
parents:
diff changeset
71 }
a61af66fc99e Initial load
duke
parents:
diff changeset
72
a61af66fc99e Initial load
duke
parents:
diff changeset
73 public String getName() {
a61af66fc99e Initial load
duke
parents:
diff changeset
74 return name;
a61af66fc99e Initial load
duke
parents:
diff changeset
75 }
a61af66fc99e Initial load
duke
parents:
diff changeset
76
a61af66fc99e Initial load
duke
parents:
diff changeset
77 public Type getType() {
a61af66fc99e Initial load
duke
parents:
diff changeset
78 return type;
a61af66fc99e Initial load
duke
parents:
diff changeset
79 }
a61af66fc99e Initial load
duke
parents:
diff changeset
80
a61af66fc99e Initial load
duke
parents:
diff changeset
81 public long getSize() {
a61af66fc99e Initial load
duke
parents:
diff changeset
82 return size;
a61af66fc99e Initial load
duke
parents:
diff changeset
83 }
a61af66fc99e Initial load
duke
parents:
diff changeset
84
a61af66fc99e Initial load
duke
parents:
diff changeset
85 public boolean isStatic() {
a61af66fc99e Initial load
duke
parents:
diff changeset
86 return isStatic;
a61af66fc99e Initial load
duke
parents:
diff changeset
87 }
a61af66fc99e Initial load
duke
parents:
diff changeset
88
a61af66fc99e Initial load
duke
parents:
diff changeset
89 public long getOffset() throws WrongTypeException {
a61af66fc99e Initial load
duke
parents:
diff changeset
90 if (isStatic) {
a61af66fc99e Initial load
duke
parents:
diff changeset
91 throw new WrongTypeException("field \"" + name + "\" in class " +
a61af66fc99e Initial load
duke
parents:
diff changeset
92 containingType.getName() + " is static");
a61af66fc99e Initial load
duke
parents:
diff changeset
93 }
a61af66fc99e Initial load
duke
parents:
diff changeset
94 return offset;
a61af66fc99e Initial load
duke
parents:
diff changeset
95 }
a61af66fc99e Initial load
duke
parents:
diff changeset
96
a61af66fc99e Initial load
duke
parents:
diff changeset
97 public Address getStaticFieldAddress() throws WrongTypeException {
a61af66fc99e Initial load
duke
parents:
diff changeset
98 if (!isStatic) {
a61af66fc99e Initial load
duke
parents:
diff changeset
99 throw new WrongTypeException("field \"" + name + "\" in class " +
a61af66fc99e Initial load
duke
parents:
diff changeset
100 containingType.getName() + " is not static");
a61af66fc99e Initial load
duke
parents:
diff changeset
101 }
a61af66fc99e Initial load
duke
parents:
diff changeset
102 return staticFieldAddress;
a61af66fc99e Initial load
duke
parents:
diff changeset
103 }
a61af66fc99e Initial load
duke
parents:
diff changeset
104
a61af66fc99e Initial load
duke
parents:
diff changeset
105 //--------------------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
106 // Dereferencing operations for non-static fields
a61af66fc99e Initial load
duke
parents:
diff changeset
107 //
a61af66fc99e Initial load
duke
parents:
diff changeset
108
a61af66fc99e Initial load
duke
parents:
diff changeset
109 public boolean getJBoolean (Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
a61af66fc99e Initial load
duke
parents:
diff changeset
110 if (isStatic) {
a61af66fc99e Initial load
duke
parents:
diff changeset
111 throw new WrongTypeException();
a61af66fc99e Initial load
duke
parents:
diff changeset
112 }
a61af66fc99e Initial load
duke
parents:
diff changeset
113 return addr.getJBooleanAt(offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
114 }
a61af66fc99e Initial load
duke
parents:
diff changeset
115 public byte getJByte (Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
a61af66fc99e Initial load
duke
parents:
diff changeset
116 if (isStatic) {
a61af66fc99e Initial load
duke
parents:
diff changeset
117 throw new WrongTypeException();
a61af66fc99e Initial load
duke
parents:
diff changeset
118 }
a61af66fc99e Initial load
duke
parents:
diff changeset
119 return addr.getJByteAt(offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
120 }
a61af66fc99e Initial load
duke
parents:
diff changeset
121 public char getJChar (Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
a61af66fc99e Initial load
duke
parents:
diff changeset
122 if (isStatic) {
a61af66fc99e Initial load
duke
parents:
diff changeset
123 throw new WrongTypeException();
a61af66fc99e Initial load
duke
parents:
diff changeset
124 }
a61af66fc99e Initial load
duke
parents:
diff changeset
125 return addr.getJCharAt(offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
126 }
a61af66fc99e Initial load
duke
parents:
diff changeset
127 public double getJDouble (Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
a61af66fc99e Initial load
duke
parents:
diff changeset
128 if (isStatic) {
a61af66fc99e Initial load
duke
parents:
diff changeset
129 throw new WrongTypeException();
a61af66fc99e Initial load
duke
parents:
diff changeset
130 }
a61af66fc99e Initial load
duke
parents:
diff changeset
131 return addr.getJDoubleAt(offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
132 }
a61af66fc99e Initial load
duke
parents:
diff changeset
133 public float getJFloat (Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
a61af66fc99e Initial load
duke
parents:
diff changeset
134 if (isStatic) {
a61af66fc99e Initial load
duke
parents:
diff changeset
135 throw new WrongTypeException();
a61af66fc99e Initial load
duke
parents:
diff changeset
136 }
a61af66fc99e Initial load
duke
parents:
diff changeset
137 return addr.getJFloatAt(offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
138 }
a61af66fc99e Initial load
duke
parents:
diff changeset
139 public int getJInt (Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
a61af66fc99e Initial load
duke
parents:
diff changeset
140 if (isStatic) {
a61af66fc99e Initial load
duke
parents:
diff changeset
141 throw new WrongTypeException();
a61af66fc99e Initial load
duke
parents:
diff changeset
142 }
a61af66fc99e Initial load
duke
parents:
diff changeset
143 return addr.getJIntAt(offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
144 }
a61af66fc99e Initial load
duke
parents:
diff changeset
145 public long getJLong (Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
a61af66fc99e Initial load
duke
parents:
diff changeset
146 if (isStatic) {
a61af66fc99e Initial load
duke
parents:
diff changeset
147 throw new WrongTypeException();
a61af66fc99e Initial load
duke
parents:
diff changeset
148 }
a61af66fc99e Initial load
duke
parents:
diff changeset
149 return addr.getJLongAt(offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
150 }
a61af66fc99e Initial load
duke
parents:
diff changeset
151 public short getJShort (Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
a61af66fc99e Initial load
duke
parents:
diff changeset
152 if (isStatic) {
a61af66fc99e Initial load
duke
parents:
diff changeset
153 throw new WrongTypeException();
a61af66fc99e Initial load
duke
parents:
diff changeset
154 }
a61af66fc99e Initial load
duke
parents:
diff changeset
155 return addr.getJShortAt(offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
156 }
a61af66fc99e Initial load
duke
parents:
diff changeset
157 public long getCInteger (Address addr, CIntegerType type)
a61af66fc99e Initial load
duke
parents:
diff changeset
158 throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
a61af66fc99e Initial load
duke
parents:
diff changeset
159 if (isStatic) {
a61af66fc99e Initial load
duke
parents:
diff changeset
160 throw new WrongTypeException();
a61af66fc99e Initial load
duke
parents:
diff changeset
161 }
a61af66fc99e Initial load
duke
parents:
diff changeset
162 return addr.getCIntegerAt(offset, type.getSize(), type.isUnsigned());
a61af66fc99e Initial load
duke
parents:
diff changeset
163 }
a61af66fc99e Initial load
duke
parents:
diff changeset
164 public Address getAddress (Address addr) throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
a61af66fc99e Initial load
duke
parents:
diff changeset
165 if (isStatic) {
a61af66fc99e Initial load
duke
parents:
diff changeset
166 throw new WrongTypeException();
a61af66fc99e Initial load
duke
parents:
diff changeset
167 }
a61af66fc99e Initial load
duke
parents:
diff changeset
168 return addr.getAddressAt(offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
169 }
a61af66fc99e Initial load
duke
parents:
diff changeset
170 public OopHandle getOopHandle(Address addr)
a61af66fc99e Initial load
duke
parents:
diff changeset
171 throws UnmappedAddressException, UnalignedAddressException, WrongTypeException, NotInHeapException {
a61af66fc99e Initial load
duke
parents:
diff changeset
172 if (isStatic) {
a61af66fc99e Initial load
duke
parents:
diff changeset
173 throw new WrongTypeException();
a61af66fc99e Initial load
duke
parents:
diff changeset
174 }
a61af66fc99e Initial load
duke
parents:
diff changeset
175 return addr.getOopHandleAt(offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
176 }
113
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
177 public OopHandle getNarrowOopHandle(Address addr)
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
178 throws UnmappedAddressException, UnalignedAddressException, WrongTypeException, NotInHeapException {
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
179 if (isStatic) {
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
180 throw new WrongTypeException();
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
181 }
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
182 return addr.getCompOopHandleAt(offset);
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
183 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
184
a61af66fc99e Initial load
duke
parents:
diff changeset
185 //--------------------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
186 // Dereferencing operations for static fields
a61af66fc99e Initial load
duke
parents:
diff changeset
187 //
a61af66fc99e Initial load
duke
parents:
diff changeset
188
a61af66fc99e Initial load
duke
parents:
diff changeset
189 public boolean getJBoolean () throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
a61af66fc99e Initial load
duke
parents:
diff changeset
190 if (!isStatic) {
a61af66fc99e Initial load
duke
parents:
diff changeset
191 throw new WrongTypeException();
a61af66fc99e Initial load
duke
parents:
diff changeset
192 }
a61af66fc99e Initial load
duke
parents:
diff changeset
193 return staticFieldAddress.getJBooleanAt(0);
a61af66fc99e Initial load
duke
parents:
diff changeset
194 }
a61af66fc99e Initial load
duke
parents:
diff changeset
195 public byte getJByte () throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
a61af66fc99e Initial load
duke
parents:
diff changeset
196 if (!isStatic) {
a61af66fc99e Initial load
duke
parents:
diff changeset
197 throw new WrongTypeException();
a61af66fc99e Initial load
duke
parents:
diff changeset
198 }
a61af66fc99e Initial load
duke
parents:
diff changeset
199 return staticFieldAddress.getJByteAt(0);
a61af66fc99e Initial load
duke
parents:
diff changeset
200 }
a61af66fc99e Initial load
duke
parents:
diff changeset
201 public char getJChar () throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
a61af66fc99e Initial load
duke
parents:
diff changeset
202 if (!isStatic) {
a61af66fc99e Initial load
duke
parents:
diff changeset
203 throw new WrongTypeException();
a61af66fc99e Initial load
duke
parents:
diff changeset
204 }
a61af66fc99e Initial load
duke
parents:
diff changeset
205 return staticFieldAddress.getJCharAt(0);
a61af66fc99e Initial load
duke
parents:
diff changeset
206 }
a61af66fc99e Initial load
duke
parents:
diff changeset
207 public double getJDouble () throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
a61af66fc99e Initial load
duke
parents:
diff changeset
208 if (!isStatic) {
a61af66fc99e Initial load
duke
parents:
diff changeset
209 throw new WrongTypeException();
a61af66fc99e Initial load
duke
parents:
diff changeset
210 }
a61af66fc99e Initial load
duke
parents:
diff changeset
211 return staticFieldAddress.getJDoubleAt(0);
a61af66fc99e Initial load
duke
parents:
diff changeset
212 }
a61af66fc99e Initial load
duke
parents:
diff changeset
213 public float getJFloat () throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
a61af66fc99e Initial load
duke
parents:
diff changeset
214 if (!isStatic) {
a61af66fc99e Initial load
duke
parents:
diff changeset
215 throw new WrongTypeException();
a61af66fc99e Initial load
duke
parents:
diff changeset
216 }
a61af66fc99e Initial load
duke
parents:
diff changeset
217 return staticFieldAddress.getJFloatAt(0);
a61af66fc99e Initial load
duke
parents:
diff changeset
218 }
a61af66fc99e Initial load
duke
parents:
diff changeset
219 public int getJInt () throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
a61af66fc99e Initial load
duke
parents:
diff changeset
220 if (!isStatic) {
a61af66fc99e Initial load
duke
parents:
diff changeset
221 throw new WrongTypeException();
a61af66fc99e Initial load
duke
parents:
diff changeset
222 }
a61af66fc99e Initial load
duke
parents:
diff changeset
223 return staticFieldAddress.getJIntAt(0);
a61af66fc99e Initial load
duke
parents:
diff changeset
224 }
a61af66fc99e Initial load
duke
parents:
diff changeset
225 public long getJLong () throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
a61af66fc99e Initial load
duke
parents:
diff changeset
226 if (!isStatic) {
a61af66fc99e Initial load
duke
parents:
diff changeset
227 throw new WrongTypeException();
a61af66fc99e Initial load
duke
parents:
diff changeset
228 }
a61af66fc99e Initial load
duke
parents:
diff changeset
229 return staticFieldAddress.getJLongAt(0);
a61af66fc99e Initial load
duke
parents:
diff changeset
230 }
a61af66fc99e Initial load
duke
parents:
diff changeset
231 public short getJShort () throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
a61af66fc99e Initial load
duke
parents:
diff changeset
232 if (!isStatic) {
a61af66fc99e Initial load
duke
parents:
diff changeset
233 throw new WrongTypeException();
a61af66fc99e Initial load
duke
parents:
diff changeset
234 }
a61af66fc99e Initial load
duke
parents:
diff changeset
235 return staticFieldAddress.getJShortAt(0);
a61af66fc99e Initial load
duke
parents:
diff changeset
236 }
a61af66fc99e Initial load
duke
parents:
diff changeset
237 public long getCInteger (CIntegerType type)
a61af66fc99e Initial load
duke
parents:
diff changeset
238 throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
a61af66fc99e Initial load
duke
parents:
diff changeset
239 if (!isStatic) {
a61af66fc99e Initial load
duke
parents:
diff changeset
240 throw new WrongTypeException();
a61af66fc99e Initial load
duke
parents:
diff changeset
241 }
a61af66fc99e Initial load
duke
parents:
diff changeset
242 return staticFieldAddress.getCIntegerAt(0, type.getSize(), type.isUnsigned());
a61af66fc99e Initial load
duke
parents:
diff changeset
243 }
a61af66fc99e Initial load
duke
parents:
diff changeset
244 public Address getAddress () throws UnmappedAddressException, UnalignedAddressException, WrongTypeException {
a61af66fc99e Initial load
duke
parents:
diff changeset
245 if (!isStatic) {
a61af66fc99e Initial load
duke
parents:
diff changeset
246 throw new WrongTypeException();
a61af66fc99e Initial load
duke
parents:
diff changeset
247 }
a61af66fc99e Initial load
duke
parents:
diff changeset
248 return staticFieldAddress.getAddressAt(0);
a61af66fc99e Initial load
duke
parents:
diff changeset
249 }
a61af66fc99e Initial load
duke
parents:
diff changeset
250 public OopHandle getOopHandle()
a61af66fc99e Initial load
duke
parents:
diff changeset
251 throws UnmappedAddressException, UnalignedAddressException, WrongTypeException, NotInHeapException {
a61af66fc99e Initial load
duke
parents:
diff changeset
252 if (!isStatic) {
a61af66fc99e Initial load
duke
parents:
diff changeset
253 throw new WrongTypeException();
a61af66fc99e Initial load
duke
parents:
diff changeset
254 }
a61af66fc99e Initial load
duke
parents:
diff changeset
255 return staticFieldAddress.getOopHandleAt(0);
a61af66fc99e Initial load
duke
parents:
diff changeset
256 }
113
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
257 public OopHandle getNarrowOopHandle()
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
258 throws UnmappedAddressException, UnalignedAddressException, WrongTypeException, NotInHeapException {
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
259 if (!isStatic) {
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
260 throw new WrongTypeException();
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
261 }
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
262 return staticFieldAddress.getCompOopHandleAt(0);
ba764ed4b6f2 6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents: 0
diff changeset
263 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
264 }