Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(765)

Side by Side Diff: src/mips/code-stubs-mips.cc

Issue 7809014: MIPS: port ARM: Fix context save/restore for VFP registers. (Closed)
Patch Set: Update frames reglist constants and push/pop routines per review comments. Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/mips/frames-mips.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 3677 matching lines...) Expand 10 before | Expand all | Expand 10 after
3688 // a2: reveiver 3688 // a2: reveiver
3689 // a3: argc 3689 // a3: argc
3690 // 3690 //
3691 // Stack: 3691 // Stack:
3692 // 4 args slots 3692 // 4 args slots
3693 // args 3693 // args
3694 3694
3695 // Save callee saved registers on the stack. 3695 // Save callee saved registers on the stack.
3696 __ MultiPush(kCalleeSaved | ra.bit()); 3696 __ MultiPush(kCalleeSaved | ra.bit());
3697 3697
3698 if (CpuFeatures::IsSupported(FPU)) {
3699 CpuFeatures::Scope scope(FPU);
3700 // Save callee-saved FPU registers.
3701 __ MultiPushFPU(kCalleeSavedFPU);
3702 }
3703
3698 // Load argv in s0 register. 3704 // Load argv in s0 register.
3699 __ lw(s0, MemOperand(sp, (kNumCalleeSaved + 1) * kPointerSize + 3705 int offset_to_argv = (kNumCalleeSaved + 1) * kPointerSize;
3700 StandardFrameConstants::kCArgsSlotsSize)); 3706 if (CpuFeatures::IsSupported(FPU)) {
3707 offset_to_argv += kNumCalleeSavedFPU * kDoubleSize;
3708 }
3709
3710 __ lw(s0, MemOperand(sp, offset_to_argv +
3711 StandardFrameConstants::kCArgsSlotsSize));
3701 3712
3702 // We build an EntryFrame. 3713 // We build an EntryFrame.
3703 __ li(t3, Operand(-1)); // Push a bad frame pointer to fail if it is used. 3714 __ li(t3, Operand(-1)); // Push a bad frame pointer to fail if it is used.
3704 int marker = is_construct ? StackFrame::ENTRY_CONSTRUCT : StackFrame::ENTRY; 3715 int marker = is_construct ? StackFrame::ENTRY_CONSTRUCT : StackFrame::ENTRY;
3705 __ li(t2, Operand(Smi::FromInt(marker))); 3716 __ li(t2, Operand(Smi::FromInt(marker)));
3706 __ li(t1, Operand(Smi::FromInt(marker))); 3717 __ li(t1, Operand(Smi::FromInt(marker)));
3707 __ li(t0, Operand(ExternalReference(Isolate::k_c_entry_fp_address, 3718 __ li(t0, Operand(ExternalReference(Isolate::k_c_entry_fp_address,
3708 masm->isolate()))); 3719 masm->isolate())));
3709 __ lw(t0, MemOperand(t0)); 3720 __ lw(t0, MemOperand(t0));
3710 __ Push(t3, t2, t1, t0); 3721 __ Push(t3, t2, t1, t0);
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
3822 3833
3823 // Restore the top frame descriptors from the stack. 3834 // Restore the top frame descriptors from the stack.
3824 __ pop(t1); 3835 __ pop(t1);
3825 __ li(t0, Operand(ExternalReference(Isolate::k_c_entry_fp_address, 3836 __ li(t0, Operand(ExternalReference(Isolate::k_c_entry_fp_address,
3826 masm->isolate()))); 3837 masm->isolate())));
3827 __ sw(t1, MemOperand(t0)); 3838 __ sw(t1, MemOperand(t0));
3828 3839
3829 // Reset the stack to the callee saved registers. 3840 // Reset the stack to the callee saved registers.
3830 __ addiu(sp, sp, -EntryFrameConstants::kCallerFPOffset); 3841 __ addiu(sp, sp, -EntryFrameConstants::kCallerFPOffset);
3831 3842
3843 if (CpuFeatures::IsSupported(FPU)) {
3844 CpuFeatures::Scope scope(FPU);
3845 // Restore callee-saved fpu registers.
3846 __ MultiPopFPU(kCalleeSavedFPU);
3847 }
3848
3832 // Restore callee saved registers from the stack. 3849 // Restore callee saved registers from the stack.
3833 __ MultiPop(kCalleeSaved | ra.bit()); 3850 __ MultiPop(kCalleeSaved | ra.bit());
3834 // Return. 3851 // Return.
3835 __ Jump(ra); 3852 __ Jump(ra);
3836 } 3853 }
3837 3854
3838 3855
3839 // Uses registers a0 to t0. 3856 // Uses registers a0 to t0.
3840 // Expected input (depending on whether args are in registers or on the stack): 3857 // Expected input (depending on whether args are in registers or on the stack):
3841 // * object: a0 or at sp + 1 * kPointerSize. 3858 // * object: a0 or at sp + 1 * kPointerSize.
(...skipping 3026 matching lines...) Expand 10 before | Expand all | Expand 10 after
6868 __ mov(result, zero_reg); 6885 __ mov(result, zero_reg);
6869 __ Ret(); 6886 __ Ret();
6870 } 6887 }
6871 6888
6872 6889
6873 #undef __ 6890 #undef __
6874 6891
6875 } } // namespace v8::internal 6892 } } // namespace v8::internal
6876 6893
6877 #endif // V8_TARGET_ARCH_MIPS 6894 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | src/mips/frames-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698