Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for x86_64 #74

Merged
merged 1 commit into from
Sep 29, 2018
Merged

Support for x86_64 #74

merged 1 commit into from
Sep 29, 2018

Conversation

paulo-raca
Copy link
Contributor

The code follows the same structure of x86, but it doesn't work. Any ideas?

This is a follow-up for #69

@rk700
Copy link
Member

rk700 commented Sep 26, 2018

As for x86_64, the first 6 arguments are passed in registers RDI, RSI, RDX, RCX, R8, R9. So I think rdi should be used instead of rax.

@rk700
Copy link
Member

rk700 commented Sep 26, 2018

http://androidxref.com/7.0.0_r1/xref/art/runtime/arch/x86_64/quick_entrypoints_x86_64.S#455:

    /*
     * Quick invocation stub.
     * On entry:
     *   [sp] = return address
     *   rdi = method pointer
     *   rsi = argument array that must at least contain the this pointer.
     *   rdx = size of argument array in bytes
     *   rcx = (managed) thread pointer
     *   r8 = JValue* result
     *   r9 = char* shorty
     */

The code follows the same structure of x86.

The only tricky detail is that the method pointer must be in `rdi`, as specified on http://androidxref.com/7.0.0_r1/xref/art/runtime/arch/x86_64/quick_entrypoints_x86_64.S#455.
@paulo-raca
Copy link
Contributor Author

That worked!
Thanks, I wouldn't have figured that out.

@paulo-raca paulo-raca changed the title WIP: Support for x86_64 Support for x86_64 Sep 26, 2018
@paulo-raca
Copy link
Contributor Author

A quick update on the tests:

x86_64 doesn't work on API versions 21, 22, 23 and 27.
x86 doesn't work on API 27.

I'm guessing 21-23 might be caused by #61
Any ideas about the issue on Android 27? Does it affect ARM device too? (I don't have any ARM device with 7.1 here)

@rk700
Copy link
Member

rk700 commented Sep 28, 2018

It's weird on API 27 since my previous demo works but the unit test fails. The debugger shows it crashes when updating the cached method. Needs to take a deeper look at it.

@rk700 rk700 merged commit 7399d86 into PAGalaxyLab:master Sep 29, 2018
@rk700
Copy link
Member

rk700 commented Sep 29, 2018

I think maybe we could create a new issue to track the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants