Index: src/interpreter/source-position-table.cc |
diff --git a/src/interpreter/source-position-table.cc b/src/interpreter/source-position-table.cc |
index c4e2425264a91c33e29ad60c5f3748215980ea36..99a865b84ef6344dae6620ffbd62459d60080dfe 100644 |
--- a/src/interpreter/source-position-table.cc |
+++ b/src/interpreter/source-position-table.cc |
@@ -115,35 +115,23 @@ void DecodeEntry(ByteArray* bytes, int* index, PositionTableEntry* entry) { |
} // namespace |
-void SourcePositionTableBuilder::AddStatementPosition( |
- size_t bytecode_offset, int source_position, |
- SourcePositionTableBuilder::OnDuplicateCodeOffset on_duplicate) { |
+void SourcePositionTableBuilder::AddStatementPosition(size_t bytecode_offset, |
+ int source_position) { |
int offset = static_cast<int>(bytecode_offset); |
- AddEntry({offset, source_position, true}, on_duplicate); |
- LOG_CODE_EVENT(isolate_, CodeLinePosInfoAddStatementPositionEvent( |
- jit_handler_data_, offset, source_position)); |
- LOG_CODE_EVENT(isolate_, CodeLinePosInfoAddPositionEvent( |
- jit_handler_data_, offset, source_position)); |
+ AddEntry({offset, source_position, true}); |
} |
void SourcePositionTableBuilder::AddExpressionPosition(size_t bytecode_offset, |
int source_position) { |
int offset = static_cast<int>(bytecode_offset); |
AddEntry({offset, source_position, false}); |
- LOG_CODE_EVENT(isolate_, CodeLinePosInfoAddPositionEvent( |
- jit_handler_data_, offset, source_position)); |
} |
-void SourcePositionTableBuilder::AddEntry( |
- const PositionTableEntry& entry, |
- SourcePositionTableBuilder::OnDuplicateCodeOffset on_duplicate) { |
+void SourcePositionTableBuilder::AddEntry(const PositionTableEntry& entry) { |
// Don't encode a new entry if this bytecode already has a source position |
// assigned. |
if (candidate_.bytecode_offset == entry.bytecode_offset) { |
- if ((!candidate_.is_statement && entry.is_statement) || |
- on_duplicate == OVERWRITE_DUPLICATE) { |
- candidate_ = entry; |
- } |
+ if (entry.is_statement) candidate_ = entry; |
return; |
} |
@@ -158,6 +146,15 @@ void SourcePositionTableBuilder::CommitEntry() { |
EncodeEntry(bytes_, tmp); |
previous_ = candidate_; |
+ if (candidate_.is_statement) { |
+ LOG_CODE_EVENT(isolate_, CodeLinePosInfoAddStatementPositionEvent( |
+ jit_handler_data_, candidate_.bytecode_offset, |
+ candidate_.source_position)); |
+ } |
+ LOG_CODE_EVENT(isolate_, CodeLinePosInfoAddPositionEvent( |
+ jit_handler_data_, candidate_.bytecode_offset, |
+ candidate_.source_position)); |
+ |
#ifdef ENABLE_SLOW_DCHECKS |
raw_entries_.push_back(candidate_); |
#endif |