use of org.jikesrvm.classloader.TypeReference in project JikesRVM by JikesRVM.
the class VMCommonLibrarySupport method setCharInternal.
@Inline(value = Inline.When.ArgumentsAreConstant, arguments = { 2 })
private static void setCharInternal(Object object, char value, RVMField field) throws IllegalArgumentException {
TypeReference type = field.getType();
if (type.isCharType())
field.setCharValueUnchecked(object, value);
else if (type.isLongType())
field.setLongValueUnchecked(object, value);
else if (type.isIntType())
field.setIntValueUnchecked(object, value);
else if (type.isShortType())
field.setShortValueUnchecked(object, (short) value);
else if (type.isDoubleType())
field.setDoubleValueUnchecked(object, value);
else if (type.isFloatType())
field.setFloatValueUnchecked(object, value);
else
throwNewIllegalArgumentException("field type mismatch");
}
use of org.jikesrvm.classloader.TypeReference in project JikesRVM by JikesRVM.
the class VMCommonLibrarySupport method getLong.
@Inline(value = Inline.When.ArgumentsAreConstant, arguments = { 1 })
static long getLong(Object object, RVMField field, Field jlrField, RVMClass accessingClass) throws IllegalAccessException, IllegalArgumentException {
checkReadAccess(object, field, jlrField, accessingClass);
TypeReference type = field.getType();
if (type.isLongType()) {
return field.getLongValueUnchecked(object);
} else if (type.isIntType()) {
return field.getIntValueUnchecked(object);
} else if (type.isShortType()) {
return field.getShortValueUnchecked(object);
} else if (type.isCharType()) {
return field.getCharValueUnchecked(object);
} else if (type.isByteType()) {
return field.getByteValueUnchecked(object);
} else {
throwNewIllegalArgumentException("field type mismatch");
return 0L;
}
}
use of org.jikesrvm.classloader.TypeReference in project JikesRVM by JikesRVM.
the class VMCommonLibrarySupport method getChar.
@Inline(value = Inline.When.ArgumentsAreConstant, arguments = { 1 })
static char getChar(Object object, RVMField field, Field jlrField, RVMClass accessingClass) throws IllegalAccessException, IllegalArgumentException {
checkReadAccess(object, field, jlrField, accessingClass);
TypeReference type = field.getType();
if (!type.isCharType())
throwNewIllegalArgumentException("field type mismatch");
return field.getCharValueUnchecked(object);
}
use of org.jikesrvm.classloader.TypeReference in project JikesRVM by JikesRVM.
the class GenerationContextTest method specializedParametersAreNotSanityChecked.
@Test
public void specializedParametersAreNotSanityChecked() throws Exception {
Class<?>[] argumentTypes = { Object.class };
TypeReference[] specializedArgumentTypes = {};
NormalMethod nm = getNormalMethodForTest("emptyStaticMethodWithObjectParam", argumentTypes);
CompiledMethod cm = new OptCompiledMethod(-1, nm);
OptOptions opts = new OptOptions();
InlineOracle io = new DefaultInlineOracle();
GenerationContext gc = new GenerationContext(nm, specializedArgumentTypes, cm, opts, io);
assertThatNumberOfParametersIs(gc, 0);
}
use of org.jikesrvm.classloader.TypeReference in project JikesRVM by JikesRVM.
the class GenerationContextTest method makeLocalUsesLocalRegToDetermineRegisters.
@Test
public void makeLocalUsesLocalRegToDetermineRegisters() throws Exception {
NormalMethod nm = TestingTools.getNormalMethod(MethodsForTests.class, "emptyInstanceMethodWithoutAnnotations");
OptOptions opts = new OptOptions();
GenerationContext gc = new GenerationContext(nm, null, null, opts, null);
int localNumber = 0;
TypeReference localType = nm.getDeclaringClass().getTypeRef();
Register expectedRegister = gc.localReg(localNumber, localType);
RegisterOperand regOp = gc.makeLocal(localNumber, localType);
assertSame(expectedRegister, regOp.getRegister());
}
Aggregations