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 78342 Details for
Bug 120223
[compiler] Support for "-target cldc1.1"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
patch_cldc11.txt (text/plain), 69.97 KB, created by
Olivier Thomann
on 2007-09-13 12:53:44 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2007-09-13 12:53:44 EDT
Size:
69.97 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >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.155 >diff -u -r1.155 CodeStream.java >--- compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java 31 Aug 2007 19:41:31 -0000 1.155 >+++ compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java 13 Sep 2007 16:51:57 -0000 >@@ -206,7 +206,9 @@ > } > public void addDefinitelyAssignedVariables(Scope scope, int initStateIndex) { > // Required to fix 1PR0XVS: LFRE:WINNT - Compiler: variable table for method appears incorrect >- if ((this.generateAttributes & (ClassFileConstants.ATTR_VARS | ClassFileConstants.ATTR_STACK_MAP)) == 0) >+ if ((this.generateAttributes & (ClassFileConstants.ATTR_VARS >+ | ClassFileConstants.ATTR_STACK_MAP_TABLE >+ | ClassFileConstants.ATTR_STACK_MAP)) == 0) > return; > for (int i = 0; i < visibleLocalsCount; i++) { > LocalVariableBinding localBinding = visibleLocals[i]; >@@ -235,7 +237,9 @@ > labels[countLabels++] = aLabel; > } > public void addVisibleLocalVariable(LocalVariableBinding localBinding) { >- if ((this.generateAttributes & (ClassFileConstants.ATTR_VARS | ClassFileConstants.ATTR_STACK_MAP)) == 0) >+ if ((this.generateAttributes & (ClassFileConstants.ATTR_VARS >+ | ClassFileConstants.ATTR_STACK_MAP_TABLE >+ | ClassFileConstants.ATTR_STACK_MAP)) == 0) > return; > > if (visibleLocalsCount >= visibleLocals.length) >@@ -1025,7 +1029,9 @@ > public void exitUserScope(BlockScope currentScope) { > // mark all the scope's locals as losing their definite assignment > >- if ((this.generateAttributes & (ClassFileConstants.ATTR_VARS | ClassFileConstants.ATTR_STACK_MAP)) == 0) >+ if ((this.generateAttributes & (ClassFileConstants.ATTR_VARS >+ | ClassFileConstants.ATTR_STACK_MAP_TABLE >+ | ClassFileConstants.ATTR_STACK_MAP)) == 0) > return; > int index = this.visibleLocalsCount - 1; > while (index >= 0) { >@@ -1045,7 +1051,9 @@ > } > public void exitUserScope(BlockScope currentScope, LocalVariableBinding binding) { > // mark all the scope's locals as losing their definite assignment >- if ((this.generateAttributes & (ClassFileConstants.ATTR_VARS | ClassFileConstants.ATTR_STACK_MAP)) == 0) >+ if ((this.generateAttributes & (ClassFileConstants.ATTR_VARS >+ | ClassFileConstants.ATTR_STACK_MAP_TABLE >+ | ClassFileConstants.ATTR_STACK_MAP)) == 0) > return; > int index = this.visibleLocalsCount - 1; > while (index >= 0) { >@@ -5740,7 +5748,9 @@ > fieldBinding.type); > } > public void record(LocalVariableBinding local) { >- if ((this.generateAttributes & (ClassFileConstants.ATTR_VARS | ClassFileConstants.ATTR_STACK_MAP)) == 0) >+ if ((this.generateAttributes & (ClassFileConstants.ATTR_VARS >+ | ClassFileConstants.ATTR_STACK_MAP_TABLE >+ | ClassFileConstants.ATTR_STACK_MAP)) == 0) > return; > if (allLocalsCounter == locals.length) { > // resize the collection >@@ -6105,7 +6115,9 @@ > public void removeNotDefinitelyAssignedVariables(Scope scope, int initStateIndex) { > // given some flow info, make sure we did not loose some variables initialization > // if this happens, then we must update their pc entries to reflect it in debug attributes >- if ((this.generateAttributes & (ClassFileConstants.ATTR_VARS | ClassFileConstants.ATTR_STACK_MAP)) == 0) >+ if ((this.generateAttributes & (ClassFileConstants.ATTR_VARS >+ | ClassFileConstants.ATTR_STACK_MAP_TABLE >+ | ClassFileConstants.ATTR_STACK_MAP)) == 0) > return; > for (int i = 0; i < visibleLocalsCount; i++) { > LocalVariableBinding localBinding = visibleLocals[i]; >@@ -6585,7 +6597,9 @@ > this.lastEntryPC = pos; > } > // need to update the initialization endPC in case of generation of local variable attributes. >- if ((this.generateAttributes & (ClassFileConstants.ATTR_VARS | ClassFileConstants.ATTR_STACK_MAP)) != 0) { >+ if ((this.generateAttributes & (ClassFileConstants.ATTR_VARS >+ | ClassFileConstants.ATTR_STACK_MAP_TABLE >+ | ClassFileConstants.ATTR_STACK_MAP)) != 0) { > for (int i = 0, max = this.locals.length; i < max; i++) { > LocalVariableBinding local = this.locals[i]; > if (local != null && local.declaringScope == scope && local.initializationCount > 0) { >Index: compiler/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.java,v >retrieving revision 1.17 >diff -u -r1.17 AttributeNamesConstants.java >--- compiler/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.java 11 May 2007 18:18:41 -0000 1.17 >+++ compiler/org/eclipse/jdt/internal/compiler/codegen/AttributeNamesConstants.java 13 Sep 2007 16:51:56 -0000 >@@ -31,4 +31,5 @@ > final char[] StackMapTableName = "StackMapTable".toCharArray(); //$NON-NLS-1$ > final char[] InconsistentHierarchy = "InconsistentHierarchy".toCharArray(); //$NON-NLS-1$ > final char[] VarargsName = "Varargs".toCharArray(); //$NON-NLS-1$ >+ final char[] StackMapName = "StackMap".toCharArray(); //$NON-NLS-1$ > } >Index: compiler/org/eclipse/jdt/internal/compiler/codegen/BranchLabel.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/BranchLabel.java,v >retrieving revision 1.11 >diff -u -r1.11 BranchLabel.java >--- compiler/org/eclipse/jdt/internal/compiler/codegen/BranchLabel.java 31 Aug 2007 19:41:32 -0000 1.11 >+++ compiler/org/eclipse/jdt/internal/compiler/codegen/BranchLabel.java 13 Sep 2007 16:51:56 -0000 >@@ -205,7 +205,7 @@ > this.codeStream.lastEntryPC = this.position; > } > // end of new code >- if ((this.codeStream.generateAttributes & (ClassFileConstants.ATTR_VARS | ClassFileConstants.ATTR_STACK_MAP)) != 0) { >+ if ((this.codeStream.generateAttributes & (ClassFileConstants.ATTR_VARS | ClassFileConstants.ATTR_STACK_MAP_TABLE | ClassFileConstants.ATTR_STACK_MAP)) != 0) { > LocalVariableBinding locals[] = this.codeStream.locals; > for (int i = 0, max = locals.length; i < max; i++) { > LocalVariableBinding local = locals[i]; >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java,v >retrieving revision 1.150 >diff -u -r1.150 ClassScope.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java 22 Aug 2007 19:47:00 -0000 1.150 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java 13 Sep 2007 16:51:58 -0000 >@@ -274,7 +274,7 @@ > int count = isEnum ? 2 : 0; // reserve 2 slots for special enum methods: #values() and #valueOf(String) > MethodBinding[] methodBindings = new MethodBinding[(clinitIndex == -1 ? size : size - 1) + count]; > // create special methods for enums >- SourceTypeBinding sourceType = referenceContext.binding; >+ SourceTypeBinding sourceType = referenceContext.binding; > if (isEnum) { > methodBindings[0] = sourceType.addSyntheticEnumMethod(TypeConstants.VALUES); // add <EnumType>[] values() > methodBindings[1] = sourceType.addSyntheticEnumMethod(TypeConstants.VALUEOF); // add <EnumType> valueOf() >Index: batch/org/eclipse/jdt/internal/compiler/batch/Main.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java,v >retrieving revision 1.306 >diff -u -r1.306 Main.java >--- batch/org/eclipse/jdt/internal/compiler/batch/Main.java 1 Aug 2007 13:44:00 -0000 1.306 >+++ batch/org/eclipse/jdt/internal/compiler/batch/Main.java 13 Sep 2007 16:51:54 -0000 >@@ -2636,7 +2636,7 @@ > this.options.put( > CompilerOptions.OPTION_InlineJsr, > CompilerOptions.ENABLED); >- continue; >+ continue; > } > if (currentArg.startsWith("-g")) { //$NON-NLS-1$ > mode = DEFAULT; >@@ -2848,7 +2848,10 @@ > this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_1_7); > } else if (currentArg.equals("jsr14")) { //$NON-NLS-1$ > this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_JSR14); >- } else { >+ } else if (currentArg.equals("cldc1.1")) { //$NON-NLS-1$ >+ this.options.put(CompilerOptions.OPTION_TargetPlatform, CompilerOptions.VERSION_CLDC1_1); >+ this.options.put(CompilerOptions.OPTION_InlineJsr, CompilerOptions.ENABLED); >+ }else { > throw new InvalidInputException(this.bind("configure.targetJDK", currentArg)); //$NON-NLS-1$ > } > mode = DEFAULT; >@@ -3976,6 +3979,10 @@ > if (CompilerOptions.versionToJdkLevel(sourceVersion) < ClassFileConstants.JDK1_5) { > throw new InvalidInputException(this.bind("configure.incompatibleTargetForGenericSource", (String) targetVersion, (String) sourceVersion)); //$NON-NLS-1$ > } >+ } else if (CompilerOptions.VERSION_CLDC1_1.equals(targetVersion)) { >+ if (CompilerOptions.versionToJdkLevel(sourceVersion) >= ClassFileConstants.JDK1_5) { >+ throw new InvalidInputException(this.bind("configure.incompatibleSourceForCldcTarget", (String) targetVersion, (String) sourceVersion)); //$NON-NLS-1$ >+ } > } else { > // target must be 1.7 if source is 1.7 > if (CompilerOptions.versionToJdkLevel(sourceVersion) >= ClassFileConstants.JDK1_7 >Index: batch/org/eclipse/jdt/internal/compiler/batch/messages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/messages.properties,v >retrieving revision 1.662 >diff -u -r1.662 messages.properties >--- batch/org/eclipse/jdt/internal/compiler/batch/messages.properties 12 Sep 2007 07:14:29 -0000 1.662 >+++ batch/org/eclipse/jdt/internal/compiler/batch/messages.properties 13 Sep 2007 16:51:54 -0000 >@@ -52,7 +52,7 @@ > configure.invalidWarningConfiguration = invalid warning configuration: {0} > configure.invalidWarning = invalid warning: {0} > configure.invalidWarningOption = invalid warning option: {0} >-configure.targetJDK = target level should be comprised in between ''1.1'' and ''1.7'' (or ''5'', ''5.0'', ..., ''7'' or ''7.0''): {0} >+configure.targetJDK = target level should be comprised in between ''1.1'' and ''1.7'' (or ''5'', ''5.0'', ..., ''7'' or ''7.0'') or cldc1.1: {0} > configure.incompatibleTargetForSource = Target level ''{0}'' is incompatible with source level ''{1}''. A target level ''{1}'' or better is required > configure.incompatibleTargetForGenericSource = Target level ''{0}'' is incompatible with source level ''{1}''. A source level ''1.5'' or better is required > configure.incompatibleComplianceForSource = Compliance level ''{0}'' is incompatible with source level ''{1}''. A compliance level ''{1}'' or better is required >@@ -80,6 +80,7 @@ > configure.duplicateDestinationPathEntry = duplicate destination path entry in {0} option > configure.invalidClassName = invalid class name: {0} > configure.incorrectVMVersionforAPT = Annotation processing got disabled, since it requires a 1.6 compliant JVM >+configure.incompatibleSourceForCldcTarget=Target level ''{0}'' is incompatible with source level ''{1}''. A source level ''1.5'' or lower is required > > ### requestor > requestor.error = {0}. ERROR in {1} >@@ -150,6 +151,8 @@ > \ -1.7 -7 -7.0 use 1.7 compliance (-source 1.7 -target 1.7)\n\ > \ -source <version> set source level: 1.3 to 1.7 (or 5, 5.0, etc)\n\ > \ -target <version> set classfile target: 1.1 to 1.7 (or 5, 5.0, etc)\n\ >+\ cldc1.1 can also be used to generate the StackMap\n\ >+\ attribute\n\ > \ \n\ > \ Warning options:\n\ > \ -deprecation + deprecation outside deprecated code (equivalent to\n\ >Index: model/org/eclipse/jdt/internal/core/util/Disassembler.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Disassembler.java,v >retrieving revision 1.89 >diff -u -r1.89 Disassembler.java >--- model/org/eclipse/jdt/internal/core/util/Disassembler.java 29 Aug 2007 18:15:21 -0000 1.89 >+++ model/org/eclipse/jdt/internal/core/util/Disassembler.java 13 Sep 2007 16:51:58 -0000 >@@ -1261,25 +1261,17 @@ > writeNewLine(buffer, lineSeparator, tabNumber + 3); > int numberOfEntries = attribute.getNumberOfEntries(); > final IStackMapFrame[] stackMapFrames = attribute.getStackMapFrame(); >- int absolutePC = -1; > for (int j = 0; j < numberOfEntries; j++) { > if (j > 0) { > writeNewLine(buffer, lineSeparator, tabNumber + 3); > } > final IStackMapFrame frame = stackMapFrames[j]; > // disassemble each frame >- int offsetDelta = frame.getOffsetDelta(); >- if (absolutePC == -1) { >- absolutePC = offsetDelta; >- } else { >- absolutePC += (offsetDelta + 1); >- } >- // FULL_FRAME > buffer.append( > Messages.bind( > Messages.disassembler_frame_full_frame, > new String[] { >- Integer.toString(absolutePC), >+ Integer.toString(frame.getOffsetDelta()), > Integer.toString(frame.getNumberOfLocals()), > disassemble(frame.getLocals(), mode), > Integer.toString(frame.getNumberOfStackItems()), >Index: eval/org/eclipse/jdt/internal/eval/CodeSnippetClassFile.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/eval/org/eclipse/jdt/internal/eval/CodeSnippetClassFile.java,v >retrieving revision 1.42 >diff -u -r1.42 CodeSnippetClassFile.java >--- eval/org/eclipse/jdt/internal/eval/CodeSnippetClassFile.java 6 Mar 2007 02:38:49 -0000 1.42 >+++ eval/org/eclipse/jdt/internal/eval/CodeSnippetClassFile.java 13 Sep 2007 16:51:58 -0000 >@@ -113,7 +113,11 @@ > this.creatingProblemType = creatingProblemType; > if (this.targetJDK >= ClassFileConstants.JDK1_6) { > this.codeStream = new StackMapFrameCodeStream(this); >+ this.produceAttributes |= ClassFileConstants.ATTR_STACK_MAP_TABLE; >+ } else if (this.targetJDK == ClassFileConstants.CLDC_1_1) { >+ this.targetJDK = ClassFileConstants.JDK1_1; // put back 45.3 > this.produceAttributes |= ClassFileConstants.ATTR_STACK_MAP; >+ this.codeStream = new StackMapFrameCodeStream(this); > } else { > this.codeStream = new CodeStream(this); > } >Index: compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java,v >retrieving revision 1.185 >diff -u -r1.185 CompilerOptions.java >--- compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java 10 Sep 2007 07:11:04 -0000 1.185 >+++ compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java 13 Sep 2007 16:51:57 -0000 >@@ -132,6 +132,7 @@ > public static final String VERSION_1_3 = "1.3"; //$NON-NLS-1$ > public static final String VERSION_1_4 = "1.4"; //$NON-NLS-1$ > public static final String VERSION_JSR14 = "jsr14"; //$NON-NLS-1$ >+ public static final String VERSION_CLDC1_1 = "cldc1.1"; //$NON-NLS-1$ > public static final String VERSION_1_5 = "1.5"; //$NON-NLS-1$ > public static final String VERSION_1_6 = "1.6"; //$NON-NLS-1$ > public static final String VERSION_1_7 = "1.7"; //$NON-NLS-1$ >@@ -1063,6 +1064,9 @@ > if (VERSION_JSR14.equals(versionID)) { > return ClassFileConstants.JDK1_4; > } >+ if (VERSION_CLDC1_1.equals(versionID)) { >+ return ClassFileConstants.CLDC_1_1; >+ } > } > return 0; // unknown > } >Index: compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java,v >retrieving revision 1.20 >diff -u -r1.20 ClassFileConstants.java >--- compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java 23 Nov 2006 09:06:17 -0000 1.20 >+++ compiler/org/eclipse/jdt/internal/compiler/classfmt/ClassFileConstants.java 13 Sep 2007 16:51:56 -0000 >@@ -81,9 +81,10 @@ > > int MINOR_VERSION_0 = 0; > int MINOR_VERSION_1 = 1; >- int MINOR_VERSION_2 = 2; >- int MINOR_VERSION_3 = 3; >- >+ int MINOR_VERSION_2 = 2; >+ int MINOR_VERSION_3 = 3; >+ int MINOR_VERSION_4 = 4; >+ > // JDK 1.1 -> 1.7, comparable value allowing to check both major/minor version at once 1.4.1 > 1.4.0 > // 16 unsigned bits for major, then 16 bits for minor > long JDK1_1 = ((long)ClassFileConstants.MAJOR_VERSION_1_1 << 16) + ClassFileConstants.MINOR_VERSION_3; // 1.1. is 45.3 >@@ -93,11 +94,17 @@ > long JDK1_5 = ((long)ClassFileConstants.MAJOR_VERSION_1_5 << 16) + ClassFileConstants.MINOR_VERSION_0; > long JDK1_6 = ((long)ClassFileConstants.MAJOR_VERSION_1_6 << 16) + ClassFileConstants.MINOR_VERSION_0; > long JDK1_7 = ((long)ClassFileConstants.MAJOR_VERSION_1_7 << 16) + ClassFileConstants.MINOR_VERSION_0; >- >+ >+ /* >+ * cldc1.1 is 45.3, but we modify it to be different from JDK1_1. >+ * In the code gen, we will generate the same target value as JDK1_1 >+ */ >+ long CLDC_1_1 = ((long)ClassFileConstants.MAJOR_VERSION_1_1 << 16) + ClassFileConstants.MINOR_VERSION_4; >+ > // jdk level used to denote future releases: optional behavior is not enabled for now, but may become so. In order to enable these, > // search for references to this constant, and change it to one of the official JDT constants above. > long JDK_DEFERRED = Long.MAX_VALUE; >- >+ > int INT_ARRAY = 10; > int BYTE_ARRAY = 8; > int BOOLEAN_ARRAY = 4; >@@ -106,10 +113,11 @@ > int LONG_ARRAY = 11; > int FLOAT_ARRAY = 6; > int DOUBLE_ARRAY = 7; >- >+ > // Debug attributes >- int ATTR_SOURCE = 1; // SourceFileAttribute >- int ATTR_LINES = 2; // LineNumberAttribute >- int ATTR_VARS = 4; // LocalVariableTableAttribute >- int ATTR_STACK_MAP = 8; // Stack map table attribute >+ int ATTR_SOURCE = 0x1; // SourceFileAttribute >+ int ATTR_LINES = 0x2; // LineNumberAttribute >+ int ATTR_VARS = 0x4; // LocalVariableTableAttribute >+ int ATTR_STACK_MAP_TABLE = 0x8; // Stack map table attribute >+ int ATTR_STACK_MAP = 0x10; // Stack map attribute: cldc > } >Index: compiler/org/eclipse/jdt/internal/compiler/ClassFile.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java,v >retrieving revision 1.154 >diff -u -r1.154 ClassFile.java >--- compiler/org/eclipse/jdt/internal/compiler/ClassFile.java 4 Sep 2007 22:17:53 -0000 1.154 >+++ compiler/org/eclipse/jdt/internal/compiler/ClassFile.java 13 Sep 2007 16:51:56 -0000 >@@ -412,6 +412,10 @@ > this.produceAttributes = options.produceDebugAttributes; > this.referenceBinding = typeBinding; > if (this.targetJDK >= ClassFileConstants.JDK1_6) { >+ this.produceAttributes |= ClassFileConstants.ATTR_STACK_MAP_TABLE; >+ this.codeStream = new StackMapFrameCodeStream(this); >+ } else if (this.targetJDK == ClassFileConstants.CLDC_1_1) { >+ this.targetJDK = ClassFileConstants.JDK1_1; // put back 45.3 > this.produceAttributes |= ClassFileConstants.ATTR_STACK_MAP; > this.codeStream = new StackMapFrameCodeStream(this); > } else { >@@ -1484,7 +1488,7 @@ > this.contents[codeAttributeOffset + 12] = (byte) (code_length >> 8); > this.contents[codeAttributeOffset + 13] = (byte) code_length; > >- boolean addStackMaps = (this.produceAttributes & ClassFileConstants.ATTR_STACK_MAP) != 0; >+ boolean addStackMaps = (this.produceAttributes & ClassFileConstants.ATTR_STACK_MAP_TABLE) != 0; > // write the exception table > ExceptionLabel[] exceptionLabels = codeStream.exceptionLabels; > int exceptionHandlersCount = 0; // each label holds one handler per range (start/end contiguous) >@@ -2111,6 +2115,174 @@ > } > } > >+ if ((this.produceAttributes & ClassFileConstants.ATTR_STACK_MAP) != 0) { >+ StackMapFrameCodeStream stackMapFrameCodeStream = (StackMapFrameCodeStream) this.codeStream; >+ stackMapFrameCodeStream.removeFramePosition(code_length); >+ if (stackMapFrameCodeStream.hasFramePositions()) { >+ ArrayList frames = new ArrayList(); >+ traverse(this.codeStream.methodDeclaration.binding, max_locals, this.contents, codeAttributeOffset + 14, code_length, frames, false); >+ int numberOfFrames = frames.size(); >+ if (numberOfFrames > 1) { >+ int stackMapTableAttributeOffset = localContentsOffset; >+ // add the stack map table attribute >+ if (localContentsOffset + 8 >= this.contents.length) { >+ resizeContents(8); >+ } >+ int stackMapAttributeNameIndex = >+ constantPool.literalIndex(AttributeNamesConstants.StackMapName); >+ this.contents[localContentsOffset++] = (byte) (stackMapAttributeNameIndex >> 8); >+ this.contents[localContentsOffset++] = (byte) stackMapAttributeNameIndex; >+ >+ int stackMapAttributeLengthOffset = localContentsOffset; >+ // generate the attribute >+ localContentsOffset += 4; >+ if (localContentsOffset + 4 >= this.contents.length) { >+ resizeContents(4); >+ } >+ int numberOfFramesOffset = localContentsOffset; >+ localContentsOffset += 2; >+ if (localContentsOffset + 2 >= this.contents.length) { >+ resizeContents(2); >+ } >+ StackMapFrame currentFrame = (StackMapFrame) frames.get(0); >+ for (int j = 1; j < numberOfFrames; j++) { >+ // select next frame >+ currentFrame = (StackMapFrame) frames.get(j); >+ // generate current frame >+ // need to find differences between the current frame and the previous frame >+ int frameOffset = currentFrame.pc; >+ // FULL_FRAME >+ if (localContentsOffset + 5 >= this.contents.length) { >+ resizeContents(5); >+ } >+ this.contents[localContentsOffset++] = (byte) (frameOffset >> 8); >+ this.contents[localContentsOffset++] = (byte) frameOffset; >+ int numberOfLocalOffset = localContentsOffset; >+ localContentsOffset += 2; // leave two spots for number of locals >+ int numberOfLocalEntries = 0; >+ int numberOfLocals = currentFrame.getNumberOfLocals(); >+ int numberOfEntries = 0; >+ int localsLength = currentFrame.locals == null ? 0 : currentFrame.locals.length; >+ for (int i = 0; i < localsLength && numberOfLocalEntries < numberOfLocals; i++) { >+ if (localContentsOffset + 3 >= this.contents.length) { >+ resizeContents(3); >+ } >+ VerificationTypeInfo info = currentFrame.locals[i]; >+ if (info == null) { >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_TOP; >+ } else { >+ switch(info.id()) { >+ case T_boolean : >+ case T_byte : >+ case T_char : >+ case T_int : >+ case T_short : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_INTEGER; >+ break; >+ case T_float : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_FLOAT; >+ break; >+ case T_long : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_LONG; >+ i++; >+ break; >+ case T_double : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_DOUBLE; >+ i++; >+ break; >+ case T_null : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_NULL; >+ break; >+ default: >+ this.contents[localContentsOffset++] = (byte) info.tag; >+ switch (info.tag) { >+ case VerificationTypeInfo.ITEM_UNINITIALIZED : >+ int offset = info.offset; >+ this.contents[localContentsOffset++] = (byte) (offset >> 8); >+ this.contents[localContentsOffset++] = (byte) offset; >+ break; >+ case VerificationTypeInfo.ITEM_OBJECT : >+ int indexForType = constantPool.literalIndexForType(info.constantPoolName()); >+ this.contents[localContentsOffset++] = (byte) (indexForType >> 8); >+ this.contents[localContentsOffset++] = (byte) indexForType; >+ } >+ } >+ numberOfLocalEntries++; >+ } >+ numberOfEntries++; >+ } >+ if (localContentsOffset + 4 >= this.contents.length) { >+ resizeContents(4); >+ } >+ this.contents[numberOfLocalOffset++] = (byte) (numberOfEntries >> 8); >+ this.contents[numberOfLocalOffset] = (byte) numberOfEntries; >+ int numberOfStackItems = currentFrame.numberOfStackItems; >+ this.contents[localContentsOffset++] = (byte) (numberOfStackItems >> 8); >+ this.contents[localContentsOffset++] = (byte) numberOfStackItems; >+ for (int i = 0; i < numberOfStackItems; i++) { >+ if (localContentsOffset + 3 >= this.contents.length) { >+ resizeContents(3); >+ } >+ VerificationTypeInfo info = currentFrame.stackItems[i]; >+ if (info == null) { >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_TOP; >+ } else { >+ switch(info.id()) { >+ case T_boolean : >+ case T_byte : >+ case T_char : >+ case T_int : >+ case T_short : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_INTEGER; >+ break; >+ case T_float : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_FLOAT; >+ break; >+ case T_long : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_LONG; >+ break; >+ case T_double : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_DOUBLE; >+ break; >+ case T_null : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_NULL; >+ break; >+ default: >+ this.contents[localContentsOffset++] = (byte) info.tag; >+ switch (info.tag) { >+ case VerificationTypeInfo.ITEM_UNINITIALIZED : >+ int offset = info.offset; >+ this.contents[localContentsOffset++] = (byte) (offset >> 8); >+ this.contents[localContentsOffset++] = (byte) offset; >+ break; >+ case VerificationTypeInfo.ITEM_OBJECT : >+ int indexForType = constantPool.literalIndexForType(info.constantPoolName()); >+ this.contents[localContentsOffset++] = (byte) (indexForType >> 8); >+ this.contents[localContentsOffset++] = (byte) indexForType; >+ } >+ } >+ } >+ } >+ } >+ >+ numberOfFrames--; >+ if (numberOfFrames != 0) { >+ this.contents[numberOfFramesOffset++] = (byte) (numberOfFrames >> 8); >+ this.contents[numberOfFramesOffset] = (byte) numberOfFrames; >+ >+ int attributeLength = localContentsOffset - stackMapAttributeLengthOffset - 4; >+ this.contents[stackMapAttributeLengthOffset++] = (byte) (attributeLength >> 24); >+ this.contents[stackMapAttributeLengthOffset++] = (byte) (attributeLength >> 16); >+ this.contents[stackMapAttributeLengthOffset++] = (byte) (attributeLength >> 8); >+ this.contents[stackMapAttributeLengthOffset] = (byte) attributeLength; >+ attributeNumber++; >+ } else { >+ localContentsOffset = stackMapTableAttributeOffset; >+ } >+ } >+ } >+ } >+ > this.contents[codeAttributeAttributeOffset++] = (byte) (attributeNumber >> 8); > this.contents[codeAttributeAttributeOffset] = (byte) attributeNumber; > >@@ -2162,7 +2334,7 @@ > this.contents[codeAttributeOffset + 12] = (byte) (code_length >> 8); > this.contents[codeAttributeOffset + 13] = (byte) code_length; > >- boolean addStackMaps = (this.produceAttributes & ClassFileConstants.ATTR_STACK_MAP) != 0; >+ boolean addStackMaps = (this.produceAttributes & ClassFileConstants.ATTR_STACK_MAP_TABLE) != 0; > // write the exception table > ExceptionLabel[] exceptionLabels = codeStream.exceptionLabels; > int exceptionHandlersCount = 0; // each label holds one handler per range (start/end contiguous) >@@ -2403,7 +2575,7 @@ > } > } > >- if ((this.produceAttributes & ClassFileConstants.ATTR_STACK_MAP) != 0) { >+ if ((this.produceAttributes & ClassFileConstants.ATTR_STACK_MAP_TABLE) != 0) { > StackMapFrameCodeStream stackMapFrameCodeStream = (StackMapFrameCodeStream) this.codeStream; > stackMapFrameCodeStream.removeFramePosition(code_length); > if (stackMapFrameCodeStream.hasFramePositions()) { >@@ -2752,6 +2924,174 @@ > } > } > >+ if ((this.produceAttributes & ClassFileConstants.ATTR_STACK_MAP) != 0) { >+ StackMapFrameCodeStream stackMapFrameCodeStream = (StackMapFrameCodeStream) this.codeStream; >+ stackMapFrameCodeStream.removeFramePosition(code_length); >+ if (stackMapFrameCodeStream.hasFramePositions()) { >+ ArrayList frames = new ArrayList(); >+ traverse(this.codeStream.methodDeclaration.binding, max_locals, this.contents, codeAttributeOffset + 14, code_length, frames, false); >+ int numberOfFrames = frames.size(); >+ if (numberOfFrames > 1) { >+ int stackMapTableAttributeOffset = localContentsOffset; >+ // add the stack map table attribute >+ if (localContentsOffset + 8 >= this.contents.length) { >+ resizeContents(8); >+ } >+ int stackMapAttributeNameIndex = >+ constantPool.literalIndex(AttributeNamesConstants.StackMapName); >+ this.contents[localContentsOffset++] = (byte) (stackMapAttributeNameIndex >> 8); >+ this.contents[localContentsOffset++] = (byte) stackMapAttributeNameIndex; >+ >+ int stackMapAttributeLengthOffset = localContentsOffset; >+ // generate the attribute >+ localContentsOffset += 4; >+ if (localContentsOffset + 4 >= this.contents.length) { >+ resizeContents(4); >+ } >+ int numberOfFramesOffset = localContentsOffset; >+ localContentsOffset += 2; >+ if (localContentsOffset + 2 >= this.contents.length) { >+ resizeContents(2); >+ } >+ StackMapFrame currentFrame = (StackMapFrame) frames.get(0); >+ for (int j = 1; j < numberOfFrames; j++) { >+ // select next frame >+ currentFrame = (StackMapFrame) frames.get(j); >+ // generate current frame >+ // need to find differences between the current frame and the previous frame >+ int frameOffset = currentFrame.pc; >+ // FULL_FRAME >+ if (localContentsOffset + 5 >= this.contents.length) { >+ resizeContents(5); >+ } >+ this.contents[localContentsOffset++] = (byte) (frameOffset >> 8); >+ this.contents[localContentsOffset++] = (byte) frameOffset; >+ int numberOfLocalOffset = localContentsOffset; >+ localContentsOffset += 2; // leave two spots for number of locals >+ int numberOfLocalEntries = 0; >+ int numberOfLocals = currentFrame.getNumberOfLocals(); >+ int numberOfEntries = 0; >+ int localsLength = currentFrame.locals == null ? 0 : currentFrame.locals.length; >+ for (int i = 0; i < localsLength && numberOfLocalEntries < numberOfLocals; i++) { >+ if (localContentsOffset + 3 >= this.contents.length) { >+ resizeContents(3); >+ } >+ VerificationTypeInfo info = currentFrame.locals[i]; >+ if (info == null) { >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_TOP; >+ } else { >+ switch(info.id()) { >+ case T_boolean : >+ case T_byte : >+ case T_char : >+ case T_int : >+ case T_short : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_INTEGER; >+ break; >+ case T_float : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_FLOAT; >+ break; >+ case T_long : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_LONG; >+ i++; >+ break; >+ case T_double : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_DOUBLE; >+ i++; >+ break; >+ case T_null : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_NULL; >+ break; >+ default: >+ this.contents[localContentsOffset++] = (byte) info.tag; >+ switch (info.tag) { >+ case VerificationTypeInfo.ITEM_UNINITIALIZED : >+ int offset = info.offset; >+ this.contents[localContentsOffset++] = (byte) (offset >> 8); >+ this.contents[localContentsOffset++] = (byte) offset; >+ break; >+ case VerificationTypeInfo.ITEM_OBJECT : >+ int indexForType = constantPool.literalIndexForType(info.constantPoolName()); >+ this.contents[localContentsOffset++] = (byte) (indexForType >> 8); >+ this.contents[localContentsOffset++] = (byte) indexForType; >+ } >+ } >+ numberOfLocalEntries++; >+ } >+ numberOfEntries++; >+ } >+ if (localContentsOffset + 4 >= this.contents.length) { >+ resizeContents(4); >+ } >+ this.contents[numberOfLocalOffset++] = (byte) (numberOfEntries >> 8); >+ this.contents[numberOfLocalOffset] = (byte) numberOfEntries; >+ int numberOfStackItems = currentFrame.numberOfStackItems; >+ this.contents[localContentsOffset++] = (byte) (numberOfStackItems >> 8); >+ this.contents[localContentsOffset++] = (byte) numberOfStackItems; >+ for (int i = 0; i < numberOfStackItems; i++) { >+ if (localContentsOffset + 3 >= this.contents.length) { >+ resizeContents(3); >+ } >+ VerificationTypeInfo info = currentFrame.stackItems[i]; >+ if (info == null) { >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_TOP; >+ } else { >+ switch(info.id()) { >+ case T_boolean : >+ case T_byte : >+ case T_char : >+ case T_int : >+ case T_short : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_INTEGER; >+ break; >+ case T_float : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_FLOAT; >+ break; >+ case T_long : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_LONG; >+ break; >+ case T_double : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_DOUBLE; >+ break; >+ case T_null : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_NULL; >+ break; >+ default: >+ this.contents[localContentsOffset++] = (byte) info.tag; >+ switch (info.tag) { >+ case VerificationTypeInfo.ITEM_UNINITIALIZED : >+ int offset = info.offset; >+ this.contents[localContentsOffset++] = (byte) (offset >> 8); >+ this.contents[localContentsOffset++] = (byte) offset; >+ break; >+ case VerificationTypeInfo.ITEM_OBJECT : >+ int indexForType = constantPool.literalIndexForType(info.constantPoolName()); >+ this.contents[localContentsOffset++] = (byte) (indexForType >> 8); >+ this.contents[localContentsOffset++] = (byte) indexForType; >+ } >+ } >+ } >+ } >+ } >+ >+ numberOfFrames--; >+ if (numberOfFrames != 0) { >+ this.contents[numberOfFramesOffset++] = (byte) (numberOfFrames >> 8); >+ this.contents[numberOfFramesOffset] = (byte) numberOfFrames; >+ >+ int attributeLength = localContentsOffset - stackMapAttributeLengthOffset - 4; >+ this.contents[stackMapAttributeLengthOffset++] = (byte) (attributeLength >> 24); >+ this.contents[stackMapAttributeLengthOffset++] = (byte) (attributeLength >> 16); >+ this.contents[stackMapAttributeLengthOffset++] = (byte) (attributeLength >> 8); >+ this.contents[stackMapAttributeLengthOffset] = (byte) attributeLength; >+ attributeNumber++; >+ } else { >+ localContentsOffset = stackMapTableAttributeOffset; >+ } >+ } >+ } >+ } >+ > // update the number of attributes > // ensure first that there is enough space available inside the contents array > if (codeAttributeAttributeOffset + 2 >= this.contents.length) { >@@ -2866,7 +3206,7 @@ > attributeNumber++; > } > >- if ((this.produceAttributes & ClassFileConstants.ATTR_STACK_MAP) != 0) { >+ if ((this.produceAttributes & ClassFileConstants.ATTR_STACK_MAP_TABLE) != 0) { > StackMapFrameCodeStream stackMapFrameCodeStream = (StackMapFrameCodeStream) this.codeStream; > stackMapFrameCodeStream.removeFramePosition(code_length); > if (stackMapFrameCodeStream.hasFramePositions()) { >@@ -3216,6 +3556,174 @@ > } > } > >+ if ((this.produceAttributes & ClassFileConstants.ATTR_STACK_MAP) != 0) { >+ StackMapFrameCodeStream stackMapFrameCodeStream = (StackMapFrameCodeStream) this.codeStream; >+ stackMapFrameCodeStream.removeFramePosition(code_length); >+ if (stackMapFrameCodeStream.hasFramePositions()) { >+ ArrayList frames = new ArrayList(); >+ traverse(this.codeStream.methodDeclaration.binding, max_locals, this.contents, codeAttributeOffset + 14, code_length, frames, false); >+ int numberOfFrames = frames.size(); >+ if (numberOfFrames > 1) { >+ int stackMapTableAttributeOffset = localContentsOffset; >+ // add the stack map table attribute >+ if (localContentsOffset + 8 >= this.contents.length) { >+ resizeContents(8); >+ } >+ int stackMapAttributeNameIndex = >+ constantPool.literalIndex(AttributeNamesConstants.StackMapName); >+ this.contents[localContentsOffset++] = (byte) (stackMapAttributeNameIndex >> 8); >+ this.contents[localContentsOffset++] = (byte) stackMapAttributeNameIndex; >+ >+ int stackMapAttributeLengthOffset = localContentsOffset; >+ // generate the attribute >+ localContentsOffset += 4; >+ if (localContentsOffset + 4 >= this.contents.length) { >+ resizeContents(4); >+ } >+ int numberOfFramesOffset = localContentsOffset; >+ localContentsOffset += 2; >+ if (localContentsOffset + 2 >= this.contents.length) { >+ resizeContents(2); >+ } >+ StackMapFrame currentFrame = (StackMapFrame) frames.get(0); >+ for (int j = 1; j < numberOfFrames; j++) { >+ // select next frame >+ currentFrame = (StackMapFrame) frames.get(j); >+ // generate current frame >+ // need to find differences between the current frame and the previous frame >+ int frameOffset = currentFrame.pc; >+ // FULL_FRAME >+ if (localContentsOffset + 5 >= this.contents.length) { >+ resizeContents(5); >+ } >+ this.contents[localContentsOffset++] = (byte) (frameOffset >> 8); >+ this.contents[localContentsOffset++] = (byte) frameOffset; >+ int numberOfLocalOffset = localContentsOffset; >+ localContentsOffset += 2; // leave two spots for number of locals >+ int numberOfLocalEntries = 0; >+ int numberOfLocals = currentFrame.getNumberOfLocals(); >+ int numberOfEntries = 0; >+ int localsLength = currentFrame.locals == null ? 0 : currentFrame.locals.length; >+ for (int i = 0; i < localsLength && numberOfLocalEntries < numberOfLocals; i++) { >+ if (localContentsOffset + 3 >= this.contents.length) { >+ resizeContents(3); >+ } >+ VerificationTypeInfo info = currentFrame.locals[i]; >+ if (info == null) { >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_TOP; >+ } else { >+ switch(info.id()) { >+ case T_boolean : >+ case T_byte : >+ case T_char : >+ case T_int : >+ case T_short : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_INTEGER; >+ break; >+ case T_float : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_FLOAT; >+ break; >+ case T_long : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_LONG; >+ i++; >+ break; >+ case T_double : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_DOUBLE; >+ i++; >+ break; >+ case T_null : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_NULL; >+ break; >+ default: >+ this.contents[localContentsOffset++] = (byte) info.tag; >+ switch (info.tag) { >+ case VerificationTypeInfo.ITEM_UNINITIALIZED : >+ int offset = info.offset; >+ this.contents[localContentsOffset++] = (byte) (offset >> 8); >+ this.contents[localContentsOffset++] = (byte) offset; >+ break; >+ case VerificationTypeInfo.ITEM_OBJECT : >+ int indexForType = constantPool.literalIndexForType(info.constantPoolName()); >+ this.contents[localContentsOffset++] = (byte) (indexForType >> 8); >+ this.contents[localContentsOffset++] = (byte) indexForType; >+ } >+ } >+ numberOfLocalEntries++; >+ } >+ numberOfEntries++; >+ } >+ if (localContentsOffset + 4 >= this.contents.length) { >+ resizeContents(4); >+ } >+ this.contents[numberOfLocalOffset++] = (byte) (numberOfEntries >> 8); >+ this.contents[numberOfLocalOffset] = (byte) numberOfEntries; >+ int numberOfStackItems = currentFrame.numberOfStackItems; >+ this.contents[localContentsOffset++] = (byte) (numberOfStackItems >> 8); >+ this.contents[localContentsOffset++] = (byte) numberOfStackItems; >+ for (int i = 0; i < numberOfStackItems; i++) { >+ if (localContentsOffset + 3 >= this.contents.length) { >+ resizeContents(3); >+ } >+ VerificationTypeInfo info = currentFrame.stackItems[i]; >+ if (info == null) { >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_TOP; >+ } else { >+ switch(info.id()) { >+ case T_boolean : >+ case T_byte : >+ case T_char : >+ case T_int : >+ case T_short : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_INTEGER; >+ break; >+ case T_float : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_FLOAT; >+ break; >+ case T_long : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_LONG; >+ break; >+ case T_double : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_DOUBLE; >+ break; >+ case T_null : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_NULL; >+ break; >+ default: >+ this.contents[localContentsOffset++] = (byte) info.tag; >+ switch (info.tag) { >+ case VerificationTypeInfo.ITEM_UNINITIALIZED : >+ int offset = info.offset; >+ this.contents[localContentsOffset++] = (byte) (offset >> 8); >+ this.contents[localContentsOffset++] = (byte) offset; >+ break; >+ case VerificationTypeInfo.ITEM_OBJECT : >+ int indexForType = constantPool.literalIndexForType(info.constantPoolName()); >+ this.contents[localContentsOffset++] = (byte) (indexForType >> 8); >+ this.contents[localContentsOffset++] = (byte) indexForType; >+ } >+ } >+ } >+ } >+ } >+ >+ numberOfFrames--; >+ if (numberOfFrames != 0) { >+ this.contents[numberOfFramesOffset++] = (byte) (numberOfFrames >> 8); >+ this.contents[numberOfFramesOffset] = (byte) numberOfFrames; >+ >+ int attributeLength = localContentsOffset - stackMapAttributeLengthOffset - 4; >+ this.contents[stackMapAttributeLengthOffset++] = (byte) (attributeLength >> 24); >+ this.contents[stackMapAttributeLengthOffset++] = (byte) (attributeLength >> 16); >+ this.contents[stackMapAttributeLengthOffset++] = (byte) (attributeLength >> 8); >+ this.contents[stackMapAttributeLengthOffset] = (byte) attributeLength; >+ attributeNumber++; >+ } else { >+ localContentsOffset = stackMapTableAttributeOffset; >+ } >+ } >+ } >+ } >+ > // update the number of attributes > // ensure first that there is enough space available inside the contents array > if (codeAttributeAttributeOffset + 2 >= this.contents.length) { >@@ -3301,7 +3809,7 @@ > attributeNumber++; > } > >- if ((this.produceAttributes & ClassFileConstants.ATTR_STACK_MAP) != 0) { >+ if ((this.produceAttributes & ClassFileConstants.ATTR_STACK_MAP_TABLE) != 0) { > StackMapFrameCodeStream stackMapFrameCodeStream = (StackMapFrameCodeStream) this.codeStream; > stackMapFrameCodeStream.removeFramePosition(code_length); > if (stackMapFrameCodeStream.hasFramePositions()) { >@@ -3651,6 +4159,174 @@ > } > } > >+ if ((this.produceAttributes & ClassFileConstants.ATTR_STACK_MAP) != 0) { >+ StackMapFrameCodeStream stackMapFrameCodeStream = (StackMapFrameCodeStream) this.codeStream; >+ stackMapFrameCodeStream.removeFramePosition(code_length); >+ if (stackMapFrameCodeStream.hasFramePositions()) { >+ ArrayList frames = new ArrayList(); >+ traverse(this.codeStream.methodDeclaration.binding, max_locals, this.contents, codeAttributeOffset + 14, code_length, frames, false); >+ int numberOfFrames = frames.size(); >+ if (numberOfFrames > 1) { >+ int stackMapTableAttributeOffset = localContentsOffset; >+ // add the stack map table attribute >+ if (localContentsOffset + 8 >= this.contents.length) { >+ resizeContents(8); >+ } >+ int stackMapAttributeNameIndex = >+ constantPool.literalIndex(AttributeNamesConstants.StackMapName); >+ this.contents[localContentsOffset++] = (byte) (stackMapAttributeNameIndex >> 8); >+ this.contents[localContentsOffset++] = (byte) stackMapAttributeNameIndex; >+ >+ int stackMapAttributeLengthOffset = localContentsOffset; >+ // generate the attribute >+ localContentsOffset += 4; >+ if (localContentsOffset + 4 >= this.contents.length) { >+ resizeContents(4); >+ } >+ int numberOfFramesOffset = localContentsOffset; >+ localContentsOffset += 2; >+ if (localContentsOffset + 2 >= this.contents.length) { >+ resizeContents(2); >+ } >+ StackMapFrame currentFrame = (StackMapFrame) frames.get(0); >+ for (int j = 1; j < numberOfFrames; j++) { >+ // select next frame >+ currentFrame = (StackMapFrame) frames.get(j); >+ // generate current frame >+ // need to find differences between the current frame and the previous frame >+ int frameOffset = currentFrame.pc; >+ // FULL_FRAME >+ if (localContentsOffset + 5 >= this.contents.length) { >+ resizeContents(5); >+ } >+ this.contents[localContentsOffset++] = (byte) (frameOffset >> 8); >+ this.contents[localContentsOffset++] = (byte) frameOffset; >+ int numberOfLocalOffset = localContentsOffset; >+ localContentsOffset += 2; // leave two spots for number of locals >+ int numberOfLocalEntries = 0; >+ int numberOfLocals = currentFrame.getNumberOfLocals(); >+ int numberOfEntries = 0; >+ int localsLength = currentFrame.locals == null ? 0 : currentFrame.locals.length; >+ for (int i = 0; i < localsLength && numberOfLocalEntries < numberOfLocals; i++) { >+ if (localContentsOffset + 3 >= this.contents.length) { >+ resizeContents(3); >+ } >+ VerificationTypeInfo info = currentFrame.locals[i]; >+ if (info == null) { >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_TOP; >+ } else { >+ switch(info.id()) { >+ case T_boolean : >+ case T_byte : >+ case T_char : >+ case T_int : >+ case T_short : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_INTEGER; >+ break; >+ case T_float : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_FLOAT; >+ break; >+ case T_long : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_LONG; >+ i++; >+ break; >+ case T_double : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_DOUBLE; >+ i++; >+ break; >+ case T_null : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_NULL; >+ break; >+ default: >+ this.contents[localContentsOffset++] = (byte) info.tag; >+ switch (info.tag) { >+ case VerificationTypeInfo.ITEM_UNINITIALIZED : >+ int offset = info.offset; >+ this.contents[localContentsOffset++] = (byte) (offset >> 8); >+ this.contents[localContentsOffset++] = (byte) offset; >+ break; >+ case VerificationTypeInfo.ITEM_OBJECT : >+ int indexForType = constantPool.literalIndexForType(info.constantPoolName()); >+ this.contents[localContentsOffset++] = (byte) (indexForType >> 8); >+ this.contents[localContentsOffset++] = (byte) indexForType; >+ } >+ } >+ numberOfLocalEntries++; >+ } >+ numberOfEntries++; >+ } >+ if (localContentsOffset + 4 >= this.contents.length) { >+ resizeContents(4); >+ } >+ this.contents[numberOfLocalOffset++] = (byte) (numberOfEntries >> 8); >+ this.contents[numberOfLocalOffset] = (byte) numberOfEntries; >+ int numberOfStackItems = currentFrame.numberOfStackItems; >+ this.contents[localContentsOffset++] = (byte) (numberOfStackItems >> 8); >+ this.contents[localContentsOffset++] = (byte) numberOfStackItems; >+ for (int i = 0; i < numberOfStackItems; i++) { >+ if (localContentsOffset + 3 >= this.contents.length) { >+ resizeContents(3); >+ } >+ VerificationTypeInfo info = currentFrame.stackItems[i]; >+ if (info == null) { >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_TOP; >+ } else { >+ switch(info.id()) { >+ case T_boolean : >+ case T_byte : >+ case T_char : >+ case T_int : >+ case T_short : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_INTEGER; >+ break; >+ case T_float : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_FLOAT; >+ break; >+ case T_long : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_LONG; >+ break; >+ case T_double : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_DOUBLE; >+ break; >+ case T_null : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_NULL; >+ break; >+ default: >+ this.contents[localContentsOffset++] = (byte) info.tag; >+ switch (info.tag) { >+ case VerificationTypeInfo.ITEM_UNINITIALIZED : >+ int offset = info.offset; >+ this.contents[localContentsOffset++] = (byte) (offset >> 8); >+ this.contents[localContentsOffset++] = (byte) offset; >+ break; >+ case VerificationTypeInfo.ITEM_OBJECT : >+ int indexForType = constantPool.literalIndexForType(info.constantPoolName()); >+ this.contents[localContentsOffset++] = (byte) (indexForType >> 8); >+ this.contents[localContentsOffset++] = (byte) indexForType; >+ } >+ } >+ } >+ } >+ } >+ >+ numberOfFrames--; >+ if (numberOfFrames != 0) { >+ this.contents[numberOfFramesOffset++] = (byte) (numberOfFrames >> 8); >+ this.contents[numberOfFramesOffset] = (byte) numberOfFrames; >+ >+ int attributeLength = localContentsOffset - stackMapAttributeLengthOffset - 4; >+ this.contents[stackMapAttributeLengthOffset++] = (byte) (attributeLength >> 24); >+ this.contents[stackMapAttributeLengthOffset++] = (byte) (attributeLength >> 16); >+ this.contents[stackMapAttributeLengthOffset++] = (byte) (attributeLength >> 8); >+ this.contents[stackMapAttributeLengthOffset] = (byte) attributeLength; >+ attributeNumber++; >+ } else { >+ localContentsOffset = stackMapTableAttributeOffset; >+ } >+ } >+ } >+ } >+ > // then we do the local variable attribute > // update the number of attributes// ensure first that there is enough space available inside the localContents array > if (codeAttributeAttributeOffset + 2 >= this.contents.length) { >@@ -3969,7 +4645,7 @@ > } > } > >- if ((this.produceAttributes & ClassFileConstants.ATTR_STACK_MAP) != 0) { >+ if ((this.produceAttributes & ClassFileConstants.ATTR_STACK_MAP_TABLE) != 0) { > StackMapFrameCodeStream stackMapFrameCodeStream = (StackMapFrameCodeStream) this.codeStream; > stackMapFrameCodeStream.removeFramePosition(code_length); > if (stackMapFrameCodeStream.hasFramePositions()) { >@@ -4319,6 +4995,174 @@ > } > } > >+ if ((this.produceAttributes & ClassFileConstants.ATTR_STACK_MAP) != 0) { >+ StackMapFrameCodeStream stackMapFrameCodeStream = (StackMapFrameCodeStream) this.codeStream; >+ stackMapFrameCodeStream.removeFramePosition(code_length); >+ if (stackMapFrameCodeStream.hasFramePositions()) { >+ ArrayList frames = new ArrayList(); >+ traverse(this.codeStream.methodDeclaration.binding, max_locals, this.contents, codeAttributeOffset + 14, code_length, frames, false); >+ int numberOfFrames = frames.size(); >+ if (numberOfFrames > 1) { >+ int stackMapTableAttributeOffset = localContentsOffset; >+ // add the stack map table attribute >+ if (localContentsOffset + 8 >= this.contents.length) { >+ resizeContents(8); >+ } >+ int stackMapAttributeNameIndex = >+ constantPool.literalIndex(AttributeNamesConstants.StackMapName); >+ this.contents[localContentsOffset++] = (byte) (stackMapAttributeNameIndex >> 8); >+ this.contents[localContentsOffset++] = (byte) stackMapAttributeNameIndex; >+ >+ int stackMapAttributeLengthOffset = localContentsOffset; >+ // generate the attribute >+ localContentsOffset += 4; >+ if (localContentsOffset + 4 >= this.contents.length) { >+ resizeContents(4); >+ } >+ int numberOfFramesOffset = localContentsOffset; >+ localContentsOffset += 2; >+ if (localContentsOffset + 2 >= this.contents.length) { >+ resizeContents(2); >+ } >+ StackMapFrame currentFrame = (StackMapFrame) frames.get(0); >+ for (int j = 1; j < numberOfFrames; j++) { >+ // select next frame >+ currentFrame = (StackMapFrame) frames.get(j); >+ // generate current frame >+ // need to find differences between the current frame and the previous frame >+ int frameOffset = currentFrame.pc; >+ // FULL_FRAME >+ if (localContentsOffset + 5 >= this.contents.length) { >+ resizeContents(5); >+ } >+ this.contents[localContentsOffset++] = (byte) (frameOffset >> 8); >+ this.contents[localContentsOffset++] = (byte) frameOffset; >+ int numberOfLocalOffset = localContentsOffset; >+ localContentsOffset += 2; // leave two spots for number of locals >+ int numberOfLocalEntries = 0; >+ int numberOfLocals = currentFrame.getNumberOfLocals(); >+ int numberOfEntries = 0; >+ int localsLength = currentFrame.locals == null ? 0 : currentFrame.locals.length; >+ for (int i = 0; i < localsLength && numberOfLocalEntries < numberOfLocals; i++) { >+ if (localContentsOffset + 3 >= this.contents.length) { >+ resizeContents(3); >+ } >+ VerificationTypeInfo info = currentFrame.locals[i]; >+ if (info == null) { >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_TOP; >+ } else { >+ switch(info.id()) { >+ case T_boolean : >+ case T_byte : >+ case T_char : >+ case T_int : >+ case T_short : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_INTEGER; >+ break; >+ case T_float : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_FLOAT; >+ break; >+ case T_long : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_LONG; >+ i++; >+ break; >+ case T_double : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_DOUBLE; >+ i++; >+ break; >+ case T_null : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_NULL; >+ break; >+ default: >+ this.contents[localContentsOffset++] = (byte) info.tag; >+ switch (info.tag) { >+ case VerificationTypeInfo.ITEM_UNINITIALIZED : >+ int offset = info.offset; >+ this.contents[localContentsOffset++] = (byte) (offset >> 8); >+ this.contents[localContentsOffset++] = (byte) offset; >+ break; >+ case VerificationTypeInfo.ITEM_OBJECT : >+ int indexForType = constantPool.literalIndexForType(info.constantPoolName()); >+ this.contents[localContentsOffset++] = (byte) (indexForType >> 8); >+ this.contents[localContentsOffset++] = (byte) indexForType; >+ } >+ } >+ numberOfLocalEntries++; >+ } >+ numberOfEntries++; >+ } >+ if (localContentsOffset + 4 >= this.contents.length) { >+ resizeContents(4); >+ } >+ this.contents[numberOfLocalOffset++] = (byte) (numberOfEntries >> 8); >+ this.contents[numberOfLocalOffset] = (byte) numberOfEntries; >+ int numberOfStackItems = currentFrame.numberOfStackItems; >+ this.contents[localContentsOffset++] = (byte) (numberOfStackItems >> 8); >+ this.contents[localContentsOffset++] = (byte) numberOfStackItems; >+ for (int i = 0; i < numberOfStackItems; i++) { >+ if (localContentsOffset + 3 >= this.contents.length) { >+ resizeContents(3); >+ } >+ VerificationTypeInfo info = currentFrame.stackItems[i]; >+ if (info == null) { >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_TOP; >+ } else { >+ switch(info.id()) { >+ case T_boolean : >+ case T_byte : >+ case T_char : >+ case T_int : >+ case T_short : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_INTEGER; >+ break; >+ case T_float : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_FLOAT; >+ break; >+ case T_long : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_LONG; >+ break; >+ case T_double : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_DOUBLE; >+ break; >+ case T_null : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_NULL; >+ break; >+ default: >+ this.contents[localContentsOffset++] = (byte) info.tag; >+ switch (info.tag) { >+ case VerificationTypeInfo.ITEM_UNINITIALIZED : >+ int offset = info.offset; >+ this.contents[localContentsOffset++] = (byte) (offset >> 8); >+ this.contents[localContentsOffset++] = (byte) offset; >+ break; >+ case VerificationTypeInfo.ITEM_OBJECT : >+ int indexForType = constantPool.literalIndexForType(info.constantPoolName()); >+ this.contents[localContentsOffset++] = (byte) (indexForType >> 8); >+ this.contents[localContentsOffset++] = (byte) indexForType; >+ } >+ } >+ } >+ } >+ } >+ >+ numberOfFrames--; >+ if (numberOfFrames != 0) { >+ this.contents[numberOfFramesOffset++] = (byte) (numberOfFrames >> 8); >+ this.contents[numberOfFramesOffset] = (byte) numberOfFrames; >+ >+ int attributeLength = localContentsOffset - stackMapAttributeLengthOffset - 4; >+ this.contents[stackMapAttributeLengthOffset++] = (byte) (attributeLength >> 24); >+ this.contents[stackMapAttributeLengthOffset++] = (byte) (attributeLength >> 16); >+ this.contents[stackMapAttributeLengthOffset++] = (byte) (attributeLength >> 8); >+ this.contents[stackMapAttributeLengthOffset] = (byte) attributeLength; >+ attributeNumber++; >+ } else { >+ localContentsOffset = stackMapTableAttributeOffset; >+ } >+ } >+ } >+ } >+ > // update the number of attributes// ensure first that there is enough space available inside the localContents array > if (codeAttributeAttributeOffset + 2 >= this.contents.length) { > resizeContents(2); >@@ -4374,7 +5218,7 @@ > resizeContents(40); > } > >- boolean addStackMaps = (this.produceAttributes & ClassFileConstants.ATTR_STACK_MAP) != 0; >+ boolean addStackMaps = (this.produceAttributes & ClassFileConstants.ATTR_STACK_MAP_TABLE) != 0; > if (hasExceptionHandlers) { > // write the exception table > ExceptionLabel[] exceptionLabels = codeStream.exceptionLabels; >@@ -4953,6 +5797,174 @@ > } > } > >+ if ((this.produceAttributes & ClassFileConstants.ATTR_STACK_MAP) != 0) { >+ StackMapFrameCodeStream stackMapFrameCodeStream = (StackMapFrameCodeStream) this.codeStream; >+ stackMapFrameCodeStream.removeFramePosition(code_length); >+ if (stackMapFrameCodeStream.hasFramePositions()) { >+ ArrayList frames = new ArrayList(); >+ traverse(this.codeStream.methodDeclaration.binding, max_locals, this.contents, codeAttributeOffset + 14, code_length, frames, false); >+ int numberOfFrames = frames.size(); >+ if (numberOfFrames > 1) { >+ int stackMapTableAttributeOffset = localContentsOffset; >+ // add the stack map table attribute >+ if (localContentsOffset + 8 >= this.contents.length) { >+ resizeContents(8); >+ } >+ int stackMapAttributeNameIndex = >+ constantPool.literalIndex(AttributeNamesConstants.StackMapName); >+ this.contents[localContentsOffset++] = (byte) (stackMapAttributeNameIndex >> 8); >+ this.contents[localContentsOffset++] = (byte) stackMapAttributeNameIndex; >+ >+ int stackMapAttributeLengthOffset = localContentsOffset; >+ // generate the attribute >+ localContentsOffset += 4; >+ if (localContentsOffset + 4 >= this.contents.length) { >+ resizeContents(4); >+ } >+ int numberOfFramesOffset = localContentsOffset; >+ localContentsOffset += 2; >+ if (localContentsOffset + 2 >= this.contents.length) { >+ resizeContents(2); >+ } >+ StackMapFrame currentFrame = (StackMapFrame) frames.get(0); >+ for (int j = 1; j < numberOfFrames; j++) { >+ // select next frame >+ currentFrame = (StackMapFrame) frames.get(j); >+ // generate current frame >+ // need to find differences between the current frame and the previous frame >+ int frameOffset = currentFrame.pc; >+ // FULL_FRAME >+ if (localContentsOffset + 5 >= this.contents.length) { >+ resizeContents(5); >+ } >+ this.contents[localContentsOffset++] = (byte) (frameOffset >> 8); >+ this.contents[localContentsOffset++] = (byte) frameOffset; >+ int numberOfLocalOffset = localContentsOffset; >+ localContentsOffset += 2; // leave two spots for number of locals >+ int numberOfLocalEntries = 0; >+ int numberOfLocals = currentFrame.getNumberOfLocals(); >+ int numberOfEntries = 0; >+ int localsLength = currentFrame.locals == null ? 0 : currentFrame.locals.length; >+ for (int i = 0; i < localsLength && numberOfLocalEntries < numberOfLocals; i++) { >+ if (localContentsOffset + 3 >= this.contents.length) { >+ resizeContents(3); >+ } >+ VerificationTypeInfo info = currentFrame.locals[i]; >+ if (info == null) { >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_TOP; >+ } else { >+ switch(info.id()) { >+ case T_boolean : >+ case T_byte : >+ case T_char : >+ case T_int : >+ case T_short : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_INTEGER; >+ break; >+ case T_float : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_FLOAT; >+ break; >+ case T_long : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_LONG; >+ i++; >+ break; >+ case T_double : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_DOUBLE; >+ i++; >+ break; >+ case T_null : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_NULL; >+ break; >+ default: >+ this.contents[localContentsOffset++] = (byte) info.tag; >+ switch (info.tag) { >+ case VerificationTypeInfo.ITEM_UNINITIALIZED : >+ int offset = info.offset; >+ this.contents[localContentsOffset++] = (byte) (offset >> 8); >+ this.contents[localContentsOffset++] = (byte) offset; >+ break; >+ case VerificationTypeInfo.ITEM_OBJECT : >+ int indexForType = constantPool.literalIndexForType(info.constantPoolName()); >+ this.contents[localContentsOffset++] = (byte) (indexForType >> 8); >+ this.contents[localContentsOffset++] = (byte) indexForType; >+ } >+ } >+ numberOfLocalEntries++; >+ } >+ numberOfEntries++; >+ } >+ if (localContentsOffset + 4 >= this.contents.length) { >+ resizeContents(4); >+ } >+ this.contents[numberOfLocalOffset++] = (byte) (numberOfEntries >> 8); >+ this.contents[numberOfLocalOffset] = (byte) numberOfEntries; >+ int numberOfStackItems = currentFrame.numberOfStackItems; >+ this.contents[localContentsOffset++] = (byte) (numberOfStackItems >> 8); >+ this.contents[localContentsOffset++] = (byte) numberOfStackItems; >+ for (int i = 0; i < numberOfStackItems; i++) { >+ if (localContentsOffset + 3 >= this.contents.length) { >+ resizeContents(3); >+ } >+ VerificationTypeInfo info = currentFrame.stackItems[i]; >+ if (info == null) { >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_TOP; >+ } else { >+ switch(info.id()) { >+ case T_boolean : >+ case T_byte : >+ case T_char : >+ case T_int : >+ case T_short : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_INTEGER; >+ break; >+ case T_float : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_FLOAT; >+ break; >+ case T_long : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_LONG; >+ break; >+ case T_double : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_DOUBLE; >+ break; >+ case T_null : >+ this.contents[localContentsOffset++] = (byte) VerificationTypeInfo.ITEM_NULL; >+ break; >+ default: >+ this.contents[localContentsOffset++] = (byte) info.tag; >+ switch (info.tag) { >+ case VerificationTypeInfo.ITEM_UNINITIALIZED : >+ int offset = info.offset; >+ this.contents[localContentsOffset++] = (byte) (offset >> 8); >+ this.contents[localContentsOffset++] = (byte) offset; >+ break; >+ case VerificationTypeInfo.ITEM_OBJECT : >+ int indexForType = constantPool.literalIndexForType(info.constantPoolName()); >+ this.contents[localContentsOffset++] = (byte) (indexForType >> 8); >+ this.contents[localContentsOffset++] = (byte) indexForType; >+ } >+ } >+ } >+ } >+ } >+ >+ numberOfFrames--; >+ if (numberOfFrames != 0) { >+ this.contents[numberOfFramesOffset++] = (byte) (numberOfFrames >> 8); >+ this.contents[numberOfFramesOffset] = (byte) numberOfFrames; >+ >+ int attributeLength = localContentsOffset - stackMapAttributeLengthOffset - 4; >+ this.contents[stackMapAttributeLengthOffset++] = (byte) (attributeLength >> 24); >+ this.contents[stackMapAttributeLengthOffset++] = (byte) (attributeLength >> 16); >+ this.contents[stackMapAttributeLengthOffset++] = (byte) (attributeLength >> 8); >+ this.contents[stackMapAttributeLengthOffset] = (byte) attributeLength; >+ attributeNumber++; >+ } else { >+ localContentsOffset = stackMapTableAttributeOffset; >+ } >+ } >+ } >+ } >+ > // update the number of attributes > // ensure first that there is enough space available inside the contents array > if (codeAttributeAttributeOffset + 2 >= this.contents.length) { >@@ -5976,6 +6988,9 @@ > this.targetJDK = options.targetJDK; > this.produceAttributes = options.produceDebugAttributes; > if (this.targetJDK >= ClassFileConstants.JDK1_6) { >+ this.produceAttributes |= ClassFileConstants.ATTR_STACK_MAP_TABLE; >+ } else if (this.targetJDK == ClassFileConstants.CLDC_1_1) { >+ this.targetJDK = ClassFileConstants.JDK1_1; // put back 45.3 > this.produceAttributes |= ClassFileConstants.ATTR_STACK_MAP; > } > this.bytes = null; >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java,v >retrieving revision 1.118 >diff -u -r1.118 BatchCompilerTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java 10 Sep 2007 07:11:11 -0000 1.118 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java 13 Sep 2007 16:52:02 -0000 >@@ -985,6 +985,8 @@ > " -1.7 -7 -7.0 use 1.7 compliance (-source 1.7 -target 1.7)\n" + > " -source <version> set source level: 1.3 to 1.7 (or 5, 5.0, etc)\n" + > " -target <version> set classfile target: 1.1 to 1.7 (or 5, 5.0, etc)\n" + >+ " cldc1.1 can also be used to generate the StackMap\n" + >+ " attribute\n" + > " \n" + > " Warning options:\n" + > " -deprecation + deprecation outside deprecated code (equivalent to\n" +
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 120223
:
78342
|
78358