Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 588 // GC marking, since it traverses any information between SP and | 588 // GC marking, since it traverses any information between SP and |
| 589 // FP - kExitLinkOffsetInEntryFrame. | 589 // FP - kExitLinkOffsetInEntryFrame. |
| 590 // EntryFrame::SavedContext reads the context saved in this frame. | 590 // EntryFrame::SavedContext reads the context saved in this frame. |
| 591 __ lw(T1, Address(T2, Isolate::top_context_offset())); | 591 __ lw(T1, Address(T2, Isolate::top_context_offset())); |
| 592 | 592 |
| 593 // The constants kSavedContextOffsetInEntryFrame and | 593 // The constants kSavedContextOffsetInEntryFrame and |
| 594 // kExitLinkOffsetInEntryFrame must be kept in sync with the code below. | 594 // kExitLinkOffsetInEntryFrame must be kept in sync with the code below. |
| 595 __ sw(T0, Address(SP, 1 * kWordSize)); | 595 __ sw(T0, Address(SP, 1 * kWordSize)); |
| 596 __ sw(T1, Address(SP, 0 * kWordSize)); | 596 __ sw(T1, Address(SP, 0 * kWordSize)); |
| 597 | 597 |
| 598 // after the call, The stack pointer is restored to this location. | 598 // After the call, The stack pointer is restored to this location. |
| 599 // Pushed A3, S0-7, S4, S5 = 11. | 599 // Pushed A3, S0-7, T0, T1 = 11. |
| 600 const intptr_t kSavedContextOffsetInEntryFrame = -11 * kWordSize; | 600 const intptr_t kSavedContextOffsetInEntryFrame = -11 * kWordSize; |
| 601 | 601 |
| 602 // Load arguments descriptor array into S4, which is passed to Dart code. | 602 // Load arguments descriptor array into S4, which is passed to Dart code. |
| 603 __ lw(S4, Address(A1, VMHandles::kOffsetOfRawPtrInHandle)); | 603 __ lw(S4, Address(A1, VMHandles::kOffsetOfRawPtrInHandle)); |
| 604 | 604 |
| 605 // Load number of arguments into S5. | 605 // Load number of arguments into S5. |
| 606 __ lw(T1, FieldAddress(S4, ArgumentsDescriptor::count_offset())); | 606 __ lw(T1, FieldAddress(S4, ArgumentsDescriptor::count_offset())); |
| 607 __ SmiUntag(T1); | 607 __ SmiUntag(T1); |
| 608 | 608 |
| 609 // Compute address of 'arguments array' data area into A2. | 609 // Compute address of 'arguments array' data area into A2. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 645 __ lw(T1, Address(SP, 0 * kWordSize)); | 645 __ lw(T1, Address(SP, 0 * kWordSize)); |
| 646 __ lw(T0, Address(SP, 1 * kWordSize)); | 646 __ lw(T0, Address(SP, 1 * kWordSize)); |
| 647 __ sw(T1, Address(CTX, Isolate::top_context_offset())); | 647 __ sw(T1, Address(CTX, Isolate::top_context_offset())); |
| 648 __ sw(T0, Address(CTX, Isolate::top_exit_frame_info_offset())); | 648 __ sw(T0, Address(CTX, Isolate::top_exit_frame_info_offset())); |
| 649 | 649 |
| 650 // Restore C++ ABI callee-saved registers. | 650 // Restore C++ ABI callee-saved registers. |
| 651 for (int i = S0; i <= S7; i++) { | 651 for (int i = S0; i <= S7; i++) { |
| 652 Register r = static_cast<Register>(i); | 652 Register r = static_cast<Register>(i); |
| 653 __ lw(r, Address(SP, (i - S0 + 3) * kWordSize)); | 653 __ lw(r, Address(SP, (i - S0 + 3) * kWordSize)); |
| 654 } | 654 } |
| 655 __ lw(A3, Address(SP)); | 655 __ lw(A3, Address(SP, 2 * kWordSize)); |
| 656 __ addiu(SP, SP, Immediate((3 + kAbiPreservedCpuRegCount) * kWordSize)); | 656 __ addiu(SP, SP, Immediate((3 + kAbiPreservedCpuRegCount) * kWordSize)); |
| 657 | 657 |
| 658 // Restore the frame pointer and return. | 658 // Restore the frame pointer and return. |
| 659 __ LeaveStubFrame(); | 659 __ LeaveStubFrame(); |
| 660 __ Ret(); | 660 __ Ret(); |
| 661 } | 661 } |
| 662 | 662 |
| 663 | 663 |
| 664 // Called for inline allocation of contexts. | 664 // Called for inline allocation of contexts. |
| 665 // Input: | 665 // Input: |
| (...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1596 | 1596 |
| 1597 // Jump to the exception or error handler. | 1597 // Jump to the exception or error handler. |
| 1598 // RA: return address. | 1598 // RA: return address. |
| 1599 // A0: program_counter. | 1599 // A0: program_counter. |
| 1600 // A1: stack_pointer. | 1600 // A1: stack_pointer. |
| 1601 // A2: frame_pointer. | 1601 // A2: frame_pointer. |
| 1602 // A3: error object. | 1602 // A3: error object. |
| 1603 // SP: address of stacktrace object. | 1603 // SP: address of stacktrace object. |
| 1604 // Does not return. | 1604 // Does not return. |
| 1605 void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) { | 1605 void StubCode::GenerateJumpToExceptionHandlerStub(Assembler* assembler) { |
| 1606 ASSERT(kExceptionObjectReg == A0); | 1606 ASSERT(kExceptionObjectReg == V0); |
| 1607 ASSERT(kStackTraceObjectReg == A1); | 1607 ASSERT(kStackTraceObjectReg == V1); |
| 1608 __ mov(TMP1, A1); // Stack pointer. | 1608 __ mov(TMP1, A1); // Stack pointer. |
| 1609 __ mov(RA, A0); // Program counter. | 1609 __ mov(RA, A0); // Program counter. |
|
regis
2013/04/23 18:46:18
You do not need temp registers TMP1 and RA anymore
| |
| 1610 __ mov(A0, A3); // Exception object. | 1610 __ mov(V0, A3); // Exception object. |
| 1611 __ lw(A1, Address(SP, 0)); // StackTrace object. | 1611 __ lw(V1, Address(SP, 0)); // StackTrace object. |
| 1612 __ mov(FP, A2); // Frame_pointer. | 1612 __ mov(FP, A2); // Frame_pointer. |
| 1613 __ mov(SP, TMP1); // Stack pointer. | 1613 __ mov(SP, TMP1); // Stack pointer. |
| 1614 __ jr(RA); // Jump to the exception handler code. | 1614 __ jr(RA); // Jump to the exception handler code. |
| 1615 } | 1615 } |
| 1616 | 1616 |
| 1617 | 1617 |
| 1618 void StubCode::GenerateEqualityWithNullArgStub(Assembler* assembler) { | 1618 void StubCode::GenerateEqualityWithNullArgStub(Assembler* assembler) { |
| 1619 __ Unimplemented("EqualityWithNullArg Stub"); | 1619 __ Unimplemented("EqualityWithNullArg Stub"); |
| 1620 } | 1620 } |
| 1621 | 1621 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1743 __ Bind(&done); | 1743 __ Bind(&done); |
| 1744 __ lw(T0, Address(SP, 0 * kWordSize)); | 1744 __ lw(T0, Address(SP, 0 * kWordSize)); |
| 1745 __ lw(T1, Address(SP, 1 * kWordSize)); | 1745 __ lw(T1, Address(SP, 1 * kWordSize)); |
| 1746 __ Ret(); | 1746 __ Ret(); |
| 1747 __ delay_slot()->addiu(SP, SP, Immediate(2 * kWordSize)); | 1747 __ delay_slot()->addiu(SP, SP, Immediate(2 * kWordSize)); |
| 1748 } | 1748 } |
| 1749 | 1749 |
| 1750 } // namespace dart | 1750 } // namespace dart |
| 1751 | 1751 |
| 1752 #endif // defined TARGET_ARCH_MIPS | 1752 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |