Top Description Inners Fields Constructors Methods
jdk.vm.ci.hotspot

pack-priv final Class HotSpotCompiledCodeStream

extends Object
implements AutoCloseable
Class Inheritance
All Implemented Interfaces
java.lang.AutoCloseable
Static Imports
jdk.vm.ci.hotspot.HotSpotCompiledCodeStream.Tag.CALLSITE_TARGET_VALUE, .HotSpotCompiledCodeStream.Tag.CONCRETE_METHOD, .HotSpotCompiledCodeStream.Tag.CONCRETE_SUBTYPE, .HotSpotCompiledCodeStream.Tag.ILLEGAL, .HotSpotCompiledCodeStream.Tag.JOBJECT, .HotSpotCompiledCodeStream.Tag.LEAF_TYPE, .HotSpotCompiledCodeStream.Tag.NO_FINALIZABLE_SUBCLASS, .HotSpotCompiledCodeStream.Tag.NULL_CONSTANT, .HotSpotCompiledCodeStream.Tag.OBJECT_ID, .HotSpotCompiledCodeStream.Tag.OBJECT_ID2, .HotSpotCompiledCodeStream.Tag.PATCH_JOBJECT, .HotSpotCompiledCodeStream.Tag.PATCH_KLASS, .HotSpotCompiledCodeStream.Tag.PATCH_METHOD, .HotSpotCompiledCodeStream.Tag.PATCH_NARROW_JOBJECT, .HotSpotCompiledCodeStream.Tag.PATCH_NARROW_KLASS, .HotSpotCompiledCodeStream.Tag.PATCH_NARROW_OBJECT_ID, .HotSpotCompiledCodeStream.Tag.PATCH_NARROW_OBJECT_ID2, .HotSpotCompiledCodeStream.Tag.PATCH_OBJECT_ID, .HotSpotCompiledCodeStream.Tag.PATCH_OBJECT_ID2, .HotSpotCompiledCodeStream.Tag.PRIMITIVE4, .HotSpotCompiledCodeStream.Tag.PRIMITIVE8, .HotSpotCompiledCodeStream.Tag.PRIMITIVE_0, .HotSpotCompiledCodeStream.Tag.RAW_CONSTANT, .HotSpotCompiledCodeStream.Tag.REGISTER_NARROW_OOP, .HotSpotCompiledCodeStream.Tag.REGISTER_OOP, .HotSpotCompiledCodeStream.Tag.REGISTER_PRIMITIVE, .HotSpotCompiledCodeStream.Tag.REGISTER_VECTOR, .HotSpotCompiledCodeStream.Tag.SITE_CALL, .HotSpotCompiledCodeStream.Tag.SITE_DATA_PATCH, .HotSpotCompiledCodeStream.Tag.SITE_EXCEPTION_HANDLER, .HotSpotCompiledCodeStream.Tag.SITE_FOREIGN_CALL, .HotSpotCompiledCodeStream.Tag.SITE_FOREIGN_CALL_NO_DEBUG_INFO, .HotSpotCompiledCodeStream.Tag.SITE_IMPLICIT_EXCEPTION, .HotSpotCompiledCodeStream.Tag.SITE_IMPLICIT_EXCEPTION_DISPATCH, .HotSpotCompiledCodeStream.Tag.SITE_INFOPOINT, .HotSpotCompiledCodeStream.Tag.SITE_MARK, .HotSpotCompiledCodeStream.Tag.SITE_SAFEPOINT, .HotSpotCompiledCodeStream.Tag.STACK_SLOT_NARROW_OOP, .HotSpotCompiledCodeStream.Tag.STACK_SLOT_OOP, .HotSpotCompiledCodeStream.Tag.STACK_SLOT_PRIMITIVE, .HotSpotCompiledCodeStream.Tag.STACK_SLOT_VECTOR, .HotSpotCompiledCodeStream.Tag.VIRTUAL_OBJECT_ID, .HotSpotCompiledCodeStream.Tag.VIRTUAL_OBJECT_ID2

