Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 416885
Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/ClassFile.java (-1 / +2 lines)
Lines 14-19 Link Here
14
 *     Jesper S Moller - Contributions for
14
 *     Jesper S Moller - Contributions for
15
 *							Bug 405066 - [1.8][compiler][codegen] Implement code generation infrastructure for JSR335             
15
 *							Bug 405066 - [1.8][compiler][codegen] Implement code generation infrastructure for JSR335             
16
 *							Bug 406982 - [1.8][compiler] Generation of MethodParameters Attribute in classfile
16
 *							Bug 406982 - [1.8][compiler] Generation of MethodParameters Attribute in classfile
17
 *							Bug 416885 - [1.8][compiler]IncompatibleClassChange error (edit)
17
 *        Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
18
 *        Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for
18
 *                          Bug 383624 - [1.8][compiler] Revive code generation support for type annotations (from Olivier's work)
19
 *                          Bug 383624 - [1.8][compiler] Revive code generation support for type annotations (from Olivier's work)
19
 *                          Bug 409236 - [1.8][compiler] Type annotations on intersection cast types dropped by code generator
20
 *                          Bug 409236 - [1.8][compiler] Type annotations on intersection cast types dropped by code generator
Lines 2869-2875 Link Here
2869
			this.contents[localContentsOffset++] = 0;
2870
			this.contents[localContentsOffset++] = 0;
2870
			this.contents[localContentsOffset++] = (byte) 3;
2871
			this.contents[localContentsOffset++] = (byte) 3;
2871
			
2872
			
2872
			int functionalDescriptorIndex = this.constantPool.literalIndexForMethodHandle(functional.descriptor.original());
2873
			int functionalDescriptorIndex = this.constantPool.literalIndexForMethodType(functional.descriptor.original().signature());
2873
			this.contents[localContentsOffset++] = (byte) (functionalDescriptorIndex >> 8);
2874
			this.contents[localContentsOffset++] = (byte) (functionalDescriptorIndex >> 8);
2874
			this.contents[localContentsOffset++] = (byte) functionalDescriptorIndex;
2875
			this.contents[localContentsOffset++] = (byte) functionalDescriptorIndex;
2875
2876
(-)compiler/org/eclipse/jdt/internal/compiler/ast/LambdaExpression.java (-1 / +5 lines)
Lines 14-19 Link Here
14
 *     Jesper S Moller - Contributions for
14
 *     Jesper S Moller - Contributions for
15
 *							bug 382701 - [1.8][compiler] Implement semantic analysis of Lambda expressions & Reference expression
15
 *							bug 382701 - [1.8][compiler] Implement semantic analysis of Lambda expressions & Reference expression
16
 *							bug 382721 - [1.8][compiler] Effectively final variables needs special treatment
16
 *							bug 382721 - [1.8][compiler] Effectively final variables needs special treatment
17
 *							Bug 416885 - [1.8][compiler]IncompatibleClassChange error (edit)
17
 *     Stephan Herrmann - Contribution for
18
 *     Stephan Herrmann - Contribution for
18
 *							bug 401030 - [1.8][null] Null analysis support for lambda methods.
19
 *							bug 401030 - [1.8][null] Null analysis support for lambda methods.
19
 *							Bug 392099 - [1.8][compiler][null] Apply null annotation on types for null analysis
20
 *							Bug 392099 - [1.8][compiler][null] Apply null annotation on types for null analysis
Lines 116-122 Link Here
116
		signature.append(')');
117
		signature.append(')');
117
		signature.append(this.expectedType.signature());
118
		signature.append(this.expectedType.signature());
118
		int invokeDynamicNumber = codeStream.classFile.recordBootstrapMethod(this);
119
		int invokeDynamicNumber = codeStream.classFile.recordBootstrapMethod(this);
119
		codeStream.invokeDynamic(invokeDynamicNumber, (this.shouldCaptureInstance ? 1 : 0) + this.outerLocalVariablesSlotSize, 1, TypeConstants.ANONYMOUS_METHOD, signature.toString().toCharArray());
120
		
121
		final MethodBinding sam = this.expectedType.getSingleAbstractMethod(this.enclosingScope);
122
		
123
		codeStream.invokeDynamic(invokeDynamicNumber, (this.shouldCaptureInstance ? 1 : 0) + this.outerLocalVariablesSlotSize, 1, sam.selector, signature.toString().toCharArray());
120
		codeStream.recordPositionsFrom(pc, this.sourceStart);		
124
		codeStream.recordPositionsFrom(pc, this.sourceStart);		
121
	}
125
	}
122
126
(-)compiler/org/eclipse/jdt/internal/compiler/ast/ReferenceExpression.java (-2 / +4 lines)
Lines 14-19 Link Here
14
 *     Jesper S Moller - Contributions for
14
 *     Jesper S Moller - Contributions for
15
 *							bug 382701 - [1.8][compiler] Implement semantic analysis of Lambda expressions & Reference expression
15
 *							bug 382701 - [1.8][compiler] Implement semantic analysis of Lambda expressions & Reference expression
16
 *                          Bug 384687 - [1.8] Wildcard type arguments should be rejected for lambda and reference expressions
16
 *                          Bug 384687 - [1.8] Wildcard type arguments should be rejected for lambda and reference expressions
