use of org.vmmagic.pragma.NoInline in project JikesRVM by JikesRVM.
the class MemoryManager method allocateCode.
/**
* Allocate a CodeArray into a code space.
* Currently the interface is fairly primitive;
* just the number of instructions in the code array and a boolean
* to indicate hot or cold code.
* @param numInstrs number of instructions
* @param isHot is this a request for hot code space allocation?
* @return The array
*/
@NoInline
@Interruptible
public static CodeArray allocateCode(int numInstrs, boolean isHot) {
RVMArray type = RVMType.CodeArrayType;
int headerSize = ObjectModel.computeArrayHeaderSize(type);
int align = ObjectModel.getAlignment(type);
int offset = ObjectModel.getOffsetForAlignment(type, false);
int width = type.getLogElementSize();
TIB tib = type.getTypeInformationBlock();
int allocator = isHot ? Plan.ALLOC_HOT_CODE : Plan.ALLOC_COLD_CODE;
return (CodeArray) allocateArray(numInstrs, width, headerSize, tib, allocator, align, offset, Plan.DEFAULT_SITE);
}
use of org.vmmagic.pragma.NoInline in project JikesRVM by JikesRVM.
the class JavaHeader method installHashCode.
@NoInline
@Interruptible
protected static int installHashCode(Object o) {
Word hashCode;
do {
hashCodeGenerator = hashCodeGenerator.plus(Word.one().lsh(HASH_CODE_SHIFT));
hashCode = hashCodeGenerator.and(HASH_CODE_MASK);
} while (hashCode.isZero());
while (true) {
Word statusWord = Magic.prepareWord(o, STATUS_OFFSET);
if (!(statusWord.and(HASH_CODE_MASK).isZero())) {
// some other thread installed a hashcode
return statusWord.and(HASH_CODE_MASK).rshl(HASH_CODE_SHIFT).toInt();
}
if (Magic.attemptWord(o, STATUS_OFFSET, statusWord, statusWord.or(hashCode))) {
// we installed the hash code
return hashCode.rshl(HASH_CODE_SHIFT).toInt();
}
}
}
use of org.vmmagic.pragma.NoInline in project JikesRVM by JikesRVM.
the class TIB method initializeInternalLazyCompilationTrampoline.
/**
* Initialize the lazy method invoker trampoline for this tib.
*/
@NoInline
public void initializeInternalLazyCompilationTrampoline() {
CodeArray source = LazyCompilationTrampoline.getInstructions();
int targetSlot = lazyMethodInvokerTrampolineIndex();
int logIPW = LOG_BYTES_IN_ADDRESS - ArchConstants.getLogInstructionWidth();
int logIPI = LOG_BYTES_IN_INT - ArchConstants.getLogInstructionWidth();
if (VM.VerifyAssertions)
VM._assert(ArchConstants.getLogInstructionWidth() <= LOG_BYTES_IN_INT);
int mask = 0xFFFFFFFF >>> (((1 << logIPI) - 1) << LOG_BITS_IN_BYTE);
for (int i = 0; i < lazyMethodInvokerTrampolineWords(); i++) {
Word currentWord = Word.zero();
int base = i << logIPW;
for (int j = 0; j < (1 << logIPW) && (base + j) < source.length(); j++) {
Word currentEntry = Word.fromIntZeroExtend(source.get(base + j) & mask);
currentEntry = currentEntry.lsh(((VM.LittleEndian ? j : (1 << logIPW) - (j + 1)) << ArchConstants.getLogInstructionWidth()) << LOG_BITS_IN_BYTE);
currentWord = currentWord.or(currentEntry);
}
set(targetSlot + i, currentWord);
}
}
use of org.vmmagic.pragma.NoInline in project JikesRVM by JikesRVM.
the class MemoryManager method newNonMovingWordArray.
/**
* Allocates a non moving word array.
*
* @param size The size of the array
* @return the new non moving word array
*/
@NoInline
@Interruptible
public static WordArray newNonMovingWordArray(int size) {
if (!VM.runningVM) {
return WordArray.create(size);
}
RVMArray arrayType = RVMType.WordArrayType;
int headerSize = ObjectModel.computeArrayHeaderSize(arrayType);
int align = ObjectModel.getAlignment(arrayType);
int offset = ObjectModel.getOffsetForAlignment(arrayType, false);
int width = arrayType.getLogElementSize();
TIB arrayTib = arrayType.getTypeInformationBlock();
return (WordArray) allocateArray(size, width, headerSize, arrayTib, Plan.ALLOC_NON_MOVING, align, offset, Plan.DEFAULT_SITE);
}
use of org.vmmagic.pragma.NoInline in project JikesRVM by JikesRVM.
the class MemoryManager method newNonMovingDoubleArray.
/**
* Allocates a non moving double array.
*
* @param size The size of the array
* @return the new non moving double array
*/
@NoInline
@Interruptible
public static double[] newNonMovingDoubleArray(int size) {
if (!VM.runningVM) {
return new double[size];
}
RVMArray arrayType = RVMArray.DoubleArray;
int headerSize = ObjectModel.computeArrayHeaderSize(arrayType);
int align = ObjectModel.getAlignment(arrayType);
int offset = ObjectModel.getOffsetForAlignment(arrayType, false);
int width = arrayType.getLogElementSize();
TIB arrayTib = arrayType.getTypeInformationBlock();
return (double[]) allocateArray(size, width, headerSize, arrayTib, Plan.ALLOC_NON_MOVING, align, offset, Plan.DEFAULT_SITE);
}
Aggregations