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

Unified Diff: src/assembler-ia32.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/assembler-ia32.h ('k') | src/codegen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/assembler-ia32.cc
===================================================================
--- src/assembler-ia32.cc (revision 958)
+++ src/assembler-ia32.cc (working copy)
@@ -316,8 +316,10 @@
reloc_info_writer.Reposition(buffer_ + buffer_size, pc_);
last_pc_ = NULL;
- last_position_ = RelocInfo::kNoPosition;
- last_statement_position_ = RelocInfo::kNoPosition;
+ current_statement_position_ = RelocInfo::kNoPosition;
+ current_position_ = RelocInfo::kNoPosition;
+ written_statement_position_ = current_statement_position_;
+ written_position_ = current_position_;
}
@@ -1988,31 +1990,36 @@
void Assembler::RecordPosition(int pos) {
- if (pos == RelocInfo::kNoPosition) return;
+ ASSERT(pos != RelocInfo::kNoPosition);
ASSERT(pos >= 0);
- last_position_ = pos;
+ current_position_ = pos;
}
void Assembler::RecordStatementPosition(int pos) {
- if (pos == RelocInfo::kNoPosition) return;
+ ASSERT(pos != RelocInfo::kNoPosition);
ASSERT(pos >= 0);
- last_statement_position_ = pos;
+ current_statement_position_ = pos;
}
void Assembler::WriteRecordedPositions() {
- if (last_statement_position_ != RelocInfo::kNoPosition) {
+ // Write the statement position if it is different from what was written last
+ // time.
+ if (current_statement_position_ != written_statement_position_) {
EnsureSpace ensure_space(this);
- RecordRelocInfo(RelocInfo::STATEMENT_POSITION, last_statement_position_);
+ RecordRelocInfo(RelocInfo::STATEMENT_POSITION, current_statement_position_);
+ written_statement_position_ = current_statement_position_;
}
- if ((last_position_ != RelocInfo::kNoPosition) &&
- (last_position_ != last_statement_position_)) {
+
+ // Write the position if it is different from what was written last time and
+ // also diferent from the written statement position.
+ if (current_position_ != written_position_ &&
+ current_position_ != written_statement_position_) {
EnsureSpace ensure_space(this);
- RecordRelocInfo(RelocInfo::POSITION, last_position_);
+ RecordRelocInfo(RelocInfo::POSITION, current_position_);
+ written_position_ = current_position_;
}
- last_statement_position_ = RelocInfo::kNoPosition;
- last_position_ = RelocInfo::kNoPosition;
}
« no previous file with comments | « src/assembler-ia32.h ('k') | src/codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698