OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
815 if (type == TRY_CATCH_HANDLER) { | 815 if (type == TRY_CATCH_HANDLER) { |
816 li(t0, Operand(StackHandler::TRY_CATCH)); | 816 li(t0, Operand(StackHandler::TRY_CATCH)); |
817 } else { | 817 } else { |
818 li(t0, Operand(StackHandler::TRY_FINALLY)); | 818 li(t0, Operand(StackHandler::TRY_FINALLY)); |
819 } | 819 } |
820 ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize | 820 ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize |
821 && StackHandlerConstants::kFPOffset == 2 * kPointerSize | 821 && StackHandlerConstants::kFPOffset == 2 * kPointerSize |
822 && StackHandlerConstants::kPCOffset == 3 * kPointerSize | 822 && StackHandlerConstants::kPCOffset == 3 * kPointerSize |
823 && StackHandlerConstants::kNextOffset == 0 * kPointerSize); | 823 && StackHandlerConstants::kNextOffset == 0 * kPointerSize); |
824 // Save the current handler as the next handler. | 824 // Save the current handler as the next handler. |
825 LoadExternalReference(t2, ExternalReference(Top::k_handler_address)); | 825 LoadExternalReference(t2, ExternalReference(Isolate::k_handler_address)); |
826 lw(t1, MemOperand(t2)); | 826 lw(t1, MemOperand(t2)); |
827 | 827 |
828 addiu(sp, sp, -StackHandlerConstants::kSize); | 828 addiu(sp, sp, -StackHandlerConstants::kSize); |
829 sw(ra, MemOperand(sp, 12)); | 829 sw(ra, MemOperand(sp, 12)); |
830 sw(fp, MemOperand(sp, 8)); | 830 sw(fp, MemOperand(sp, 8)); |
831 sw(t0, MemOperand(sp, 4)); | 831 sw(t0, MemOperand(sp, 4)); |
832 sw(t1, MemOperand(sp, 0)); | 832 sw(t1, MemOperand(sp, 0)); |
833 | 833 |
834 // Link this handler as the new current one. | 834 // Link this handler as the new current one. |
835 sw(sp, MemOperand(t2)); | 835 sw(sp, MemOperand(t2)); |
836 | 836 |
837 } else { | 837 } else { |
838 // Must preserve a0-a3, and s0 (argv). | 838 // Must preserve a0-a3, and s0 (argv). |
839 ASSERT(try_location == IN_JS_ENTRY); | 839 ASSERT(try_location == IN_JS_ENTRY); |
840 ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize | 840 ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize |
841 && StackHandlerConstants::kFPOffset == 2 * kPointerSize | 841 && StackHandlerConstants::kFPOffset == 2 * kPointerSize |
842 && StackHandlerConstants::kPCOffset == 3 * kPointerSize | 842 && StackHandlerConstants::kPCOffset == 3 * kPointerSize |
843 && StackHandlerConstants::kNextOffset == 0 * kPointerSize); | 843 && StackHandlerConstants::kNextOffset == 0 * kPointerSize); |
844 | 844 |
845 // The frame pointer does not point to a JS frame so we save NULL | 845 // The frame pointer does not point to a JS frame so we save NULL |
846 // for fp. We expect the code throwing an exception to check fp | 846 // for fp. We expect the code throwing an exception to check fp |
847 // before dereferencing it to restore the context. | 847 // before dereferencing it to restore the context. |
848 li(t0, Operand(StackHandler::ENTRY)); | 848 li(t0, Operand(StackHandler::ENTRY)); |
849 | 849 |
850 // Save the current handler as the next handler. | 850 // Save the current handler as the next handler. |
851 LoadExternalReference(t2, ExternalReference(Top::k_handler_address)); | 851 LoadExternalReference(t2, ExternalReference(Isolate::k_handler_address)); |
852 lw(t1, MemOperand(t2)); | 852 lw(t1, MemOperand(t2)); |
853 | 853 |
854 addiu(sp, sp, -StackHandlerConstants::kSize); | 854 addiu(sp, sp, -StackHandlerConstants::kSize); |
855 sw(ra, MemOperand(sp, 12)); | 855 sw(ra, MemOperand(sp, 12)); |
856 sw(zero_reg, MemOperand(sp, 8)); | 856 sw(zero_reg, MemOperand(sp, 8)); |
857 sw(t0, MemOperand(sp, 4)); | 857 sw(t0, MemOperand(sp, 4)); |
858 sw(t1, MemOperand(sp, 0)); | 858 sw(t1, MemOperand(sp, 0)); |
859 | 859 |
860 // Link this handler as the new current one. | 860 // Link this handler as the new current one. |
861 sw(sp, MemOperand(t2)); | 861 sw(sp, MemOperand(t2)); |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1263 | 1263 |
1264 // Push debug marker. | 1264 // Push debug marker. |
1265 if (mode == ExitFrame::MODE_DEBUG) { | 1265 if (mode == ExitFrame::MODE_DEBUG) { |
1266 Push(zero_reg); | 1266 Push(zero_reg); |
1267 } else { | 1267 } else { |
1268 li(t0, Operand(CodeObject())); | 1268 li(t0, Operand(CodeObject())); |
1269 Push(t0); | 1269 Push(t0); |
1270 } | 1270 } |
1271 | 1271 |
1272 // Save the frame pointer and the context in top. | 1272 // Save the frame pointer and the context in top. |
1273 LoadExternalReference(t0, ExternalReference(Top::k_c_entry_fp_address)); | 1273 LoadExternalReference(t0, ExternalReference(Isolate::k_c_entry_fp_address)); |
1274 sw(fp, MemOperand(t0)); | 1274 sw(fp, MemOperand(t0)); |
1275 LoadExternalReference(t0, ExternalReference(Top::k_context_address)); | 1275 LoadExternalReference(t0, ExternalReference(Isolate::k_context_address)); |
1276 sw(cp, MemOperand(t0)); | 1276 sw(cp, MemOperand(t0)); |
1277 | 1277 |
1278 // Setup argc and the builtin function in callee-saved registers. | 1278 // Setup argc and the builtin function in callee-saved registers. |
1279 mov(hold_argc, a0); | 1279 mov(hold_argc, a0); |
1280 mov(hold_function, a1); | 1280 mov(hold_function, a1); |
1281 } | 1281 } |
1282 | 1282 |
1283 | 1283 |
1284 void MacroAssembler::LeaveExitFrame(ExitFrame::Mode mode) { | 1284 void MacroAssembler::LeaveExitFrame(ExitFrame::Mode mode) { |
1285 // Clear top frame. | 1285 // Clear top frame. |
1286 LoadExternalReference(t0, ExternalReference(Top::k_c_entry_fp_address)); | 1286 LoadExternalReference(t0, ExternalReference(Isolate::k_c_entry_fp_address)); |
1287 sw(zero_reg, MemOperand(t0)); | 1287 sw(zero_reg, MemOperand(t0)); |
1288 | 1288 |
1289 // Restore current context from top and clear it in debug mode. | 1289 // Restore current context from top and clear it in debug mode. |
1290 LoadExternalReference(t0, ExternalReference(Top::k_context_address)); | 1290 LoadExternalReference(t0, ExternalReference(Isolate::k_context_address)); |
1291 lw(cp, MemOperand(t0)); | 1291 lw(cp, MemOperand(t0)); |
1292 #ifdef DEBUG | 1292 #ifdef DEBUG |
1293 sw(a3, MemOperand(t0)); | 1293 sw(a3, MemOperand(t0)); |
1294 #endif | 1294 #endif |
1295 | 1295 |
1296 // Pop the arguments, restore registers, and return. | 1296 // Pop the arguments, restore registers, and return. |
1297 mov(sp, fp); // Respect ABI stack constraint. | 1297 mov(sp, fp); // Respect ABI stack constraint. |
1298 lw(fp, MemOperand(sp, 0)); | 1298 lw(fp, MemOperand(sp, 0)); |
1299 lw(ra, MemOperand(sp, 4)); | 1299 lw(ra, MemOperand(sp, 4)); |
1300 lw(sp, MemOperand(sp, 8)); | 1300 lw(sp, MemOperand(sp, 8)); |
(...skipping 16 matching lines...) Expand all Loading... |
1317 andi(t0, sp, activation_frame_alignment - 1); | 1317 andi(t0, sp, activation_frame_alignment - 1); |
1318 addiu(t0, t0, -4); | 1318 addiu(t0, t0, -4); |
1319 Push(zero_reg, eq, t0, zero_reg); | 1319 Push(zero_reg, eq, t0, zero_reg); |
1320 } | 1320 } |
1321 } | 1321 } |
1322 } | 1322 } |
1323 | 1323 |
1324 } } // namespace v8::internal | 1324 } } // namespace v8::internal |
1325 | 1325 |
1326 #endif // V8_TARGET_ARCH_MIPS | 1326 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |