252 return getSymbolAt(signatureIndex); 253 } 254 255 public Symbol getSignatureRefAt(int which) { 256 return implGetSignatureRefAt(which, false); 257 } 258 259 public Symbol uncachedGetSignatureRefAt(int which) { 260 return implGetSignatureRefAt(which, true); 261 } 262 263 private Symbol implGetSignatureRefAt(int which, boolean uncached) { 264 int signatureIndex = getSignatureRefIndexAt(implNameAndTypeRefIndexAt(which, uncached)); 265 return getSymbolAt(signatureIndex); 266 } 267 268 public static boolean isInvokedynamicIndex(int i) { return (i < 0); } 269 270 public static int decodeInvokedynamicIndex(int i) { Assert.that(isInvokedynamicIndex(i), ""); return ~i; } 271 272 // The invokedynamic points at the object index. The object map points at 273 // the cpCache index and the cpCache entry points at the original constant 274 // pool index. 275 public int invokedynamicCPCacheIndex(int index) { 276 Assert.that(isInvokedynamicIndex(index), "should be a invokedynamic index"); 277 int rawIndex = decodeInvokedynamicIndex(index); 278 return referenceMap().at(rawIndex); 279 } 280 281 ConstantPoolCacheEntry invokedynamicCPCacheEntryAt(int index) { 282 // decode index that invokedynamic points to. 283 int cpCacheIndex = invokedynamicCPCacheIndex(index); 284 return getCache().getEntryAt(cpCacheIndex); 285 } 286 287 private int implNameAndTypeRefIndexAt(int which, boolean uncached) { 288 int i = which; 289 if (!uncached && getCache() != null) { 290 if (isInvokedynamicIndex(which)) { 291 // Invokedynamic index is index into resolved_references 292 int poolIndex = invokedynamicCPCacheEntryAt(which).getConstantPoolIndex(); 293 poolIndex = invokeDynamicNameAndTypeRefIndexAt(poolIndex); 294 Assert.that(getTagAt(poolIndex).isNameAndType(), ""); 295 return poolIndex; 296 } 297 // change byte-ordering and go via cache 298 i = remapInstructionOperandFromCache(which); | 252 return getSymbolAt(signatureIndex); 253 } 254 255 public Symbol getSignatureRefAt(int which) { 256 return implGetSignatureRefAt(which, false); 257 } 258 259 public Symbol uncachedGetSignatureRefAt(int which) { 260 return implGetSignatureRefAt(which, true); 261 } 262 263 private Symbol implGetSignatureRefAt(int which, boolean uncached) { 264 int signatureIndex = getSignatureRefIndexAt(implNameAndTypeRefIndexAt(which, uncached)); 265 return getSymbolAt(signatureIndex); 266 } 267 268 public static boolean isInvokedynamicIndex(int i) { return (i < 0); } 269 270 public static int decodeInvokedynamicIndex(int i) { Assert.that(isInvokedynamicIndex(i), ""); return ~i; } 271 272 // The invokedynamic points at a CP cache entry. This entry points back 273 // at the original CP entry (CONSTANT_InvokeDynamic) and also (via f2) at an entry 274 // in the resolved_references array (which provides the appendix argument). 275 public int invokedynamicCPCacheIndex(int index) { 276 Assert.that(isInvokedynamicIndex(index), "should be a invokedynamic index"); 277 return decodeInvokedynamicIndex(index); 278 } 279 280 ConstantPoolCacheEntry invokedynamicCPCacheEntryAt(int index) { 281 // decode index that invokedynamic points to. 282 int cpCacheIndex = invokedynamicCPCacheIndex(index); 283 return getCache().getEntryAt(cpCacheIndex); 284 } 285 286 private int implNameAndTypeRefIndexAt(int which, boolean uncached) { 287 int i = which; 288 if (!uncached && getCache() != null) { 289 if (isInvokedynamicIndex(which)) { 290 // Invokedynamic index is index into resolved_references 291 int poolIndex = invokedynamicCPCacheEntryAt(which).getConstantPoolIndex(); 292 poolIndex = invokeDynamicNameAndTypeRefIndexAt(poolIndex); 293 Assert.that(getTagAt(poolIndex).isNameAndType(), ""); 294 return poolIndex; 295 } 296 // change byte-ordering and go via cache 297 i = remapInstructionOperandFromCache(which); |