mirror of
https://github.com/corda/corda.git
synced 2025-01-23 04:48:09 +00:00
interpret.invokeNative(): call native function with a right signature
This commit is contained in:
parent
331c635814
commit
b7abaf7a78
@ -1441,6 +1441,7 @@ Classpath* makeClasspath(System* system,
|
|||||||
const char* embedPrefix);
|
const char* embedPrefix);
|
||||||
|
|
||||||
typedef uint64_t(JNICALL* FastNativeFunction)(Thread*, GcMethod*, uintptr_t*);
|
typedef uint64_t(JNICALL* FastNativeFunction)(Thread*, GcMethod*, uintptr_t*);
|
||||||
|
typedef void(JNICALL* FastVoidNativeFunction)(Thread*, GcMethod*, uintptr_t*);
|
||||||
|
|
||||||
inline GcClass* objectClass(Thread*, object o)
|
inline GcClass* objectClass(Thread*, object o)
|
||||||
{
|
{
|
||||||
|
@ -641,8 +641,15 @@ unsigned invokeNative(Thread* t, GcMethod* method)
|
|||||||
marshalArguments(
|
marshalArguments(
|
||||||
t, RUNTIME_ARRAY_BODY(args) + argOffset, 0, sp, method, true);
|
t, RUNTIME_ARRAY_BODY(args) + argOffset, 0, sp, method, true);
|
||||||
|
|
||||||
result = reinterpret_cast<FastNativeFunction>(native->function())(
|
if(method->returnCode() != VoidField) {
|
||||||
|
result = reinterpret_cast<FastNativeFunction>(native->function())(
|
||||||
t, method, RUNTIME_ARRAY_BODY(args));
|
t, method, RUNTIME_ARRAY_BODY(args));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
result = 0;
|
||||||
|
reinterpret_cast<FastVoidNativeFunction>(native->function())(
|
||||||
|
t, method, RUNTIME_ARRAY_BODY(args));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pushResult(t, method->returnCode(), result, false);
|
pushResult(t, method->returnCode(), result, false);
|
||||||
|
Loading…
Reference in New Issue
Block a user