use of com.oracle.truffle.espresso.impl.Field in project graal by oracle.
the class BytecodeNode method resolveField.
private Field resolveField(int opcode, char cpi) {
assert opcode == GETFIELD || opcode == GETSTATIC || opcode == PUTFIELD || opcode == PUTSTATIC;
Field field = getConstantPool().resolvedFieldAt(getMethod().getDeclaringKlass(), cpi);
if (field.needsReResolution()) {
CompilerDirectives.transferToInterpreterAndInvalidate();
getMethod().getContext().getClassRedefinition().check();
field = getConstantPool().resolveFieldAndUpdate(getMethod().getDeclaringKlass(), cpi, field);
}
return field;
}
use of com.oracle.truffle.espresso.impl.Field in project graal by oracle.
the class AbstractLookupFieldNode method doLookup.
@TruffleBoundary
protected Field doLookup(Klass klass, String name, boolean publicOnly, FieldLookupKind kind) {
Field[] table = getFieldArray(klass);
int len = table.length;
for (int i = len - 1; i >= 0; i--) {
Field f = table[i];
if (!f.isRemoved() && (kind == FieldLookupKind.All) || (kind == FieldLookupKind.Static && f.isStatic()) || (kind == FieldLookupKind.Instance && !f.isStatic())) {
if (f.getNameAsString().equals(name) && (f.isPublic() || !publicOnly)) {
return f;
}
}
}
return null;
}
use of com.oracle.truffle.espresso.impl.Field in project graal by oracle.
the class JniEnv method SetLongField.
@JniImpl
public void SetLongField(@JavaType(Object.class) StaticObject obj, @Handle(Field.class) long fieldId, long val) {
Field field = fieldIds.getObject(fieldId);
field.set(obj, val);
}
use of com.oracle.truffle.espresso.impl.Field in project graal by oracle.
the class JniEnv method SetFloatField.
@JniImpl
public void SetFloatField(@JavaType(Object.class) StaticObject obj, @Handle(Field.class) long fieldId, float val) {
Field field = fieldIds.getObject(fieldId);
field.set(obj, val);
}
use of com.oracle.truffle.espresso.impl.Field in project graal by oracle.
the class JniEnv method SetStaticFloatField.
@JniImpl
public void SetStaticFloatField(@SuppressWarnings("unused") @JavaType(Class.class) StaticObject unused, @Handle(Field.class) long fieldId, float val) {
Field field = fieldIds.getObject(fieldId);
assert field.isStatic();
field.set(field.getDeclaringKlass().tryInitializeAndGetStatics(), val);
}
Aggregations