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 are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // 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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 // Writes a single word of data in the code stream. | 700 // Writes a single word of data in the code stream. |
701 // Used for inline tables, e.g., jump-tables. | 701 // Used for inline tables, e.g., jump-tables. |
702 void dd(uint32_t data, RelocInfo::Mode reloc_info); | 702 void dd(uint32_t data, RelocInfo::Mode reloc_info); |
703 | 703 |
704 // Writes the absolute address of a bound label at the given position in | 704 // Writes the absolute address of a bound label at the given position in |
705 // the generated code. That positions should have the relocation mode | 705 // the generated code. That positions should have the relocation mode |
706 // internal_reference! | 706 // internal_reference! |
707 void WriteInternalReference(int position, const Label& bound_label); | 707 void WriteInternalReference(int position, const Label& bound_label); |
708 | 708 |
709 int pc_offset() const { return pc_ - buffer_; } | 709 int pc_offset() const { return pc_ - buffer_; } |
710 int last_statement_position() const { return last_statement_position_; } | 710 int current_statement_position() const { return current_statement_position_; } |
711 int last_position() const { return last_position_; } | 711 int current_position() const { return current_position_; } |
712 | 712 |
713 // Check if there is less than kGap bytes available in the buffer. | 713 // Check if there is less than kGap bytes available in the buffer. |
714 // If this is the case, we need to grow the buffer before emitting | 714 // If this is the case, we need to grow the buffer before emitting |
715 // an instruction or relocation information. | 715 // an instruction or relocation information. |
716 inline bool overflow() const { return pc_ >= reloc_info_writer.pos() - kGap; } | 716 inline bool overflow() const { return pc_ >= reloc_info_writer.pos() - kGap; } |
717 | 717 |
718 // Get the number of bytes available in the buffer. | 718 // Get the number of bytes available in the buffer. |
719 inline int available_space() const { return reloc_info_writer.pos() - pc_; } | 719 inline int available_space() const { return reloc_info_writer.pos() - pc_; } |
720 | 720 |
721 // Avoid overflows for displacements etc. | 721 // Avoid overflows for displacements etc. |
(...skipping 17 matching lines...) Expand all Loading... |
739 bool own_buffer_; | 739 bool own_buffer_; |
740 | 740 |
741 // code generation | 741 // code generation |
742 byte* pc_; // the program counter; moves forward | 742 byte* pc_; // the program counter; moves forward |
743 RelocInfoWriter reloc_info_writer; | 743 RelocInfoWriter reloc_info_writer; |
744 | 744 |
745 // push-pop elimination | 745 // push-pop elimination |
746 byte* last_pc_; | 746 byte* last_pc_; |
747 | 747 |
748 // source position information | 748 // source position information |
749 int last_position_; | 749 int current_statement_position_; |
750 int last_statement_position_; | 750 int current_position_; |
| 751 int written_statement_position_; |
| 752 int written_position_; |
751 | 753 |
752 byte* addr_at(int pos) { return buffer_ + pos; } | 754 byte* addr_at(int pos) { return buffer_ + pos; } |
753 byte byte_at(int pos) { return buffer_[pos]; } | 755 byte byte_at(int pos) { return buffer_[pos]; } |
754 uint32_t long_at(int pos) { | 756 uint32_t long_at(int pos) { |
755 return *reinterpret_cast<uint32_t*>(addr_at(pos)); | 757 return *reinterpret_cast<uint32_t*>(addr_at(pos)); |
756 } | 758 } |
757 void long_at_put(int pos, uint32_t x) { | 759 void long_at_put(int pos, uint32_t x) { |
758 *reinterpret_cast<uint32_t*>(addr_at(pos)) = x; | 760 *reinterpret_cast<uint32_t*>(addr_at(pos)) = x; |
759 } | 761 } |
760 | 762 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
820 private: | 822 private: |
821 Assembler* assembler_; | 823 Assembler* assembler_; |
822 #ifdef DEBUG | 824 #ifdef DEBUG |
823 int space_before_; | 825 int space_before_; |
824 #endif | 826 #endif |
825 }; | 827 }; |
826 | 828 |
827 } } // namespace v8::internal | 829 } } // namespace v8::internal |
828 | 830 |
829 #endif // V8_ASSEMBLER_IA32_H_ | 831 #endif // V8_ASSEMBLER_IA32_H_ |
OLD | NEW |