Record Class Methods.Def<MR,N>

java.lang.Object
java.lang.Record
ghidra.pcode.emu.jit.gen.util.Methods.Def<MR,N>
Type Parameters:
MR - the return type
N - the parameter types, encoded as in Emitter
Record Components:
em - the emitter to be given once method definition moves into bytecode generation
params - the defined parameters so far
Enclosing interface:
Methods

public static record Methods.Def<MR,N>(Emitter<Emitter.Bot> em, List<Methods.MthParam<?>> params) extends Record
A static method definition (builder)
  • Constructor Details

  • Method Details

    • param

      public static <MR extends Types.BType, T1 extends Types.BNonVoid, N1 extends Emitter.Next, N0 extends Emitter.Ent<N1, T1>> Methods.Def<MR,N1> param(Methods.Def<MR,N0> mdef, T1 type, String name, Consumer<Local<T1>> receiver)
      Define a parameter for a static method
      Type Parameters:
      MR - the return type
      T1 - the parameter type
      N1 - the remaining parameters still requiring definition
      N0 - the parameters remaining and the one being defined
      Parameters:
      mdef - the method definition
      type - the parameter type
      name - the name
      receiver - a consumer to accept the declared local variable handle
      Returns:
      the method definition
    • param

      public static <MR extends Types.BType, OT, T1 extends Types.BNonVoid, N1 extends Emitter.Next, N0 extends Emitter.Ent<N1, T1>> Methods.ObjDef<MR,OT,N1> param(Methods.ObjDef<MR,OT,N0> mdef, T1 type, String name, Consumer<Local<T1>> receiver)
      Define a parameter for an instance method
      Type Parameters:
      MR - the return type
      OT - the owning type
      T1 - the parameter type
      N1 - the remaining parameters still requiring definition
      N0 - the parameters remaining and the one being defined
      Parameters:
      mdef - the method definition
      type - the parameter type
      name - the name
      receiver - a consumer to accept the declared local variable handle
      Returns:
      the method definition
    • done

      public static <MR extends Types.BType> Methods.RetReqEm<MR> done(Methods.Def<MR,Emitter.Bot> mdef)
      Finish defining a static method and begin emitting bytecode
      Type Parameters:
      MR - the return type
      Parameters:
      mdef - the method definition
      Returns:
      the return request and emitter typed with an empty stack
    • done

      public static <MR extends Types.BType, OT> Methods.RetReqEm<MR> done(Methods.ObjDef<MR,OT,Emitter.Bot> mdef, Types.TRef<OT> type, Consumer<Local<Types.TRef<OT>>> receiver)
      Finish defining an instance method and begin emitting bytecode
      Type Parameters:
      MR - the return type
      OT - the owning type
      Parameters:
      mdef - the method definition
      type - the owning type (for this this) parameter
      receiver - a consumer to accept the declared this local handle
      Returns:
      the return request and emitter typed with an empty stack
    • param

      public <R, T1 extends Types.BNonVoid> R param(Methods.Def.ParamFunction<? super Methods.Def<MR,N>,T1,R> func, T1 type, String name, Consumer<Local<T1>> receiver)
      A syntactic workaround for static method chaining
      Type Parameters:
      R - the return type of func
      T1 - the parameter type
      Parameters:
      func - the static method reference that actually processes the parameter
      type - the parameter type
      name - the name
      receiver - the receiver
      Returns:
      the return value from func
    • param

      public <R> R param(Methods.Def.DoneFunction<? super Methods.Def<MR,N>,R> func)
      A syntactic workaround for static method chaining
      Type Parameters:
      R - the return type of func
      Parameters:
      func - the static method reference
      Returns:
      the return value from func
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • em

      public Emitter<Emitter.Bot> em()
      Returns the value of the em record component.
      Returns:
      the value of the em record component
    • params

      public List<Methods.MthParam<?>> params()
      Returns the value of the params record component.
      Returns:
      the value of the params record component