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

Unified Diff: runtime/vm/clustered_snapshot.h

Issue 2859913002: Resolve inconsistent treatment of stubs in kAppJIT snapshots in favor of write stubs in the snapsho… (Closed)
Patch Set: Created 3 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 | « no previous file | runtime/vm/clustered_snapshot.cc » ('j') | runtime/vm/clustered_snapshot.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/clustered_snapshot.h
diff --git a/runtime/vm/clustered_snapshot.h b/runtime/vm/clustered_snapshot.h
index 9f707b689bd74a1c744045b891ff919e39ec7611..da667edbe33828b06c7be46fef78a8734992bb39 100644
--- a/runtime/vm/clustered_snapshot.h
+++ b/runtime/vm/clustered_snapshot.h
@@ -140,6 +140,9 @@ class Serializer : public StackResource {
void AssignRef(RawObject* object) {
ASSERT(next_ref_index_ != 0);
if (object->IsHeapObject()) {
+ // The object id weak table holds image offsets for Instructions instead
+ // of ref indices.
+ ASSERT(!object->IsInstructions());
heap_->SetObjectId(object, next_ref_index_);
ASSERT(heap_->GetObjectId(object) == next_ref_index_);
} else {
@@ -210,6 +213,9 @@ class Serializer : public StackResource {
return;
}
+ // The object id weak table holds image offsets for Instructions instead
+ // of ref indices.
+ ASSERT(!object->IsInstructions());
intptr_t id = heap_->GetObjectId(object);
if (id == 0) {
if (object->IsCode() && !Snapshot::IncludesCode(kind_)) {
@@ -237,11 +243,17 @@ class Serializer : public StackResource {
}
int32_t GetTextOffset(RawInstructions* instr, RawCode* code) {
- return image_writer_->GetOffsetFor(instr, code);
+ intptr_t offset = heap_->GetObjectId(instr);
+ if (offset == 0) {
+ offset = image_writer_->GetTextOffsetFor(instr, code);
+ ASSERT(offset != 0);
+ heap_->SetObjectId(instr, offset);
+ }
+ return offset;
}
- int32_t GetRODataOffset(RawObject* object) {
- return image_writer_->GetObjectOffsetFor(object);
+ int32_t GetDataOffset(RawObject* object) {
+ return image_writer_->GetDataOffsetFor(object);
}
Snapshot::Kind kind() const { return kind_; }
« no previous file with comments | « no previous file | runtime/vm/clustered_snapshot.cc » ('j') | runtime/vm/clustered_snapshot.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698