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

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

Issue 2248673002: Avoid accessing Isolate in source position logging. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 4 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 628e35a1cdc28f42affb6d15b727918e1be4df77..ef6d0773f9b640fd35619b2a6cf7bcac3ea5afff 100644
--- a/src/source-position-table.cc
+++ b/src/source-position-table.cc
@@ -105,24 +105,13 @@ void DecodeEntry(ByteArray* bytes, int* index, PositionTableEntry* entry) {
} // namespace
SourcePositionTableBuilder::SourcePositionTableBuilder(
- Isolate* isolate, Zone* zone,
- SourcePositionTableBuilder::RecordingMode mode)
- : isolate_(isolate),
- mode_(mode),
+ Zone* zone, SourcePositionTableBuilder::RecordingMode mode)
+ : 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_));
+ previous_() {
}
void SourcePositionTableBuilder::AddPosition(size_t code_offset,
@@ -138,30 +127,23 @@ void SourcePositionTableBuilder::AddEntry(const PositionTableEntry& entry) {
SubtractFromEntry(tmp, previous_);
EncodeEntry(bytes_, tmp);
previous_ = entry;
-
- if (entry.is_statement) {
- LOG_CODE_EVENT(isolate_, CodeLinePosInfoAddStatementPositionEvent(
- jit_handler_data_, entry.code_offset,
- entry.source_position));
- }
- LOG_CODE_EVENT(isolate_, CodeLinePosInfoAddPositionEvent(
- jit_handler_data_, entry.code_offset,
- entry.source_position));
-
#ifdef ENABLE_SLOW_DCHECKS
raw_entries_.push_back(entry);
#endif
}
-Handle<ByteArray> SourcePositionTableBuilder::ToSourcePositionTable() {
- if (bytes_.empty()) return isolate_->factory()->empty_byte_array();
+Handle<ByteArray> SourcePositionTableBuilder::ToSourcePositionTable(
+ Isolate* isolate, Handle<AbstractCode> code) {
+ if (bytes_.empty()) return isolate->factory()->empty_byte_array();
DCHECK(!Omit());
- Handle<ByteArray> table = isolate_->factory()->NewByteArray(
+ Handle<ByteArray> table = isolate->factory()->NewByteArray(
static_cast<int>(bytes_.size()), TENURED);
MemCopy(table->GetDataStartAddress(), &*bytes_.begin(), bytes_.size());
+ LOG_CODE_EVENT(isolate, CodeLinePosInfoRecordEvent(*code, *table));
+
#ifdef ENABLE_SLOW_DCHECKS
// Brute force testing: Record all positions and decode
// the entire table to verify they are identical.
« 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