17
 *							Bug 416885 - [1.8][compiler]IncompatibleClassChange error (edit)
17
 *	   Stephan Herrmann - Contribution for
18
 *	   Stephan Herrmann - Contribution for
18
 *							bug 402028 - [1.8][compiler] null analysis for reference expressions 
19
 *							bug 402028 - [1.8][compiler] null analysis for reference expressions 
19
 *							bug 404649 - [1.8][compiler] detect illegal reference to indirect or redundant super via I.super.m() syntax
20
 *							bug 404649 - [1.8][compiler] detect illegal reference to indirect or redundant super via I.super.m() syntax
Lines 58-64 Link Here
58
59
59
public class ReferenceExpression extends FunctionalExpression implements InvocationSite {
60
public class ReferenceExpression extends FunctionalExpression implements InvocationSite {
60
	
61
	
61
	private static char [] LAMBDA = { 'l', 'a', 'm', 'b', 'd', 'a' };
62
	public Expression lhs;
62
	public Expression lhs;
63
	public TypeReference [] typeArguments;
63
	public TypeReference [] typeArguments;
64
	public char [] selector;
64
	public char [] selector;
Lines 154-160 Link Here
154
		buffer.append(this.resolvedType.constantPoolName());
154
		buffer.append(this.resolvedType.constantPoolName());
155
		buffer.append(';');
155
		buffer.append(';');
156
		int invokeDynamicNumber = codeStream.classFile.recordBootstrapMethod(this);
156
		int invokeDynamicNumber = codeStream.classFile.recordBootstrapMethod(this);
157
		codeStream.invokeDynamic(invokeDynamicNumber, argumentsSize, 1, LAMBDA, buffer.toString().toCharArray(), 
157
		final MethodBinding sam = this.expectedType.getSingleAbstractMethod(this.enclosingScope);
158
159
		codeStream.invokeDynamic(invokeDynamicNumber, argumentsSize, 1, sam.selector, buffer.toString().toCharArray(), 
158
				this.isConstructorReference(), (this.lhs instanceof TypeReference? (TypeReference) this.lhs : null), this.typeArguments);
160
				this.isConstructorReference(), (this.lhs instanceof TypeReference? (TypeReference) this.lhs : null), this.typeArguments);
159
		codeStream.recordPositionsFrom(pc, this.sourceStart);
161
		codeStream.recordPositionsFrom(pc, this.sourceStart);
160
	}
162
	}
(-)compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java (-2 / +3 lines)
Lines 14-19 Link Here
14
 *     Jesper S Moller - Contributions for
14
 *     Jesper S Moller - Contributions for
15
 *							Bug 405066 - [1.8][compiler][codegen] Implement code generation infrastructure for JSR335        
15
 *							Bug 405066 - [1.8][compiler][codegen] Implement code generation infrastructure for JSR335        
16
 *							Bug 406982 - [1.8][compiler] Generation of MethodParameters Attribute in classfile
16
 *							Bug 406982 - [1.8][compiler] Generation of MethodParameters Attribute in classfile
17
 *							Bug 416885 - [1.8][compiler]IncompatibleClassChange error (edit)
17
 *******************************************************************************/
18
 *******************************************************************************/
18
package org.eclipse.jdt.internal.compiler.codegen;
19
package org.eclipse.jdt.internal.compiler.codegen;
19
20
Lines 260-267 Link Here
260
	// java 7 java.lang.invoke.MethodHandle.invokeExact(..)/invokeGeneric(..)
261
	// java 7 java.lang.invoke.MethodHandle.invokeExact(..)/invokeGeneric(..)
261
	public static final char[] JAVA_LANG_INVOKE_METHODHANDLE_POLYMORPHICSIGNATURE = "Ljava/lang/invoke/MethodHandle$PolymorphicSignature;".toCharArray(); //$NON-NLS-1$
262
	public static final char[] JAVA_LANG_INVOKE_METHODHANDLE_POLYMORPHICSIGNATURE = "Ljava/lang/invoke/MethodHandle$PolymorphicSignature;".toCharArray(); //$NON-NLS-1$
262
	// Java 8 lambda support
263
	// Java 8 lambda support
263
	public static final char[] METAFACTORY = "metaFactory".toCharArray(); //$NON-NLS-1$
264
	public static final char[] METAFACTORY = "metafactory".toCharArray(); //$NON-NLS-1$
264
	public static final char[] JAVA_LANG_INVOKE_LAMBDAMETAFACTORY_METAFACTORY_SIGNATURE = "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;".toCharArray(); //$NON-NLS-1$
265
	public static final char[] JAVA_LANG_INVOKE_LAMBDAMETAFACTORY_METAFACTORY_SIGNATURE = "(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;".toCharArray(); //$NON-NLS-1$
265
266
266
	public static final char[] HashCode = "hashCode".toCharArray(); //$NON-NLS-1$
267
	public static final char[] HashCode = "hashCode".toCharArray(); //$NON-NLS-1$
267
	public static final char[] HashCodeSignature = "()I".toCharArray(); //$NON-NLS-1$; 
268
	public static final char[] HashCodeSignature = "()I".toCharArray(); //$NON-NLS-1$; 

Return to bug 416885