Mercurial > hg > truffle
comparison agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java @ 1385:bc32f286fae0
6945219: minor SA fixes
Reviewed-by: twisti
author | never |
---|---|
date | Tue, 20 Apr 2010 13:26:33 -0700 |
parents | d1605aabd0a1 |
children | c18cbe5936b8 |
comparison
equal
deleted
inserted
replaced
1384:c544d979f886 | 1385:bc32f286fae0 |
---|---|
1 /* | 1 /* |
2 * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved. | 2 * Copyright 2000-2010 Sun Microsystems, Inc. All Rights Reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 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 | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
261 case JVM_CONSTANT_Methodref: return "JVM_CONSTANT_Methodref"; | 261 case JVM_CONSTANT_Methodref: return "JVM_CONSTANT_Methodref"; |
262 case JVM_CONSTANT_InterfaceMethodref: return "JVM_CONSTANT_InterfaceMethodref"; | 262 case JVM_CONSTANT_InterfaceMethodref: return "JVM_CONSTANT_InterfaceMethodref"; |
263 case JVM_CONSTANT_NameAndType: return "JVM_CONSTANT_NameAndType"; | 263 case JVM_CONSTANT_NameAndType: return "JVM_CONSTANT_NameAndType"; |
264 case JVM_CONSTANT_Invalid: return "JVM_CONSTANT_Invalid"; | 264 case JVM_CONSTANT_Invalid: return "JVM_CONSTANT_Invalid"; |
265 case JVM_CONSTANT_UnresolvedClass: return "JVM_CONSTANT_UnresolvedClass"; | 265 case JVM_CONSTANT_UnresolvedClass: return "JVM_CONSTANT_UnresolvedClass"; |
266 case JVM_CONSTANT_UnresolvedClassInError: return "JVM_CONSTANT_UnresolvedClassInError"; | |
266 case JVM_CONSTANT_ClassIndex: return "JVM_CONSTANT_ClassIndex"; | 267 case JVM_CONSTANT_ClassIndex: return "JVM_CONSTANT_ClassIndex"; |
267 case JVM_CONSTANT_UnresolvedString: return "JVM_CONSTANT_UnresolvedString"; | 268 case JVM_CONSTANT_UnresolvedString: return "JVM_CONSTANT_UnresolvedString"; |
268 case JVM_CONSTANT_StringIndex: return "JVM_CONSTANT_StringIndex"; | 269 case JVM_CONSTANT_StringIndex: return "JVM_CONSTANT_StringIndex"; |
269 } | 270 } |
270 throw new InternalError("unknown tag"); | 271 throw new InternalError("Unknown tag: " + tag); |
271 } | 272 } |
272 | 273 |
273 public void iterateFields(OopVisitor visitor, boolean doVMFields) { | 274 public void iterateFields(OopVisitor visitor, boolean doVMFields) { |
274 super.iterateFields(visitor, doVMFields); | 275 super.iterateFields(visitor, doVMFields); |
275 if (doVMFields) { | 276 if (doVMFields) { |
302 visitor.doDouble(new DoubleField(new NamedFieldIdentifier(nameForTag(ctag)), indexOffset(index), true), true); | 303 visitor.doDouble(new DoubleField(new NamedFieldIdentifier(nameForTag(ctag)), indexOffset(index), true), true); |
303 // double entries occupy two slots | 304 // double entries occupy two slots |
304 index++; | 305 index++; |
305 break; | 306 break; |
306 | 307 |
308 case JVM_CONSTANT_UnresolvedClassInError: | |
307 case JVM_CONSTANT_UnresolvedClass: | 309 case JVM_CONSTANT_UnresolvedClass: |
308 case JVM_CONSTANT_Class: | 310 case JVM_CONSTANT_Class: |
309 case JVM_CONSTANT_UnresolvedString: | 311 case JVM_CONSTANT_UnresolvedString: |
310 case JVM_CONSTANT_Utf8: | 312 case JVM_CONSTANT_Utf8: |
311 visitor.doOop(new OopField(new NamedFieldIdentifier(nameForTag(ctag)), indexOffset(index), true), true); | 313 visitor.doOop(new OopField(new NamedFieldIdentifier(nameForTag(ctag)), indexOffset(index), true), true); |
407 if (DEBUG) debugMessage("CP[" + ci + "] = class " + s); | 409 if (DEBUG) debugMessage("CP[" + ci + "] = class " + s); |
408 break; | 410 break; |
409 } | 411 } |
410 | 412 |
411 // case JVM_CONSTANT_ClassIndex: | 413 // case JVM_CONSTANT_ClassIndex: |
414 case JVM_CONSTANT_UnresolvedClassInError: | |
412 case JVM_CONSTANT_UnresolvedClass: { | 415 case JVM_CONSTANT_UnresolvedClass: { |
413 dos.writeByte(JVM_CONSTANT_Class); | 416 dos.writeByte(JVM_CONSTANT_Class); |
414 String klassName = getSymbolAt(ci).asString(); | 417 String klassName = getSymbolAt(ci).asString(); |
415 Short s = (Short) utf8ToIndex.get(klassName); | 418 Short s = (Short) utf8ToIndex.get(klassName); |
416 dos.writeShort(s.shortValue()); | 419 dos.writeShort(s.shortValue()); |
462 dos.writeShort(signatureIndex); | 465 dos.writeShort(signatureIndex); |
463 if (DEBUG) debugMessage("CP[" + ci + "] = N&T name = " + nameIndex | 466 if (DEBUG) debugMessage("CP[" + ci + "] = N&T name = " + nameIndex |
464 + ", type = " + signatureIndex); | 467 + ", type = " + signatureIndex); |
465 break; | 468 break; |
466 } | 469 } |
470 default: | |
471 throw new InternalError("unknown tag: " + cpConstType); | |
467 } // switch | 472 } // switch |
468 } | 473 } |
469 dos.flush(); | 474 dos.flush(); |
470 return; | 475 return; |
471 } | 476 } |