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

Unified Diff: src/log.cc

Issue 1751963003: Fix crash when --ll_prof is enabled after cb29f9c (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_profile_sourcepos
Patch Set: Created 4 years, 10 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/log.h ('k') | src/snapshot/deserializer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/log.cc
diff --git a/src/log.cc b/src/log.cc
index d5395150147fe33d041a8e1de81f13be41a03452..294596c396277d59453054830dc754245b116731 100644
--- a/src/log.cc
+++ b/src/log.cc
@@ -298,7 +298,7 @@ class LowLevelLogger : public CodeEventLogger {
void CodeMoveEvent(AbstractCode* from, Address to) override;
void CodeDisableOptEvent(AbstractCode* code,
SharedFunctionInfo* shared) override {}
- void SnapshotPositionEvent(Address addr, int pos);
+ void SnapshotPositionEvent(HeapObject* obj, int pos);
void CodeMovingGCEvent() override;
private:
@@ -421,12 +421,12 @@ void LowLevelLogger::CodeMoveEvent(AbstractCode* from, Address to) {
LogWriteStruct(event);
}
-void LowLevelLogger::SnapshotPositionEvent(Address addr, int pos) {
- HeapObject* obj = HeapObject::FromAddress(addr);
+void LowLevelLogger::SnapshotPositionEvent(HeapObject* obj, int pos) {
if (obj->IsAbstractCode()) {
SnapshotPositionStruct event;
event.address =
- addr + (obj->IsCode() ? Code::kHeaderSize : BytecodeArray::kHeaderSize);
+ obj->address() +
+ (obj->IsCode() ? Code::kHeaderSize : BytecodeArray::kHeaderSize);
event.position = pos;
LogWriteStruct(event);
}
@@ -1294,14 +1294,13 @@ void Logger::CodeNameEvent(Address addr, int pos, const char* code_name) {
msg.WriteToLogFile();
}
-
-void Logger::SnapshotPositionEvent(Address addr, int pos) {
+void Logger::SnapshotPositionEvent(HeapObject* obj, int pos) {
if (!log_->IsEnabled()) return;
- LL_LOG(SnapshotPositionEvent(addr, pos));
+ LL_LOG(SnapshotPositionEvent(obj, pos));
if (!FLAG_log_snapshot_positions) return;
Log::MessageBuilder msg(log_);
msg.Append("%s,", kLogEventsNames[SNAPSHOT_POSITION_EVENT]);
- msg.AppendAddress(addr);
+ msg.AppendAddress(obj->address());
msg.Append(",%d", pos);
msg.WriteToLogFile();
}
« no previous file with comments | « src/log.h ('k') | src/snapshot/deserializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698