Commit ca266e74 authored by jarin's avatar jarin Committed by Commit bot

[arm] Make CEntryStub's handling of triple return values more robust.

At the moment the code assumes C-function returns the address of the
struct with the values. Unfortunately, the arm ABI does not guarantee that.
After this CL, we do not assume that, and instead just take the value from the stack.

BUG=chromium:611885
LOG=n

Review-Url: https://codereview.chromium.org/2000713002
Cr-Commit-Position: refs/heads/master@{#36415}
parent ee4ce544
...@@ -1055,9 +1055,9 @@ void CEntryStub::Generate(MacroAssembler* masm) { ...@@ -1055,9 +1055,9 @@ void CEntryStub::Generate(MacroAssembler* masm) {
if (result_size() > 2) { if (result_size() > 2) {
DCHECK_EQ(3, result_size()); DCHECK_EQ(3, result_size());
// Read result values stored on stack. // Read result values stored on stack.
__ ldr(r2, MemOperand(r0, 2 * kPointerSize)); __ ldr(r2, MemOperand(sp, 2 * kPointerSize));
__ ldr(r1, MemOperand(r0, 1 * kPointerSize)); __ ldr(r1, MemOperand(sp, 1 * kPointerSize));
__ ldr(r0, MemOperand(r0, 0 * kPointerSize)); __ ldr(r0, MemOperand(sp, 0 * kPointerSize));
} }
// Result returned in r0, r1:r0 or r2:r1:r0 - do not destroy these registers! // Result returned in r0, r1:r0 or r2:r1:r0 - do not destroy these registers!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment