Index: compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java,v retrieving revision 1.84 diff -u -r1.84 MessageSend.java --- compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java 8 Feb 2005 22:25:27 -0000 1.84 +++ compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java 11 Feb 2005 21:50:07 -0000 @@ -111,7 +111,11 @@ // actual message invocation if (syntheticAccessor == null){ if (isStatic){ - codeStream.invokestatic(this.codegenBinding); + if (receiver.isImplicitThis()) { + codeStream.invokestatic(this.actualReceiverType, this.codegenBinding); + } else { + codeStream.invokestatic(this.codegenBinding); + } } else { if( (receiver.isSuper()) || this.codegenBinding.isPrivate()){ codeStream.invokespecial(this.codegenBinding); Index: compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java,v retrieving revision 1.100 diff -u -r1.100 CodeStream.java --- compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java 27 Jan 2005 21:53:23 -0000 1.100 +++ compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java 11 Feb 2005 21:50:08 -0000 @@ -1719,7 +1719,8 @@ FieldBinding fieldBinding = (FieldBinding) mappingSequence[i]; this.getfield(fieldBinding); } else { - this.invokestatic((MethodBinding) mappingSequence[i]); + MethodBinding methodBinding = (MethodBinding) mappingSequence[i]; + this.invokestatic(methodBinding.declaringClass, methodBinding); } } } @@ -2055,7 +2056,7 @@ } TypeBinding type; if (methodBinding.isStatic()) - this.invokestatic(methodBinding); + this.invokestatic(methodBinding.declaringClass, methodBinding); else { if (methodBinding.isConstructor() || methodBinding.isPrivate() @@ -3374,6 +3375,34 @@ position++; bCodeStream[classFileOffset++] = OPC_invokestatic; writeUnsignedShort(constantPool.literalIndex(methodBinding)); + for (int i = methodBinding.parameters.length - 1; i >= 0; i--) + if (((id = methodBinding.parameters[i].id) == T_double) || (id == T_long)) + argCount += 2; + else + argCount += 1; + if (((id = methodBinding.returnType.id) == T_double) || (id == T_long)) + stackDepth += (2 - argCount); + else + if (id == T_void) + stackDepth -= argCount; + else + stackDepth += (1 - argCount); + if (stackDepth > stackMax) + stackMax = stackDepth; +} +final public void invokestatic(TypeBinding actualReceiverType, MethodBinding methodBinding) { + if (DEBUG) System.out.println(position + "\t\tinvokestatic:"+methodBinding); //$NON-NLS-1$ + // initialized to 0 to take into account that there is no this for + // a static method + countLabels = 0; + int argCount = 0; + int id; + if (classFileOffset + 2 >= bCodeStream.length) { + resizeByteArray(); + } + position++; + bCodeStream[classFileOffset++] = OPC_invokestatic; + writeUnsignedShort(constantPool.literalIndexForMethod(actualReceiverType.constantPoolName(), methodBinding.selector, methodBinding.signature(), actualReceiverType.isInterface())); for (int i = methodBinding.parameters.length - 1; i >= 0; i--) if (((id = methodBinding.parameters[i].id) == T_double) || (id == T_long)) argCount += 2;