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 139054 Details for
Bug 240934
Add support for the invokedynamic bytecode into the disassembler
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
patch_240934_official.txt (text/plain), 8.98 KB, created by
Olivier Thomann
on 2009-06-12 13:44:12 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2009-06-12 13:44:12 EDT
Size:
8.98 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/util/DefaultBytecodeVisitor.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/DefaultBytecodeVisitor.java,v >retrieving revision 1.44 >diff -u -r1.44 DefaultBytecodeVisitor.java >--- model/org/eclipse/jdt/internal/core/util/DefaultBytecodeVisitor.java 10 Jul 2008 15:42:52 -0000 1.44 >+++ model/org/eclipse/jdt/internal/core/util/DefaultBytecodeVisitor.java 12 Jun 2009 17:44:15 -0000 >@@ -1490,7 +1490,28 @@ > })); > writeNewLine(); > } >+ /** >+ * @see IBytecodeVisitor#_invokedynamic(int, int, IConstantPoolEntry, IConstantPoolEntry) >+ */ >+ public void _invokedynamic( >+ int pc, >+ int index, >+ IConstantPoolEntry nameEntry, >+ IConstantPoolEntry descriptorEntry) { > >+ dumpPcNumber(pc); >+ this.buffer.append(Messages.bind(Messages.classformat_invokedynamic, new String[] { >+ OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.INVOKEDYNAMIC], >+ Integer.toString(index), >+ Util.toString( >+ null, >+ nameEntry.getUtf8Value(), >+ descriptorEntry.getUtf8Value(), >+ true, >+ isCompact()) >+ })); >+ writeNewLine(); >+ } > /** > * @see IBytecodeVisitor#_invokeinterface(int, int, byte, IConstantPoolEntry) > */ >Index: model/org/eclipse/jdt/internal/core/util/Messages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Messages.java,v >retrieving revision 1.25 >diff -u -r1.25 Messages.java >--- model/org/eclipse/jdt/internal/core/util/Messages.java 8 Dec 2008 15:49:12 -0000 1.25 >+++ model/org/eclipse/jdt/internal/core/util/Messages.java 12 Jun 2009 17:44:15 -0000 >@@ -316,6 +316,7 @@ > public static String classformat_invokeinterface; > public static String classformat_invokestatic; > public static String classformat_invokevirtual; >+ public static String classformat_invokedynamic; > public static String classformat_getfield; > public static String classformat_getstatic; > public static String classformat_putstatic; >Index: model/org/eclipse/jdt/internal/core/util/messages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/messages.properties,v >retrieving revision 1.74 >diff -u -r1.74 messages.properties >--- model/org/eclipse/jdt/internal/core/util/messages.properties 8 Dec 2008 15:49:12 -0000 1.74 >+++ model/org/eclipse/jdt/internal/core/util/messages.properties 12 Jun 2009 17:44:15 -0000 >@@ -355,6 +355,7 @@ > classformat_iinc = {0} {1} {2}{3} > classformat_invokespecial ={0} {2} [{1}] > classformat_invokeinterface ={0} {3} [{1}] [nargs: {2}] >+classformat_invokedynamic={0} {2} [{1}] > classformat_invokestatic ={0} {2} [{1}] > classformat_invokevirtual ={0} {2} [{1}] > classformat_getfield ={0} {2}.{3} : {4} [{1}] >Index: model/org/eclipse/jdt/internal/core/util/CodeAttribute.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/CodeAttribute.java,v >retrieving revision 1.24 >diff -u -r1.24 CodeAttribute.java >--- model/org/eclipse/jdt/internal/core/util/CodeAttribute.java 7 Mar 2009 01:08:06 -0000 1.24 >+++ model/org/eclipse/jdt/internal/core/util/CodeAttribute.java 12 Jun 2009 17:44:15 -0000 >@@ -1046,6 +1046,19 @@ > visitor._invokeinterface(pc - this.codeOffset, index, count, constantPoolEntry); > pc += 5; > break; >+ case IOpcodeMnemonics.INVOKEDYNAMIC : >+ index = u2At(this.classFileBytes, 1, pc); >+ constantPoolEntry = this.constantPool.decodeEntry(index); >+ if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_NameAndType) { >+ throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY); >+ } >+ visitor._invokedynamic( >+ pc - this.codeOffset, >+ index, >+ this.constantPool.decodeEntry(constantPoolEntry.getNameAndTypeInfoNameIndex()), >+ this.constantPool.decodeEntry(constantPoolEntry.getNameAndTypeInfoDescriptorIndex())); >+ pc += 5; >+ break; > case IOpcodeMnemonics.NEW : > index = u2At(this.classFileBytes, 1, pc); > constantPoolEntry = this.constantPool.decodeEntry(index); >Index: model/org/eclipse/jdt/internal/core/util/Util.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Util.java,v >retrieving revision 1.133 >diff -u -r1.133 Util.java >--- model/org/eclipse/jdt/internal/core/util/Util.java 26 May 2009 16:05:11 -0000 1.133 >+++ model/org/eclipse/jdt/internal/core/util/Util.java 12 Jun 2009 17:44:15 -0000 >@@ -2516,7 +2516,7 @@ > > // decode declaring class name > // it can be either an array signature or a type signature >- if (declaringClass.length > 0) { >+ if (declaringClass != null && declaringClass.length > 0) { > char[] declaringClassSignature = null; > if (declaringClass[0] == Signature.C_ARRAY) { > CharOperation.replace(declaringClass, '/', '.'); >@@ -2531,14 +2531,14 @@ > } else { > buffer.append(declaringClassSignature); > } >+ if (!isConstructor) { >+ buffer.append('.'); >+ } > } > > // selector >- if (!isConstructor) { >- buffer.append('.'); >- if (methodName != null) { >- buffer.append(methodName); >- } >+ if (!isConstructor && methodName != null) { >+ buffer.append(methodName); > } > > // parameters >Index: model/org/eclipse/jdt/core/util/IOpcodeMnemonics.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IOpcodeMnemonics.java,v >retrieving revision 1.14 >diff -u -r1.14 IOpcodeMnemonics.java >--- model/org/eclipse/jdt/core/util/IOpcodeMnemonics.java 27 Jun 2008 16:04:09 -0000 1.14 >+++ model/org/eclipse/jdt/core/util/IOpcodeMnemonics.java 12 Jun 2009 17:44:15 -0000 >@@ -204,6 +204,10 @@ > int INVOKESPECIAL = 0xB7; > int INVOKESTATIC = 0xB8; > int INVOKEINTERFACE = 0xB9; >+ /** >+ * @since 3.5 >+ */ >+ int INVOKEDYNAMIC = 0xBA; > int NEW = 0xBB; > int NEWARRAY = 0xBC; > int ANEWARRAY = 0xBD; >Index: model/org/eclipse/jdt/core/util/OpcodeStringValues.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/OpcodeStringValues.java,v >retrieving revision 1.15 >diff -u -r1.15 OpcodeStringValues.java >--- model/org/eclipse/jdt/core/util/OpcodeStringValues.java 27 Jun 2008 16:04:09 -0000 1.15 >+++ model/org/eclipse/jdt/core/util/OpcodeStringValues.java 12 Jun 2009 17:44:15 -0000 >@@ -207,6 +207,7 @@ > BYTECODE_NAMES[INVOKESPECIAL] = "invokespecial"; //$NON-NLS-1$ > BYTECODE_NAMES[INVOKESTATIC] = "invokestatic"; //$NON-NLS-1$ > BYTECODE_NAMES[INVOKEINTERFACE] = "invokeinterface"; //$NON-NLS-1$ >+ BYTECODE_NAMES[INVOKEDYNAMIC] = "invokedynamic"; //$NON-NLS-1$ > BYTECODE_NAMES[NEW] = "new"; //$NON-NLS-1$ > BYTECODE_NAMES[NEWARRAY] = "newarray"; //$NON-NLS-1$ > BYTECODE_NAMES[ANEWARRAY] = "anewarray"; //$NON-NLS-1$ >Index: model/org/eclipse/jdt/core/util/ByteCodeVisitorAdapter.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/ByteCodeVisitorAdapter.java,v >retrieving revision 1.13 >diff -u -r1.13 ByteCodeVisitorAdapter.java >--- model/org/eclipse/jdt/core/util/ByteCodeVisitorAdapter.java 7 Mar 2009 01:08:06 -0000 1.13 >+++ model/org/eclipse/jdt/core/util/ByteCodeVisitorAdapter.java 12 Jun 2009 17:44:15 -0000 >@@ -922,7 +922,17 @@ > public void _instanceof(int pc, int index, IConstantPoolEntry constantClass) { > // default behavior is to do nothing > } >- >+ /** >+ * @see IBytecodeVisitor#_invokeinterface(int, int, byte, IConstantPoolEntry) >+ * @since 3.5 >+ */ >+ public void _invokedynamic( >+ int pc, >+ int index, >+ IConstantPoolEntry nameEntry, >+ IConstantPoolEntry descriptorEntry) { >+ // default behavior is to do nothing >+ } > /** > * @see IBytecodeVisitor#_invokeinterface(int, int, byte, IConstantPoolEntry) > */ >Index: model/org/eclipse/jdt/core/util/IBytecodeVisitor.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/util/IBytecodeVisitor.java,v >retrieving revision 1.14 >diff -u -r1.14 IBytecodeVisitor.java >--- model/org/eclipse/jdt/core/util/IBytecodeVisitor.java 27 Jun 2008 16:04:09 -0000 1.14 >+++ model/org/eclipse/jdt/core/util/IBytecodeVisitor.java 12 Jun 2009 17:44:15 -0000 >@@ -166,6 +166,14 @@ > int pc, > int index, > IConstantPoolEntry constantClass); >+ /** >+ * @since 3.5 >+ */ >+ void _invokedynamic( >+ int pc, >+ int index, >+ IConstantPoolEntry nameEntry, >+ IConstantPoolEntry descriptorEntry); > void _invokeinterface( > int pc, > int index,
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 240934
:
138708
| 139054