Entry point publishing in Truffle OptimizedCallTarget, on AArch64
Andrew Dinn
adinn at redhat.com
Wed Jun 14 16:09:04 UTC 2017
On 14/06/17 16:45, Andrew Dinn wrote:
> Hi Aleksander,
>
> On 14/06/17 13:09, Aleksandar Prokopec wrote:
>
>> Yes, pulling out the check in TruffleCompiler should enable this on
>> AArch64. To make it even easier, I added a change with a flag that turns
>> the new functionality on and off on AArch64 (should land on github in
>> half an hour or so).
>
> It built ok on AArch64 using the latest head -- n.b. that's minus the
> switch you mentioned.
>
>> On SPARC and x86, I was testing the fix with plain "mx unittest", and
>> this helped me detect correctness issues.
>
> Well, it's not entirely clear that this is ok on AArch64 because the
> unit tests do not run cleanly on the latest head (23 failures).
>
> However, I ran the unit tests with your disabling check in place and
> then with the check removed and I saw the same number of failures. So, I
> think your patch is ok.
Correction:
Looking at the details of the test failures it appears that many of them
are caused by an error that might be related to your code.
Many of the tests are manifesting exceptions under method
AArch64MacroAssembler.patchJumpTarget in a call to
ConditionFlag.fromEncoding. Here is the offending code:
int instruction = getInt(branch);
int branchOffset = jumpTarget - branch;
PatchLabelKind type = PatchLabelKind.fromEncoding(instruction);
switch (type) {
case BRANCH_CONDITIONALLY:
ConditionFlag cf =
ConditionFlag.fromEncoding(instruction >>>
PatchLabelKind.INFORMATION_OFFSET);
super.b(cf, branchOffset, branch);
break;
case BRANCH_UNCONDITIONALLY:
super.b(branchOffset, branch);
. . .
So, there is something in the format of a generated branch that the
assembler does not understand. If you are generating a TBZ that is
susceptible to patching -- even if it is not actually installed -- then
that might account for why I am seeing these specific unit test
failures. I'll take a deeper look to see if I can diagnose whether the
offending instruction is a TBZ and where it is being generated from.
regards,
Andrew Dinn
-----------
Senior Principal Software Engineer
Red Hat UK Ltd
Registered in England and Wales under Company Registration No. 03798903
Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander
More information about the graal-dev
mailing list