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

Occur argument passing error in interpreter mode in AArch64 Linux #5037

Closed
Funkwai opened this issue Apr 24, 2018 · 2 comments
Closed

Occur argument passing error in interpreter mode in AArch64 Linux #5037

Funkwai opened this issue Apr 24, 2018 · 2 comments

Comments

@Funkwai
Copy link

Funkwai commented Apr 24, 2018

I modified some code to be able to compile and execute ChaKraCore in AArch64 Linux.
Currently, I run the following simple code in interpreter mode, but occur argument passing error when calling into function test(num)

function test(num) {
return num;
}
var sum = 1;
for (var step = 0; step < 500000; step++) {
sum += test(step);
}

In this case, because of the parameter number is less than 6, thus just passing them by register in arm64_CallFunction()
// ARM64 calling convention is:
// x0 parameter 1 = function
// x1 parameter 2 = info
// x2 values[0]
// x3 values[1]

but entryPoint function as InterpreterStackFrame::InterpreterThunk(), use MACRO ARGUMENTS to get the arguments but expect the parameters are located in the stack.
// At entry of JavascriptMethod the stack layout is:
// [Return Address] [function] [callInfo] [arg0] [arg1] ...
Js::Var* va = _get_va(_AddressOfReturnAddress(), n);

my question is whether the parameters should be stored in the stack before enter the entrypoint?

@obastemur
Copy link
Collaborator

Please take a look at the #4452

@Funkwai
Copy link
Author

Funkwai commented May 16, 2018

Thanks @obastemur , my question is solved.

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

No branches or pull requests

4 participants