Closed Bug 805917 (BaselineX64) Opened 12 years ago Closed 12 years ago

BaselineCompiler: x86-64 support

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: djvj, Assigned: djvj)

References

Details

Attachments

(1 file)

Fix baseline compiler to build on X86-64.
Assignee: general → kvijayan
Depends on: 808045
Depends on: 808061
Attached patch Add x64 support.Splinter Review
Basic x64 support.  I'm guessing that you'll be checking in the patch to handle new ops before this patch gets checked in, so I'll probably go back and update the patch to support the new ops before committing, but that should be pretty straightforward.
Attachment #680849 - Flags: review?(jdemooij)
Comment on attachment 680849 [details] [diff] [review]
Add x64 support.

Review of attachment 680849 [details] [diff] [review]:
-----------------------------------------------------------------

I wonder if we can share more stub code between x86/x64, but we can do that in a later bug.

::: js/src/ion/x64/BaselineHelpers-x64.h
@@ +60,5 @@
> +    masm.movq(Operand(BaselineStubReg, (int32_t) ICStub::offsetOfNext()), BaselineStubReg);
> +
> +    // Load stubcode pointer from BaselineStubEntry into BaselineTailCallReg
> +    // BaselineTailCallReg will always be unused in the contexts where IC stub guards fail
> +    masm.movq(Operand(BaselineStubReg, (int32_t) ICStub::offsetOfStubCode()),

Nit: these casts are not necessary.

::: js/src/ion/x64/MacroAssembler-x64.h
@@ +186,5 @@
>          boxValue(type, reg, ScratchReg);
>          push(ScratchReg);
>      }
> +    void pushValue(const Address &addr) {
> +        push(Operand(addr.base, 0));

push(Operand(addr));
Attachment #680849 - Flags: review?(jdemooij) → review+
(Just a heads-up: bug 810946 modified EmitTailCall)
Comment on attachment 680849 [details] [diff] [review]
Add x64 support.

Review of attachment 680849 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/ion/x64/BaselineHelpers-x64.h
@@ +44,5 @@
> +    masm.addl(Imm32(sizeof(void *)), ScratchReg);
> +    masm.makeFrameDescriptor(ScratchReg, IonFrame_BaselineJS);
> +    masm.push(ScratchReg);
> +    masm.push(BaselineTailCallReg);
> +    masm.jmp(target);

I think this should work right after the recent changes. As long as we can actually use rdx.

        // We an assume during this that R0 and R1 have been pushed.
        masm.movl(BaselineFrameReg, ScratchReg);
        masm.addl(Imm32(BaselineFrame::FramePointerOffset), ScratchReg);
        masm.subl(BaselineStackReg, ScratchReg);
     
        // Store frame size without VMFunction arguments for GC marking.
        masm.movl(ScratchReg, rdx);
        masm.subl(Imm32(argSize), rdx);
        masm.store32(rdx, Operand(BaselineFrameReg, BaselineFrame::reverseOffsetOfFrameSize()));
     
        masm.makeFrameDescriptor(ScratchReg, IonFrame_BaselineJS);
        masm.push(ScratchReg);
        masm.push(BaselineTailCallReg);
        masm.jmp(target);
Thanks Tom, I've rolled in those changes, with some minor adjustments.

https://hg.mozilla.org/projects/ionmonkey/rev/4d42c3ef72f5
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: