Package gnu.kawa.reflect
Class SlotGet
- java.lang.Object
-
- gnu.mapping.PropertySet
-
- gnu.mapping.Procedure
-
- gnu.mapping.Procedure2
-
- gnu.kawa.reflect.SlotGet
-
- All Implemented Interfaces:
Inlineable,HasSetter,Named
public class SlotGet extends Procedure2 implements HasSetter, Inlineable
-
-
Field Summary
Fields Modifier and Type Field Description static SlotGetfieldstatic SlotGetslotRefstatic SlotGetstaticField-
Fields inherited from class gnu.mapping.Procedure2
applyToObject
-
Fields inherited from class gnu.mapping.Procedure
applyMethodType, applyToConsumerDefault, applyToConsumerMethod, applyToObjectDefault, applyToObjectMethod, compilerKey, compilerXKey, inlineIfConstantSymbol, validateApplyKey, validateXApplyKey
-
Fields inherited from class gnu.mapping.PropertySet
nameKey
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectapply2(java.lang.Object arg1, java.lang.Object arg2)voidcompile(ApplyExp exp, Compilation comp, Target target)static java.lang.Objectfield(java.lang.Object obj, java.lang.String fname)ProceduregetSetter()static java.lang.ObjectgetSlotValue(boolean isStatic, java.lang.Object obj, java.lang.String name, java.lang.String fname, java.lang.String getName, java.lang.String isName, Language language)The actual gets of finding the field value.static MemberlookupMember(ObjectType clas, java.lang.String name, ClassType caller)Get a named property - field or member class or 'get' accessor method.static ApplyExpmakeGetField(Expression value, java.lang.String fieldName)Convenience method to make an Expression that gets the value of a field.voidset2(java.lang.Object obj, java.lang.Object name, java.lang.Object value)voidsetN(java.lang.Object[] args)static java.lang.ObjectstaticField(java.lang.Object obj, java.lang.String fname)-
Methods inherited from class gnu.mapping.Procedure2
apply0, apply1, apply3, apply4, applyN, applyToObject, numArgs
-
Methods inherited from class gnu.mapping.Procedure
applyL, applyToConsumerDefault, applyToObjectDefault, checkArgCount, checkBadCode, getApplyMethod, getApplyToConsumerMethod, getApplyToObjectMethod, getReturnType, getSourceLocation, isSideEffectFree, lookupApplyHandle, maxArgs, maxArgs, minArgs, minArgs, set0, set1, setSetter, setSourceLocation, toString
-
Methods inherited from class gnu.mapping.PropertySet
getName, getProperty, getSymbol, removeProperty, setName, setProperty, setProperty, setSymbol
-
-
-
-
Constructor Detail
-
SlotGet
public SlotGet(java.lang.String name, boolean isStatic)
-
SlotGet
public SlotGet(java.lang.String name, boolean isStatic, Procedure setter)
-
-
Method Detail
-
field
public static java.lang.Object field(java.lang.Object obj, java.lang.String fname)
-
staticField
public static java.lang.Object staticField(java.lang.Object obj, java.lang.String fname)
-
apply2
public java.lang.Object apply2(java.lang.Object arg1, java.lang.Object arg2)- Specified by:
apply2in classProcedure2
-
getSlotValue
public static java.lang.Object getSlotValue(boolean isStatic, java.lang.Object obj, java.lang.String name, java.lang.String fname, java.lang.String getName, java.lang.String isName, Language language)The actual gets of finding the field value. The compiler emits calls to this method if the field name is literal but the actual field is not known at compile time. This speeds lookup a bit. If fname equals "length" or "class", it is assumed to be interned.
-
set2
public void set2(java.lang.Object obj, java.lang.Object name, java.lang.Object value)
-
lookupMember
public static Member lookupMember(ObjectType clas, java.lang.String name, ClassType caller)
Get a named property - field or member class or 'get' accessor method.- Parameters:
clas- the class type declaring the property.name- the source (unmangled) name of the property.
-
compile
public void compile(ApplyExp exp, Compilation comp, Target target)
- Specified by:
compilein interfaceInlineable
-
getSetter
public Procedure getSetter()
-
makeGetField
public static ApplyExp makeGetField(Expression value, java.lang.String fieldName)
Convenience method to make an Expression that gets the value of a field.- Parameters:
value- evaluates to object that has the named fieldfieldName- name of field in value- Returns:
- expression that get the name field from value
-
-