public final Object invokeObject(Function function, HeapInvocationBuffer buffer) { ObjectBuffer objectBuffer = buffer.objectBuffer(); return Foreign.invokeArrayWithObjectsReturnObject(function.contextAddress, function.functionAddress, buffer.array(), objectBuffer.objectCount(), objectBuffer.info(), objectBuffer.objects()); }
public final Object invokeObject(Function function, HeapInvocationBuffer buffer) { ObjectBuffer objectBuffer = buffer.objectBuffer(); return Foreign.invokeArrayWithObjectsReturnObject(function.contextAddress, function.functionAddress, buffer.array(), objectBuffer.objectCount(), objectBuffer.info(), objectBuffer.objects()); }
public final Object invokeObject(Function function, HeapInvocationBuffer buffer) { ObjectBuffer objectBuffer = buffer.objectBuffer(); return Foreign.invokeArrayWithObjectsReturnObject(function.contextAddress, function.functionAddress, buffer.array(), objectBuffer.objectCount(), objectBuffer.info(), objectBuffer.objects()); }
/** * Invokes a function and returns a 64 bit floating point value. * * @param ctx The call context describing how to call the native function. * @param function The address of the native function to invoke. * @param buffer A buffer containing the arguments to the function. * @return A native memory address. */ public final double invokeDouble(CallContext ctx, long function, HeapInvocationBuffer buffer) { ObjectBuffer objectBuffer = buffer.objectBuffer(); return objectBuffer != null ? Foreign.invokeArrayWithObjectsDouble(ctx.contextAddress, function, buffer.array(), objectBuffer.objectCount(), objectBuffer.info(), objectBuffer.objects()) : Foreign.invokeArrayReturnDouble(ctx.contextAddress, function, buffer.array()); }
/** * Invokes a function and returns a 64 bit floating point value. * * @param ctx The call context describing how to call the native function. * @param function The address of the native function to invoke. * @param buffer A buffer containing the arguments to the function. * @return A native memory address. */ public final double invokeDouble(CallContext ctx, long function, HeapInvocationBuffer buffer) { ObjectBuffer objectBuffer = buffer.objectBuffer(); return objectBuffer != null ? Foreign.invokeArrayWithObjectsDouble(ctx.contextAddress, function, buffer.array(), objectBuffer.objectCount(), objectBuffer.info(), objectBuffer.objects()) : Foreign.invokeArrayReturnDouble(ctx.contextAddress, function, buffer.array()); }
/** * Invokes a function and returns a 32 bit floating point value. * * @param ctx The call context which describes how to call the native function. * @param function The address of the native function to invoke. * @param buffer A buffer containing the arguments to the function. * @return A native memory address. */ public final float invokeFloat(CallContext ctx, long function, HeapInvocationBuffer buffer) { ObjectBuffer objectBuffer = buffer.objectBuffer(); return objectBuffer != null ? Foreign.invokeArrayWithObjectsFloat(ctx.contextAddress, function, buffer.array(), objectBuffer.objectCount(), objectBuffer.info(), objectBuffer.objects()) : Foreign.invokeArrayReturnFloat(ctx.contextAddress, function, buffer.array()); }
/** * Invokes a function and returns a 64 bit floating point value. * * @param ctx The call context describing how to call the native function. * @param function The address of the native function to invoke. * @param buffer A buffer containing the arguments to the function. * @return A native memory address. */ public final double invokeDouble(CallContext ctx, long function, HeapInvocationBuffer buffer) { ObjectBuffer objectBuffer = buffer.objectBuffer(); return objectBuffer != null ? Foreign.invokeArrayWithObjectsDouble(ctx.contextAddress, function, buffer.array(), objectBuffer.objectCount(), objectBuffer.info(), objectBuffer.objects()) : Foreign.invokeArrayReturnDouble(ctx.contextAddress, function, buffer.array()); }
/** * Invokes a function and returns a 32 bit floating point value. * * @param ctx The call context which describes how to call the native function. * @param function The address of the native function to invoke. * @param buffer A buffer containing the arguments to the function. * @return A native memory address. */ public final float invokeFloat(CallContext ctx, long function, HeapInvocationBuffer buffer) { ObjectBuffer objectBuffer = buffer.objectBuffer(); return objectBuffer != null ? Foreign.invokeArrayWithObjectsFloat(ctx.contextAddress, function, buffer.array(), objectBuffer.objectCount(), objectBuffer.info(), objectBuffer.objects()) : Foreign.invokeArrayReturnFloat(ctx.contextAddress, function, buffer.array()); }
/** * Invokes a function and returns a 32 bit floating point value. * * @param ctx The call context which describes how to call the native function. * @param function The address of the native function to invoke. * @param buffer A buffer containing the arguments to the function. * @return A native memory address. */ public final float invokeFloat(CallContext ctx, long function, HeapInvocationBuffer buffer) { ObjectBuffer objectBuffer = buffer.objectBuffer(); return objectBuffer != null ? Foreign.invokeArrayWithObjectsFloat(ctx.contextAddress, function, buffer.array(), objectBuffer.objectCount(), objectBuffer.info(), objectBuffer.objects()) : Foreign.invokeArrayReturnFloat(ctx.contextAddress, function, buffer.array()); }
/** * Invokes a function that returns a C struct by value. * * @param ctx The call context which describes how to call the native function. * @param function The address of the native function to invoke. * @param buffer The parameter buffer. * @param returnBuffer The output buffer to place the return value in. * @param offset The offset within returnBuffer to place the return value. */ public final void invokeStruct(CallContext ctx, long function, HeapInvocationBuffer buffer, byte[] returnBuffer, int offset) { ObjectBuffer objectBuffer = buffer.objectBuffer(); if (objectBuffer != null) { Foreign.invokeArrayWithObjectsReturnStruct(ctx.contextAddress, function, buffer.array(), objectBuffer.objectCount(), objectBuffer.info(), objectBuffer.objects(), returnBuffer, offset); } else { Foreign.invokeArrayReturnStruct(ctx.contextAddress, function, buffer.array(), returnBuffer, offset); } }
/** * Invokes a function that returns a C struct by value. * * @param ctx The call context which describes how to call the native function. * @param function The address of the native function to invoke. * @param buffer The parameter buffer. * @param returnBuffer The output buffer to place the return value in. * @param offset The offset within returnBuffer to place the return value. */ public final void invokeStruct(CallContext ctx, long function, HeapInvocationBuffer buffer, byte[] returnBuffer, int offset) { ObjectBuffer objectBuffer = buffer.objectBuffer(); if (objectBuffer != null) { Foreign.invokeArrayWithObjectsReturnStruct(ctx.contextAddress, function, buffer.array(), objectBuffer.objectCount(), objectBuffer.info(), objectBuffer.objects(), returnBuffer, offset); } else { Foreign.invokeArrayReturnStruct(ctx.contextAddress, function, buffer.array(), returnBuffer, offset); } }
/** * Invokes a function that returns a C struct by value. * * @param ctx The call context which describes how to call the native function. * @param function The address of the native function to invoke. * @param buffer The parameter buffer. * @param returnBuffer The output buffer to place the return value in. * @param offset The offset within returnBuffer to place the return value. */ public final void invokeStruct(CallContext ctx, long function, HeapInvocationBuffer buffer, byte[] returnBuffer, int offset) { ObjectBuffer objectBuffer = buffer.objectBuffer(); if (objectBuffer != null) { Foreign.invokeArrayWithObjectsReturnStruct(ctx.contextAddress, function, buffer.array(), objectBuffer.objectCount(), objectBuffer.info(), objectBuffer.objects(), returnBuffer, offset); } else { Foreign.invokeArrayReturnStruct(ctx.contextAddress, function, buffer.array(), returnBuffer, offset); } }
/** * Convenience method to pass the objects and object descriptor array down as * normal arguments, so hotspot can optimize it. This is faster than the native * code pulling the objects and descriptors out of arrays. * * @param function The native function to invoke. * @param buffer A buffer containing the arguments to the function. * @param objectBuffer A buffer containing objects to be passed to the native function. * @return A 32 bit integer value. */ private int invokeArrayWithObjectsInt32(long ctx, long function, HeapInvocationBuffer buffer, ObjectBuffer objectBuffer) { Object[] objects = objectBuffer.objects(); int[] info = objectBuffer.info(); int objectCount = objectBuffer.objectCount(); switch (objectCount) { case 1: return Foreign.invokeArrayO1Int32(ctx, function, buffer.array(), objects[0], info[0], info[1], info[2]); case 2: return Foreign.invokeArrayO2Int32(ctx, function, buffer.array(), objects[0], info[0], info[1], info[2], objects[1], info[3], info[4], info[5]); } return Foreign.invokeArrayWithObjectsInt32(ctx, function, buffer.array(), objectCount, info, objects); }
/** * Convenience method to pass the objects and object descriptor array down as * normal arguments, so hotspot can optimize it. This is faster than the native * code pulling the objects and descriptors out of arrays. * * @param function The native function to invoke. * @param buffer A buffer containing the arguments to the function. * @param objectBuffer A buffer containing objects to be passed to the native function. * @return A 64 bit integer value. */ private long invokeArrayWithObjectsInt64(long ctx, long function, HeapInvocationBuffer buffer, ObjectBuffer objectBuffer) { Object[] objects = objectBuffer.objects(); int[] info = objectBuffer.info(); int objectCount = objectBuffer.objectCount(); switch (objectCount) { case 1: return Foreign.invokeArrayO1Int64(ctx, function, buffer.array(), objects[0], info[0], info[1], info[2]); case 2: return Foreign.invokeArrayO2Int64(ctx, function, buffer.array(), objects[0], info[0], info[1], info[2], objects[1], info[3], info[4], info[5]); } return Foreign.invokeArrayWithObjectsInt64(ctx, function, buffer.array(), objectCount, info, objects); }
/** * Convenience method to pass the objects and object descriptor array down as * normal arguments, so hotspot can optimize it. This is faster than the native * code pulling the objects and descriptors out of arrays. * * @param function The native function to invoke. * @param buffer A buffer containing the arguments to the function. * @param objectBuffer A buffer containing objects to be passed to the native function. * @return A 32 bit integer value. */ private int invokeArrayWithObjectsInt32(long ctx, long function, HeapInvocationBuffer buffer, ObjectBuffer objectBuffer) { Object[] objects = objectBuffer.objects(); int[] info = objectBuffer.info(); int objectCount = objectBuffer.objectCount(); switch (objectCount) { case 1: return Foreign.invokeArrayO1Int32(ctx, function, buffer.array(), objects[0], info[0], info[1], info[2]); case 2: return Foreign.invokeArrayO2Int32(ctx, function, buffer.array(), objects[0], info[0], info[1], info[2], objects[1], info[3], info[4], info[5]); } return Foreign.invokeArrayWithObjectsInt32(ctx, function, buffer.array(), objectCount, info, objects); }
/** * Convenience method to pass the objects and object descriptor array down as * normal arguments, so hotspot can optimize it. This is faster than the native * code pulling the objects and descriptors out of arrays. * * @param function The native function to invoke. * @param buffer A buffer containing the arguments to the function. * @param objectBuffer A buffer containing objects to be passed to the native function. * @return A 64 bit integer value. */ private long invokeArrayWithObjectsInt64(long ctx, long function, HeapInvocationBuffer buffer, ObjectBuffer objectBuffer) { Object[] objects = objectBuffer.objects(); int[] info = objectBuffer.info(); int objectCount = objectBuffer.objectCount(); switch (objectCount) { case 1: return Foreign.invokeArrayO1Int64(ctx, function, buffer.array(), objects[0], info[0], info[1], info[2]); case 2: return Foreign.invokeArrayO2Int64(ctx, function, buffer.array(), objects[0], info[0], info[1], info[2], objects[1], info[3], info[4], info[5]); } return Foreign.invokeArrayWithObjectsInt64(ctx, function, buffer.array(), objectCount, info, objects); }
/** * Convenience method to pass the objects and object descriptor array down as * normal arguments, so hotspot can optimize it. This is faster than the native * code pulling the objects and descriptors out of arrays. * * @param function The native function to invoke. * @param buffer A buffer containing the arguments to the function. * @param objectBuffer A buffer containing objects to be passed to the native function. * @return A 64 bit integer value. */ private long invokeArrayWithObjectsInt64(long ctx, long function, HeapInvocationBuffer buffer, ObjectBuffer objectBuffer) { Object[] objects = objectBuffer.objects(); int[] info = objectBuffer.info(); int objectCount = objectBuffer.objectCount(); switch (objectCount) { case 1: return Foreign.invokeArrayO1Int64(ctx, function, buffer.array(), objects[0], info[0], info[1], info[2]); case 2: return Foreign.invokeArrayO2Int64(ctx, function, buffer.array(), objects[0], info[0], info[1], info[2], objects[1], info[3], info[4], info[5]); } return Foreign.invokeArrayWithObjectsInt64(ctx, function, buffer.array(), objectCount, info, objects); }
/** * Convenience method to pass the objects and object descriptor array down as * normal arguments, so hotspot can optimize it. This is faster than the native * code pulling the objects and descriptors out of arrays. * * @param function The native function to invoke. * @param buffer A buffer containing the arguments to the function. * @param objectBuffer A buffer containing objects to be passed to the native function. * @return A 32 bit integer value. */ private int invokeArrayWithObjectsInt32(long ctx, long function, HeapInvocationBuffer buffer, ObjectBuffer objectBuffer) { Object[] objects = objectBuffer.objects(); int[] info = objectBuffer.info(); int objectCount = objectBuffer.objectCount(); switch (objectCount) { case 1: return Foreign.invokeArrayO1Int32(ctx, function, buffer.array(), objects[0], info[0], info[1], info[2]); case 2: return Foreign.invokeArrayO2Int32(ctx, function, buffer.array(), objects[0], info[0], info[1], info[2], objects[1], info[3], info[4], info[5]); } return Foreign.invokeArrayWithObjectsInt32(ctx, function, buffer.array(), objectCount, info, objects); }