Packages

final class FunctionBuilder extends AnyRef

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FunctionBuilder
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new FunctionBuilder(moduleBuilder: ModuleBuilder, functionID: FunctionID, functionOriginalName: OriginalName, functionPos: Position)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def ++=(instrs: Iterable[Instr]): Unit
  4. def +=(instr: Instr): Unit
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. def addLocal(name: String, tpe: Type): LocalID
  7. def addLocal(originalName: OriginalName, tpe: Type): LocalID
  8. def addParam(name: String, tpe: Type): LocalID

    Adds one parameter to the function with the given orignal name and type.

    Adds one parameter to the function with the given orignal name and type.

    Returns the LocalID of the new parameter.

    Note

    This follows a builder pattern to easily and safely correlate the definition of a parameter and extracting its LocalID.

  9. def addParam(originalName: OriginalName, tpe: Type): LocalID

    Adds one parameter to the function with the given orignal name and type.

    Adds one parameter to the function with the given orignal name and type.

    Returns the LocalID of the new parameter.

    Note

    This follows a builder pattern to easily and safely correlate the definition of a parameter and extracting its LocalID.

  10. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  11. def block[BT, A](blockType: BT = Nil)(body: (LabelID) ⇒ A)(implicit arg0: BlockTypeLike[BT]): A
  12. def buildAndAddToModule(): Function
  13. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  14. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  16. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. val functionID: FunctionID
  18. val functionOriginalName: OriginalName
  19. def genLabel(): LabelID
  20. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  22. def ifThen[BT](blockType: BT = Nil)(thenp: ⇒ Unit)(implicit arg0: BlockTypeLike[BT]): Unit
  23. def ifThenElse[BT](blockType: BT = Nil)(thenp: ⇒ Unit)(elsep: ⇒ Unit)(implicit arg0: BlockTypeLike[BT]): Unit
  24. def insert(index: InstructionIndex, instr: Instr): Unit
  25. def insertAll(index: InstructionIndex, instrs: List[Instr]): Unit
  26. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  27. def loop[BT, A](blockType: BT = Nil)(body: (LabelID) ⇒ A)(implicit arg0: BlockTypeLike[BT]): A
  28. def markCurrentInstructionIndex(): InstructionIndex
  29. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  30. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  31. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  32. def setFunctionType(typeID: TypeID): Unit

    Specifies the function type to use for the function.

    Specifies the function type to use for the function.

    If this method is not called, a default function type will be automatically generated. Generated function types are always alone in a recursive type group, without supertype, and final.

    Use setFunctionType if the function must conform to a specific function type, such as one that is defined within a recursive type group, or that is a subtype of other function types.

    The given function type must be consistent with the params created with addParam and with the result types specified by setResultType(s). Using setFunctionType does not implicitly set any result type or create any parameter (it cannot, since it cannot *resolve* the typeID to a FunctionType).

  33. def setResultType(tpe: Type): Unit

    Sets the list of result types to a single type.

    Sets the list of result types to a single type.

    This method is equivalent to

    setResultTypes(tpe :: Nil)
    Note

    This follows a builder pattern to be consistent with addParam.

  34. def setResultTypes(tpes: List[Type]): Unit

    Sets the list of result types of the function to build.

    Sets the list of result types of the function to build.

    By default, the list of result types is Nil.

    Note

    This follows a builder pattern to be consistent with addParam.

  35. def sigToBlockType(sig: FunctionType): BlockType
  36. def switch()(scrutinee: () ⇒ Unit)(clauses: (List[Int], () ⇒ Unit)*)(default: () ⇒ Unit): Unit
  37. def switch(resultType: Type)(scrutinee: () ⇒ Unit)(clauses: (List[Int], () ⇒ Unit)*)(default: () ⇒ Unit): Unit
  38. def switch(clauseSig: FunctionType)(scrutinee: () ⇒ Unit)(clauses: (List[Int], () ⇒ Unit)*)(default: () ⇒ Unit): Unit
  39. def switch(scrutineeSig: FunctionType, clauseSig: FunctionType)(scrutinee: () ⇒ Unit)(clauses: (List[Int], () ⇒ Unit)*)(default: () ⇒ Unit): Unit

    Builds a switch over a scrutinee using a br_table instruction.

    Builds a switch over a scrutinee using a br_table instruction.

    This function produces code that encodes the following control-flow:

    switch (scrutinee) {
      case clause0_alt0 | ... | clause0_altN => clause0_body
      ...
      case clauseM_alt0 | ... | clauseM_altN => clauseM_body
      case _ => default
    }

    All the alternative values must be non-negative and distinct, but they need not be consecutive. The highest one must be strictly smaller than 128, as a safety precaution against generating unexpectedly large tables.

    scrutineeSig

    The signature of the scrutinee block, *excluding* the i32 result that will be switched over.

    clauseSig

    The signature of every clauseI_body block and of the default block. The clauses' params must consume at least all the results of the scrutinee.

  40. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  41. def toString(): String
    Definition Classes
    AnyRef → Any
  42. def tryTable[BT, A](blockType: BT = Nil)(clauses: List[CatchClause])(body: ⇒ A)(implicit arg0: BlockTypeLike[BT]): A
  43. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  46. def whileLoop()(cond: ⇒ Unit)(body: ⇒ Unit): Unit

Inherited from AnyRef

Inherited from Any

Ungrouped