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

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

Issue 1947403002: [interpreter] Introduce bytecode generation pipeline. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Incorporate review comments. Created 4 years, 7 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
Index: src/interpreter/source-position-table.cc
diff --git a/src/interpreter/source-position-table.cc b/src/interpreter/source-position-table.cc
index 99a865b84ef6344dae6620ffbd62459d60080dfe..7a599abbb58643cc7de1140ae206bb2288446a8f 100644
--- a/src/interpreter/source-position-table.cc
+++ b/src/interpreter/source-position-table.cc
@@ -128,40 +128,27 @@ void SourcePositionTableBuilder::AddExpressionPosition(size_t bytecode_offset,
}
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 (entry.is_statement) candidate_ = entry;
- return;
- }
-
- CommitEntry();
- candidate_ = entry;
-}
-
-void SourcePositionTableBuilder::CommitEntry() {
- if (candidate_.bytecode_offset == kUninitializedCandidateOffset) return;
- PositionTableEntry tmp(candidate_);
+ if (entry.bytecode_offset == kUninitializedCandidateOffset) return;
rmcilroy 2016/05/10 11:14:10 You can remove this line
oth 2016/05/11 13:17:31 Done.
+ PositionTableEntry tmp(entry);
SubtractFromEntry(tmp, previous_);
EncodeEntry(bytes_, tmp);
- previous_ = candidate_;
+ previous_ = entry;
- if (candidate_.is_statement) {
+ if (entry.is_statement) {
LOG_CODE_EVENT(isolate_, CodeLinePosInfoAddStatementPositionEvent(
- jit_handler_data_, candidate_.bytecode_offset,
- candidate_.source_position));
+ jit_handler_data_, entry.bytecode_offset,
+ entry.source_position));
}
LOG_CODE_EVENT(isolate_, CodeLinePosInfoAddPositionEvent(
- jit_handler_data_, candidate_.bytecode_offset,
- candidate_.source_position));
+ jit_handler_data_, entry.bytecode_offset,
+ entry.source_position));
#ifdef ENABLE_SLOW_DCHECKS
- raw_entries_.push_back(candidate_);
+ raw_entries_.push_back(entry);
#endif
}
Handle<ByteArray> SourcePositionTableBuilder::ToSourcePositionTable() {
- CommitEntry();
if (bytes_.empty()) return isolate_->factory()->empty_byte_array();
Handle<ByteArray> table = isolate_->factory()->NewByteArray(

Powered by Google App Engine
This is Rietveld 408576698