Class ReplacementForArray


  • public class ReplacementForArray
    extends java.lang.Object
    Replacement for java.lang.reflect.Array
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static int array_getLength​(java.lang.Object obj)
      Replacement of the native Java methods Array.getLength(x)
      private static java.lang.Object array_newInstance​(ReplacementForClass<?> componentClass, int length)
      Replacement of the native Java methods Array.newInstance(c,l)
      private static int getIntFromMemory​(int pos)
      WASM code
      private static int getVTable​(java.lang.Object obj)
      get the vtable value
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ReplacementForArray

        public ReplacementForArray()
    • Method Detail

      • getVTable

        private static int getVTable​(java.lang.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​(java.lang.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 java.lang.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