Serializes HotSpotCompiledCode to a list linked native memory chunks. Each chunk has the following layout:
{@code 
  | word |  4   |<------  size -------->|             |
  +------+------+-----------------------+-------------+
  | next | size |       used data       | unused data |
  +------+------+-----------------------+-------------+

  |<----------- chunkSize --------------------------->|
  |<-- HEADER ->|
Each chunk is twice as large as its predecessor. See ensureCapacity(int).
See Also
Option#DumpSerializedCode, Option#CodeSerializationTypeInfo

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
HotSpotCompiledCodeStream.IdentityBox

Alternative to using IdentityHashMap which would require dealing with the IdentityHashMap#NULL_KEY constant.

pack-priv static enum

Field Summary

Modifier and TypeField and Description
private Object
private long
private int
currentChunkIndex

Index of current chunk.

private int
currentChunkOffset

Insertion position in current chunk.

private int
currentChunkSize

Size of current chunk.

private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
pack-priv final long
headChunk

Head and current chunk.

private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
pack-priv final Object[]
private HashMap<HotSpotCompiledCodeStream.IdentityBox, Integer>
private static final int
private final HotSpotJVMCIRuntime
pack-priv long
private final Unsafe
private final boolean
withTypeInfo

Specifies if the name and size of each data element is written to the buffer.

Constructor Summary

AccessConstructor and Description
pack-priv
HotSpotCompiledCodeStream(HotSpotCompiledCode
the object to serialize
code
,
boolean withTypeInfo, boolean
include HotSpotCompiledCode#comments in the stream
withComments
,
boolean
include HotSpotCompiledCode#methods in the stream
withMethods
)

Serializes .

Method Summary

Modifier and TypeMethod and Description
private void
beforeWrite(String
name of data element to be written
name
,
int
the size of the data element to be written
sizeInBytes
)

Emits type info for a write to the buffer and ensures there's sufficient capacity.

private static int
c(String name)

public void
close()

Implements java.lang.AutoCloseable.close.

Closes this resource, relinquishing any underlying resources.

private String
private void
dump(String dumpName)

private void
emitType(String name, int sizeInBytes)

Emits the name and size in bytes of a data element if type info is enabled.

private void
ensureCapacity(int toWrite)

Ensures there is capacity for appending toWrite additional bytes.

private JVMCIError
error(String format, Object... args)

private Object[]
finalizeObjectPool()

Creates the pool for DirectHotSpotObjectConstantImpl values written to the stream.

private long
getChunkNext(long chunk)

Reads the pointer in chunk pointing to the next chunk in the list.

private int
getDataSize(long chunk)

Reads the size of the payload in chunk.

private int
getTotalDataSize()

Gets the size of payload data in the buffer.

private static void
hexdump(PrintStream out, long address, byte[] data)

private boolean
isNarrowOop(Value oopValue)

private static boolean
isSet(int flags, int bit)

private static boolean
isU1(int value)

private boolean
isVector(Value value)

private void
maybeDump(String name, HotSpotCompiledNmethod nmethod)

Dumps the buffer to TTY if name or method are matched by Option#DumpSerializedCode.

private void
rawWriteU2(String name, int value)

private void
setChunkNext(long chunk, long next)

Writes the pointer in chunk pointing to the next chunk in the list.

private void
setDataSize(long chunk, int size)

Writes the size of the payload in chunk.

private static int
setIf(int flag, Object[] array)

Returns flag if condition == true else 0.

private static int
setIf(int flag, boolean condition)

Returns flag if condition == true else 0.

private static int
setIf(int flag, int condition)

Returns flag if condition != 0 else 0.

private static String

Returns:

the matched value or null if no match was made
shouldDump
(String name, HotSpotCompiledNmethod nmethod)

Determines if name or method are matched by Option#DumpSerializedCode.

private void
private void
private void
writeBoolean(String name, boolean value)

private void
private void
private void
writeDataSectionPatches(DataPatch[] dataSectionPatches)

private void
writeDebugInfo(DebugInfo debugInfo, boolean fullInfo)

private void
writeFrame(BytecodePosition pos, boolean fullInfo, int depth)

private void
writeInt(String name, int value)

private void
private void
private void
writeLong(String name, long value)

private void
private void
private int
private void
private void
private void
private void
private void
writeS2(String name, int value)

private void
private void
private void
private void
writeU1(String name, int value)

private void
writeU2(String name, int value)

private void
writeUTF8(String name, String value)

Writes the UTF8 bytes for value to the stream followed by a 0.

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait