Class TableConvention.Delegating
- All Implemented Interfaces:
ConstructorCallback,ExportableConvention,TableConvention,ExtContainer
- Enclosing interface:
- TableConvention
TableConvention which delegates all calls to another.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.eutro.wasm2j.core.conf.itf.ConstructorCallback
ConstructorCallback.AbstractNested classes/interfaces inherited from interface io.github.eutro.wasm2j.core.conf.itf.TableConvention
TableConvention.Delegating -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final TableConventionThe convention calls will be delegated to. -
Constructor Summary
ConstructorsConstructorDescriptionDelegating(TableConvention delegate) Construct a newTableConvention.Delegatingwith the given delegate. -
Method Summary
Modifier and TypeMethodDescriptionvoidemitTableCopy(IRBuilder ib, Effect effect, TableConvention dst) Emit code for a WebAssemblytable.copyinstruction.voidemitTableFill(IRBuilder ib, Effect effect) Emit code for a WebAssemblytable.fillinstruction.voidemitTableGrow(IRBuilder ib, Effect effect) Emit code for a WebAssemblytable.growinstruction.voidemitTableInit(IRBuilder ib, Effect effect, Var data) Emit code for a WebAssemblytable.initinstruction.voidemitTableRef(IRBuilder ib, Effect effect) Emit code for a WebAssemblytable.getinstruction.voidemitTableSize(IRBuilder ib, Effect effect) Emit code for a WebAssemblytable.sizeinstruction.voidemitTableStore(IRBuilder ib, Effect effect) Emit code for a WebAssemblytable.setinstruction.voidmodifyConstructor(IRBuilder ib, JClass.JavaMethod ctorMethod, Module module, JClass jClass) Modify the constructor in any way.Methods inherited from class io.github.eutro.wasm2j.core.conf.impl.DelegatingExporter
export, getDelegateMethods inherited from class io.github.eutro.wasm2j.core.ext.DelegatingExtHolder
getNullableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.eutro.wasm2j.core.conf.itf.ExportableConvention
exportMethods inherited from interface io.github.eutro.wasm2j.core.ext.ExtContainer
attachExt, getExt, getExtOrRun, getExtOrThrow, getNullable, removeExtMethods inherited from interface io.github.eutro.wasm2j.core.conf.itf.TableConvention
emitBoundsCheck
-
Field Details
-
delegate
The convention calls will be delegated to.
-
-
Constructor Details
-
Delegating
Construct a newTableConvention.Delegatingwith the given delegate.- Parameters:
delegate- The delegate.
-
-
Method Details
-
emitTableRef
Description copied from interface:TableConventionEmit code for a WebAssemblytable.getinstruction.The effect will have an instruction of type
WasmOps.TABLE_REF,
with one argument: the index in the table;
it will assign to one variable: the retrieved table element.- Specified by:
emitTableRefin interfaceTableConvention- Parameters:
ib- The instruction builder.effect- The effect.
-
emitTableStore
Description copied from interface:TableConventionEmit code for a WebAssemblytable.setinstruction.The effect will have an instruction of type
WasmOps.TABLE_STORE,
with two arguments: the index in the table, the element to set it to;
it will assign to no variables.- Specified by:
emitTableStorein interfaceTableConvention- Parameters:
ib- The instruction builder.effect- The effect.
-
emitTableSize
Description copied from interface:TableConventionEmit code for a WebAssemblytable.sizeinstruction.The effect will have an instruction of type
WasmOps.TABLE_SIZE,
with no arguments;
it will assign to one variable: the retrieved table size.- Specified by:
emitTableSizein interfaceTableConvention- Parameters:
ib- The instruction builder.effect- The effect.
-
emitTableGrow
Description copied from interface:TableConventionEmit code for a WebAssemblytable.growinstruction.The effect will have an instruction of type
WasmOps.TABLE_GROW,
with two arguments: the number of elements to grow by, the element to fill with;
it will assign to one variable: the previous size, or-1if resizing failed.The default implementation returns
-1and ignores the arguments.- Specified by:
emitTableGrowin interfaceTableConvention- Parameters:
ib- The instruction builder.effect- The effect.
-
emitTableInit
Description copied from interface:TableConventionEmit code for a WebAssemblytable.initinstruction.The effect will have an instruction of type
WasmOps.TABLE_INIT,
with three arguments: the table index to start at, the elem index to start at, the number of elements to copy;
it will assign to no variables.- Specified by:
emitTableInitin interfaceTableConvention- Parameters:
ib- The instruction builder.effect- The effect.data- The array containing the data.
-
emitTableCopy
Description copied from interface:TableConventionEmit code for a WebAssemblytable.copyinstruction.The effect will have an instruction of type
WasmOps.TABLE_COPY,
with three arguments: the destination index to start at, the source index to start at, the number of elements to copy;
it will assign to no variables.Implementations are encouraged to override the default implementation when they can more efficiently copy within themselves, or to other instances of the same or similar table conventions.
For example, an array-based implementation would prefer to use
System.arraycopy(Object, int, Object, int, int), as it is more efficient, and smaller, than the default implementation.Exts should be used to find whether implementations are suitably compatible, as they may be obscured bydelegatingimplementations.- Specified by:
emitTableCopyin interfaceTableConvention- Parameters:
ib- The instruction builder.effect- The effect.dst- The destination table.
-
emitTableFill
Description copied from interface:TableConventionEmit code for a WebAssemblytable.fillinstruction.The effect will have an instruction of type
WasmOps.TABLE_FILL,
with three arguments: the destination index to start at, the element to fill with, the number of elements to fill;
it will assign to no variables.- Specified by:
emitTableFillin interfaceTableConvention- Parameters:
ib- The instruction builder.effect- The effect.
-
modifyConstructor
public void modifyConstructor(IRBuilder ib, JClass.JavaMethod ctorMethod, Module module, JClass jClass) Description copied from interface:ConstructorCallbackModify the constructor in any way.- Specified by:
modifyConstructorin interfaceConstructorCallback- Parameters:
ib- The instruction builder.ctorMethod- The Java method which is the constructor.module- The WebAssembly module being compiled.jClass- The Java class being compiled into.
-