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

Unified Diff: src/interpreter/source-position-table.cc

Issue 1854113002: [interpreter] statement position always overwrites earlier positions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 4 years, 8 months 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/interpreter/source-position-table.h ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « src/interpreter/source-position-table.h ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698