Class ReplacementForArray
java.lang.Object
de.inetsoftware.jwebassembly.module.nativecode.ReplacementForArray
Replacement for java.lang.reflect.Array
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static intarray_getLength(Object obj) Replacement of the native Java methods Array.getLength(x)private static Objectarray_newInstance(ReplacementForClass<?> componentClass, int length) Replacement of the native Java methods Array.newInstance(c,l)private static intgetIntFromMemory(int pos) WASM codeprivate static intget the vtable value
-
Constructor Details
-
ReplacementForArray
public ReplacementForArray()
-
-
Method Details
-
getVTable
get the vtable value- Parameters:
obj- the instance- Returns:
- the vtable value
-
getIntFromMemory
private static int getIntFromMemory(int pos) WASM codeLoad 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
Replacement of the native Java methods Array.getLength(x)- Parameters:
obj- the object- Returns:
- the length of the object
-
array_newInstance
Replacement of the native Java methods Array.newInstance(c,l)- Parameters:
obj- the object- Returns:
- the length of the object
-