final class FunctionBuilder extends AnyRef
- Alphabetic
- By Inheritance
- FunctionBuilder
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new FunctionBuilder(moduleBuilder: ModuleBuilder, functionID: FunctionID, functionOriginalName: OriginalName, functionPos: Position)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
- def ++=(instrs: Iterable[Instr]): Unit
- def +=(instr: Instr): Unit
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def addLocal(name: String, tpe: Type): LocalID
- def addLocal(originalName: OriginalName, tpe: Type): LocalID
-
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
.
-
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
.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- def block[BT, A](blockType: BT = Nil)(body: (LabelID) ⇒ A)(implicit arg0: BlockTypeLike[BT]): A
- def buildAndAddToModule(): Function
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- val functionID: FunctionID
- val functionOriginalName: OriginalName
- def genLabel(): LabelID
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def ifThen[BT](blockType: BT = Nil)(thenp: ⇒ Unit)(implicit arg0: BlockTypeLike[BT]): Unit
- def ifThenElse[BT](blockType: BT = Nil)(thenp: ⇒ Unit)(elsep: ⇒ Unit)(implicit arg0: BlockTypeLike[BT]): Unit
- def insert(index: InstructionIndex, instr: Instr): Unit
- def insertAll(index: InstructionIndex, instrs: List[Instr]): Unit
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def loop[BT, A](blockType: BT = Nil)(body: (LabelID) ⇒ A)(implicit arg0: BlockTypeLike[BT]): A
- def markCurrentInstructionIndex(): InstructionIndex
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
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 bysetResultType(s)
. UsingsetFunctionType
does not implicitly set any result type or create any parameter (it cannot, since it cannot *resolve* thetypeID
to aFunctionType
). -
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
.
-
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
.
- def sigToBlockType(sig: FunctionType): BlockType
- def switch()(scrutinee: () ⇒ Unit)(clauses: (List[Int], () ⇒ Unit)*)(default: () ⇒ Unit): Unit
- def switch(resultType: Type)(scrutinee: () ⇒ Unit)(clauses: (List[Int], () ⇒ Unit)*)(default: () ⇒ Unit): Unit
- def switch(clauseSig: FunctionType)(scrutinee: () ⇒ Unit)(clauses: (List[Int], () ⇒ Unit)*)(default: () ⇒ Unit): Unit
-
def
switch(scrutineeSig: FunctionType, clauseSig: FunctionType)(scrutinee: () ⇒ Unit)(clauses: (List[Int], () ⇒ Unit)*)(default: () ⇒ Unit): Unit
Builds a
switch
over a scrutinee using abr_table
instruction.Builds a
switch
over a scrutinee using abr_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 thedefault
block. The clauses' params must consume at least all the results of the scrutinee.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
- def tryTable[BT, A](blockType: BT = Nil)(clauses: List[CatchClause])(body: ⇒ A)(implicit arg0: BlockTypeLike[BT]): A
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- def whileLoop()(cond: ⇒ Unit)(body: ⇒ Unit): Unit