Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 17877 Details for
Bug 85062
[compiler] Implicit static method invocation should target the receiver type not the declaring class
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Apply on HEAD
patch_85062.txt (text/plain), 3.51 KB, created by
Olivier Thomann
on 2005-02-11 16:52:27 EST
(
hide
)
Description:
Apply on HEAD
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2005-02-11 16:52:27 EST
Size:
3.51 KB
patch
obsolete
>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;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 85062
: 17877