public class NewObjectSnippets extends Object implements Snippets
Modifier and Type | Class and Description |
---|---|
(package private) static class |
NewObjectSnippets.Options |
(package private) static class |
NewObjectSnippets.ProfileMode |
static class |
NewObjectSnippets.Templates |
Modifier and Type | Field and Description |
---|---|
private static SnippetCounter.Group |
countersNew |
private static SnippetCounter.Group |
countersNewArray |
static ForeignCallDescriptor |
DYNAMIC_NEW_ARRAY |
static ForeignCallDescriptor |
DYNAMIC_NEW_INSTANCE |
static LocationIdentity |
INIT_LOCATION |
static int |
MAX_ARRAY_FAST_PATH_ALLOCATION_LENGTH
Maximum array length for which fast path allocation is used.
|
private static int |
MAX_UNROLLED_OBJECT_ZEROING_STORES
Maximum number of long stores to emit when zeroing an object with a constant size.
|
private static SnippetCounter |
new_loopInit |
private static SnippetCounter |
new_seqInit |
private static SnippetCounter |
new_stub |
private static SnippetCounter |
newarray_loopInit |
private static SnippetCounter |
newarray_stub |
static NewObjectSnippets.ProfileMode |
PROFILE_MODE |
Constructor and Description |
---|
NewObjectSnippets() |
Modifier and Type | Method and Description |
---|---|
static Object |
allocateArray(KlassPointer hub,
int length,
Word prototypeMarkWord,
int headerSize,
int log2ElementSize,
boolean fillContents,
Register threadRegister,
boolean maybeUnroll,
String typeContext) |
static Object |
allocateArrayDynamic(Class<?> elementType,
int length,
boolean fillContents,
Register threadRegister,
Kind knownElementKind,
int knownLayoutHelper,
Word prototypeMarkWord) |
private static Object |
allocateArrayDynamicImpl(Class<?> elementType,
int length,
boolean fillContents,
Register threadRegister,
Kind knownElementKind,
int knownLayoutHelper,
Word prototypeMarkWord) |
private static Object |
allocateArrayImpl(KlassPointer hub,
int length,
Word prototypeMarkWord,
int headerSize,
int log2ElementSize,
boolean fillContents,
Register threadRegister,
boolean maybeUnroll,
String typeContext,
boolean skipNegativeCheck) |
static Object |
allocateInstance(int size,
KlassPointer hub,
Word prototypeMarkWord,
boolean fillContents,
Register threadRegister,
boolean constantSize,
String typeContext) |
static Object |
allocateInstanceDynamic(Class<?> type,
boolean fillContents,
Register threadRegister) |
private static String |
createName(String path,
String typeContext) |
private static boolean |
doProfile() |
static Object |
dynamicNewArrayStub(ForeignCallDescriptor descriptor,
Class<?> elementType,
int length) |
static Object |
dynamicNewInstanceStub(Class<?> elementType) |
static Object |
dynamicNewInstanceStubCall(ForeignCallDescriptor descriptor,
Class<?> elementType) |
static void |
emitPrefetchAllocate(Word address,
boolean isArray) |
private static void |
fillMemory(long value,
int size,
Word memory,
boolean constantSize,
int startOffset,
boolean manualUnroll,
boolean useSnippetCounters) |
private static void |
fillWithGarbage(int size,
Word memory,
boolean constantSize,
int startOffset,
boolean manualUnroll,
boolean useSnippetCounters)
Fill uninitialized memory with garbage value in a newly allocated object, unrolling as
necessary and ensuring that stores are aligned.
|
static Object |
formatArray(KlassPointer hub,
int allocationSize,
int length,
int headerSize,
Word memory,
Word prototypeMarkWord,
boolean fillContents,
boolean maybeUnroll,
boolean useSnippetCounters)
Formats some allocated memory with an object header and zeroes out the rest.
|
protected static Object |
formatObject(KlassPointer hub,
int size,
Word memory,
Word compileTimePrototypeMarkWord,
boolean fillContents,
boolean constantSize,
boolean useSnippetCounters)
Formats some allocated memory with an object header and zeroes out the rest.
|
static Object |
formatObjectForStub(KlassPointer hub,
int size,
Word memory,
Word compileTimePrototypeMarkWord)
Formats some allocated memory with an object header and zeroes out the rest.
|
static Object |
newArray(ForeignCallDescriptor descriptor,
KlassPointer hub,
int length) |
static Object |
newArrayCall(ForeignCallDescriptor descriptor,
Word hub,
int rank,
Word dims) |
static Object |
newInstance(ForeignCallDescriptor descriptor,
KlassPointer hub) |
static Object |
newmultiarray(Word hub,
int rank,
int[] dimensions)
Calls the runtime stub for implementing MULTIANEWARRAY.
|
protected static void |
profileAllocation(String path,
long size,
String typeContext) |
protected static void |
verifyHeap(Register threadRegister) |
private static void |
zeroMemory(int size,
Word memory,
boolean constantSize,
int startOffset,
boolean manualUnroll,
boolean useSnippetCounters)
Zero uninitialized memory in a newly allocated object, unrolling as necessary and ensuring
that stores are aligned.
|
public static final LocationIdentity INIT_LOCATION
public static final NewObjectSnippets.ProfileMode PROFILE_MODE
public static final int MAX_ARRAY_FAST_PATH_ALLOCATION_LENGTH
public static final ForeignCallDescriptor DYNAMIC_NEW_ARRAY
public static final ForeignCallDescriptor DYNAMIC_NEW_INSTANCE
private static final int MAX_UNROLLED_OBJECT_ZEROING_STORES
private static final SnippetCounter.Group countersNew
private static final SnippetCounter new_seqInit
private static final SnippetCounter new_loopInit
private static final SnippetCounter new_stub
private static final SnippetCounter.Group countersNewArray
private static final SnippetCounter newarray_loopInit
private static final SnippetCounter newarray_stub
public NewObjectSnippets()
private static String createName(String path, String typeContext)
private static boolean doProfile()
protected static void profileAllocation(String path, long size, String typeContext)
public static void emitPrefetchAllocate(Word address, boolean isArray)
public static Object allocateInstance(int size, KlassPointer hub, Word prototypeMarkWord, boolean fillContents, Register threadRegister, boolean constantSize, String typeContext)
public static Object newInstance(ForeignCallDescriptor descriptor, KlassPointer hub)
public static Object allocateInstanceDynamic(Class<?> type, boolean fillContents, Register threadRegister)
public static Object allocateArray(KlassPointer hub, int length, Word prototypeMarkWord, int headerSize, int log2ElementSize, boolean fillContents, Register threadRegister, boolean maybeUnroll, String typeContext)
private static Object allocateArrayImpl(KlassPointer hub, int length, Word prototypeMarkWord, int headerSize, int log2ElementSize, boolean fillContents, Register threadRegister, boolean maybeUnroll, String typeContext, boolean skipNegativeCheck)
public static Object newArray(ForeignCallDescriptor descriptor, KlassPointer hub, int length)
public static Object dynamicNewArrayStub(ForeignCallDescriptor descriptor, Class<?> elementType, int length)
public static Object dynamicNewInstanceStub(Class<?> elementType)
public static Object dynamicNewInstanceStubCall(ForeignCallDescriptor descriptor, Class<?> elementType)
public static Object allocateArrayDynamic(Class<?> elementType, int length, boolean fillContents, Register threadRegister, Kind knownElementKind, int knownLayoutHelper, Word prototypeMarkWord)
private static Object allocateArrayDynamicImpl(Class<?> elementType, int length, boolean fillContents, Register threadRegister, Kind knownElementKind, int knownLayoutHelper, Word prototypeMarkWord)
public static Object newmultiarray(Word hub, int rank, int[] dimensions)
public static Object newArrayCall(ForeignCallDescriptor descriptor, Word hub, int rank, Word dims)
private static void zeroMemory(int size, Word memory, boolean constantSize, int startOffset, boolean manualUnroll, boolean useSnippetCounters)
size
- number of bytes to zeromemory
- beginning of object which is being zeroedconstantSize
- is size
known to be constant in the snippetstartOffset
- offset to begin zeroing. May not be word aligned.manualUnroll
- maximally unroll zeroingprivate static void fillMemory(long value, int size, Word memory, boolean constantSize, int startOffset, boolean manualUnroll, boolean useSnippetCounters)
private static void fillWithGarbage(int size, Word memory, boolean constantSize, int startOffset, boolean manualUnroll, boolean useSnippetCounters)
size
- number of bytes to zeromemory
- beginning of object which is being zeroedconstantSize
- is size
known to be constant in the snippetstartOffset
- offset to begin zeroing. May not be word aligned.manualUnroll
- maximally unroll zeroingpublic static Object formatObjectForStub(KlassPointer hub, int size, Word memory, Word compileTimePrototypeMarkWord)
protected static Object formatObject(KlassPointer hub, int size, Word memory, Word compileTimePrototypeMarkWord, boolean fillContents, boolean constantSize, boolean useSnippetCounters)
protected static void verifyHeap(Register threadRegister)
public static Object formatArray(KlassPointer hub, int allocationSize, int length, int headerSize, Word memory, Word prototypeMarkWord, boolean fillContents, boolean maybeUnroll, boolean useSnippetCounters)