### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream.java,v retrieving revision 1.7 diff -u -r1.7 StackMapFrameCodeStream.java --- compiler/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream.java 3 Apr 2006 13:51:36 -0000 1.7 +++ compiler/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream.java 8 Jun 2006 15:38:36 -0000 @@ -1110,10 +1110,11 @@ super.invokeJavaLangClassDesiredAssertionStatus(); this.currentFrame.stackItems[this.currentFrame.numberOfStackItems - 1] = new VerificationTypeInfo(TypeBinding.BOOLEAN); } -public void invokeJavaLangEnumname(TypeBinding typeBinding) { - // invokevirtual: java.lang.Enum.name()String - super.invokeJavaLangEnumname(typeBinding); - this.currentFrame.stackItems[this.currentFrame.numberOfStackItems - 1] = new VerificationTypeInfo(TypeIds.T_JavaLangString, ConstantPool.JavaLangStringConstantPoolName); +public void invokeJavaLangEnumvalueOf(ReferenceBinding binding) { + // invokestatic: java.lang.Enum.valueOf(Class,String) + super.invokeJavaLangEnumvalueOf(binding); + this.currentFrame.numberOfStackItems -= 2; + this.currentFrame.addStackItem(binding); } public void invokeJavaLangEnumValues(TypeBinding enumBinding, ArrayBinding arrayBinding) { super.invokeJavaLangEnumValues(enumBinding, arrayBinding); @@ -1125,13 +1126,6 @@ this.currentFrame.initializeReceiver(); this.currentFrame.numberOfStackItems--; // remove the top of stack } -public void invokeJavaLangIllegalArgumentExceptionStringConstructor() { - // invokespecial: java.lang.IllegalArgumentException.(String)V - super.invokeJavaLangIllegalArgumentExceptionStringConstructor(); - this.currentFrame.numberOfStackItems--; - this.currentFrame.initializeReceiver(); - this.currentFrame.numberOfStackItems--; // remove the top of stack -} public void invokeJavaLangReflectConstructorNewInstance() { super.invokeJavaLangReflectConstructorNewInstance(); this.currentFrame.numberOfStackItems--; @@ -1255,11 +1249,6 @@ super.invokeStringConcatenationToString(); this.currentFrame.stackItems[this.currentFrame.numberOfStackItems - 1] = new VerificationTypeInfo(TypeIds.T_JavaLangString, ConstantPool.JavaLangStringConstantPoolName); } -public void invokeStringEquals() { - super.invokeStringEquals(); - this.currentFrame.numberOfStackItems--; // remove argument - this.currentFrame.stackItems[this.currentFrame.numberOfStackItems - 1] = new VerificationTypeInfo(TypeBinding.BOOLEAN); -} public void invokeStringValueOf(int typeID) { super.invokeStringValueOf(typeID); this.currentFrame.stackItems[this.currentFrame.numberOfStackItems - 1] = new VerificationTypeInfo(TypeIds.T_JavaLangString, ConstantPool.JavaLangStringConstantPoolName); @@ -1562,13 +1551,6 @@ verificationTypeInfo.offset = pc; this.currentFrame.addStackItem(verificationTypeInfo); } -public void newJavaLangIllegalArgumentException() { - int pc = this.position; - super.newJavaLangIllegalArgumentException(); - final VerificationTypeInfo verificationTypeInfo = new VerificationTypeInfo(TypeIds.T_JavaLangIllegalArgumentException, VerificationTypeInfo.ITEM_UNINITIALIZED, ConstantPool.JavaLangIllegalArgumentExceptionConstantPoolName); - verificationTypeInfo.offset = pc; - this.currentFrame.addStackItem(verificationTypeInfo); -} public void newNoClassDefFoundError() { int pc = this.position; super.newNoClassDefFoundError(); Index: compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java,v retrieving revision 1.51 diff -u -r1.51 ConstantPool.java --- compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java 8 Jun 2006 13:08:57 -0000 1.51 +++ compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java 8 Jun 2006 15:38:35 -0000 @@ -73,8 +73,6 @@ public static final char[] doubleDoubleSignature = "(D)Ljava/lang/Double;".toCharArray(); //$NON-NLS-1$ public static final char[] DOUBLEVALUE_DOUBLE_METHOD_NAME = "doubleValue".toCharArray(); //$NON-NLS-1$ public static final char[] DOUBLEVALUE_DOUBLE_METHOD_SIGNATURE = "()D".toCharArray(); //$NON-NLS-1$ - public static final char[] Equals = "equals".toCharArray(); //$NON-NLS-1$ - public static final char[] EqualsSignature = "(Ljava/lang/Object;)Z".toCharArray(); //$NON-NLS-1$ public static final char[] Exit = "exit".toCharArray(); //$NON-NLS-1$ public static final char[] ExitIntSignature = "(I)V".toCharArray(); //$NON-NLS-1$ public static final char[] FloatConstrSignature = "(F)V".toCharArray(); //$NON-NLS-1$ @@ -143,7 +141,6 @@ public static final char[] JavaLangErrorConstantPoolName = "java/lang/Error".toCharArray(); //$NON-NLS-1$ public static final char[] JavaLangExceptionConstantPoolName = "java/lang/Exception".toCharArray(); //$NON-NLS-1$ public static final char[] JavaLangFloatConstantPoolName = "java/lang/Float".toCharArray(); //$NON-NLS-1$ - public static final char[] JavaLangIllegalArgumentExceptionConstantPoolName = "java/lang/IllegalArgumentException".toCharArray(); //$NON-NLS-1$ public static final char[] JavaLangIntegerConstantPoolName = "java/lang/Integer".toCharArray(); //$NON-NLS-1$ public static final char[] JavaLangLongConstantPoolName = "java/lang/Long".toCharArray(); //$NON-NLS-1$ public static final char[] JavaLangNoClassDefFoundErrorConstantPoolName = "java/lang/NoClassDefFoundError".toCharArray(); //$NON-NLS-1$ @@ -169,8 +166,6 @@ public static final char[] longLongSignature = "(J)Ljava/lang/Long;".toCharArray(); //$NON-NLS-1$ public static final char[] LONGVALUE_LONG_METHOD_NAME = "longValue".toCharArray(); //$NON-NLS-1$ public static final char[] LONGVALUE_LONG_METHOD_SIGNATURE = "()J".toCharArray(); //$NON-NLS-1$ - public static final char[] Name = "name".toCharArray(); //$NON-NLS-1$ - public static final char[] NameSignature = "()Ljava/lang/String;".toCharArray(); //$NON-NLS-1$ public static final char[] NewInstance = "newInstance".toCharArray(); //$NON-NLS-1$ public static final char[] NewInstanceSignature = "(Ljava/lang/Class;[I)Ljava/lang/Object;".toCharArray(); //$NON-NLS-1$ public static final char[] Next = "next".toCharArray();//$NON-NLS-1$ Index: compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java,v retrieving revision 1.134 diff -u -r1.134 CodeStream.java --- compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java 8 Jun 2006 13:08:57 -0000 1.134 +++ compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java 8 Jun 2006 15:38:35 -0000 @@ -2328,16 +2328,17 @@ this.return_(); } //static X valueOf(String name) { -// return (X) Enum.valueOf(name, X.class); +// return (X) Enum.valueOf(X.class, name); //} public void generateSyntheticBodyForEnumValueOf(SyntheticMethodBinding methodBinding) { initializeMaxLocals(methodBinding); - this.ldc(methodBinding.declaringClass); + final ReferenceBinding declaringClass = methodBinding.declaringClass; + this.ldc(declaringClass); this.aload_0(); - this.invokeJavaLangEnumvalueOf(); - this.checkcast(methodBinding.declaringClass); + this.invokeJavaLangEnumvalueOf(declaringClass); + this.checkcast(declaringClass); this.areturn(); -} +} //static X[] values() { // X[] values; // int length; @@ -3904,20 +3905,9 @@ ConstantPool.DesiredAssertionStatus, ConstantPool.DesiredAssertionStatusSignature); } -public void invokeJavaLangEnumname(TypeBinding typeBinding) { - // invokevirtual: java.lang.Enum.name()String - if (DEBUG) System.out.println(position + "\t\tinvokevirtual: java.lang.Enum.name()Ljava/lang/String;"); //$NON-NLS-1$ - this.invoke( - Opcodes.OPC_invokevirtual, - 0, // argCount - 1, // return type size - typeBinding.constantPoolName(), - ConstantPool.Name, - ConstantPool.NameSignature); -} -public void invokeJavaLangEnumvalueOf() { - // invokevirtual: java.lang.Enum.valueOf(String,Class) - if (DEBUG) System.out.println(position + "\t\tinvokevirtual: java.lang.Enum.valueOf(Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Enum;"); //$NON-NLS-1$ +public void invokeJavaLangEnumvalueOf(ReferenceBinding binding) { + // invokestatic: java.lang.Enum.valueOf(Class,String) + if (DEBUG) System.out.println(position + "\t\tinvokestatic: java.lang.Enum.valueOf(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;"); //$NON-NLS-1$ this.invoke( Opcodes.OPC_invokestatic, 2, // argCount @@ -3942,17 +3932,6 @@ ConstantPool.Init, ConstantPool.StringConstructorSignature); } -public void invokeJavaLangIllegalArgumentExceptionStringConstructor() { - // invokespecial: java.lang.IllegalArgumentException.(String)V - if (DEBUG) System.out.println(position + "\t\tinvokespecial: java.lang.IllegalArgumentException.(java.lang.String)V"); //$NON-NLS-1$ - this.invoke( - Opcodes.OPC_invokespecial, - 1, // argCount - 0, // return type size - ConstantPool.JavaLangIllegalArgumentExceptionConstantPoolName, - ConstantPool.Init, - ConstantPool.StringConstructorSignature); -} public void invokeJavaLangReflectConstructorNewInstance() { // invokevirtual: java.lang.reflect.Constructor.newInstance([Ljava.lang.Object;)Ljava.lang.Object; this.invoke( @@ -4376,17 +4355,6 @@ ConstantPool.ToString, ConstantPool.ToStringSignature); } -public void invokeStringEquals() { - // invokevirtual: java.lang.String.equals(java.lang.Object) - if (DEBUG) System.out.println(position + "\t\tinvokevirtual: java.lang.String.equals(...)"); //$NON-NLS-1$ - this.invoke( - Opcodes.OPC_invokevirtual, - 1, // argCount - 1, // return type size - ConstantPool.JavaLangStringConstantPoolName, - ConstantPool.Equals, - ConstantPool.EqualsSignature); -} public void invokeStringIntern() { // invokevirtual: java.lang.String.intern() if (DEBUG) System.out.println(position + "\t\tinvokevirtual: java.lang.String.intern()"); //$NON-NLS-1$ @@ -5552,20 +5520,6 @@ bCodeStream[classFileOffset++] = Opcodes.OPC_new; writeUnsignedShort(constantPool.literalIndexForType(ConstantPool.JavaLangErrorConstantPoolName)); } -public void newJavaLangIllegalArgumentException() { - // new: java.lang.IllegalArgumentException - if (DEBUG) System.out.println(position + "\t\tnew: java.lang.IllegalArgumentException"); //$NON-NLS-1$ - countLabels = 0; - stackDepth++; - if (stackDepth > stackMax) - stackMax = stackDepth; - if (classFileOffset + 2 >= bCodeStream.length) { - resizeByteArray(); - } - position++; - bCodeStream[classFileOffset++] = Opcodes.OPC_new; - writeUnsignedShort(constantPool.literalIndexForType(ConstantPool.JavaLangIllegalArgumentExceptionConstantPoolName)); -} public void newNoClassDefFoundError() { // new: java.lang.NoClassDefFoundError if (DEBUG) System.out.println(position + "\t\tnew: java.lang.NoClassDefFoundError"); //$NON-NLS-1$