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

Unified Diff: src/assembler-arm.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-arm.h ('k') | src/assembler-ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/assembler-arm.cc
===================================================================
--- src/assembler-arm.cc (revision 958)
+++ src/assembler-arm.cc (working copy)
@@ -320,8 +320,10 @@
no_const_pool_before_ = 0;
last_const_pool_end_ = 0;
last_bound_pos_ = 0;
- last_position_ = RelocInfo::kNoPosition;
- last_position_is_statement_ = false;
+ current_statement_position_ = RelocInfo::kNoPosition;
+ current_position_ = RelocInfo::kNoPosition;
+ written_statement_position_ = current_statement_position_;
+ written_position_ = current_position_;
}
@@ -1306,23 +1308,39 @@
void Assembler::RecordPosition(int pos) {
if (pos == RelocInfo::kNoPosition) return;
ASSERT(pos >= 0);
- if (pos == last_position_) return;
- CheckBuffer();
- RecordRelocInfo(RelocInfo::POSITION, pos);
- last_position_ = pos;
- last_position_is_statement_ = false;
+ current_position_ = pos;
+ WriteRecordedPositions();
}
void Assembler::RecordStatementPosition(int pos) {
- if (pos == last_position_) return;
- CheckBuffer();
- RecordRelocInfo(RelocInfo::STATEMENT_POSITION, pos);
- last_position_ = pos;
- last_position_is_statement_ = true;
+ if (pos == RelocInfo::kNoPosition) return;
+ ASSERT(pos >= 0);
+ current_statement_position_ = pos;
+ WriteRecordedPositions();
}
+void Assembler::WriteRecordedPositions() {
+ // Write the statement position if it is different from what was written last
+ // time.
+ if (current_statement_position_ != written_statement_position_) {
+ CheckBuffer();
+ RecordRelocInfo(RelocInfo::STATEMENT_POSITION, current_statement_position_);
+ written_statement_position_ = current_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_) {
+ CheckBuffer();
+ RecordRelocInfo(RelocInfo::POSITION, current_position_);
+ written_position_ = current_position_;
+ }
+}
+
+
void Assembler::GrowBuffer() {
if (!own_buffer_) FATAL("external code buffer is too small");
« no previous file with comments | « src/assembler-arm.h ('k') | src/assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698