| 7325 | } |
| 7326 | |
| 7327 | uint64_t invokeNative(MyThread* t) |
| 7328 | { |
| 7329 | if (t->trace->nativeMethod == 0) { |
| 7330 | void* ip; |
| 7331 | if (t->tailAddress) { |
| 7332 | ip = t->tailAddress; |
| 7333 | t->tailAddress = 0; |
| 7334 | } else { |
| 7335 | ip = getIp(t); |
| 7336 | } |
| 7337 | |
| 7338 | GcCallNode* node = findCallNode(t, ip); |
| 7339 | GcMethod* target = node->target(); |
| 7340 | if (node->flags() & TraceElement::VirtualCall) { |
| 7341 | target = resolveTarget(t, t->stack, target); |
| 7342 | } |
| 7343 | t->trace->nativeMethod = target; |
| 7344 | } |
| 7345 | |
| 7346 | assertT(t, t->tailAddress == 0); |
| 7347 | |
| 7348 | uint64_t result = 0; |
| 7349 | |
| 7350 | t->trace->targetMethod = t->trace->nativeMethod; |
| 7351 | |
| 7352 | t->m->classpath->resolveNative(t, t->trace->nativeMethod); |
| 7353 | |
| 7354 | result = invokeNative2(t, t->trace->nativeMethod); |
| 7355 | |
| 7356 | unsigned parameterFootprint = t->trace->targetMethod->parameterFootprint(); |
| 7357 | |
| 7358 | uintptr_t* stack = static_cast<uintptr_t*>(t->stack); |
| 7359 | |
| 7360 | if (avian::codegen::TailCalls |
| 7361 | and t->arch->argumentFootprint(parameterFootprint) |
| 7362 | > t->arch->stackAlignmentInWords()) { |
| 7363 | stack += t->arch->argumentFootprint(parameterFootprint) |
| 7364 | - t->arch->stackAlignmentInWords(); |
| 7365 | } |
| 7366 | |
| 7367 | stack += t->arch->frameReturnAddressSize(); |
| 7368 | |
| 7369 | t->trace->targetMethod = 0; |
| 7370 | t->trace->nativeMethod = 0; |
| 7371 | |
| 7372 | t->newStack = stack; |
| 7373 | |
| 7374 | return result; |
| 7375 | } |
| 7376 | |
| 7377 | void findFrameMapInSimpleTable(MyThread* t, |
| 7378 | GcMethod* method, |
nothing calls this directly
no test coverage detected