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 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 // Writes a single word of data in the code stream. | 714 // Writes a single word of data in the code stream. |
715 // Used for inline tables, e.g., jump-tables. | 715 // Used for inline tables, e.g., jump-tables. |
716 void dd(uint32_t data, RelocInfo::Mode reloc_info); | 716 void dd(uint32_t data, RelocInfo::Mode reloc_info); |
717 | 717 |
718 // Writes the absolute address of a bound label at the given position in | 718 // Writes the absolute address of a bound label at the given position in |
719 // the generated code. That positions should have the relocation mode | 719 // the generated code. That positions should have the relocation mode |
720 // internal_reference! | 720 // internal_reference! |
721 void WriteInternalReference(int position, const Label& bound_label); | 721 void WriteInternalReference(int position, const Label& bound_label); |
722 | 722 |
723 int pc_offset() const { return pc_ - buffer_; } | 723 int pc_offset() const { return pc_ - buffer_; } |
724 int last_statement_position() const { return last_statement_position_; } | 724 int current_statement_position() const { return current_statement_position_; } |
725 int last_position() const { return last_position_; } | 725 int current_position() const { return current_position_; } |
726 | 726 |
727 // Check if there is less than kGap bytes available in the buffer. | 727 // Check if there is less than kGap bytes available in the buffer. |
728 // If this is the case, we need to grow the buffer before emitting | 728 // If this is the case, we need to grow the buffer before emitting |
729 // an instruction or relocation information. | 729 // an instruction or relocation information. |
730 inline bool overflow() const { return pc_ >= reloc_info_writer.pos() - kGap; } | 730 inline bool overflow() const { return pc_ >= reloc_info_writer.pos() - kGap; } |
731 | 731 |
732 // Get the number of bytes available in the buffer. | 732 // Get the number of bytes available in the buffer. |
733 inline int available_space() const { return reloc_info_writer.pos() - pc_; } | 733 inline int available_space() const { return reloc_info_writer.pos() - pc_; } |
734 | 734 |
735 // Avoid overflows for displacements etc. | 735 // Avoid overflows for displacements etc. |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 bool own_buffer_; | 802 bool own_buffer_; |
803 | 803 |
804 // code generation | 804 // code generation |
805 byte* pc_; // the program counter; moves forward | 805 byte* pc_; // the program counter; moves forward |
806 RelocInfoWriter reloc_info_writer; | 806 RelocInfoWriter reloc_info_writer; |
807 | 807 |
808 // push-pop elimination | 808 // push-pop elimination |
809 byte* last_pc_; | 809 byte* last_pc_; |
810 | 810 |
811 // source position information | 811 // source position information |
812 int last_position_; | 812 int current_statement_position_; |
813 int last_statement_position_; | 813 int current_position_; |
| 814 int written_statement_position_; |
| 815 int written_position_; |
814 }; | 816 }; |
815 | 817 |
816 | 818 |
817 // Helper class that ensures that there is enough space for generating | 819 // Helper class that ensures that there is enough space for generating |
818 // instructions and relocation information. The constructor makes | 820 // instructions and relocation information. The constructor makes |
819 // sure that there is enough space and (in debug mode) the destructor | 821 // sure that there is enough space and (in debug mode) the destructor |
820 // checks that we did not generate too much. | 822 // checks that we did not generate too much. |
821 class EnsureSpace BASE_EMBEDDED { | 823 class EnsureSpace BASE_EMBEDDED { |
822 public: | 824 public: |
823 explicit EnsureSpace(Assembler* assembler) : assembler_(assembler) { | 825 explicit EnsureSpace(Assembler* assembler) : assembler_(assembler) { |
(...skipping 13 matching lines...) Expand all Loading... |
837 private: | 839 private: |
838 Assembler* assembler_; | 840 Assembler* assembler_; |
839 #ifdef DEBUG | 841 #ifdef DEBUG |
840 int space_before_; | 842 int space_before_; |
841 #endif | 843 #endif |
842 }; | 844 }; |
843 | 845 |
844 } } // namespace v8::internal | 846 } } // namespace v8::internal |
845 | 847 |
846 #endif // V8_ASSEMBLER_IA32_H_ | 848 #endif // V8_ASSEMBLER_IA32_H_ |
OLD | NEW |