use of com.oracle.truffle.espresso.impl.Field in project graal by oracle.
the class JniEnv method FromReflectedField.
/**
* <h3>jfieldID FromReflectedField(JNIEnv *env, jobject field);</h3>
* <p>
* Converts a java.lang.reflect.Field to a field ID.
*/
@JniImpl
@Handle(Field.class)
public long FromReflectedField(@JavaType(java.lang.reflect.Field.class) StaticObject field) {
assert InterpreterToVM.instanceOf(field, getMeta().java_lang_reflect_Field);
Field guestField = Field.getReflectiveFieldRoot(field, getMeta());
guestField.getDeclaringKlass().initialize();
return fieldIds.handlify(guestField);
}
use of com.oracle.truffle.espresso.impl.Field in project graal by oracle.
the class JniEnv method SetStaticDoubleField.
@JniImpl
public void SetStaticDoubleField(@SuppressWarnings("unused") @JavaType(Class.class) StaticObject unused, @Handle(Field.class) long fieldId, double val) {
Field field = fieldIds.getObject(fieldId);
assert field.isStatic();
field.set(field.getDeclaringKlass().tryInitializeAndGetStatics(), val);
}
use of com.oracle.truffle.espresso.impl.Field in project graal by oracle.
the class JniEnv method SetStaticBooleanField.
@JniImpl
public void SetStaticBooleanField(@SuppressWarnings("unused") @JavaType(Class.class) StaticObject unused, @Handle(Field.class) long fieldId, boolean val) {
Field field = fieldIds.getObject(fieldId);
assert field.isStatic();
field.set(field.getDeclaringKlass().tryInitializeAndGetStatics(), val);
}
use of com.oracle.truffle.espresso.impl.Field in project graal by oracle.
the class JniEnv method SetStaticObjectField.
// endregion Get*Field
// region SetStatic*Field
@JniImpl
public void SetStaticObjectField(@SuppressWarnings("unused") @JavaType(Class.class) StaticObject unused, @Handle(Field.class) long fieldId, @JavaType(Object.class) StaticObject val) {
Field field = fieldIds.getObject(fieldId);
assert field.isStatic();
field.set(field.getDeclaringKlass().tryInitializeAndGetStatics(), val);
}
use of com.oracle.truffle.espresso.impl.Field in project graal by oracle.
the class JniEnv method SetStaticByteField.
@JniImpl
public void SetStaticByteField(@SuppressWarnings("unused") @JavaType(Class.class) StaticObject unused, @Handle(Field.class) long fieldId, byte val) {
Field field = fieldIds.getObject(fieldId);
assert field.isStatic();
field.set(field.getDeclaringKlass().tryInitializeAndGetStatics(), val);
}
Aggregations