Class TableConvention.Delegating

All Implemented Interfaces:
ConstructorCallback, ExportableConvention, TableConvention, ExtContainer
Enclosing interface:
TableConvention

public static class TableConvention.Delegating extends DelegatingExporter implements TableConvention
A TableConvention which delegates all calls to another.
  • Field Details

    • delegate

      protected final TableConvention delegate
      The convention calls will be delegated to.
  • Constructor Details

  • Method Details

    • emitTableRef

      public void emitTableRef(IRBuilder ib, Effect effect)
      Description copied from interface: TableConvention
      Emit code for a WebAssembly table.get instruction.

      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:
      emitTableRef in interface TableConvention
      Parameters:
      ib - The instruction builder.
      effect - The effect.
    • emitTableStore

      public void emitTableStore(IRBuilder ib, Effect effect)
      Description copied from interface: TableConvention
      Emit code for a WebAssembly table.set instruction.

      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:
      emitTableStore in interface TableConvention
      Parameters:
      ib - The instruction builder.
      effect - The effect.
    • emitTableSize

      public void emitTableSize(IRBuilder ib, Effect effect)
      Description copied from interface: TableConvention
      Emit code for a WebAssembly table.size instruction.

      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:
      emitTableSize in interface TableConvention
      Parameters:
      ib - The instruction builder.
      effect - The effect.
    • emitTableGrow

      public void emitTableGrow(IRBuilder ib, Effect effect)
      Description copied from interface: TableConvention
      Emit code for a WebAssembly table.grow instruction.

      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 -1 if resizing failed.

      The default implementation returns -1 and ignores the arguments.

      Specified by:
      emitTableGrow in interface TableConvention
      Parameters:
      ib - The instruction builder.
      effect - The effect.
    • emitTableInit

      public void emitTableInit(IRBuilder ib, Effect effect, Var data)
      Description copied from interface: TableConvention
      Emit code for a WebAssembly table.init instruction.

      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:
      emitTableInit in interface TableConvention
      Parameters:
      ib - The instruction builder.
      effect - The effect.
      data - The array containing the data.
    • emitTableCopy

      public void emitTableCopy(IRBuilder ib, Effect effect, TableConvention dst)
      Description copied from interface: TableConvention
      Emit code for a WebAssembly table.copy instruction.

      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 by delegating implementations.

      Specified by:
      emitTableCopy in interface TableConvention
      Parameters:
      ib - The instruction builder.
      effect - The effect.
      dst - The destination table.
    • emitTableFill

      public void emitTableFill(IRBuilder ib, Effect effect)
      Description copied from interface: TableConvention
      Emit code for a WebAssembly table.fill instruction.

      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:
      emitTableFill in interface TableConvention
      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: ConstructorCallback
      Modify the constructor in any way.
      Specified by:
      modifyConstructor in interface ConstructorCallback
      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.