Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Side by Side Diff: src/assembler-ia32.h

Issue 14170: Refactored the recording of source position in the generated code. The code g... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/assembler-arm.cc ('k') | src/assembler-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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_
OLDNEW
« no previous file with comments | « src/assembler-arm.cc ('k') | src/assembler-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698