Index: src/ia32/assembler-ia32.cc |
diff --git a/src/ia32/assembler-ia32.cc b/src/ia32/assembler-ia32.cc |
index 019f478adc5c1575a9c515a6de4b852bfd04a5e0..125f503bec33109adfd606d5a26720d92d0efa31 100644 |
--- a/src/ia32/assembler-ia32.cc |
+++ b/src/ia32/assembler-ia32.cc |
@@ -298,7 +298,8 @@ static void InitCoverageLog(); |
// Spare buffer. |
byte* Assembler::spare_buffer_ = NULL; |
-Assembler::Assembler(void* buffer, int buffer_size) { |
+Assembler::Assembler(void* buffer, int buffer_size) |
+ : positions_recorder_(this) { |
if (buffer == NULL) { |
// Do our own buffer management. |
if (buffer_size <= kMinimalBufferSize) { |
@@ -339,10 +340,6 @@ Assembler::Assembler(void* buffer, int buffer_size) { |
reloc_info_writer.Reposition(buffer_ + buffer_size, pc_); |
last_pc_ = NULL; |
- current_statement_position_ = RelocInfo::kNoPosition; |
- current_position_ = RelocInfo::kNoPosition; |
- written_statement_position_ = current_statement_position_; |
- written_position_ = current_position_; |
#ifdef GENERATED_CODE_COVERAGE |
InitCoverageLog(); |
#endif |
@@ -1581,7 +1578,7 @@ void Assembler::call(const Operand& adr) { |
void Assembler::call(Handle<Code> code, RelocInfo::Mode rmode) { |
- WriteRecordedPositions(); |
+ positions_recorder()->WriteRecordedPositions(); |
EnsureSpace ensure_space(this); |
last_pc_ = pc_; |
ASSERT(RelocInfo::IsCodeTarget(rmode)); |
@@ -2464,14 +2461,14 @@ void Assembler::Print() { |
void Assembler::RecordJSReturn() { |
- WriteRecordedPositions(); |
+ positions_recorder()->WriteRecordedPositions(); |
EnsureSpace ensure_space(this); |
RecordRelocInfo(RelocInfo::JS_RETURN); |
} |
void Assembler::RecordDebugBreakSlot() { |
- WriteRecordedPositions(); |
+ positions_recorder()->WriteRecordedPositions(); |
EnsureSpace ensure_space(this); |
RecordRelocInfo(RelocInfo::DEBUG_BREAK_SLOT); |
} |
@@ -2485,47 +2482,6 @@ void Assembler::RecordComment(const char* msg) { |
} |
-void Assembler::RecordPosition(int pos) { |
- ASSERT(pos != RelocInfo::kNoPosition); |
- ASSERT(pos >= 0); |
- current_position_ = pos; |
-} |
- |
- |
-void Assembler::RecordStatementPosition(int pos) { |
- ASSERT(pos != RelocInfo::kNoPosition); |
- ASSERT(pos >= 0); |
- current_statement_position_ = pos; |
-} |
- |
- |
-bool Assembler::WriteRecordedPositions() { |
- bool written = false; |
- |
- // 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, current_statement_position_); |
- written_statement_position_ = current_statement_position_; |
- written = true; |
- } |
- |
- // Write the position if it is different from what was written last time and |
- // also different from the written statement position. |
- if (current_position_ != written_position_ && |
- current_position_ != written_statement_position_) { |
- EnsureSpace ensure_space(this); |
- RecordRelocInfo(RelocInfo::POSITION, current_position_); |
- written_position_ = current_position_; |
- written = true; |
- } |
- |
- // Return whether something was written. |
- return written; |
-} |
- |
- |
void Assembler::GrowBuffer() { |
ASSERT(overflow()); |
if (!own_buffer_) FATAL("external code buffer is too small"); |