use of org.jikesrvm.classloader.NormalMethod in project JikesRVM by JikesRVM.
the class BaselineCompilerImplTest method emptyStaticMethodInClassWithDynamicBridgeRequires32WordsForWhenSSE2_FULLisFalse.
@Test
public void emptyStaticMethodInClassWithDynamicBridgeRequires32WordsForWhenSSE2_FULLisFalse() throws Exception {
assumeThat(VM.BuildForSSE2Full, is(false));
Class<?>[] noArgs = {};
NormalMethod emptyStaticMethod = TestingTools.getNormalMethod(DynamicBridgeMethodsForTests.class, "emptyStaticMethodInClassWithDynamicBridge", noArgs);
int size = BaselineCompilerImpl.calculateRequiredSpaceForFrame(emptyStaticMethod);
assertThat(size, is(32 * WORDSIZE));
}
use of org.jikesrvm.classloader.NormalMethod in project JikesRVM by JikesRVM.
the class BaselineCompilerImplTest method emptyInstanceMethodWithParamsRequiresThreeWords.
@Test
public void emptyInstanceMethodWithParamsRequiresThreeWords() throws Exception {
Class<?>[] args = { Object.class, double.class, int.class, long.class };
NormalMethod emptyInstanceMethod = TestingTools.getNormalMethod(MethodsForTests.class, "emptyInstanceMethodWithParams", args);
int size = BaselineCompilerImpl.calculateRequiredSpaceForFrame(emptyInstanceMethod);
assertThat(size, is(3 * WORDSIZE));
}
use of org.jikesrvm.classloader.NormalMethod in project JikesRVM by JikesRVM.
the class BaselineCompilerImplTest method printRandomIntegerMethodRequiresSixWords.
@Test
public void printRandomIntegerMethodRequiresSixWords() throws Exception {
Class<?>[] noArgs = {};
NormalMethod printRandomIntegerMethod = TestingTools.getNormalMethod(MethodsForTests.class, "printRandomInteger", noArgs);
int size = BaselineCompilerImpl.calculateRequiredSpaceForFrame(printRandomIntegerMethod);
assertThat(size, is(6 * WORDSIZE));
}
use of org.jikesrvm.classloader.NormalMethod in project JikesRVM by JikesRVM.
the class BaselineCompilerImplTest method multiplyByAFewPrimesRequiresFiveWords.
@Test
public void multiplyByAFewPrimesRequiresFiveWords() throws Exception {
NormalMethod multiplyByAFewPrimesMethod = TestingTools.getNormalMethod(MethodsForTests.class, "multiplyByAFewPrimes", int.class);
int size = BaselineCompilerImpl.calculateRequiredSpaceForFrame(multiplyByAFewPrimesMethod);
assertThat(size, is(5 * WORDSIZE));
}
use of org.jikesrvm.classloader.NormalMethod in project JikesRVM by JikesRVM.
the class BaselineGCMapIteratorTest method getNextReferenceAddressReturnsCorrectReferenceIfReferencesArePresent.
@Test
public void getNextReferenceAddressReturnsCorrectReferenceIfReferencesArePresent() throws Exception {
NormalMethod nm = TestingTools.getNormalMethod(MethodsForTests.class, "emptyStaticMethodWithObjectParam", Object.class);
CompiledMethod cm = nm.getCurrentCompiledMethod();
// Fake a stack frame
int stackWords = 5;
WordArray wa = createNonMovableWordArray(stackWords);
for (int i = 0; i < wa.length(); i++) {
wa.set(i, Word.fromIntSignExtend(5 * i));
}
int targetSlot = wa.length() - 1;
Address fp = Magic.objectAsAddress(wa).plus(targetSlot * BYTES_IN_WORD);
// local 0 is reference.
// +/- 0 words: FP
// - 1 words: CMID
// - 2 words: saved GPRs (EDI)
// - 3 words: saved GPRs (EBX)
// - 4 words: local0 == reference
Address targetAddress = fp.minus(4 * BYTES_IN_STACKSLOT);
Word targetContents = targetAddress.loadWord();
gcMapIter.setupIterator(cm, Offset.fromIntZeroExtend(cm.getEntryCodeArray().length()), fp);
Address referenceAddr = gcMapIter.getNextReferenceAddress();
assertEquals(targetAddress, referenceAddr);
assertEquals(targetContents, referenceAddr.loadWord());
}
Aggregations