Package kala.compress.harmony.pack200
Class NewAttributeBands
java.lang.Object
kala.compress.harmony.pack200.BandSet
kala.compress.harmony.pack200.NewAttributeBands
Sets of bands relating to a non-predefined attribute that has had a layout definition given to pack200 (e.g. via one of the -C, -M, -F or -D command line
options)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAn AttributeLayoutElement is a part of an attribute layout and has one or more bands associated with it, which transmit the AttributeElement data for successive Attributes of this type.classclassclassclassclassConstant Pool ReferenceclassA replication is an array of layout elements, with an associated countclassA Union is a type of layout element where the tag value acts as a selector for one of the union casesclassA Union caseNested classes/interfaces inherited from class kala.compress.harmony.pack200.BandSet
BandSet.BandAnalysisResults, BandSet.BandData -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<NewAttributeBands.AttributeLayoutElement> private int[]private final CpBandsprivate final AttributeDefinitionBands.AttributeDefinitionprivate NewAttributeBands.Integralprivate booleanFields inherited from class kala.compress.harmony.pack200.BandSet
effort, segmentHeader -
Constructor Summary
ConstructorsConstructorDescriptionNewAttributeBands(int effort, CpBands cpBands, SegmentHeader header, AttributeDefinitionBands.AttributeDefinition def) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(NewAttribute attribute) private BHSDCodecReturns theBHSDCodecthat should be used for the given layout elementintprivate StringReaderUtility method to get the contents of the given stream, up to the next], (ignoring pairs of brackets[and])booleanint[]voidpack(OutputStream outputStream) Write the packed set of bands to the given output streamprivate voidprivate List<NewAttributeBands.LayoutElement> readBody(StringReader reader) Read a 'body' section of the layout from the given streamprivate intreadInteger(int i, InputStream inputStream) readNextAttributeElement(StringReader reader) private NewAttributeBands.LayoutElementreadNextLayoutElement(StringReader reader) private NewAttributeBands.UnionCasereadNextUnionCase(StringReader reader) Read a UnionCase from the streamprivate IntegerreadNumber(StringReader stream) Read a number from the stream and return itprivate StringreadUpToMatchingBracket(StringReader reader) Utility method to get the contents of the given stream, up to the next ']', (ignoring pairs of brackets '[' and ']')voidrenumberBci(IntList bciRenumbering, Map<org.objectweb.asm.Label, Integer> labelsToOffsets) Renumber any bytecode indexes or offsets as described in section 5.5.2 of the pack200 specificationprivate voidResolve calls in the attribute layout and returns the number of backwards callablesprivate voidresolveCallsForElement(int i, NewAttributeBands.Callable currentCallable, NewAttributeBands.LayoutElement layoutElement) Methods inherited from class kala.compress.harmony.pack200.BandSet
cpEntryListToArray, cpEntryOrNullListToArray, encodeBandInt, encodeFlags, encodeFlags, encodeScalar, encodeScalar, integerListToArray, longListToArray
-
Field Details
-
attributeLayoutElements
-
backwardsCallCounts
private int[] backwardsCallCounts -
cpBands
-
def
-
usedAtLeastOnce
private boolean usedAtLeastOnce -
lastPIntegral
-
-
Constructor Details
-
NewAttributeBands
public NewAttributeBands(int effort, CpBands cpBands, SegmentHeader header, AttributeDefinitionBands.AttributeDefinition def) throws IOException - Throws:
IOException
-
-
Method Details
-
addAttribute
-
getAttributeName
-
getCodec
Returns theBHSDCodecthat should be used for the given layout element- Parameters:
layoutElement-
-
getFlagIndex
public int getFlagIndex() -
getStreamUpToMatchingBracket
Utility method to get the contents of the given stream, up to the next], (ignoring pairs of brackets[and])- Parameters:
reader-- Returns:
- Throws:
IOException- If an I/O error occurs.
-
isUsedAtLeastOnce
public boolean isUsedAtLeastOnce() -
numBackwardsCalls
public int[] numBackwardsCalls() -
pack
Description copied from class:BandSetWrite the packed set of bands to the given output stream- Specified by:
packin classBandSet- Parameters:
outputStream- TODO- Throws:
IOException- If an I/O error occurs.Pack200Exception- TODO
-
parseLayout
- Throws:
IOException
-
readBody
Read a 'body' section of the layout from the given stream- Parameters:
reader-- Returns:
- List of LayoutElements
- Throws:
IOException- If an I/O error occurs.
-
readInteger
-
readNextAttributeElement
private NewAttributeBands.AttributeLayoutElement readNextAttributeElement(StringReader reader) throws IOException - Throws:
IOException
-
readNextLayoutElement
private NewAttributeBands.LayoutElement readNextLayoutElement(StringReader reader) throws IOException - Throws:
IOException
-
readNextUnionCase
Read a UnionCase from the stream- Parameters:
reader-- Returns:
- Throws:
IOException- If an I/O error occurs.
-
readNumber
Read a number from the stream and return it- Parameters:
stream-- Returns:
- Throws:
IOException- If an I/O error occurs.
-
readUpToMatchingBracket
Utility method to get the contents of the given stream, up to the next ']', (ignoring pairs of brackets '[' and ']')- Parameters:
reader-- Returns:
- Throws:
IOException- If an I/O error occurs.
-
renumberBci
public void renumberBci(IntList bciRenumbering, Map<org.objectweb.asm.Label, Integer> labelsToOffsets) Renumber any bytecode indexes or offsets as described in section 5.5.2 of the pack200 specification- Parameters:
bciRenumbering- TODOlabelsToOffsets- TODO
-
resolveCalls
private void resolveCalls()Resolve calls in the attribute layout and returns the number of backwards callables -
resolveCallsForElement
private void resolveCallsForElement(int i, NewAttributeBands.Callable currentCallable, NewAttributeBands.LayoutElement layoutElement)
-