OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 } | 466 } |
467 | 467 |
468 // Push in reverse order: caller_fp, sp_on_exit, and caller_pc. | 468 // Push in reverse order: caller_fp, sp_on_exit, and caller_pc. |
469 stm(db_w, sp, fp.bit() | ip.bit() | lr.bit()); | 469 stm(db_w, sp, fp.bit() | ip.bit() | lr.bit()); |
470 mov(fp, Operand(sp)); // Setup new frame pointer. | 470 mov(fp, Operand(sp)); // Setup new frame pointer. |
471 | 471 |
472 mov(ip, Operand(CodeObject())); | 472 mov(ip, Operand(CodeObject())); |
473 push(ip); // Accessed from ExitFrame::code_slot. | 473 push(ip); // Accessed from ExitFrame::code_slot. |
474 | 474 |
475 // Save the frame pointer and the context in top. | 475 // Save the frame pointer and the context in top. |
476 mov(ip, Operand(ExternalReference(Top::k_c_entry_fp_address))); | 476 mov(ip, Operand(ExternalReference(Isolate::k_c_entry_fp_address))); |
477 str(fp, MemOperand(ip)); | 477 str(fp, MemOperand(ip)); |
478 mov(ip, Operand(ExternalReference(Top::k_context_address))); | 478 mov(ip, Operand(ExternalReference(Isolate::k_context_address))); |
479 str(cp, MemOperand(ip)); | 479 str(cp, MemOperand(ip)); |
480 | 480 |
481 // Setup argc and the builtin function in callee-saved registers. | 481 // Setup argc and the builtin function in callee-saved registers. |
482 mov(r4, Operand(r0)); | 482 mov(r4, Operand(r0)); |
483 mov(r5, Operand(r1)); | 483 mov(r5, Operand(r1)); |
484 | 484 |
485 | 485 |
486 #ifdef ENABLE_DEBUGGER_SUPPORT | 486 #ifdef ENABLE_DEBUGGER_SUPPORT |
487 // Save the state of all registers to the stack from the memory | 487 // Save the state of all registers to the stack from the memory |
488 // location. This is needed to allow nested break points. | 488 // location. This is needed to allow nested break points. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 // This code intentionally clobbers r2 and r3. | 533 // This code intentionally clobbers r2 and r3. |
534 const int kCallerSavedSize = kNumJSCallerSaved * kPointerSize; | 534 const int kCallerSavedSize = kNumJSCallerSaved * kPointerSize; |
535 const int kOffset = ExitFrameConstants::kCodeOffset - kCallerSavedSize; | 535 const int kOffset = ExitFrameConstants::kCodeOffset - kCallerSavedSize; |
536 add(r3, fp, Operand(kOffset)); | 536 add(r3, fp, Operand(kOffset)); |
537 CopyRegistersFromStackToMemory(r3, r2, kJSCallerSaved); | 537 CopyRegistersFromStackToMemory(r3, r2, kJSCallerSaved); |
538 } | 538 } |
539 #endif | 539 #endif |
540 | 540 |
541 // Clear top frame. | 541 // Clear top frame. |
542 mov(r3, Operand(0)); | 542 mov(r3, Operand(0)); |
543 mov(ip, Operand(ExternalReference(Top::k_c_entry_fp_address))); | 543 mov(ip, Operand(ExternalReference(Isolate::k_c_entry_fp_address))); |
544 str(r3, MemOperand(ip)); | 544 str(r3, MemOperand(ip)); |
545 | 545 |
546 // Restore current context from top and clear it in debug mode. | 546 // Restore current context from top and clear it in debug mode. |
547 mov(ip, Operand(ExternalReference(Top::k_context_address))); | 547 mov(ip, Operand(ExternalReference(Isolate::k_context_address))); |
548 ldr(cp, MemOperand(ip)); | 548 ldr(cp, MemOperand(ip)); |
549 #ifdef DEBUG | 549 #ifdef DEBUG |
550 str(r3, MemOperand(ip)); | 550 str(r3, MemOperand(ip)); |
551 #endif | 551 #endif |
552 | 552 |
553 // Pop the arguments, restore registers, and return. | 553 // Pop the arguments, restore registers, and return. |
554 mov(sp, Operand(fp)); // respect ABI stack constraint | 554 mov(sp, Operand(fp)); // respect ABI stack constraint |
555 ldm(ia, sp, fp.bit() | sp.bit() | pc.bit()); | 555 ldm(ia, sp, fp.bit() | sp.bit() | pc.bit()); |
556 } | 556 } |
557 | 557 |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 if (type == TRY_CATCH_HANDLER) { | 784 if (type == TRY_CATCH_HANDLER) { |
785 mov(r3, Operand(StackHandler::TRY_CATCH)); | 785 mov(r3, Operand(StackHandler::TRY_CATCH)); |
786 } else { | 786 } else { |
787 mov(r3, Operand(StackHandler::TRY_FINALLY)); | 787 mov(r3, Operand(StackHandler::TRY_FINALLY)); |
788 } | 788 } |
789 ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize | 789 ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize |
790 && StackHandlerConstants::kFPOffset == 2 * kPointerSize | 790 && StackHandlerConstants::kFPOffset == 2 * kPointerSize |
791 && StackHandlerConstants::kPCOffset == 3 * kPointerSize); | 791 && StackHandlerConstants::kPCOffset == 3 * kPointerSize); |
792 stm(db_w, sp, r3.bit() | fp.bit() | lr.bit()); | 792 stm(db_w, sp, r3.bit() | fp.bit() | lr.bit()); |
793 // Save the current handler as the next handler. | 793 // Save the current handler as the next handler. |
794 mov(r3, Operand(ExternalReference(Top::k_handler_address))); | 794 mov(r3, Operand(ExternalReference(Isolate::k_handler_address))); |
795 ldr(r1, MemOperand(r3)); | 795 ldr(r1, MemOperand(r3)); |
796 ASSERT(StackHandlerConstants::kNextOffset == 0); | 796 ASSERT(StackHandlerConstants::kNextOffset == 0); |
797 push(r1); | 797 push(r1); |
798 // Link this handler as the new current one. | 798 // Link this handler as the new current one. |
799 str(sp, MemOperand(r3)); | 799 str(sp, MemOperand(r3)); |
800 } else { | 800 } else { |
801 // Must preserve r0-r4, r5-r7 are available. | 801 // Must preserve r0-r4, r5-r7 are available. |
802 ASSERT(try_location == IN_JS_ENTRY); | 802 ASSERT(try_location == IN_JS_ENTRY); |
803 // The frame pointer does not point to a JS frame so we save NULL | 803 // The frame pointer does not point to a JS frame so we save NULL |
804 // for fp. We expect the code throwing an exception to check fp | 804 // for fp. We expect the code throwing an exception to check fp |
805 // before dereferencing it to restore the context. | 805 // before dereferencing it to restore the context. |
806 mov(ip, Operand(0)); // To save a NULL frame pointer. | 806 mov(ip, Operand(0)); // To save a NULL frame pointer. |
807 mov(r6, Operand(StackHandler::ENTRY)); | 807 mov(r6, Operand(StackHandler::ENTRY)); |
808 ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize | 808 ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize |
809 && StackHandlerConstants::kFPOffset == 2 * kPointerSize | 809 && StackHandlerConstants::kFPOffset == 2 * kPointerSize |
810 && StackHandlerConstants::kPCOffset == 3 * kPointerSize); | 810 && StackHandlerConstants::kPCOffset == 3 * kPointerSize); |
811 stm(db_w, sp, r6.bit() | ip.bit() | lr.bit()); | 811 stm(db_w, sp, r6.bit() | ip.bit() | lr.bit()); |
812 // Save the current handler as the next handler. | 812 // Save the current handler as the next handler. |
813 mov(r7, Operand(ExternalReference(Top::k_handler_address))); | 813 mov(r7, Operand(ExternalReference(Isolate::k_handler_address))); |
814 ldr(r6, MemOperand(r7)); | 814 ldr(r6, MemOperand(r7)); |
815 ASSERT(StackHandlerConstants::kNextOffset == 0); | 815 ASSERT(StackHandlerConstants::kNextOffset == 0); |
816 push(r6); | 816 push(r6); |
817 // Link this handler as the new current one. | 817 // Link this handler as the new current one. |
818 str(sp, MemOperand(r7)); | 818 str(sp, MemOperand(r7)); |
819 } | 819 } |
820 } | 820 } |
821 | 821 |
822 | 822 |
823 void MacroAssembler::PopTryHandler() { | 823 void MacroAssembler::PopTryHandler() { |
824 ASSERT_EQ(0, StackHandlerConstants::kNextOffset); | 824 ASSERT_EQ(0, StackHandlerConstants::kNextOffset); |
825 pop(r1); | 825 pop(r1); |
826 mov(ip, Operand(ExternalReference(Top::k_handler_address))); | 826 mov(ip, Operand(ExternalReference(Isolate::k_handler_address))); |
827 add(sp, sp, Operand(StackHandlerConstants::kSize - kPointerSize)); | 827 add(sp, sp, Operand(StackHandlerConstants::kSize - kPointerSize)); |
828 str(r1, MemOperand(ip)); | 828 str(r1, MemOperand(ip)); |
829 } | 829 } |
830 | 830 |
831 | 831 |
832 Register MacroAssembler::CheckMaps(JSObject* object, Register object_reg, | 832 Register MacroAssembler::CheckMaps(JSObject* object, Register object_reg, |
833 JSObject* holder, Register holder_reg, | 833 JSObject* holder, Register holder_reg, |
834 Register scratch, | 834 Register scratch, |
835 int save_at_depth, | 835 int save_at_depth, |
836 Label* miss) { | 836 Label* miss) { |
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1799 | 1799 |
1800 void CodePatcher::Emit(Address addr) { | 1800 void CodePatcher::Emit(Address addr) { |
1801 masm()->emit(reinterpret_cast<Instr>(addr)); | 1801 masm()->emit(reinterpret_cast<Instr>(addr)); |
1802 } | 1802 } |
1803 #endif // ENABLE_DEBUGGER_SUPPORT | 1803 #endif // ENABLE_DEBUGGER_SUPPORT |
1804 | 1804 |
1805 | 1805 |
1806 } } // namespace v8::internal | 1806 } } // namespace v8::internal |
1807 | 1807 |
1808 #endif // V8_TARGET_ARCH_ARM | 1808 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |