Class ReplacementForArray

java.lang.Object
de.inetsoftware.jwebassembly.module.nativecode.ReplacementForArray

public class ReplacementForArray extends Object
Replacement for java.lang.reflect.Array
  • Constructor Details

    • ReplacementForArray

      public ReplacementForArray()
  • Method Details

    • getVTable

      private static int getVTable(Object obj)
      get the vtable value
      Parameters:
      obj - the instance
      Returns:
      the vtable value
    • getIntFromMemory

      private static int getIntFromMemory(int pos)
      WASM code

      Load an i32 from memory. The offset must be aligned. Should be inlined from the optimizer.

      Parameters:
      pos - the memory position
      Returns:
      the value from the memory
    • array_getLength

      private static int array_getLength(Object obj)
      Replacement of the native Java methods Array.getLength(x)
      Parameters:
      obj - the object
      Returns:
      the length of the object
    • array_newInstance

      private static Object array_newInstance(ReplacementForClass<?> componentClass, int length)
      Replacement of the native Java methods Array.newInstance(c,l)
      Parameters:
      obj - the object
      Returns:
      the length of the object