| 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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 | 642 |
| 643 | 643 |
| 644 // Debugging | 644 // Debugging |
| 645 | 645 |
| 646 // Record a comment relocation entry that can be used by a disassembler. | 646 // Record a comment relocation entry that can be used by a disassembler. |
| 647 // Use --debug_code to enable. | 647 // Use --debug_code to enable. |
| 648 void RecordComment(const char* msg); | 648 void RecordComment(const char* msg); |
| 649 | 649 |
| 650 void RecordPosition(int pos); | 650 void RecordPosition(int pos); |
| 651 void RecordStatementPosition(int pos); | 651 void RecordStatementPosition(int pos); |
| 652 void WriteRecordedPositions(); |
| 652 | 653 |
| 653 int pc_offset() const { return pc_ - buffer_; } | 654 int pc_offset() const { return pc_ - buffer_; } |
| 654 int last_position() const { return last_position_; } | 655 int current_position() const { return current_position_; } |
| 655 bool last_position_is_statement() const { | 656 int current_statement_position() const { return current_position_; } |
| 656 return last_position_is_statement_; | |
| 657 } | |
| 658 | |
| 659 // Temporary helper function. Used by codegen.cc. | |
| 660 int last_statement_position() const { return last_position_; } | |
| 661 | 657 |
| 662 protected: | 658 protected: |
| 663 int buffer_space() const { return reloc_info_writer.pos() - pc_; } | 659 int buffer_space() const { return reloc_info_writer.pos() - pc_; } |
| 664 | 660 |
| 665 // Read/patch instructions | 661 // Read/patch instructions |
| 666 Instr instr_at(byte* pc) { return *reinterpret_cast<Instr*>(pc); } | 662 Instr instr_at(byte* pc) { return *reinterpret_cast<Instr*>(pc); } |
| 667 void instr_at_put(byte* pc, Instr instr) { | 663 void instr_at_put(byte* pc, Instr instr) { |
| 668 *reinterpret_cast<Instr*>(pc) = instr; | 664 *reinterpret_cast<Instr*>(pc) = instr; |
| 669 } | 665 } |
| 670 Instr instr_at(int pos) { return *reinterpret_cast<Instr*>(buffer_ + pos); } | 666 Instr instr_at(int pos) { return *reinterpret_cast<Instr*>(buffer_ + pos); } |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 753 // If every instruction in a long sequence is accessing the pool, we need one | 749 // If every instruction in a long sequence is accessing the pool, we need one |
| 754 // pending relocation entry per instruction. | 750 // pending relocation entry per instruction. |
| 755 static const int kMaxNumPRInfo = kMaxDistBetweenPools/kInstrSize; | 751 static const int kMaxNumPRInfo = kMaxDistBetweenPools/kInstrSize; |
| 756 RelocInfo prinfo_[kMaxNumPRInfo]; // the buffer of pending relocation info | 752 RelocInfo prinfo_[kMaxNumPRInfo]; // the buffer of pending relocation info |
| 757 int num_prinfo_; // number of pending reloc info entries in the buffer | 753 int num_prinfo_; // number of pending reloc info entries in the buffer |
| 758 | 754 |
| 759 // The bound position, before this we cannot do instruction elimination. | 755 // The bound position, before this we cannot do instruction elimination. |
| 760 int last_bound_pos_; | 756 int last_bound_pos_; |
| 761 | 757 |
| 762 // source position information | 758 // source position information |
| 763 int last_position_; | 759 int current_position_; |
| 764 bool last_position_is_statement_; | 760 int current_statement_position_; |
| 761 int written_position_; |
| 762 int written_statement_position_; |
| 765 | 763 |
| 766 // Code emission | 764 // Code emission |
| 767 inline void CheckBuffer(); | 765 inline void CheckBuffer(); |
| 768 void GrowBuffer(); | 766 void GrowBuffer(); |
| 769 inline void emit(Instr x); | 767 inline void emit(Instr x); |
| 770 | 768 |
| 771 // Instruction generation | 769 // Instruction generation |
| 772 void addrmod1(Instr instr, Register rn, Register rd, const Operand& x); | 770 void addrmod1(Instr instr, Register rn, Register rd, const Operand& x); |
| 773 void addrmod2(Instr instr, Register rd, const MemOperand& x); | 771 void addrmod2(Instr instr, Register rd, const MemOperand& x); |
| 774 void addrmod3(Instr instr, Register rd, const MemOperand& x); | 772 void addrmod3(Instr instr, Register rd, const MemOperand& x); |
| 775 void addrmod4(Instr instr, Register rn, RegList rl); | 773 void addrmod4(Instr instr, Register rn, RegList rl); |
| 776 void addrmod5(Instr instr, CRegister crd, const MemOperand& x); | 774 void addrmod5(Instr instr, CRegister crd, const MemOperand& x); |
| 777 | 775 |
| 778 // Labels | 776 // Labels |
| 779 void print(Label* L); | 777 void print(Label* L); |
| 780 void bind_to(Label* L, int pos); | 778 void bind_to(Label* L, int pos); |
| 781 void link_to(Label* L, Label* appendix); | 779 void link_to(Label* L, Label* appendix); |
| 782 void next(Label* L); | 780 void next(Label* L); |
| 783 | 781 |
| 784 // Record reloc info for current pc_ | 782 // Record reloc info for current pc_ |
| 785 void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0); | 783 void RecordRelocInfo(RelocInfo::Mode rmode, intptr_t data = 0); |
| 786 }; | 784 }; |
| 787 | 785 |
| 788 } } // namespace v8::internal | 786 } } // namespace v8::internal |
| 789 | 787 |
| 790 #endif // V8_ASSEMBLER_ARM_H_ | 788 #endif // V8_ASSEMBLER_ARM_H_ |
| OLD | NEW |