| 616 | } |
| 617 | |
| 618 | unsigned invokeNative(Thread* t, GcMethod* method) |
| 619 | { |
| 620 | PROTECT(t, method); |
| 621 | |
| 622 | resolveNative(t, method); |
| 623 | |
| 624 | GcNative* native = getMethodRuntimeData(t, method)->native(); |
| 625 | if (native->fast()) { |
| 626 | pushFrame(t, method); |
| 627 | |
| 628 | uint64_t result; |
| 629 | { |
| 630 | THREAD_RESOURCE0(t, popFrame(static_cast<Thread*>(t))); |
| 631 | |
| 632 | unsigned footprint = method->parameterFootprint(); |
| 633 | THREAD_RUNTIME_ARRAY(t, uintptr_t, args, footprint); |
| 634 | unsigned sp = frameBase(t, t->frame); |
| 635 | unsigned argOffset = 0; |
| 636 | if ((method->flags() & ACC_STATIC) == 0) { |
| 637 | RUNTIME_ARRAY_BODY(args)[argOffset++] |
| 638 | = reinterpret_cast<uintptr_t>(peekObject(t, sp++)); |
| 639 | } |
| 640 | |
| 641 | marshalArguments( |
| 642 | t, RUNTIME_ARRAY_BODY(args) + argOffset, 0, sp, method, true); |
| 643 | |
| 644 | if(method->returnCode() != VoidField) { |
| 645 | result = reinterpret_cast<FastNativeFunction>(native->function())( |
| 646 | t, method, RUNTIME_ARRAY_BODY(args)); |
| 647 | } |
| 648 | else { |
| 649 | result = 0; |
| 650 | reinterpret_cast<FastVoidNativeFunction>(native->function())( |
| 651 | t, method, RUNTIME_ARRAY_BODY(args)); |
| 652 | } |
| 653 | } |
| 654 | |
| 655 | pushResult(t, method->returnCode(), result, false); |
| 656 | |
| 657 | return method->returnCode(); |
| 658 | } else { |
| 659 | return invokeNativeSlow(t, method, native->function()); |
| 660 | } |
| 661 | } |
| 662 | |
| 663 | inline void store(Thread* t, unsigned index) |
| 664 | { |
no test coverage detected