Mercurial > hg > truffle
comparison agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java @ 1660:083fde3b838e
6964498: JSR 292 invokedynamic sites need local bootstrap methods
Summary: Add JVM_CONSTANT_InvokeDynamic records to constant pool to determine per-instruction BSMs.
Reviewed-by: twisti
author | jrose |
---|---|
date | Thu, 15 Jul 2010 18:40:45 -0700 |
parents | 136b78722a08 |
children | 3b2dea75431e |
comparison
equal
deleted
inserted
replaced
1649:a528509c992b | 1660:083fde3b838e |
---|---|
301 } | 301 } |
302 | 302 |
303 case JVM_CONSTANT_MethodHandle: { | 303 case JVM_CONSTANT_MethodHandle: { |
304 dos.writeByte(cpConstType); | 304 dos.writeByte(cpConstType); |
305 int value = cpool.getIntAt(ci); | 305 int value = cpool.getIntAt(ci); |
306 short refIndex = (short) extractHighShortFromInt(value); | 306 short bootstrapMethodIndex = (short) extractLowShortFromInt(value); |
307 byte refKind = (byte) extractLowShortFromInt(value); | 307 short nameAndTypeIndex = (short) extractHighShortFromInt(value); |
308 dos.writeByte(refKind); | 308 dos.writeShort(bootstrapMethodIndex); |
309 dos.writeShort(nameAndTypeIndex); | |
310 if (DEBUG) debugMessage("CP[" + ci + "] = indy BSM = " + | |
311 bootstrapMethodIndex + ", N&T = " + nameAndTypeIndex); | |
312 break; | |
313 } | |
314 | |
315 case JVM_CONSTANT_MethodType: { | |
316 dos.writeByte(cpConstType); | |
317 int value = cpool.getIntAt(ci); | |
318 short refIndex = (short) value; | |
309 dos.writeShort(refIndex); | 319 dos.writeShort(refIndex); |
310 if (DEBUG) debugMessage("CP[" + ci + "] = MH index = " + refIndex | 320 if (DEBUG) debugMessage("CP[" + ci + "] = MT index = " + refIndex); |
311 + ", kind = " + refKind); | 321 break; |
312 break; | 322 } |
313 } | 323 |
314 | 324 case JVM_CONSTANT_InvokeDynamic: { |
315 case JVM_CONSTANT_MethodType: { | |
316 dos.writeByte(cpConstType); | 325 dos.writeByte(cpConstType); |
317 int value = cpool.getIntAt(ci); | 326 int value = cpool.getIntAt(ci); |
318 short refIndex = (short) value; | 327 short refIndex = (short) value; |
319 dos.writeShort(refIndex); | 328 dos.writeShort(refIndex); |
320 if (DEBUG) debugMessage("CP[" + ci + "] = MT index = " + refIndex); | 329 if (DEBUG) debugMessage("CP[" + ci + "] = MT index = " + refIndex); |