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

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

Issue 7834017: MIPS: Minor cleanup change to arguments slots constants. (Closed)
Patch Set: 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/constants-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 3520 matching lines...) Expand 10 before | Expand all | Expand 10 after
3531 masm->bal(&find_ra); // bal exposes branch delay slot. 3531 masm->bal(&find_ra); // bal exposes branch delay slot.
3532 masm->nop(); // Branch delay slot nop. 3532 masm->nop(); // Branch delay slot nop.
3533 masm->bind(&find_ra); 3533 masm->bind(&find_ra);
3534 3534
3535 // Adjust the value in ra to point to the correct return location, 2nd 3535 // Adjust the value in ra to point to the correct return location, 2nd
3536 // instruction past the real call into C code (the jalr(t9)), and push it. 3536 // instruction past the real call into C code (the jalr(t9)), and push it.
3537 // This is the return address of the exit frame. 3537 // This is the return address of the exit frame.
3538 const int kNumInstructionsToJump = 6; 3538 const int kNumInstructionsToJump = 6;
3539 masm->Addu(ra, ra, kNumInstructionsToJump * kPointerSize); 3539 masm->Addu(ra, ra, kNumInstructionsToJump * kPointerSize);
3540 masm->sw(ra, MemOperand(sp)); // This spot was reserved in EnterExitFrame. 3540 masm->sw(ra, MemOperand(sp)); // This spot was reserved in EnterExitFrame.
3541 masm->Subu(sp, sp, StandardFrameConstants::kCArgsSlotsSize); 3541 masm->Subu(sp, sp, kCArgsSlotsSize);
3542 // Stack is still aligned. 3542 // Stack is still aligned.
3543 3543
3544 // Call the C routine. 3544 // Call the C routine.
3545 masm->mov(t9, s2); // Function pointer to t9 to conform to ABI for PIC. 3545 masm->mov(t9, s2); // Function pointer to t9 to conform to ABI for PIC.
3546 masm->jalr(t9); 3546 masm->jalr(t9);
3547 masm->nop(); // Branch delay slot nop. 3547 masm->nop(); // Branch delay slot nop.
3548 // Make sure the stored 'ra' points to this position. 3548 // Make sure the stored 'ra' points to this position.
3549 ASSERT_EQ(kNumInstructionsToJump, 3549 ASSERT_EQ(kNumInstructionsToJump,
3550 masm->InstructionsGeneratedSince(&find_ra)); 3550 masm->InstructionsGeneratedSince(&find_ra));
3551 } 3551 }
3552 3552
3553 // Restore stack (remove arg slots). 3553 // Restore stack (remove arg slots).
3554 __ Addu(sp, sp, StandardFrameConstants::kCArgsSlotsSize); 3554 __ Addu(sp, sp, kCArgsSlotsSize);
3555 3555
3556 if (always_allocate) { 3556 if (always_allocate) {
3557 // It's okay to clobber a2 and a3 here. v0 & v1 contain result. 3557 // It's okay to clobber a2 and a3 here. v0 & v1 contain result.
3558 __ li(a2, Operand(scope_depth)); 3558 __ li(a2, Operand(scope_depth));
3559 __ lw(a3, MemOperand(a2)); 3559 __ lw(a3, MemOperand(a2));
3560 __ Subu(a3, a3, Operand(1)); 3560 __ Subu(a3, a3, Operand(1));
3561 __ sw(a3, MemOperand(a2)); 3561 __ sw(a3, MemOperand(a2));
3562 } 3562 }
3563 3563
3564 // Check for failure result. 3564 // Check for failure result.
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
3700 // Save callee-saved FPU registers. 3700 // Save callee-saved FPU registers.
3701 __ MultiPushFPU(kCalleeSavedFPU); 3701 __ MultiPushFPU(kCalleeSavedFPU);
3702 } 3702 }
3703 3703
3704 // Load argv in s0 register. 3704 // Load argv in s0 register.
3705 int offset_to_argv = (kNumCalleeSaved + 1) * kPointerSize; 3705 int offset_to_argv = (kNumCalleeSaved + 1) * kPointerSize;
3706 if (CpuFeatures::IsSupported(FPU)) { 3706 if (CpuFeatures::IsSupported(FPU)) {
3707 offset_to_argv += kNumCalleeSavedFPU * kDoubleSize; 3707 offset_to_argv += kNumCalleeSavedFPU * kDoubleSize;
3708 } 3708 }
3709 3709
3710 __ lw(s0, MemOperand(sp, offset_to_argv + 3710 __ lw(s0, MemOperand(sp, offset_to_argv + kCArgsSlotsSize));
3711 StandardFrameConstants::kCArgsSlotsSize));
3712 3711
3713 // We build an EntryFrame. 3712 // We build an EntryFrame.
3714 __ li(t3, Operand(-1)); // Push a bad frame pointer to fail if it is used. 3713 __ li(t3, Operand(-1)); // Push a bad frame pointer to fail if it is used.
3715 int marker = is_construct ? StackFrame::ENTRY_CONSTRUCT : StackFrame::ENTRY; 3714 int marker = is_construct ? StackFrame::ENTRY_CONSTRUCT : StackFrame::ENTRY;
3716 __ li(t2, Operand(Smi::FromInt(marker))); 3715 __ li(t2, Operand(Smi::FromInt(marker)));
3717 __ li(t1, Operand(Smi::FromInt(marker))); 3716 __ li(t1, Operand(Smi::FromInt(marker)));
3718 __ li(t0, Operand(ExternalReference(Isolate::k_c_entry_fp_address, 3717 __ li(t0, Operand(ExternalReference(Isolate::k_c_entry_fp_address,
3719 masm->isolate()))); 3718 masm->isolate())));
3720 __ lw(t0, MemOperand(t0)); 3719 __ lw(t0, MemOperand(t0));
3721 __ Push(t3, t2, t1, t0); 3720 __ Push(t3, t2, t1, t0);
(...skipping 3164 matching lines...) Expand 10 before | Expand all | Expand 10 after
6886 __ mov(result, zero_reg); 6885 __ mov(result, zero_reg);
6887 __ Ret(); 6886 __ Ret();
6888 } 6887 }
6889 6888
6890 6889
6891 #undef __ 6890 #undef __
6892 6891
6893 } } // namespace v8::internal 6892 } } // namespace v8::internal
6894 6893
6895 #endif // V8_TARGET_ARCH_MIPS 6894 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | src/mips/constants-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698