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

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

Issue 2112853002: Do not record source positions for non-JS or native script code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@simplifyjitlogging
Patch Set: update test expectation Created 4 years, 5 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/source-position-table.h ('k') | test/unittests/interpreter/bytecode-array-writer-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/source-position-table.cc
diff --git a/src/source-position-table.cc b/src/source-position-table.cc
index 5f5af76227699220f6aa5a74ff727ece208f0ecc..628e35a1cdc28f42affb6d15b727918e1be4df77 100644
--- a/src/source-position-table.cc
+++ b/src/source-position-table.cc
@@ -104,19 +104,23 @@ void DecodeEntry(ByteArray* bytes, int* index, PositionTableEntry* entry) {
} // namespace
-SourcePositionTableBuilder::SourcePositionTableBuilder(Isolate* isolate,
- Zone* zone)
+SourcePositionTableBuilder::SourcePositionTableBuilder(
+ Isolate* isolate, Zone* zone,
+ SourcePositionTableBuilder::RecordingMode mode)
: isolate_(isolate),
+ mode_(mode),
bytes_(zone),
#ifdef ENABLE_SLOW_DCHECKS
raw_entries_(zone),
#endif
previous_(),
jit_handler_data_(nullptr) {
+ if (Omit()) return;
LOG_CODE_EVENT(isolate_, CodeStartLinePosInfoRecordEvent(&jit_handler_data_));
}
void SourcePositionTableBuilder::EndJitLogging(AbstractCode* code) {
+ if (Omit()) return;
LOG_CODE_EVENT(isolate_,
CodeEndLinePosInfoRecordEvent(code, jit_handler_data_));
}
@@ -124,6 +128,7 @@ void SourcePositionTableBuilder::EndJitLogging(AbstractCode* code) {
void SourcePositionTableBuilder::AddPosition(size_t code_offset,
int source_position,
bool is_statement) {
+ if (Omit()) return;
int offset = static_cast<int>(code_offset);
AddEntry({offset, source_position, is_statement});
}
@@ -150,6 +155,7 @@ void SourcePositionTableBuilder::AddEntry(const PositionTableEntry& entry) {
Handle<ByteArray> SourcePositionTableBuilder::ToSourcePositionTable() {
if (bytes_.empty()) return isolate_->factory()->empty_byte_array();
+ DCHECK(!Omit());
Handle<ByteArray> table = isolate_->factory()->NewByteArray(
static_cast<int>(bytes_.size()), TENURED);
@@ -168,8 +174,9 @@ Handle<ByteArray> SourcePositionTableBuilder::ToSourcePositionTable() {
DCHECK_EQ(encoded.is_statement(), raw->is_statement);
}
DCHECK(raw == raw_entries_.end());
+ // No additional source positions after creating the table.
+ mode_ = OMIT_SOURCE_POSITIONS;
#endif
-
return table;
}
« no previous file with comments | « src/source-position-table.h ('k') | test/unittests/interpreter/bytecode-array-writer-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698