Class SlotGet

All Implemented Interfaces:
Inlineable, HasSetter, Named

public class SlotGet extends Procedure2 implements HasSetter, Inlineable
  • Field Details

    • field

      public static final SlotGet field
    • slotRef

      public static final SlotGet slotRef
    • staticField

      public static final SlotGet staticField
  • Constructor Details

    • SlotGet

      public SlotGet(String name, boolean isStatic)
    • SlotGet

      public SlotGet(String name, boolean isStatic, Procedure setter)
  • Method Details

    • field

      public static Object field(Object obj, String fname)
    • staticField

      public static Object staticField(Object obj, String fname)
    • apply2

      public Object apply2(Object arg1, Object arg2)
      Specified by:
      apply2 in class Procedure2
    • 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 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.
    • setN

      public void setN(Object[] args)
      Overrides:
      setN in class Procedure
    • set2

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

      public static Member lookupMember(ObjectType clas, 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:
      compile in interface Inlineable
    • getSetter

      public Procedure getSetter()
      Specified by:
      getSetter in interface HasSetter
      Overrides:
      getSetter in class Procedure
    • 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