Class ExportableFunction
- java.lang.Object
-
- de.mirkosertic.bytecoder.core.backend.wasm.ast.Container
-
- de.mirkosertic.bytecoder.core.backend.wasm.ast.Function
-
- de.mirkosertic.bytecoder.core.backend.wasm.ast.ExportableFunction
-
- All Implemented Interfaces:
Callable
,Exportable
,Importable
public class ExportableFunction extends Function implements Exportable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
ExportableFunction.DefaultExportContext
-
Field Summary
Fields Modifier and Type Field Description private LocalIndex
localIndex
-
Constructor Summary
Constructors Constructor Description ExportableFunction(Module aModule, FunctionType functionType, java.lang.String label)
ExportableFunction(Module aModule, FunctionType functionType, java.lang.String label, WasmType result)
ExportableFunction(Module aModule, FunctionType functionType, java.lang.String label, java.util.List<Param> params)
ExportableFunction(Module aModule, FunctionType functionType, java.lang.String label, java.util.List<Param> params, WasmType result)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
exportAs(java.lang.String functionName)
Local
localByLabel(java.lang.String label)
LocalIndex
localIndex()
Local
newLocal(java.lang.String label, WasmType type)
ExportableFunction
toTable()
void
writeCodeTo(BinaryWriter.Writer sectionWriter, FunctionIndex functionIndex)
void
writeRefTo(TextWriter textWriter)
void
writeTo(TextWriter textWriter, Module aModule)
-
Methods inherited from class de.mirkosertic.bytecoder.core.backend.wasm.ast.Function
getFunctionType, getLabel, getModule, getParams, getResultType, resolveIndex, resolveResultType
-
Methods inherited from class de.mirkosertic.bytecoder.core.backend.wasm.ast.Container
addChild, end, findByLabelInHierarchy, getChildren, hasChildren, parent, relativeDepthTo, relativeDepthTo
-
-
-
-
Field Detail
-
localIndex
private final LocalIndex localIndex
-
-
Constructor Detail
-
ExportableFunction
ExportableFunction(Module aModule, FunctionType functionType, java.lang.String label, java.util.List<Param> params, WasmType result)
-
ExportableFunction
ExportableFunction(Module aModule, FunctionType functionType, java.lang.String label, java.util.List<Param> params)
-
ExportableFunction
ExportableFunction(Module aModule, FunctionType functionType, java.lang.String label, WasmType result)
-
ExportableFunction
ExportableFunction(Module aModule, FunctionType functionType, java.lang.String label)
-
-
Method Detail
-
exportAs
public void exportAs(java.lang.String functionName)
-
localByLabel
public Local localByLabel(java.lang.String label)
-
localIndex
public LocalIndex localIndex()
-
writeTo
public void writeTo(TextWriter textWriter, Module aModule) throws java.io.IOException
- Specified by:
writeTo
in interfaceImportable
- Overrides:
writeTo
in classFunction
- Throws:
java.io.IOException
-
writeRefTo
public void writeRefTo(TextWriter textWriter)
- Specified by:
writeRefTo
in interfaceExportable
-
writeCodeTo
public void writeCodeTo(BinaryWriter.Writer sectionWriter, FunctionIndex functionIndex) throws java.io.IOException
- Throws:
java.io.IOException
-
toTable
public ExportableFunction toTable()
-
-