OLD | NEW |
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions | 5 // modification, are permitted provided that the following conditions |
6 // are met: | 6 // are met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 } | 730 } |
731 | 731 |
732 // Return the code target address at a call site from the return address | 732 // Return the code target address at a call site from the return address |
733 // of that call in the instruction stream. | 733 // of that call in the instruction stream. |
734 INLINE(static Address target_address_from_return_address(Address pc)); | 734 INLINE(static Address target_address_from_return_address(Address pc)); |
735 | 735 |
736 // Given the address of the beginning of a call, return the address | 736 // Given the address of the beginning of a call, return the address |
737 // in the instruction stream that the call will return from. | 737 // in the instruction stream that the call will return from. |
738 INLINE(static Address return_address_from_call_start(Address pc)); | 738 INLINE(static Address return_address_from_call_start(Address pc)); |
739 | 739 |
740 // Return the code target address of the patch debug break slot | |
741 INLINE(static Address break_address_from_return_address(Address pc)); | |
742 | |
743 // This sets the branch destination (which is in the constant pool on ARM). | 740 // This sets the branch destination (which is in the constant pool on ARM). |
744 // This is for calls and branches within generated code. | 741 // This is for calls and branches within generated code. |
745 inline static void deserialization_set_special_target_at( | 742 inline static void deserialization_set_special_target_at( |
746 Address constant_pool_entry, Code* code, Address target); | 743 Address constant_pool_entry, Code* code, Address target); |
747 | 744 |
748 // This sets the internal reference at the pc. | 745 // This sets the internal reference at the pc. |
749 inline static void deserialization_set_target_internal_reference_at( | 746 inline static void deserialization_set_target_internal_reference_at( |
750 Address pc, Address target, | 747 Address pc, Address target, |
751 RelocInfo::Mode mode = RelocInfo::INTERNAL_REFERENCE); | 748 RelocInfo::Mode mode = RelocInfo::INTERNAL_REFERENCE); |
752 | 749 |
753 // Here we are patching the address in the constant pool, not the actual call | 750 // Here we are patching the address in the constant pool, not the actual call |
754 // instruction. The address in the constant pool is the same size as a | 751 // instruction. The address in the constant pool is the same size as a |
755 // pointer. | 752 // pointer. |
756 static const int kSpecialTargetSize = kPointerSize; | 753 static const int kSpecialTargetSize = kPointerSize; |
757 | 754 |
758 // Size of an instruction. | 755 // Size of an instruction. |
759 static const int kInstrSize = sizeof(Instr); | 756 static const int kInstrSize = sizeof(Instr); |
760 | 757 |
761 // Distance between start of patched return sequence and the emitted address | |
762 // to jump to. | |
763 // Patched return sequence is: | |
764 // ldr ip, [pc, #0] @ emited address and start | |
765 // blx ip | |
766 static const int kPatchReturnSequenceAddressOffset = 0 * kInstrSize; | |
767 | |
768 // Distance between start of patched debug break slot and the emitted address | 758 // Distance between start of patched debug break slot and the emitted address |
769 // to jump to. | 759 // to jump to. |
770 // Patched debug break slot code is: | 760 // Patched debug break slot code is: |
771 // ldr ip, [pc, #0] @ emited address and start | 761 // ldr ip, [pc, #0] @ emited address and start |
772 // blx ip | 762 // blx ip |
773 static const int kPatchDebugBreakSlotAddressOffset = 0 * kInstrSize; | 763 static const int kPatchDebugBreakSlotAddressOffset = 2 * kInstrSize; |
774 | |
775 static const int kPatchDebugBreakSlotReturnOffset = 2 * kInstrSize; | |
776 | 764 |
777 // Difference between address of current opcode and value read from pc | 765 // Difference between address of current opcode and value read from pc |
778 // register. | 766 // register. |
779 static const int kPcLoadDelta = 8; | 767 static const int kPcLoadDelta = 8; |
780 | 768 |
781 static const int kJSReturnSequenceInstructions = 4; | 769 static const int kDebugBreakSlotInstructions = 4; |
782 static const int kJSReturnSequenceLength = | |
783 kJSReturnSequenceInstructions * kInstrSize; | |
784 static const int kDebugBreakSlotInstructions = 3; | |
785 static const int kDebugBreakSlotLength = | 770 static const int kDebugBreakSlotLength = |
786 kDebugBreakSlotInstructions * kInstrSize; | 771 kDebugBreakSlotInstructions * kInstrSize; |
787 | 772 |
788 // --------------------------------------------------------------------------- | 773 // --------------------------------------------------------------------------- |
789 // Code generation | 774 // Code generation |
790 | 775 |
791 // Insert the smallest number of nop instructions | 776 // Insert the smallest number of nop instructions |
792 // possible to align the pc offset to a multiple | 777 // possible to align the pc offset to a multiple |
793 // of m. m must be a power of 2 (>= 4). | 778 // of m. m must be a power of 2 (>= 4). |
794 void Align(int m); | 779 void Align(int m); |
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1347 } | 1332 } |
1348 | 1333 |
1349 private: | 1334 private: |
1350 Assembler* assem_; | 1335 Assembler* assem_; |
1351 | 1336 |
1352 DISALLOW_IMPLICIT_CONSTRUCTORS(BlockConstPoolScope); | 1337 DISALLOW_IMPLICIT_CONSTRUCTORS(BlockConstPoolScope); |
1353 }; | 1338 }; |
1354 | 1339 |
1355 // Debugging | 1340 // Debugging |
1356 | 1341 |
1357 // Mark address of the ExitJSFrame code. | |
1358 void RecordJSReturn(); | |
1359 | |
1360 // Mark generator continuation. | 1342 // Mark generator continuation. |
1361 void RecordGeneratorContinuation(); | 1343 void RecordGeneratorContinuation(); |
1362 | 1344 |
1363 // Mark address of a debug break slot. | 1345 // Mark address of a debug break slot. |
1364 void RecordDebugBreakSlot(); | 1346 void RecordDebugBreakSlot(RelocInfo::Mode mode, int argc = 0); |
1365 void RecordDebugBreakSlotForCall(int argc); | |
1366 void RecordDebugBreakSlotForConstructCall(); | |
1367 | 1347 |
1368 // Record the AST id of the CallIC being compiled, so that it can be placed | 1348 // Record the AST id of the CallIC being compiled, so that it can be placed |
1369 // in the relocation information. | 1349 // in the relocation information. |
1370 void SetRecordedAstId(TypeFeedbackId ast_id) { | 1350 void SetRecordedAstId(TypeFeedbackId ast_id) { |
1371 DCHECK(recorded_ast_id_.IsNone()); | 1351 DCHECK(recorded_ast_id_.IsNone()); |
1372 recorded_ast_id_ = ast_id; | 1352 recorded_ast_id_ = ast_id; |
1373 } | 1353 } |
1374 | 1354 |
1375 TypeFeedbackId RecordedAstId() { | 1355 TypeFeedbackId RecordedAstId() { |
1376 DCHECK(!recorded_ast_id_.IsNone()); | 1356 DCHECK(!recorded_ast_id_.IsNone()); |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1672 public: | 1652 public: |
1673 explicit EnsureSpace(Assembler* assembler) { | 1653 explicit EnsureSpace(Assembler* assembler) { |
1674 assembler->CheckBuffer(); | 1654 assembler->CheckBuffer(); |
1675 } | 1655 } |
1676 }; | 1656 }; |
1677 | 1657 |
1678 | 1658 |
1679 } } // namespace v8::internal | 1659 } } // namespace v8::internal |
1680 | 1660 |
1681 #endif // V8_ARM_ASSEMBLER_ARM_H_ | 1661 #endif // V8_ARM_ASSEMBLER_ARM_H_ |
OLD | NEW |