equal
deleted
inserted
replaced
329 /** Lookup for multi-operand (InvokeDynamic) entries. */ |
329 /** Lookup for multi-operand (InvokeDynamic) entries. */ |
330 public short[] getBootstrapSpecifierAt(int i) { |
330 public short[] getBootstrapSpecifierAt(int i) { |
331 if (Assert.ASSERTS_ENABLED) { |
331 if (Assert.ASSERTS_ENABLED) { |
332 Assert.that(getTagAt(i).isInvokeDynamic(), "Corrupted constant pool"); |
332 Assert.that(getTagAt(i).isInvokeDynamic(), "Corrupted constant pool"); |
333 } |
333 } |
334 if (getTagAt(i).value() == JVM_CONSTANT_InvokeDynamicTrans) |
|
335 return null; |
|
336 int bsmSpec = extractLowShortFromInt(this.getIntAt(i)); |
334 int bsmSpec = extractLowShortFromInt(this.getIntAt(i)); |
337 TypeArray operands = getOperands(); |
335 TypeArray operands = getOperands(); |
338 if (operands == null) return null; // safety first |
336 if (operands == null) return null; // safety first |
339 int basePos = VM.getVM().buildIntFromShorts(operands.getShortAt(bsmSpec * 2 + 0), |
337 int basePos = VM.getVM().buildIntFromShorts(operands.getShortAt(bsmSpec * 2 + 0), |
340 operands.getShortAt(bsmSpec * 2 + 1)); |
338 operands.getShortAt(bsmSpec * 2 + 1)); |
366 case JVM_CONSTANT_InterfaceMethodref: return "JVM_CONSTANT_InterfaceMethodref"; |
364 case JVM_CONSTANT_InterfaceMethodref: return "JVM_CONSTANT_InterfaceMethodref"; |
367 case JVM_CONSTANT_NameAndType: return "JVM_CONSTANT_NameAndType"; |
365 case JVM_CONSTANT_NameAndType: return "JVM_CONSTANT_NameAndType"; |
368 case JVM_CONSTANT_MethodHandle: return "JVM_CONSTANT_MethodHandle"; |
366 case JVM_CONSTANT_MethodHandle: return "JVM_CONSTANT_MethodHandle"; |
369 case JVM_CONSTANT_MethodType: return "JVM_CONSTANT_MethodType"; |
367 case JVM_CONSTANT_MethodType: return "JVM_CONSTANT_MethodType"; |
370 case JVM_CONSTANT_InvokeDynamic: return "JVM_CONSTANT_InvokeDynamic"; |
368 case JVM_CONSTANT_InvokeDynamic: return "JVM_CONSTANT_InvokeDynamic"; |
371 case JVM_CONSTANT_InvokeDynamicTrans: return "JVM_CONSTANT_InvokeDynamic/transitional"; |
|
372 case JVM_CONSTANT_Invalid: return "JVM_CONSTANT_Invalid"; |
369 case JVM_CONSTANT_Invalid: return "JVM_CONSTANT_Invalid"; |
373 case JVM_CONSTANT_UnresolvedClass: return "JVM_CONSTANT_UnresolvedClass"; |
370 case JVM_CONSTANT_UnresolvedClass: return "JVM_CONSTANT_UnresolvedClass"; |
374 case JVM_CONSTANT_UnresolvedClassInError: return "JVM_CONSTANT_UnresolvedClassInError"; |
371 case JVM_CONSTANT_UnresolvedClassInError: return "JVM_CONSTANT_UnresolvedClassInError"; |
375 case JVM_CONSTANT_ClassIndex: return "JVM_CONSTANT_ClassIndex"; |
372 case JVM_CONSTANT_ClassIndex: return "JVM_CONSTANT_ClassIndex"; |
376 case JVM_CONSTANT_UnresolvedString: return "JVM_CONSTANT_UnresolvedString"; |
373 case JVM_CONSTANT_UnresolvedString: return "JVM_CONSTANT_UnresolvedString"; |
426 case JVM_CONSTANT_InterfaceMethodref: |
423 case JVM_CONSTANT_InterfaceMethodref: |
427 case JVM_CONSTANT_NameAndType: |
424 case JVM_CONSTANT_NameAndType: |
428 case JVM_CONSTANT_MethodHandle: |
425 case JVM_CONSTANT_MethodHandle: |
429 case JVM_CONSTANT_MethodType: |
426 case JVM_CONSTANT_MethodType: |
430 case JVM_CONSTANT_InvokeDynamic: |
427 case JVM_CONSTANT_InvokeDynamic: |
431 case JVM_CONSTANT_InvokeDynamicTrans: |
|
432 visitor.doInt(new IntField(new NamedFieldIdentifier(nameForTag(ctag)), indexOffset(index), true), true); |
428 visitor.doInt(new IntField(new NamedFieldIdentifier(nameForTag(ctag)), indexOffset(index), true), true); |
433 break; |
429 break; |
434 } |
430 } |
435 } |
431 } |
436 } |
432 } |
590 if (DEBUG) debugMessage("CP[" + ci + "] = N&T name = " + nameIndex |
586 if (DEBUG) debugMessage("CP[" + ci + "] = N&T name = " + nameIndex |
591 + ", type = " + signatureIndex); |
587 + ", type = " + signatureIndex); |
592 break; |
588 break; |
593 } |
589 } |
594 |
590 |
595 case JVM_CONSTANT_InvokeDynamicTrans: |
|
596 case JVM_CONSTANT_InvokeDynamic: { |
591 case JVM_CONSTANT_InvokeDynamic: { |
597 dos.writeByte(cpConstType); |
592 dos.writeByte(cpConstType); |
598 int value = getIntAt(ci); |
593 int value = getIntAt(ci); |
599 short bsmIndex = (short) extractLowShortFromInt(value); |
594 short bsmIndex = (short) extractLowShortFromInt(value); |
600 short nameAndTypeIndex = (short) extractHighShortFromInt(value); |
595 short nameAndTypeIndex = (short) extractHighShortFromInt(value); |