Skip to content

Instantly share code, notes, and snippets.

@lschuetze
Created November 8, 2018 14:11
Show Gist options
  • Save lschuetze/c97ff013a1a3b69c1cedecfdee7b688c to your computer and use it in GitHub Desktop.
Save lschuetze/c97ff013a1a3b69c1cedecfdee7b688c to your computer and use it in GitHub Desktop.
generateBootstrapMethods adaptions
if (contentsEntries + localContentsOffset >= this.contents.length) {
resizeContents(contentsEntries);
}
char[] SIGNATURE = "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;II)Ljava/lang/invoke/CallSite;".toCharArray(); //$NON-NLS-1$
char[] NAME = "callNext".toCharArray(); //$NON-NLS-1$
MethodBinding callNext = objectTeamsCallNextBootstrap.getMethod(this.referenceBinding.scope, NAME);
if(indexForCallNext == 0) {
indexForCallNext = this.constantPool.literalIndexForMethodHandle(ClassFileConstants.MethodHandleRefKindInvokeStatic, objectTeamsCallNextBootstrap,
NAME, SIGNATURE, false);
}
this.contents[localContentsOffset++] = (byte) (indexForCallNext >> 8);
this.contents[localContentsOffset++] = (byte) indexForCallNext;
// u2 num_bootstrap_arguments
this.contents[localContentsOffset++] = 0;
this.contents[localContentsOffset++] = (byte) 2;
int functionalDescriptorIndex = this.constantPool.literalIndexForType(TypeBinding.INT);
this.contents[localContentsOffset++] = (byte) (functionalDescriptorIndex >> 8);
this.contents[localContentsOffset++] = (byte) functionalDescriptorIndex;
this.contents[localContentsOffset++] = (byte) (functionalDescriptorIndex >> 8);
this.contents[localContentsOffset++] = (byte) functionalDescriptorIndex;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment