gnu.kawa.reflect

Class SlotGet

public class SlotGet extends Procedure2 implements HasSetter, CanInline, Inlineable

Field Summary
static SlotGetfield
static SlotGetslotRef
static SlotGetstaticField
Constructor Summary
SlotGet(String name, boolean isStatic)
SlotGet(String name, boolean isStatic, Procedure setter)
Method Summary
Objectapply2(Object arg1, Object arg2)
voidcompile(ApplyExp exp, Compilation comp, Target target)
static Objectfield(Object obj, String fname)
TypegetReturnType(Expression[] args)
ProceduregetSetter()
static ObjectgetSlotValue(boolean isStatic, Object obj, String name, String fname, String getName, String isName, Language language)
The actual gets of finding the field value.
Expressioninline(ApplyExp exp, ExpWalker walker)
static MemberlookupMember(ClassType clas, String name, ClassType caller)
Get a named property - field or 'get' accessor method.
static ApplyExpmakeGetField(Expression value, String fieldName)
Convenience method to make an Expression that gets the value of a field.
voidset2(Object obj, Object name, Object value)
voidsetN(Object[] args)
static ObjectstaticField(Object obj, String fname)

Field Detail

field

public static final SlotGet field

slotRef

public static final SlotGet slotRef

staticField

public static final SlotGet staticField

Constructor Detail

SlotGet

public SlotGet(String name, boolean isStatic)

SlotGet

public SlotGet(String name, boolean isStatic, Procedure setter)

Method Detail

apply2

public Object apply2(Object arg1, Object arg2)

compile

public void compile(ApplyExp exp, Compilation comp, Target target)

field

public static Object field(Object obj, String fname)

getReturnType

public Type getReturnType(Expression[] args)

getSetter

public Procedure getSetter()

getSlotValue

public static Object getSlotValue(boolean isStatic, Object obj, String name, String fname, String getName, String isName, Language language)
The actual gets of finding the field value. The compiler emits calls to this method if the field name is literals but the actual field is not known at compile time. This speeds lookup a bit.

inline

public Expression inline(ApplyExp exp, ExpWalker walker)

lookupMember

public static Member lookupMember(ClassType clas, String name, ClassType caller)
Get a named property - field or 'get' accessor method.

Parameters: clas the class type declaring the property. name the source (unmangled) name of the property.

makeGetField

public static ApplyExp makeGetField(Expression value, String fieldName)
Convenience method to make an Expression that gets the value of a field.

Parameters: value evaluates to object that has the named field fieldName name of field in value

Returns: expression that get the name field from value

set2

public void set2(Object obj, Object name, Object value)

setN

public void setN(Object[] args)

staticField

public static Object staticField(Object obj, String fname)