[Webkit-unassigned] [Bug 116306] New: MacroAssemblerARM should use xor to swap registers instead of move
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri May 17 05:04:09 PDT 2013
https://bugs.webkit.org/show_bug.cgi?id=116306
Summary: MacroAssemblerARM should use xor to swap registers
instead of move
Product: WebKit
Version: 528+ (Nightly build)
Platform: Unspecified
OS/Version: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: JavaScriptCore
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: rgabor at webkit.org
CC: zherczeg at webkit.org, fpizlo at apple.com
On ARM Traditional and Thumb2 we are using a temporary register to swap two register value.
ARM Traditional using the r3 register for that purpose.
MacroAssemblerARM.h:540
void swap(RegisterID reg1, RegisterID reg2)
{
move(reg1, ARMRegisters::S0);
move(reg2, reg1);
move(ARMRegisters::S0, reg2);
}
That causing a problem because there is a case when we set up the function parameters in DFGCCallHelpers.h we put the third parameter to r3 then in setupTwoStubArgs() we swap r1 and r2 using r3 as temporary register.
DFGCCallHelpers.h:460
if (arg1 != GPRInfo::argumentGPR3 && arg2 != GPRInfo::argumentGPR3) {
move(arg3, GPRInfo::argumentGPR3);
setupTwoStubArgs<GPRInfo::argumentGPR1, GPRInfo::argumentGPR2>(arg1, arg2);
return;
}
This generates the following code which is not correct:
=> 0x40022a3c: mov r3, r4
=> 0x40022a40: mov r3, r1
=> 0x40022a44: mov r1, r2
=> 0x40022a48: mov r2, r3
ARM Thumb2 is using the r12 register so this bug doesn't affect it.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list